From 4308871ec475d6346406b30a1302765eb0d30793 Mon Sep 17 00:00:00 2001 From: Nikki Wines Date: Fri, 29 Sep 2023 12:29:23 +0800 Subject: [PATCH] prettier style --- src/CONST.ts | 2 +- src/SCREENS.ts | 2 +- src/languages/en.ts | 2 +- src/pages/signin/SAMLEnabledForm.js | 2 +- src/pages/signin/SAMLSignInPage/index.js | 7 ++-- src/pages/signin/SignInPage.js | 39 ++++++++++--------- .../ValidateCodeForm/BaseValidateCodeForm.js | 2 +- 7 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index dd4fe909a211..0d6532b6c0d2 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -240,7 +240,7 @@ const CONST = { CUSTOM_STATUS: 'customStatus', NEW_DOT_CATEGORIES: 'newDotCategories', NEW_DOT_TAGS: 'newDotTags', - NEW_DOT_SAML: 'newDotSAML' + NEW_DOT_SAML: 'newDotSAML', }, BUTTON_STATES: { DEFAULT: 'default', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index cb569dcb47e0..2b0fa68a180f 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -24,5 +24,5 @@ export default { SIGN_IN_WITH_APPLE_DESKTOP: 'AppleSignInDesktop', SIGN_IN_WITH_GOOGLE_DESKTOP: 'GoogleSignInDesktop', DESKTOP_SIGN_IN_REDIRECT: 'DesktopSignInRedirect', - SAML_SIGN_IN: 'SAMLSignIN' + SAML_SIGN_IN: 'SAMLSignIN', } as const; diff --git a/src/languages/en.ts b/src/languages/en.ts index bc245c2d6420..93e1221ce2cd 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -368,7 +368,7 @@ export default { useSingleSignOn: 'Use single sign-on', useMagicCode: 'Use magic code', launching: 'Launching...', - oneMoment: 'One moment while we redirect you to your company\'s single sign-on portal.', + oneMoment: "One moment while we redirect you to your company's single sign-on portal.", }, reportActionCompose: { addAction: 'Actions', diff --git a/src/pages/signin/SAMLEnabledForm.js b/src/pages/signin/SAMLEnabledForm.js index d12530a8505f..e58099ed3cad 100644 --- a/src/pages/signin/SAMLEnabledForm.js +++ b/src/pages/signin/SAMLEnabledForm.js @@ -49,7 +49,7 @@ const defaultProps = { account: {}, }; -function SAMLEnabledForm (props) { +function SAMLEnabledForm(props) { return ( <> diff --git a/src/pages/signin/SAMLSignInPage/index.js b/src/pages/signin/SAMLSignInPage/index.js index 66ba7179303a..f09ab0f2c20e 100644 --- a/src/pages/signin/SAMLSignInPage/index.js +++ b/src/pages/signin/SAMLSignInPage/index.js @@ -20,15 +20,14 @@ const propTypes = { login: PropTypes.string, }), ...withLocalizePropTypes, -} +}; const defaultProps = { credentials: {}, }; function SAMLSignInPage(props) { useEffect(() => { - window.open(`${CONFIG.EXPENSIFY.SAML_URL}?email=${props.credentials.login}&referer=${CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER}`, '_self') - + window.open(`${CONFIG.EXPENSIFY.SAML_URL}?email=${props.credentials.login}&referer=${CONFIG.EXPENSIFY.EXPENSIFY_CASH_REFERER}`, '_self'); }, [props.credentials.login]); return ( @@ -61,7 +60,7 @@ function SAMLSignInPage(props) { SAMLSignInPage.propTypes = propTypes; SAMLSignInPage.defaultProps = defaultProps; -export default compose ( +export default compose( withLocalize, withOnyx({ credentials: {key: ONYXKEYS.CREDENTIALS}, diff --git a/src/pages/signin/SignInPage.js b/src/pages/signin/SignInPage.js index c6f0b17cc409..b8eec5b97d25 100644 --- a/src/pages/signin/SignInPage.js +++ b/src/pages/signin/SignInPage.js @@ -129,19 +129,26 @@ function SignInPage({credentials, account, isInModal}) { App.setLocale(Localize.getDevicePreferredLocale()); }, []); - const {shouldShowLoginForm, shouldShowEmailDeliveryFailurePage, shouldShowUnlinkLoginForm, shouldShowValidateCodeForm, shouldShowSAMLEnabledForm, shouldInitiateSAMLLogin, shouldShowWelcomeHeader, shouldShowWelcomeText} = getRenderOptions( - { - hasLogin: Boolean(credentials.login), - hasValidateCode: Boolean(credentials.validateCode), - hasAccount: !_.isEmpty(account), - isPrimaryLogin: !account.primaryLogin || account.primaryLogin === credentials.login, - isAccountValidated: Boolean(account.validated), - isSAMLEnabled: Boolean(account.isSAMLEnabled), - isSAMLRequired: Boolean(account.isSAMLRequired), - isUsingSAMLLogin, - hasEmailDeliveryFailure: Boolean(account.hasEmailDeliveryFailure), - }, - ); + const { + shouldShowLoginForm, + shouldShowEmailDeliveryFailurePage, + shouldShowUnlinkLoginForm, + shouldShowValidateCodeForm, + shouldShowSAMLEnabledForm, + shouldInitiateSAMLLogin, + shouldShowWelcomeHeader, + shouldShowWelcomeText, + } = getRenderOptions({ + hasLogin: Boolean(credentials.login), + hasValidateCode: Boolean(credentials.validateCode), + hasAccount: !_.isEmpty(account), + isPrimaryLogin: !account.primaryLogin || account.primaryLogin === credentials.login, + isAccountValidated: Boolean(account.validated), + isSAMLEnabled: Boolean(account.isSAMLEnabled), + isSAMLRequired: Boolean(account.isSAMLRequired), + isUsingSAMLLogin, + hasEmailDeliveryFailure: Boolean(account.hasEmailDeliveryFailure), + }); // If the user has SAML required and we're not already loading their account // bypass the rest of the sign in logic and open up their SSO provider login page @@ -215,11 +222,7 @@ function SignInPage({credentials, account, isInModal}) { /> )} {shouldShowUnlinkLoginForm && } - {shouldShowSAMLEnabledForm && ( - - )} + {shouldShowSAMLEnabledForm && } {shouldShowEmailDeliveryFailurePage && } diff --git a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js index 0e19f52727e6..ce38e3aec03f 100755 --- a/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js +++ b/src/pages/signin/ValidateCodeForm/BaseValidateCodeForm.js @@ -206,7 +206,7 @@ function BaseValidateCodeForm(props) { */ const clearSignInData = () => { // Reset the user's preference for signing in with SAML - props.setIsUsingSAMLLogin(props.account.isSAMLEnabled || props.account.isSAMLRequired) + props.setIsUsingSAMLLogin(props.account.isSAMLEnabled || props.account.isSAMLRequired); clearLocalSignInData(); Session.clearSignInData(); };