forked from binary-com/deriv-app
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Utkarsha/ts migration constant files in accounts package #79
Merged
amina-deriv
merged 7 commits into
amina-deriv:accounts_team/accounts_package_ts_migration/sprint_6
from
utkarsha-deriv:utkarsha/TS-migration-constant-files-in-accounts-package
Aug 23, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bdd40af
chore: ts migration for onfido and routes
utkarsha-deriv ed21329
Merge branch 'binary-com:master' into utkarsha/TS-migration-constant-…
utkarsha-deriv 503cc84
chore: code review changes
utkarsha-deriv 8120787
chore: change type for onfido phrases
utkarsha-deriv c75510c
chore: remove is_appstore and modify testcases
utkarsha-deriv 46b8b5b
chore: remove platformcontext from binary route test file
utkarsha-deriv 12486d6
Merge branch 'accounts_team/accounts_package_ts_migration/sprint_6' i…
utkarsha-deriv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
...s/account/src/Constants/onfido-phrases.js → .../account/src/Constants/onfido-phrases.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,13 +20,16 @@ import { | |
AccountClosed, | ||
DeactivateAccount, | ||
LanguageSettings, | ||
} from 'Sections'; | ||
} from '../Sections'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For some reason the editor throws error saying |
||
|
||
import { TRoute, TRouteConfig } from '../Types'; | ||
|
||
// Error Routes | ||
const Page404 = React.lazy(() => moduleLoader(() => import(/* webpackChunkName: "404" */ 'Modules/Page404'))); | ||
export type TPage404 = typeof Page404; | ||
|
||
// Order matters | ||
const initRoutesConfig = ({ is_appstore }) => [ | ||
const initRoutesConfig = (): TRouteConfig[] => [ | ||
{ | ||
path: routes.account_closed, | ||
component: AccountClosed, | ||
|
@@ -112,27 +115,23 @@ const initRoutesConfig = ({ is_appstore }) => [ | |
{ | ||
path: routes.self_exclusion, | ||
component: SelfExclusion, | ||
getTitle: () => (is_appstore ? localize('Self-exclusion') : localize('Self exclusion')), | ||
getTitle: () => localize('Self exclusion'), | ||
}, | ||
{ | ||
path: routes.account_limits, | ||
component: AccountLimits, | ||
getTitle: () => (is_appstore ? localize('Withdrawal limits') : localize('Account limits')), | ||
getTitle: () => localize('Account limits'), | ||
}, | ||
{ | ||
path: routes.login_history, | ||
component: LoginHistory, | ||
getTitle: () => localize('Login history'), | ||
}, | ||
...(is_appstore | ||
? [] | ||
: [ | ||
{ | ||
path: routes.api_token, | ||
component: ApiToken, | ||
getTitle: () => localize('API token'), | ||
}, | ||
]), | ||
{ | ||
path: routes.api_token, | ||
component: ApiToken, | ||
getTitle: () => localize('API token'), | ||
}, | ||
{ | ||
path: routes.connected_apps, | ||
component: ConnectedApps, | ||
|
@@ -150,30 +149,18 @@ const initRoutesConfig = ({ is_appstore }) => [ | |
}, | ||
], | ||
}, | ||
// TO DO -- Please remove these comments after changing for dashboard routes | ||
// It is possible to add a Deriv Dashboard only path. | ||
// ...(is_appstore | ||
// ? [ | ||
// { | ||
// component: Home, | ||
// getTitle: () => localize('Dashboard-only path'), | ||
// is_authenticated: false, | ||
// path: routes.resources, | ||
// }, | ||
// ] | ||
// : []), | ||
], | ||
}, | ||
]; | ||
|
||
let routesConfig; | ||
let routesConfig: TRouteConfig[] | undefined; | ||
|
||
// For default page route if page/path is not found, must be kept at the end of routes_config array | ||
const route_default = { component: Page404, getTitle: () => localize('Error 404') }; | ||
const route_default: TRoute = { component: Page404, getTitle: () => localize('Error 404') }; | ||
|
||
const getRoutesConfig = ({ is_appstore }) => { | ||
const getRoutesConfig = (): TRouteConfig[] => { | ||
if (!routesConfig) { | ||
routesConfig = initRoutesConfig({ is_appstore }); | ||
routesConfig = initRoutesConfig(); | ||
routesConfig.push(route_default); | ||
} | ||
return routesConfig; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: This render could be written as a function and then re-used in the test suites