diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index d0f9c2e4..348d0207 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,7 +1,7 @@ # Nodes with values to reuse in the pipeline. common_params: plugins: &common_plugins - - automattic/a8c-ci-toolkit#3.1.0 + - automattic/a8c-ci-toolkit#3.2.2 env: &common_env IMAGE_ID: xcode-15.0.1 @@ -28,7 +28,9 @@ steps: - label: "🔬 Validate Podspec" key: "validate" command: | - validate_podspec --patch-cocoapods + # This library use deprecated Gravatar API in WordPressUI. + # Allow warning for now, until we are ready to migrate to Gravatar SDK. + validate_podspec --patch-cocoapods --allow-warnings env: *common_env plugins: *common_plugins diff --git a/.buildkite/publish-pod.sh b/.buildkite/publish-pod.sh index 9961d0ef..20f1de93 100644 --- a/.buildkite/publish-pod.sh +++ b/.buildkite/publish-pod.sh @@ -8,7 +8,7 @@ echo "--- :rubygems: Setting up Gems" install_gems echo "--- :cocoapods: Publishing Pod to CocoaPods CDN" -publish_pod --patch-cocoapods $PODSPEC_PATH +publish_pod --patch-cocoapods $PODSPEC_PATH --allow-warnings echo "--- :cocoapods: Publishing Pod to WP Specs Repo" publish_private_pod --patch-cocoapods $PODSPEC_PATH $SPECS_REPO "$SPEC_REPO_PUBLIC_DEPLOY_KEY" diff --git a/CHANGELOG.md b/CHANGELOG.md index 65603055..1bb2b534 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ _None._ ### Breaking Changes -_None._ +- Show social login options in site credentials login mode [#849] ### New Features diff --git a/WordPressAuthenticator/NUX/Button/NUXButtonViewController.swift b/WordPressAuthenticator/NUX/Button/NUXButtonViewController.swift index 111c8a94..55196bc5 100644 --- a/WordPressAuthenticator/NUX/Button/NUXButtonViewController.swift +++ b/WordPressAuthenticator/NUX/Button/NUXButtonViewController.swift @@ -178,6 +178,11 @@ open class NUXButtonViewController: UIViewController { bottomButtonConfig = buttonConfigFor(socialService: socialService, onTap: callback) } + func setupTertiaryButton(attributedTitle: NSAttributedString, isPrimary: Bool = false, accessibilityIdentifier: String? = nil, onTap callback: @escaping CallBackType) { + tertiaryButton?.isHidden = false + tertiaryButtonConfig = NUXButtonConfig(attributedTitle: attributedTitle, isPrimary: isPrimary, accessibilityIdentifier: accessibilityIdentifier, callback: callback) + } + func setupTertiaryButton(title: String, isPrimary: Bool = false, accessibilityIdentifier: String? = nil, onTap callback: @escaping CallBackType) { tertiaryButton?.isHidden = false tertiaryButtonConfig = NUXButtonConfig(title: title, isPrimary: isPrimary, accessibilityIdentifier: accessibilityIdentifier, callback: callback) diff --git a/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift b/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift index 5f2cbe39..0d4d0f53 100644 --- a/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift +++ b/WordPressAuthenticator/Unified Auth/View Related/Get Started/GetStartedViewController.swift @@ -124,8 +124,7 @@ class GetStartedViewController: LoginViewController, NUXKeyboardResponder { }() private var showsContinueButtonAtTheBottom: Bool { - screenMode == .signInUsingSiteCredentials || - configuration.enableSocialLogin == false + configuration.enableSocialLogin == false } override open var sourceTag: WordPressSupportSourceTag { @@ -811,20 +810,32 @@ private extension GetStartedViewController { buttonViewController.hideShadowView() - // Add a "Continue" button here as the `continueButton` at the top - // will not be displayed for `signInUsingSiteCredentials` screen mode. - // - buttonViewController.setupTopButton(title: ButtonConfiguration.Continue.title, - isPrimary: true, - accessibilityIdentifier: ButtonConfiguration.Continue.accessibilityIdentifier) { [weak self] in - self?.handleSubmitButtonTapped() - } + if configuration.enableSocialLogin { + configureSocialButtons() + + // Setup Sign in with site credentials button + buttonViewController.setupTertiaryButton(attributedTitle: WPStyleGuide.formattedSignInWithSiteCredentialsString(), + isPrimary: false, + accessibilityIdentifier: ButtonConfiguration.SignInWithSiteCredentials.accessibilityIdentifier) { [weak self] in + self?.handleSiteCredentialsButtonTapped() + } + } else { + // Add a "Continue" button here as the `continueButton` at the top will be hidden + // + if showsContinueButtonAtTheBottom { + buttonViewController.setupTopButton(title: ButtonConfiguration.Continue.title, + isPrimary: true, + accessibilityIdentifier: ButtonConfiguration.Continue.accessibilityIdentifier) { [weak self] in + self?.handleSubmitButtonTapped() + } + } - // Setup Sign in with site credentials button - buttonViewController.setupBottomButton(attributedTitle: WPStyleGuide.formattedSignInWithSiteCredentialsString(), - isPrimary: false, - accessibilityIdentifier: ButtonConfiguration.SignInWithSiteCredentials.accessibilityIdentifier) { [weak self] in - self?.handleSiteCredentialsButtonTapped() + // Setup Sign in with site credentials button + buttonViewController.setupBottomButton(attributedTitle: WPStyleGuide.formattedSignInWithSiteCredentialsString(), + isPrimary: false, + accessibilityIdentifier: ButtonConfiguration.SignInWithSiteCredentials.accessibilityIdentifier) { [weak self] in + self?.handleSiteCredentialsButtonTapped() + } } } @@ -835,12 +846,14 @@ private extension GetStartedViewController { buttonViewController.hideShadowView() - // Add a "Continue" button here as the `continueButton` at the top will be hidden - // - buttonViewController.setupTopButton(title: ButtonConfiguration.Continue.title, - isPrimary: true, - accessibilityIdentifier: ButtonConfiguration.Continue.accessibilityIdentifier) { [weak self] in - self?.handleSubmitButtonTapped() + if showsContinueButtonAtTheBottom { + // Add a "Continue" button here as the `continueButton` at the top will be hidden + // + buttonViewController.setupTopButton(title: ButtonConfiguration.Continue.title, + isPrimary: true, + accessibilityIdentifier: ButtonConfiguration.Continue.accessibilityIdentifier) { [weak self] in + self?.handleSubmitButtonTapped() + } } }