Skip to content
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

fix(ui): DTIS-450 removal crypto UI and deps #259

Merged
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
951e59c
fix: remove pages, components, reducers, fixtures from Crypto
jimcase Nov 16, 2023
3b95d39
fix: remove Crypto types
jimcase Nov 16, 2023
dd2aa93
Merge remote-tracking branch 'origin/develop' into fix/DTIS-450-Crypt…
jimcase Nov 17, 2023
53f65ee
fix: remove unused defaultCredentialsCardData
jimcase Nov 17, 2023
c1dbb28
fix: remove unnecessary ChooseAccountName component
jimcase Nov 17, 2023
a82e5d7
fix: remove unused toast state
jimcase Nov 17, 2023
b5b24f1
fix: remove seedPhraseType from GenerateSeedPhrase.tsx
jimcase Nov 20, 2023
5eb0627
fix: remove passing route params from onboarding
jimcase Nov 20, 2023
ca73583
fix: unit test after clean up on generate seed
jimcase Nov 20, 2023
cdc6da7
fix: clean unused operationState fields
jimcase Nov 20, 2023
04ae4ce
fix: remove unused imports
jimcase Nov 20, 2023
fedce0d
fix: remove crypto fields from redux in VerifySeedPhrase.test.tsx
jimcase Nov 20, 2023
17ea872
fix: remove unused validateMnemonic import in GenerateSeedPhrase.tsx
jimcase Nov 20, 2023
645dd6d
fix: remove unnecessary stateRestore condition in GenerateSeedPhrase.tsx
jimcase Nov 20, 2023
d4ef8fa
fix: remove unnecessary cryptoAccountsCache from GenerateSeedPhrase.t…
jimcase Nov 20, 2023
bf280c5
fix: remove unnecessary onboardingRoute dict and deps
jimcase Nov 20, 2023
df459c7
fix: crypto clean up in i18n
jimcase Nov 20, 2023
650a482
fix: remove unused cryptoAccountsCache
jimcase Nov 20, 2023
179ae5a
fix: remove unnecessary restore tests
jimcase Nov 20, 2023
00fd094
fix: remove unnecessary unit tests for Generate Seed Phrase screen fr…
jimcase Nov 20, 2023
61b4d52
fix: remove comment
jimcase Nov 20, 2023
469dbe0
fix: remove unused wallet toast messages in i18n
jimcase Nov 20, 2023
18ab091
fix: remove unused restoreCryptoAccount
jimcase Nov 20, 2023
08717af
fix: remove unnecessary undefined value
jimcase Nov 21, 2023
32031f5
fix: using optional route in handleNavigation, Onboarding.tsx
jimcase Nov 21, 2023
65d7c4f
fix: put back route condition in handleNavigation
jimcase Nov 21, 2023
72701a8
fix: rename crypto placeholder to just crypto
jimcase Nov 21, 2023
1c5976c
fix: crypto wallet messages for toast
jimcase Nov 21, 2023
3864d98
fix: remove unused toast message after verify seed phrase
jimcase Nov 21, 2023
b7feb66
fix: remove defaultCryptoAccount from redux
jimcase Nov 21, 2023
9f524e1
fix: remove newcryptoaccount from i18n
jimcase Nov 21, 2023
5ed1c99
fix: remove AlertVerify in GenerateSeedPhrase.tsx
jimcase Nov 21, 2023
0a39450
fix: refactor GenerateSeedPhrase.tsx
jimcase Nov 21, 2023
9ba6649
fix: remove AlertExit from GenerateSeedPhrase.tsx
jimcase Nov 21, 2023
413648f
fix: remove AlertExit and refactor
jimcase Nov 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 0 additions & 84 deletions src/locales/en/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,6 @@
"continue": "Continue"
}
},
"newcryptoaccount": {
"title": "Generate your Seed Phrase",
"paragraph": {
"top": "It is critical that you securely store this secret recovery phrase, also referred to as a mnemonic, seed, or backup phrase. You will require this phrase in the event that you change mobile devices or need to regain access to your identity wallet profile.",
"bottom": "This phrase is essentially a representation of your Identity Wallet profile private key. This means that anyone with access to it can control your identity. We strongly recommend not using screenshots or storing this phrase without encryption."
},
"button": {
"continue": "Continue"
}
},
"restorecryptoaccount": {
"title": "Enter Seed Phrase",
"suggestions": "Suggestions",
"paragraph": {
"top": "Restore a crypto account based on an existing seed phrase.",
"bottom": ""
},
"button": {
"continue": "Verify Seed Phrase"
}
},
"segment": "{{length}} words",
"privacy": {
"overlay": {
Expand Down Expand Up @@ -589,75 +568,12 @@
]
}
},
jimcase marked this conversation as resolved.
Show resolved Hide resolved
"crypto": {
"tab": {
"create": "Add a crypto account",
"network": {
"mainnet": "Mainnet"
},
"slider": {
"title": {
"mainbalance": "Main balance",
"rewardbalance": "Reward balance"
}
},
"actionbuttons": {
"send": "Send",
"receive": "Receive",
"nfts": "NFTs",
"staking": "Staking"
},
"assetstransactions": {
"swipeupmessage": "Swipe up to see assets & transactions",
"assets": "Assets",
"nfts": "NFTs",
"metadata": "Metadata",
"transactions": "Transactions",
"searchtransactions": "Search transactions"
}
},
"mywalletsmodal": {
"title": "My wallets",
"empty": "No wallets available",
"create": "Add a crypto account"
},
"addcryptoaccountmodal": {
"title": "Add a new crypto account",
"reuse": "Use existing identity seed phrase",
"generate": "Generate a new seed phrase",
"restore": "Restore using an existing seed phrase"
},
"chooseaccountnamemodal": {
"title": "Wallet name",
"skip": "Skip",
"label": "Display name",
"placeholder": "My wallet",
"confirm": "Create wallet"
},
"renamewallet": {
"title": "Rename wallet",
"cancel": "Cancel",
"label": "Display name",
"placeholder": "Wallet name",
"confirm": "Confirm changes"
},
"receivemodal": {
"title": "Receive",
"derivationpath": "Derivation path",
"divider": "or",
"more": "More share options"
}
},
"shareqr": {
"divider": "or",
"more": "More share options"
},
"toast": {
"copiedtoclipboard": "Copied to clipboard",
"walletcreated": "Seed phrase verified",
"walletrenamed": "Account renamed successfully",
"walletrestored": "Seed phrase verified",
"walletdeleted": "Account deleted successfully",
"identitycreated": "New identity created successfully",
"identityupdated": "Identity successfully updated",
"identitydeleted": "Identity successfully deleted",
Expand Down
15 changes: 0 additions & 15 deletions src/routes/backRoute/backRoute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ describe("getBackRoute", () => {
},
identitiesCache: { identities: [], favourites: [] },
credsCache: { creds: [], favourites: [] },
cryptoAccountsCache: {
cryptoAccounts: [],
defaultCryptoAccount: "",
hideCryptoBalances: false,
},
connectionsCache: {
connections: [],
},
Expand Down Expand Up @@ -142,11 +137,6 @@ describe("getBackRoute", () => {
},
identitiesCache: { identities: [], favourites: [] },
credsCache: { creds: [], favourites: [] },
cryptoAccountsCache: {
cryptoAccounts: [],
defaultCryptoAccount: "",
hideCryptoBalances: false,
},
connectionsCache: {
connections: [],
},
Expand Down Expand Up @@ -218,11 +208,6 @@ describe("getPreviousRoute", () => {
},
identitiesCache: { identities: [], favourites: [] },
credsCache: { creds: [], favourites: [] },
cryptoAccountsCache: {
cryptoAccounts: [],
defaultCryptoAccount: "",
hideCryptoBalances: false,
},
connectionsCache: {
connections: [],
},
Expand Down
11 changes: 0 additions & 11 deletions src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { DidCardDetails } from "../ui/pages/DidCardDetails";
import { CredCardDetails } from "../ui/pages/CredCardDetails";
import { ConnectionDetails } from "../ui/pages/ConnectionDetails";
import { AuthenticatedRouteProps } from "./routes.types";
import { onboardingRoute } from "../ui/constants/dictionary";

const AuthenticatedRoute: React.FC<AuthenticatedRouteProps> = (props) => {
const authentication = useAppSelector(getAuthentication);
Expand Down Expand Up @@ -89,16 +88,6 @@ const Routes = () => {
component={GenerateSeedPhrase}
nextPathname={nextPath.pathname}
/>
<AuthenticatedRoute
path={RoutePath.GENERATE_SEED_PHRASE + onboardingRoute.createRoute}
component={GenerateSeedPhrase}
nextPathname={nextPath.pathname}
/>
<AuthenticatedRoute
path={RoutePath.GENERATE_SEED_PHRASE + onboardingRoute.restoreRoute}
component={GenerateSeedPhrase}
nextPathname={nextPath.pathname}
/>
<AuthenticatedRoute
path={RoutePath.VERIFY_SEED_PHRASE}
exact
Expand Down
29 changes: 3 additions & 26 deletions src/routes/nextRoute/nextRoute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { RoutePath } from "../index";
import { setAuthentication } from "../../store/reducers/stateCache";
import { FIFTEEN_WORDS_BIT_LENGTH } from "../../constants/appConstants";
import { DataProps } from "./nextRoute.types";
import { onboardingRoute } from "../../ui/constants/dictionary";
import { TabsRoutePath } from "../paths";

describe("NextRoute", () => {
Expand Down Expand Up @@ -48,11 +47,6 @@ describe("NextRoute", () => {
},
identitiesCache: { identities: [], favourites: [] },
credsCache: { creds: [], favourites: [] },
cryptoAccountsCache: {
cryptoAccounts: [],
defaultCryptoAccount: "",
hideCryptoBalances: false,
},
connectionsCache: {
connections: [],
},
Expand Down Expand Up @@ -119,28 +113,16 @@ describe("NextRoute", () => {
});

test("should return correct route for /verifyseedphrase", () => {
let data = {
store: storeMock,
state: {
currentOperation: onboardingRoute.create,
},
};
let result = getNextVerifySeedPhraseRoute(data);

expect(result).toEqual({
pathname: RoutePath.CREATE_PASSWORD,
});

data = {
const data = {
store: storeMock,
state: {
currentOperation: "",
},
};
result = getNextVerifySeedPhraseRoute(data);
const result = getNextVerifySeedPhraseRoute(data);

expect(result).toEqual({
pathname: TabsRoutePath.CRYPTO,
pathname: RoutePath.CREATE_PASSWORD,
});
});
});
Expand Down Expand Up @@ -173,11 +155,6 @@ describe("getNextRoute", () => {
},
identitiesCache: { identities: [], favourites: [] },
credsCache: { creds: [], favourites: [] },
cryptoAccountsCache: {
cryptoAccounts: [],
defaultCryptoAccount: "",
hideCryptoBalances: false,
},
connectionsCache: {
connections: [],
},
Expand Down
26 changes: 4 additions & 22 deletions src/routes/nextRoute/nextRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from "../../store/reducers/seedPhraseCache";
import { DataProps, StoreState } from "./nextRoute.types";
import { RoutePath, TabsRoutePath } from "../paths";
import { onboardingRoute, toastState } from "../../ui/constants/dictionary";
import { toastState } from "../../ui/constants/dictionary";

const getNextRootRoute = (store: StoreState) => {
const isInitialized = store.stateCache.initialized;
Expand All @@ -26,14 +26,7 @@ const getNextRootRoute = (store: StoreState) => {
} else if (routes.length === 1 && !isInitialized) {
path = RoutePath.ONBOARDING;
} else if (authentication.passcodeIsSet && authentication.seedPhraseIsSet) {
if (
store.stateCache.currentOperation ===
(onboardingRoute.create || onboardingRoute.restore)
) {
path = RoutePath.CREATE_PASSWORD;
} else {
path = RoutePath.TABS_MENU;
}
path = RoutePath.TABS_MENU;
} else {
if (initialRoute) {
path = RoutePath.ONBOARDING;
Expand All @@ -46,18 +39,11 @@ const getNextRootRoute = (store: StoreState) => {
};

const getNextOnboardingRoute = (data: DataProps) => {
const route = data?.state?.currentOperation;
let query = "";
if (route === onboardingRoute.create) {
query = onboardingRoute.createRoute;
} else if (route === onboardingRoute.restore) {
query = onboardingRoute.restoreRoute;
}
let path;
if (!data.store.stateCache.authentication.passcodeIsSet) {
path = RoutePath.SET_PASSCODE;
} else {
path = RoutePath.GENERATE_SEED_PHRASE + query;
path = RoutePath.GENERATE_SEED_PHRASE;
}

return { pathname: path };
Expand Down Expand Up @@ -113,11 +99,7 @@ const getNextGenerateSeedPhraseRoute = () => {
};

const getNextVerifySeedPhraseRoute = (data: DataProps) => {
const route = data?.state?.currentOperation;
const nextPath: string =
route === onboardingRoute.create
? RoutePath.CREATE_PASSWORD
: TabsRoutePath.CRYPTO;
const nextPath: string = RoutePath.CREATE_PASSWORD;

return { pathname: nextPath };
};
Expand Down
1 change: 0 additions & 1 deletion src/routes/paths.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ enum TabsRoutePath {
CREDS = "/tabs/creds",
SCAN = "/tabs/scan",
CRYPTO = "/tabs/crypto",
CRYPTO_PLACEHOLDER = "/tabs/cryptoplaceholder",
CHAT = "/tabs/chat",
DID_DETAILS = "/tabs/dids/:id?",
CRED_DETAILS = "/tabs/creds/:id?",
Expand Down
2 changes: 0 additions & 2 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { seedPhraseCacheSlice } from "./reducers/seedPhraseCache";
import { stateCacheSlice } from "./reducers/stateCache";
import { identitiesCacheSlice } from "./reducers/identitiesCache";
import { credsCacheSlice } from "./reducers/credsCache";
import { cryptoAccountsCacheSlice } from "./reducers/cryptoAccountsCache";
import { connectionsCacheSlice } from "./reducers/connectionsCache";

const store = configureStore({
Expand All @@ -12,7 +11,6 @@ const store = configureStore({
seedPhraseCache: seedPhraseCacheSlice.reducer,
identitiesCache: identitiesCacheSlice.reducer,
credsCache: credsCacheSlice.reducer,
cryptoAccountsCache: cryptoAccountsCacheSlice.reducer,
connectionsCache: connectionsCacheSlice.reducer,
},
});
Expand Down
Loading
Loading