Skip to content

Commit

Permalink
feat(sso): pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLeoB committed Dec 10, 2021
1 parent f964268 commit e89804f
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 120 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"cross-env": "7.0.3",
"css-loader": "4.3.0",
"cz-conventional-changelog": "3.3.0",
"base64url": "^3.0.1",
"base64url": "3.0.1",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.6",
"enzyme-to-json": "3.6.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ type MessagesType = {
'copy.instantly_fund': 'Send, Receive and instantly fund your trades using the Trading Account.'
'copy.interest_transactions_report': 'Reward Transactions Report'
'copy.oops': 'Oops. Something went wrong.'
'copy.later:': "I'll Do This Later"
'copy.ill_do_this_later:': "I'll Do This Later"
'copy.loading': 'Loading...'
'copy.learn_more': 'Learn more'
'copy.pending': 'Pending'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ enum DepositMethod {
BANK_TRANSFER = 'BANK_TRANSFER'
}

enum LoginHelpClikedOrigin {
enum LoginHelpClickedOrigin {
IDENTIFIER = 'IDENTIFIER',
PASSWORD = 'PASSWORD',
QR_CODE = 'QR_CODE',
Expand Down Expand Up @@ -360,7 +360,7 @@ type LinkBankClickedPayload = BasePayload & {
}

type LoginHelpClickedPayload = BasePayload & {
origin: LoginHelpClikedOrigin
origin: LoginHelpClickedOrigin
site_redirect: 'WALLET' | 'EXCHANGE'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const Template: React.FC<Props> = (props) => {
style={{ marginTop: '8px' }}
type='button'
>
<FormattedMessage id='copy.later' defaultMessage="I'll Do This Later" />
<FormattedMessage id='copy.ill_do_this_later' defaultMessage="I'll Do This Later" />
</Button>
</ContentContainer>
</Wrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export const selectMessage = (message, values) => {
export const selectCancel = (message) => {
switch (message) {
case C.CANCEL_VERIFY_IDENTITY:
return <FormattedMessage id='copy.later' defaultMessage="I'll Do This Later" />
return <FormattedMessage id='copy.ill_do_this_later' defaultMessage="I'll Do This Later" />
case C.CANCEL_PHONE_CALL:
return <FormattedMessage id='modals.confirm.cancel.phone_call' defaultMessage='No, Thanks' />
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ const MergeAccountConfirm = (props: Props) => {
>
{/* might need to do some loading state here while user is being logged into
whatever product they want to be logged into */}
<FormattedMessage id='copy.later' defaultMessage="I'll Do This Later" />
<FormattedMessage id='copy.ill_do_this_later' defaultMessage="I'll Do This Later" />
</Button>
</LoginWrapper>
)
Expand Down

This file was deleted.

20 changes: 6 additions & 14 deletions packages/blockchain-wallet-v4-frontend/src/scenes/Login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { RemoteDataType } from '@core/types'
import { Text } from 'blockchain-info-components'
import { Form } from 'components/Form'
import { actions, selectors } from 'data'
import { LOGIN_FORM } from 'data/auth/model'
import {
ExchangeErrorCodes,
LoginFormType,
Expand All @@ -18,18 +19,12 @@ import {
// step templates
import Loading from '../loading.public'
import MergeAccountConfirm from './AccountUnification/MergeAccountConfirm'
import ProductPicker from './AccountUnification/ProductPicker'
import UpgradePassword from './AccountUnification/UpgradePassword'
import UpgradeSuccess from './AccountUnification/UpgradeSuccess'
import ExchangeEnterEmail from './Exchange/EnterEmail'
import EnterPasswordExchange from './Exchange/EnterPasswordExchange'
import TwoFAExchange from './Exchange/TwoFA'
import {
getLoginPageFooter,
getLoginPageSubTitle,
getLoginPageTitle,
LOGIN_FORM_NAME
} from './model'
import { getLoginPageFooter, getLoginPageSubTitle, getLoginPageTitle } from './model'
import { getData } from './selectors'
import VerifyMagicLink from './VerifyMagicLink'
import CheckEmail from './Wallet/CheckEmail'
Expand All @@ -51,7 +46,7 @@ class Login extends PureComponent<InjectedFormProps<{}, Props> & Props, StatePro
}

setStep = (step: LoginSteps) => {
this.props.formActions.change(LOGIN_FORM_NAME, 'step', step)
this.props.formActions.change(LOGIN_FORM, 'step', step)
}

initCaptcha = (callback?) => {
Expand All @@ -74,7 +69,7 @@ class Login extends PureComponent<InjectedFormProps<{}, Props> & Props, StatePro

handleBackArrowClick = () => {
this.props.cacheActions.removedStoredLogin()
this.props.formActions.destroy(LOGIN_FORM_NAME)
this.props.formActions.destroy(LOGIN_FORM)
this.setStep(LoginSteps.ENTER_EMAIL_GUID)
this.props.authActions.clearLoginError()
this.initCaptcha()
Expand Down Expand Up @@ -164,9 +159,6 @@ class Login extends PureComponent<InjectedFormProps<{}, Props> & Props, StatePro
return <UpgradePassword {...loginProps} />
case LoginSteps.UPGRADE_SUCCESS:
return <UpgradeSuccess {...loginProps} />
case LoginSteps.PRODUCT_PICKER_AFTER_AUTHENTICATION:
case LoginSteps.PRODUCT_PICKER_BEFORE_AUTHENTICATION:
return <ProductPicker {...loginProps} />
case LoginSteps.ENTER_EMAIL_GUID:
default:
return product === ProductAuthOptions.EXCHANGE ? (
Expand All @@ -190,7 +182,7 @@ const mapStateToProps = (state) => ({
authType: selectors.auth.getAuthType(state) as Number,
data: getData(state),
exchangeLoginData: selectors.auth.getExchangeLogin(state) as RemoteDataType<any, any>,
formValues: selectors.form.getFormValues(LOGIN_FORM_NAME)(state) as LoginFormType,
formValues: selectors.form.getFormValues(LOGIN_FORM)(state) as LoginFormType,
initialValues: {
step: LoginSteps.ENTER_EMAIL_GUID
},
Expand Down Expand Up @@ -225,6 +217,6 @@ type StateProps = {
}
export type Props = ConnectedProps<typeof connector> & FormProps

const enhance = compose<any>(reduxForm({ form: LOGIN_FORM_NAME }), connector)
const enhance = compose<any>(reduxForm({ form: LOGIN_FORM }), connector)

export default enhance(Login)
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ import { Wrapper } from 'components/Public'
import { LoginFormType, LoginSteps } from 'data/types'
import { media } from 'services/styles'

export const LOGIN_FORM_NAME = 'login'

export const removeWhitespace = (string) => string.replace(/\s/g, ``)

export const TabWrapper = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ import { lift } from 'ramda'

import { ExtractSuccess } from '@core/types'
import { selectors } from 'data'
import { LOGIN_FORM } from 'data/auth/model'
import { RootState } from 'data/rootReducer'
import { LoginFormType, LoginSteps } from 'data/types'

import { LOGIN_FORM_NAME } from './model'

export const getData = (state: RootState) => {
const accountUnificationFlow = selectors.auth.getAccountUnificationFlowType(state)
const authType = selectors.auth.getAuthType(state)
const formValues = selectors.form.getFormValues(LOGIN_FORM_NAME)(state) as LoginFormType
const formValues = selectors.form.getFormValues(LOGIN_FORM)(state) as LoginFormType
const exchangeLoginR = selectors.auth.getExchangeLogin(state)
const jwtToken = selectors.auth.getJwtToken(state)
const language = selectors.preferences.getLanguage(state)
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6566,7 +6566,7 @@ base64-js@^1.0.2, base64-js@^1.3.1:
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==

base64url@^3.0.1:
base64url@3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/base64url/-/base64url-3.0.1.tgz#6399d572e2bc3f90a9a8b22d5dbb0a32d33f788d"
integrity sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==
Expand Down

0 comments on commit e89804f

Please sign in to comment.