-
-
-
-`;
diff --git a/src/loc/CollectionLocRequestForm.tsx b/src/loc/CollectionLocRequestForm.tsx
index 18333421..921fb26f 100644
--- a/src/loc/CollectionLocRequestForm.tsx
+++ b/src/loc/CollectionLocRequestForm.tsx
@@ -12,7 +12,7 @@ import { useUserContext } from "../wallet-user/UserContext";
import ButtonGroup from "../common/ButtonGroup";
import Button from "../common/Button";
import { useLogionChain } from "../logion-chain";
-import { locDetailsPath } from "../wallet-user/UserRouter";
+import { locDetailsPath } from "../wallet-user/UserPaths";
import { useNavigate } from "react-router";
export interface FormValues {
diff --git a/src/loc/DataLocRequest.tsx b/src/loc/DataLocRequest.tsx
index 5d457254..ee1cdca7 100644
--- a/src/loc/DataLocRequest.tsx
+++ b/src/loc/DataLocRequest.tsx
@@ -1,6 +1,6 @@
import { FullWidthPane } from "../common/Dashboard";
import Frame from "../common/Frame";
-import SelectLegalOfficer from "../wallet-user/trust-protection/SelectLegalOfficer";
+import SelectLegalOfficer from "../wallet-user/protection/SelectLegalOfficer";
import { Row, Col } from "react-bootstrap";
import { useNavigate } from "react-router";
import { useState, useMemo } from "react";
@@ -8,7 +8,7 @@ import { LegalOfficerClass } from "@logion/client";
import { useUserContext } from "../wallet-user/UserContext";
import { useCommonContext } from "../common/CommonContext";
import CollectionLocRequestForm from "./CollectionLocRequestForm";
-import LocCreation from "../wallet-user/LocCreation";
+import LocRequestButton from "../components/locrequest/LocRequestButton";
import "./DataLocRequest.css";
import ButtonGroup from "../common/ButtonGroup";
import TransactionLocRequestForm from "./TransactionLocRequestForm";
@@ -63,7 +63,7 @@ export default function DataLocRequest(props: Props) {
please request an Identity LOC to the Logion Legal Officer of your choice by
clicking on the related button below:
-
+
}
@@ -74,7 +74,7 @@ export default function DataLocRequest(props: Props) {
Please request an Identity LOC to the Logion Legal Officer of your
choice:
-
+
}
diff --git a/src/loc/DocumentClaimHistory.tsx b/src/loc/DocumentClaimHistory.tsx
index 6a2c4a07..d23d90f1 100644
--- a/src/loc/DocumentClaimHistory.tsx
+++ b/src/loc/DocumentClaimHistory.tsx
@@ -9,7 +9,7 @@ import CheckDeliveredFrame from "src/components/deliverycheck/CheckDeliveredFram
import ItemFiles, { DeliveredFile } from "src/components/itemfiles/ItemFiles";
import { locDetailsPath, tokensRecordPath } from "src/legal-officer/LegalOfficerPaths";
import { useLogionChain } from "src/logion-chain";
-import { locDetailsPath as userLocDetailsPath, tokensRecordPath as requesterTokensRecordPath, issuerTokensRecordPath } from "src/wallet-user/UserRouter";
+import { locDetailsPath as userLocDetailsPath, tokensRecordPath as requesterTokensRecordPath, issuerTokensRecordPath } from "src/wallet-user/UserPaths";
import { CheckLatestDeliveryResponse, getAllCollectionFileDeliveries, getTokensRecordDeliveries, getTokensRecordFileSource } from "./FileModel";
import { LegalOfficerLocContextProvider } from "./LegalOfficerLocContext";
import { useLocContext } from "./LocContext";
diff --git a/src/loc/IdenfyVerification.tsx b/src/loc/IdenfyVerification.tsx
index 20d69ca7..d59f87ed 100644
--- a/src/loc/IdenfyVerification.tsx
+++ b/src/loc/IdenfyVerification.tsx
@@ -3,7 +3,7 @@ import { useCallback } from "react";
import Button from "src/common/Button";
import Frame from "src/common/Frame";
import { useLocContext } from "./LocContext";
-import { resumeAfterIDenfyProcessUrl } from "../wallet-user/UserRouter";
+import { resumeAfterIDenfyProcessUrl } from "../wallet-user/UserPaths";
export default function IdenfyVerification() {
const { loc, mutateLocState } = useLocContext();
diff --git a/src/wallet-user/trust-protection/IdentityLocRequest.css b/src/loc/IdentityLocRequest.css
similarity index 100%
rename from src/wallet-user/trust-protection/IdentityLocRequest.css
rename to src/loc/IdentityLocRequest.css
diff --git a/src/wallet-user/trust-protection/IdentityLocRequest.test.tsx b/src/loc/IdentityLocRequest.test.tsx
similarity index 88%
rename from src/wallet-user/trust-protection/IdentityLocRequest.test.tsx
rename to src/loc/IdentityLocRequest.test.tsx
index 6c78a459..6429b27c 100644
--- a/src/wallet-user/trust-protection/IdentityLocRequest.test.tsx
+++ b/src/loc/IdentityLocRequest.test.tsx
@@ -3,16 +3,16 @@ import { DraftRequest, LocsState } from "@logion/client";
import { render, waitFor, screen, getByText } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
-import { GUILLAUME, oneLegalOfficer } from "../../common/TestData";
-import { shallowRender, clickByName } from "../../tests";
+import { GUILLAUME, oneLegalOfficer } from "../common/TestData";
+import { shallowRender, clickByName } from "../tests";
import IdentityLocRequest from "./IdentityLocRequest";
-import { fillInForm } from "../../components/identity/IdentityFormTestHelper";
-import { setMutateLocsState, setHasValidIdentityLoc, setLocsState } from "../__mocks__/UserContextMock";
-import { navigate, setSearchParams } from 'src/__mocks__/ReactRouterMock';
+import { fillInForm } from "../components/identity/IdentityFormTestHelper";
+import { setMutateLocsState, setHasValidIdentityLoc, setLocsState } from "../wallet-user/__mocks__/UserContextMock";
+import { navigate, setSearchParams } from '../__mocks__/ReactRouterMock';
-jest.mock('../UserContext');
-jest.mock('../../logion-chain');
-jest.mock('../../common/CommonContext');
+jest.mock('../wallet-user/UserContext');
+jest.mock('../logion-chain');
+jest.mock('../common/CommonContext');
describe("IdentityLocRequest", () => {
diff --git a/src/wallet-user/trust-protection/IdentityLocRequest.tsx b/src/loc/IdentityLocRequest.tsx
similarity index 94%
rename from src/wallet-user/trust-protection/IdentityLocRequest.tsx
rename to src/loc/IdentityLocRequest.tsx
index f2edab60..3649b6a3 100644
--- a/src/wallet-user/trust-protection/IdentityLocRequest.tsx
+++ b/src/loc/IdentityLocRequest.tsx
@@ -1,22 +1,22 @@
-import Button from "../../common/Button";
+import Button from "../common/Button";
import { useState, useCallback, useMemo } from "react";
-import IdentityForm, { FormValues } from "../../components/identity/IdentityForm";
+import IdentityForm, { FormValues } from "../components/identity/IdentityForm";
import { useForm } from "react-hook-form";
-import { useCommonContext } from "../../common/CommonContext";
-import SelectLegalOfficer from "./SelectLegalOfficer";
+import { useCommonContext } from "../common/CommonContext";
+import SelectLegalOfficer from "../wallet-user/protection/SelectLegalOfficer";
import { LegalOfficerClass, LocsState, UserIdentity, PostalAddress, DraftRequest } from "@logion/client";
-import { useUserContext } from "../UserContext";
+import { useUserContext } from "../wallet-user/UserContext";
import Form from "react-bootstrap/Form";
-import Frame from "../../common/Frame";
-import { useLogionChain } from "../../logion-chain";
-import { FullWidthPane } from "../../common/Dashboard";
+import Frame from "../common/Frame";
+import { useLogionChain } from "../logion-chain";
+import { FullWidthPane } from "../common/Dashboard";
import { useNavigate } from "react-router";
import { Row, Col } from "react-bootstrap";
-import FormGroup from "src/common/FormGroup";
+import FormGroup from "../common/FormGroup";
import './IdentityLocRequest.css';
-import { locDetailsPath } from "../UserRouter";
-import IconTextRow from "src/common/IconTextRow";
-import Icon from "src/common/Icon";
+import { locDetailsPath } from "../wallet-user/UserPaths";
+import IconTextRow from "../common/IconTextRow";
+import Icon from "../common/Icon";
import { UUID } from "@logion/node-api";
export interface Props {
diff --git a/src/loc/LocDetails.tsx b/src/loc/LocDetails.tsx
index 48df7038..3284a93c 100644
--- a/src/loc/LocDetails.tsx
+++ b/src/loc/LocDetails.tsx
@@ -44,11 +44,6 @@ export function UserLocDetails(props: UserLocDetailsProps) {
)
}
-export interface VoterLocDetailsProps {
- backPath: string;
- detailsPath: (locId: UUID, type: LocType) => string;
-}
-
export function VoterLocDetails(props: LocDetailsProps) {
const locId: UUID = new UUID(useParams<"locId">().locId);
return (
diff --git a/src/loc/LocItem.tsx b/src/loc/LocItem.tsx
index 5a579876..68de6c01 100644
--- a/src/loc/LocItem.tsx
+++ b/src/loc/LocItem.tsx
@@ -24,7 +24,7 @@ import { Child } from "src/common/types/Helpers";
import ViewFileButton from "src/common/ViewFileButton";
import { documentClaimHistoryPath } from "src/legal-officer/LegalOfficerPaths";
import { fullCertificateUrl } from "src/PublicPaths";
-import { documentClaimHistoryPath as userDocumentClaimHistoryPath } from "src/wallet-user/UserRouter";
+import { documentClaimHistoryPath as userDocumentClaimHistoryPath } from "src/wallet-user/UserPaths";
import LocLinkDetails from "./LocLinkDetails";
import LocPrivateFileDetails from "./LocPrivateFileDetails";
import LocPublicDataDetails from "./LocPublicDataDetails";
diff --git a/src/loc/TransactionLocRequestForm.tsx b/src/loc/TransactionLocRequestForm.tsx
index 34c99cc3..0067ad1c 100644
--- a/src/loc/TransactionLocRequestForm.tsx
+++ b/src/loc/TransactionLocRequestForm.tsx
@@ -10,7 +10,7 @@ import { DraftRequest, LocsState } from "@logion/client";
import { useUserContext } from "../wallet-user/UserContext";
import ButtonGroup from "../common/ButtonGroup";
import Button from "../common/Button";
-import { locDetailsPath } from "../wallet-user/UserRouter";
+import { locDetailsPath } from "../wallet-user/UserPaths";
import { useNavigate } from "react-router";
export interface FormValues {
diff --git a/src/wallet-user/trust-protection/__snapshots__/IdentityLocRequest.test.tsx.snap b/src/loc/__snapshots__/IdentityLocRequest.test.tsx.snap
similarity index 100%
rename from src/wallet-user/trust-protection/__snapshots__/IdentityLocRequest.test.tsx.snap
rename to src/loc/__snapshots__/IdentityLocRequest.test.tsx.snap
diff --git a/src/loc/invited-contributor/InvitedContributorsButton.tsx b/src/loc/invited-contributor/InvitedContributorsButton.tsx
index e39b4501..28c942df 100644
--- a/src/loc/invited-contributor/InvitedContributorsButton.tsx
+++ b/src/loc/invited-contributor/InvitedContributorsButton.tsx
@@ -4,7 +4,7 @@ import Button from "src/common/Button";
import { useCommonContext } from "src/common/CommonContext";
import { invitedContributorsPath as legalOfficerInvitedContributorsPath } from "src/legal-officer/LegalOfficerPaths";
import { useLocContext } from "../LocContext";
-import { invitedContributorsPath as requesterInvitedContributorsPath } from "src/wallet-user/UserRouter";
+import { invitedContributorsPath as requesterInvitedContributorsPath } from "src/wallet-user/UserPaths";
export default function InvitedContributorsButton() {
const { viewer } = useCommonContext();
diff --git a/src/loc/invited-contributor/InvitedContributorsPane.tsx b/src/loc/invited-contributor/InvitedContributorsPane.tsx
index 23f154df..eb9dcafa 100644
--- a/src/loc/invited-contributor/InvitedContributorsPane.tsx
+++ b/src/loc/invited-contributor/InvitedContributorsPane.tsx
@@ -1,7 +1,7 @@
import { UUID } from "@logion/node-api";
import { useParams } from "react-router-dom";
import { locDetailsPath } from "src/legal-officer/LegalOfficerPaths";
-import { ISSUER_PATH, locDetailsPath as userLocDetailsPath } from "src/wallet-user/UserRouter";
+import { ISSUER_PATH, locDetailsPath as userLocDetailsPath } from "src/wallet-user/UserPaths";
import { LegalOfficerLocContextProvider } from "../LegalOfficerLocContext";
import { useLocContext } from "../LocContext";
import LocPane from "../LocPane";
diff --git a/src/loc/record/TokensRecordButton.tsx b/src/loc/record/TokensRecordButton.tsx
index 8130246a..54b60ed8 100644
--- a/src/loc/record/TokensRecordButton.tsx
+++ b/src/loc/record/TokensRecordButton.tsx
@@ -6,7 +6,7 @@ import Icon from "src/common/Icon";
import { tokensRecordPath } from "src/legal-officer/LegalOfficerPaths";
import { useLocContext } from "../LocContext";
import { ContributionMode } from "../types";
-import { tokensRecordPath as requesterTokensRecordPath, issuerTokensRecordPath } from "src/wallet-user/UserRouter";
+import { tokensRecordPath as requesterTokensRecordPath, issuerTokensRecordPath } from "src/wallet-user/UserPaths";
export default function TokensRecordButton(props: { contributionMode?: ContributionMode }) {
const { viewer } = useCommonContext();
diff --git a/src/loc/record/TokensRecordFiles.tsx b/src/loc/record/TokensRecordFiles.tsx
index e638438d..83a6dfb8 100644
--- a/src/loc/record/TokensRecordFiles.tsx
+++ b/src/loc/record/TokensRecordFiles.tsx
@@ -5,7 +5,7 @@ import { tokensRecordDocumentClaimHistoryPath } from "../../legal-officer/LegalO
import {
tokensRecordDocumentClaimHistoryPath as requesterTokensRecordDocumentClaimHistoryPath,
issuerTokensRecordDocumentClaimHistoryPath
-} from "../../wallet-user/UserRouter";
+} from "../../wallet-user/UserPaths";
import { useLocContext } from "../LocContext";
import ViewFileButton from "../../common/ViewFileButton";
import { getTokensRecordFileSource } from "../FileModel";
diff --git a/src/loc/record/TokensRecordPane.tsx b/src/loc/record/TokensRecordPane.tsx
index 32b0103d..8a4b0454 100644
--- a/src/loc/record/TokensRecordPane.tsx
+++ b/src/loc/record/TokensRecordPane.tsx
@@ -1,7 +1,7 @@
import { UUID } from "@logion/node-api";
import { useParams } from "react-router-dom";
import { locDetailsPath } from "src/legal-officer/LegalOfficerPaths";
-import { ISSUER_PATH, locDetailsPath as userLocDetailsPath } from "src/wallet-user/UserRouter";
+import { ISSUER_PATH, locDetailsPath as userLocDetailsPath } from "src/wallet-user/UserPaths";
import { LegalOfficerLocContextProvider } from "../LegalOfficerLocContext";
import { useLocContext } from "../LocContext";
import LocPane from "../LocPane";
diff --git a/src/loc/statement/StatementOfFactsRequestButton.tsx b/src/loc/statement/StatementOfFactsRequestButton.tsx
index 2402c5d1..2da70f2a 100644
--- a/src/loc/statement/StatementOfFactsRequestButton.tsx
+++ b/src/loc/statement/StatementOfFactsRequestButton.tsx
@@ -5,7 +5,7 @@ import { useState, useCallback } from "react";
import Button from "../../common/Button";
import { useUserLocContext } from "../UserLocContext";
import Dialog from "../../common/Dialog";
-import { locRequestsPath } from "../../wallet-user/UserRouter";
+import { locRequestsPath } from "../../wallet-user/UserPaths";
type Status = 'Idle' | 'Confirming' | 'Requesting' | 'Requested';
diff --git a/src/vault/VaultOutRequest.tsx b/src/vault/VaultOutRequest.tsx
index e9f507d2..7e2803eb 100644
--- a/src/vault/VaultOutRequest.tsx
+++ b/src/vault/VaultOutRequest.tsx
@@ -13,7 +13,7 @@ import Icon from "../common/Icon";
import Select, { OptionType } from "../common/Select";
import { CallCallback, useLogionChain } from "../logion-chain";
-import { buildOptions } from '../wallet-user/trust-protection/SelectLegalOfficer';
+import { buildOptions } from '../wallet-user/protection/SelectLegalOfficer';
import { useUserContext } from "../wallet-user/UserContext";
import ExtrinsicSubmissionStateView from "src/ExtrinsicSubmissionStateView";
diff --git a/src/wallet-user/Main.tsx b/src/wallet-user/Main.tsx
index 9eaa2752..c801658e 100644
--- a/src/wallet-user/Main.tsx
+++ b/src/wallet-user/Main.tsx
@@ -1,7 +1,7 @@
import { useLogionChain } from '../logion-chain';
import { UserContextProvider } from "./UserContext";
-import ContextualizedWallet from './ContextualizedWallet';
+import UserDashboard from './UserDashboard';
export default function Wallet() {
const { allAccounts } = useLogionChain();
@@ -12,7 +12,7 @@ export default function Wallet() {
return (
-
+
);
}
diff --git a/src/wallet-user/RefreshRequestsButton.test.tsx b/src/wallet-user/RefreshRequestsButton.test.tsx
deleted file mode 100644
index 300e4d45..00000000
--- a/src/wallet-user/RefreshRequestsButton.test.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-jest.mock('./UserContext');
-
-import RefreshRequestsButton from './RefreshRequestsButton';
-import { shallowRender } from '../tests';
-import { setRefreshRequests } from './__mocks__/UserContextMock';
-
-test("Renders null with no data", () => {
- setRefreshRequests(null);
- const tree = shallowRender();
- expect(tree).toMatchSnapshot();
-});
-
-test("Renders with refreshRequests", () => {
- const refreshRequests = jest.fn();
- setRefreshRequests(refreshRequests);
- const tree = shallowRender();
- expect(tree).toMatchSnapshot();
-});
diff --git a/src/wallet-user/RefreshRequestsButton.tsx b/src/wallet-user/RefreshRequestsButton.tsx
deleted file mode 100644
index e0b22162..00000000
--- a/src/wallet-user/RefreshRequestsButton.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import Button from 'react-bootstrap/Button';
-
-import { useUserContext } from './UserContext';
-
-export default function RefreshRequestsButton() {
- const { refreshRequests } = useUserContext();
- if(refreshRequests === null) {
- return null;
- } else {
- return ;
- }
-}
diff --git a/src/wallet-user/ContextualizedWallet.test.tsx b/src/wallet-user/UserDashboard.test.tsx
similarity index 80%
rename from src/wallet-user/ContextualizedWallet.test.tsx
rename to src/wallet-user/UserDashboard.test.tsx
index d5daf98e..e9e76053 100644
--- a/src/wallet-user/ContextualizedWallet.test.tsx
+++ b/src/wallet-user/UserDashboard.test.tsx
@@ -4,13 +4,13 @@ jest.mock('../logion-chain');
jest.mock('../common/CommonContext');
jest.mock('./UserContext');
-import ContextualizedWallet from './ContextualizedWallet';
+import UserDashboard from './UserDashboard';
import { setContextMock } from '../logion-chain/__mocks__/LogionChainMock';
import { shallowRender } from '../tests';
import { LocsState } from "@logion/client";
import { mockValidPolkadotAccountId, api } from 'src/__mocks__/LogionMock';
-describe("ContextualizedWallet", () => {
+describe("UserDashboard", () => {
setLocsState({} as LocsState)
@@ -25,12 +25,12 @@ describe("ContextualizedWallet", () => {
}
}
});
-
- const tree = shallowRender();
-
+
+ const tree = shallowRender();
+
expect(tree).toMatchSnapshot();
});
-
+
test('Given connected and account, then renders with router', () => {
setContextMock({
api: api.object(),
@@ -41,8 +41,8 @@ describe("ContextualizedWallet", () => {
}
});
- const tree = shallowRender();
-
+ const tree = shallowRender();
+
expect(tree).toMatchSnapshot();
});
@@ -51,9 +51,9 @@ describe("ContextualizedWallet", () => {
api: api.object(),
accounts: null
});
-
- const tree = shallowRender();
-
+
+ const tree = shallowRender();
+
expect(tree).toMatchSnapshot();
- });
+ });
});
diff --git a/src/wallet-user/ContextualizedWallet.tsx b/src/wallet-user/UserDashboard.tsx
similarity index 97%
rename from src/wallet-user/ContextualizedWallet.tsx
rename to src/wallet-user/UserDashboard.tsx
index 1283f75e..9510ed11 100644
--- a/src/wallet-user/ContextualizedWallet.tsx
+++ b/src/wallet-user/UserDashboard.tsx
@@ -4,7 +4,8 @@ import { useLogionChain } from '../logion-chain';
import Dashboard from '../common/Dashboard';
-import UserRouter, {
+import UserRouter from "./UserRouter";
+import {
HOME_PATH,
TRUST_PROTECTION_PATH,
SETTINGS_PATH,
@@ -13,11 +14,11 @@ import UserRouter, {
ISSUER_PATH,
transactionsPath,
vaultTransactionsPath,
-} from "./UserRouter";
+} from "./UserPaths";
import { useUserContext } from "./UserContext";
import { useCommonContext } from '../common/CommonContext';
-export default function ContextualizedWallet() {
+export default function UserDashboard() {
const { accounts, api } = useLogionChain();
const { colorTheme, refresh } = useCommonContext();
const { refreshRequests, vaultState, locsState } = useUserContext();
diff --git a/src/wallet-user/UserPaths.tsx b/src/wallet-user/UserPaths.tsx
new file mode 100644
index 00000000..5b8f4ac7
--- /dev/null
+++ b/src/wallet-user/UserPaths.tsx
@@ -0,0 +1,125 @@
+import { UUID, LocType, Hash } from '@logion/node-api';
+import { getBaseUrl } from "../PublicPaths";
+
+import {
+ USER_PATH,
+ locRequestsRelativePath,
+ locDetailsRelativePath,
+ LOC_DETAILS_RELATIVE_PATH
+} from '../RootPaths';
+
+export const HOME_PATH = USER_PATH;
+export const TRUST_PROTECTION_RELATIVE_PATH = '/protection';
+export const TRUST_PROTECTION_PATH = USER_PATH + TRUST_PROTECTION_RELATIVE_PATH;
+export const SETTINGS_RELATIVE_PATH = '/settings';
+export const SETTINGS_PATH = USER_PATH + SETTINGS_RELATIVE_PATH;
+export const RECOVERY_RELATIVE_PATH = '/recovery';
+export const RECOVERY_PATH = USER_PATH + RECOVERY_RELATIVE_PATH;
+export const WALLET_RELATIVE_PATH = '/wallet';
+export const VAULT_RELATIVE_PATH = '/vault';
+export const ISSUER_RELATIVE_PATH = '/verified-issuer';
+export const ISSUER_PATH = USER_PATH + ISSUER_RELATIVE_PATH;
+export const ISSUER_DETAILS_RELATIVE_PATH = ISSUER_RELATIVE_PATH + '/:locId';
+export const IDENFY_RELATIVE_PATH = '/idenfy';
+export const IDENFY_PATH = USER_PATH + IDENFY_RELATIVE_PATH;
+export const REQUEST_LOC_RELATIVE_PATH = '/loc/:locType-request';
+
+export function issuerDetailsPath(locId: UUID | string) {
+ return USER_PATH + ISSUER_DETAILS_RELATIVE_PATH
+ .replace(":locId", locId.toString())
+}
+
+export const TRANSACTIONS_RELATIVE_PATH = WALLET_RELATIVE_PATH + '/:coinId';
+const TRANSACTIONS_PATH = USER_PATH + TRANSACTIONS_RELATIVE_PATH;
+export function transactionsPath(coinId: string): string {
+ return TRANSACTIONS_PATH.replace(":coinId", coinId);
+}
+
+export const VAULT_TRANSACTIONS_RELATIVE_PATH = VAULT_RELATIVE_PATH + '/:coinId';
+const VAULT_TRANSACTIONS_PATH = USER_PATH + VAULT_TRANSACTIONS_RELATIVE_PATH;
+export function vaultTransactionsPath(coinId: string): string {
+ return VAULT_TRANSACTIONS_PATH.replace(":coinId", coinId);
+}
+
+export function dataLocDetailsPath(locType: LocType, locId: string) {
+ return USER_PATH + locDetailsRelativePath(locType)
+ .replace(":locId", locId)
+}
+
+export function locRequestsPath(locType: LocType) {
+ return USER_PATH + locRequestsRelativePath(locType)
+}
+
+export function requestLocRelativePath(locType: LocType) {
+ return REQUEST_LOC_RELATIVE_PATH
+ .replace(":locType", locType.toLowerCase())
+}
+
+export function requestLocPath(locType: LocType) {
+ return USER_PATH + requestLocRelativePath(locType)
+}
+
+export function locDetailsPath(locId: string | UUID, locType: LocType) {
+ let stringId;
+ if(locId instanceof UUID) {
+ stringId = locId.toString();
+ } else {
+ stringId = locId;
+ }
+ return dataLocDetailsPath(locType, stringId);
+}
+
+export const PARAM_RESULT = "result";
+export const PARAM_LOC_ID = "locId";
+
+export function resumeAfterIDenfyProcessUrl(result: 'success' | 'error' | 'unverified', locId: UUID): string {
+ return `${ getBaseUrl() }${ IDENFY_PATH }?${ PARAM_RESULT }=${ result }&${ PARAM_LOC_ID }=${ locId.toString() }`;
+}
+
+export const DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/claims/:hash";
+export function documentClaimHistoryPath(locId: UUID, hash: Hash) {
+ return USER_PATH + DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH
+ .replace(":locType", "Collection")
+ .replace(":locId", locId.toString())
+ .replace(":hash", hash.toHex());
+}
+
+export const TOKENS_RECORD_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/records";
+export function tokensRecordPath(locId: UUID) {
+ return USER_PATH + TOKENS_RECORD_RELATIVE_PATH
+ .replace(":locType", "Collection")
+ .replace(":locId", locId.toString());
+}
+
+export const ISSUER_TOKENS_RECORD_RELATIVE_PATH = ISSUER_DETAILS_RELATIVE_PATH + "/records";
+export function issuerTokensRecordPath(locId: UUID) {
+ return USER_PATH + ISSUER_TOKENS_RECORD_RELATIVE_PATH
+ .replace(":locType", "Collection")
+ .replace(":locId", locId.toString());
+}
+
+export const TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/records/:recordId/claims/:hash";
+export function tokensRecordDocumentClaimHistoryPath(locId: UUID, recordId: Hash, hash: Hash) {
+ return USER_PATH + TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH
+ .replace(":locType", "Collection")
+ .replace(":locId", locId.toString())
+ .replace(":recordId", recordId.toHex())
+ .replace(":hash", hash.toHex());
+}
+
+export const ISSUER_TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH = ISSUER_DETAILS_RELATIVE_PATH + "/records/:recordId/claims/:hash";
+export function issuerTokensRecordDocumentClaimHistoryPath(locId: UUID, recordId: Hash, hash: Hash) {
+ return USER_PATH + ISSUER_TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH
+ .replace(":locType", "Collection")
+ .replace(":locId", locId.toString())
+ .replace(":recordId", recordId.toHex())
+ .replace(":hash", hash.toHex());
+}
+
+export const INVITED_CONTRIBUTORS_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/invited-contributors";
+export function invitedContributorsPath(locId: UUID) {
+ return USER_PATH + INVITED_CONTRIBUTORS_RELATIVE_PATH
+ .replace(":locType", "collection")
+ .replace(":locId", locId.toString());
+}
+
diff --git a/src/wallet-user/UserRouter.tsx b/src/wallet-user/UserRouter.tsx
index d311df80..45980439 100644
--- a/src/wallet-user/UserRouter.tsx
+++ b/src/wallet-user/UserRouter.tsx
@@ -1,154 +1,53 @@
import { Routes, Route } from 'react-router-dom';
-import { UUID, LocType, Hash } from '@logion/node-api';
-
+import { UUID, LocType } from '@logion/node-api';
import {
- USER_PATH,
locRequestsRelativePath,
locDetailsRelativePath,
relativeDashboardCertificateRelativePath,
- LOC_DETAILS_RELATIVE_PATH
} from '../RootPaths';
-
+import {
+ TRUST_PROTECTION_RELATIVE_PATH,
+ SETTINGS_RELATIVE_PATH,
+ RECOVERY_RELATIVE_PATH,
+ TRANSACTIONS_RELATIVE_PATH,
+ VAULT_TRANSACTIONS_RELATIVE_PATH,
+ SETTINGS_PATH,
+ locDetailsPath,
+ locRequestsPath,
+ requestLocRelativePath,
+ ISSUER_RELATIVE_PATH,
+ ISSUER_DETAILS_RELATIVE_PATH,
+ ISSUER_PATH,
+ issuerDetailsPath,
+ IDENFY_RELATIVE_PATH,
+ DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH,
+ TOKENS_RECORD_RELATIVE_PATH,
+ ISSUER_TOKENS_RECORD_RELATIVE_PATH,
+ TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH,
+ ISSUER_TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH,
+ INVITED_CONTRIBUTORS_RELATIVE_PATH
+} from "./UserPaths";
import Settings from "../settings/Settings";
import Transactions from "../common/Transactions";
import { UserLocDetails } from '../loc/LocDetails';
import DashboardCertificateRouter from "../loc/DashboardCertificateRouter";
import { useCommonContext } from "../common/CommonContext";
-
import { useUserContext } from "./UserContext";
-import Home from "./Home";
-import TrustProtection from "./trust-protection/TrustProtection";
-import Recovery from "./trust-protection/Recovery";
+import Home from "./home/Home";
+import TrustProtection from "./protection/TrustProtection";
+import Recovery from "./recovery/Recovery";
import { useLogionChain } from '../logion-chain';
-import IdentityLocRequest from "./trust-protection/IdentityLocRequest";
+import IdentityLocRequest from "../loc/IdentityLocRequest";
import IssuerDashboard from "./issuer/IssuerDashboard";
-import IdenfyVerificationResult from './IdenfyVerificationResult';
+import IdenfyVerificationResult from './idenfy/IdenfyVerificationResult';
import { UserDocumentClaimHistory, UserTokensRecordDocumentClaimHistory } from 'src/loc/DocumentClaimHistory';
import { UserTokensRecordPane } from 'src/loc/record/TokensRecordPane';
import { Navigate } from 'react-router-dom';
-import { getBaseUrl } from "../PublicPaths";
import { UserInvitedContributorsPane } from "../loc/invited-contributor/InvitedContributorsPane";
import LocsDashboard from 'src/loc/dashboard/LocsDashboard';
-import LocCreation from "./LocCreation";
+import LocRequestButton from "../components/locrequest/LocRequestButton";
import DataLocRequest from "../loc/DataLocRequest";
-export const HOME_PATH = USER_PATH;
-
-export const TRUST_PROTECTION_RELATIVE_PATH = '/protection';
-export const TRUST_PROTECTION_PATH = USER_PATH + TRUST_PROTECTION_RELATIVE_PATH;
-export const SETTINGS_RELATIVE_PATH = '/settings';
-export const SETTINGS_PATH = USER_PATH + SETTINGS_RELATIVE_PATH;
-export const RECOVERY_RELATIVE_PATH = '/recovery';
-export const RECOVERY_PATH = USER_PATH + RECOVERY_RELATIVE_PATH;
-export const WALLET_RELATIVE_PATH = '/wallet';
-export const VAULT_RELATIVE_PATH = '/vault';
-export const ISSUER_RELATIVE_PATH = '/verified-issuer';
-export const ISSUER_PATH = USER_PATH + ISSUER_RELATIVE_PATH;
-export const ISSUER_DETAILS_RELATIVE_PATH = ISSUER_RELATIVE_PATH + '/:locId';
-export const IDENFY_RELATIVE_PATH = '/idenfy';
-export const IDENFY_PATH = USER_PATH + IDENFY_RELATIVE_PATH;
-
-export function issuerDetailsPath(locId: UUID | string) {
- return USER_PATH + ISSUER_DETAILS_RELATIVE_PATH
- .replace(":locId", locId.toString())
-}
-
-export const TRANSACTIONS_RELATIVE_PATH = WALLET_RELATIVE_PATH + '/:coinId';
-const TRANSACTIONS_PATH = USER_PATH + TRANSACTIONS_RELATIVE_PATH;
-export function transactionsPath(coinId: string): string {
- return TRANSACTIONS_PATH.replace(":coinId", coinId);
-}
-
-export const VAULT_TRANSACTIONS_RELATIVE_PATH = VAULT_RELATIVE_PATH + '/:coinId';
-const VAULT_TRANSACTIONS_PATH = USER_PATH + VAULT_TRANSACTIONS_RELATIVE_PATH;
-export function vaultTransactionsPath(coinId: string): string {
- return VAULT_TRANSACTIONS_PATH.replace(":coinId", coinId);
-}
-
-export function dataLocDetailsPath(locType: LocType, locId: string) {
- return USER_PATH + locDetailsRelativePath(locType)
- .replace(":locId", locId)
-}
-
-export function locRequestsPath(locType: LocType) {
- return USER_PATH + locRequestsRelativePath(locType)
-}
-
-export const REQUEST_LOC_RELATIVE_PATH = '/loc/:locType-request';
-
-function requestLocRelativePath(locType: LocType) {
- return REQUEST_LOC_RELATIVE_PATH
- .replace(":locType", locType.toLowerCase())
-}
-
-export function requestLocPath(locType: LocType) {
- return USER_PATH + requestLocRelativePath(locType)
-}
-
-export function locDetailsPath(locId: string | UUID, locType: LocType) {
- let stringId;
- if(locId instanceof UUID) {
- stringId = locId.toString();
- } else {
- stringId = locId;
- }
- return dataLocDetailsPath(locType, stringId);
-}
-
-export const PARAM_RESULT = "result";
-export const PARAM_LOC_ID = "locId";
-
-export function resumeAfterIDenfyProcessUrl(result: 'success' | 'error' | 'unverified', locId: UUID): string {
- return `${ getBaseUrl() }${ IDENFY_PATH }?${ PARAM_RESULT }=${ result }&${ PARAM_LOC_ID }=${ locId.toString() }`;
-}
-
-export const DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/claims/:hash";
-export function documentClaimHistoryPath(locId: UUID, hash: Hash) {
- return USER_PATH + DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH
- .replace(":locType", "Collection")
- .replace(":locId", locId.toString())
- .replace(":hash", hash.toHex());
-}
-
-export const TOKENS_RECORD_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/records";
-export function tokensRecordPath(locId: UUID) {
- return USER_PATH + TOKENS_RECORD_RELATIVE_PATH
- .replace(":locType", "Collection")
- .replace(":locId", locId.toString());
-}
-
-export const ISSUER_TOKENS_RECORD_RELATIVE_PATH = ISSUER_DETAILS_RELATIVE_PATH + "/records";
-export function issuerTokensRecordPath(locId: UUID) {
- return USER_PATH + ISSUER_TOKENS_RECORD_RELATIVE_PATH
- .replace(":locType", "Collection")
- .replace(":locId", locId.toString());
-}
-
-export const TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/records/:recordId/claims/:hash";
-export function tokensRecordDocumentClaimHistoryPath(locId: UUID, recordId: Hash, hash: Hash) {
- return USER_PATH + TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH
- .replace(":locType", "Collection")
- .replace(":locId", locId.toString())
- .replace(":recordId", recordId.toHex())
- .replace(":hash", hash.toHex());
-}
-
-export const ISSUER_TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH = ISSUER_DETAILS_RELATIVE_PATH + "/records/:recordId/claims/:hash";
-export function issuerTokensRecordDocumentClaimHistoryPath(locId: UUID, recordId: Hash, hash: Hash) {
- return USER_PATH + ISSUER_TOKENS_RECORD_DOCUMENT_CLAIM_HISTORY_RELATIVE_PATH
- .replace(":locType", "Collection")
- .replace(":locId", locId.toString())
- .replace(":recordId", recordId.toHex())
- .replace(":hash", hash.toHex());
-}
-
-export const INVITED_CONTRIBUTORS_RELATIVE_PATH = LOC_DETAILS_RELATIVE_PATH + "/invited-contributors";
-export function invitedContributorsPath(locId: UUID) {
- return USER_PATH + INVITED_CONTRIBUTORS_RELATIVE_PATH
- .replace(":locType", "collection")
- .replace(":locId", locId.toString());
-}
-
export default function UserRouter() {
const { accounts } = useLogionChain();
const { balanceState } = useCommonContext();
@@ -184,7 +83,7 @@ export default function UserRouter() {
element={ }
+ actions={ }
settingsPath={ SETTINGS_PATH }
locs={ locs["Transaction"] }
loading={ locsState === undefined || locsState.discarded }
@@ -196,7 +95,7 @@ export default function UserRouter() {
element={ }
+ actions={ }
settingsPath={ SETTINGS_PATH }
locs={ locs["Collection"] }
loading={ locsState === undefined || locsState.discarded }
@@ -208,7 +107,7 @@ export default function UserRouter() {
element={ }
+ actions={ }
settingsPath={ SETTINGS_PATH }
locs={ locs["Identity"] }
loading={ locsState === undefined || locsState.discarded }
@@ -259,7 +158,7 @@ export default function UserRouter() {
issuerDetailsPath(locId) }
+ detailsPath={ (locId: UUID, _: LocType) => issuerDetailsPath(locId) }
contributionMode='VerifiedIssuer'
/>
} />
diff --git a/src/wallet-user/__snapshots__/Main.test.tsx.snap b/src/wallet-user/__snapshots__/Main.test.tsx.snap
index 45090828..6912c267 100644
--- a/src/wallet-user/__snapshots__/Main.test.tsx.snap
+++ b/src/wallet-user/__snapshots__/Main.test.tsx.snap
@@ -2,6 +2,6 @@
exports[`renders 1`] = `
-
+
`;
diff --git a/src/wallet-user/__snapshots__/RefreshRequestsButton.test.tsx.snap b/src/wallet-user/__snapshots__/RefreshRequestsButton.test.tsx.snap
deleted file mode 100644
index 722229d7..00000000
--- a/src/wallet-user/__snapshots__/RefreshRequestsButton.test.tsx.snap
+++ /dev/null
@@ -1,14 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`Renders null with no data 1`] = `null`;
-
-exports[`Renders with refreshRequests 1`] = `
-
-`;
diff --git a/src/wallet-user/__snapshots__/ContextualizedWallet.test.tsx.snap b/src/wallet-user/__snapshots__/UserDashboard.test.tsx.snap
similarity index 96%
rename from src/wallet-user/__snapshots__/ContextualizedWallet.test.tsx.snap
rename to src/wallet-user/__snapshots__/UserDashboard.test.tsx.snap
index 12f0fb15..46e9406f 100644
--- a/src/wallet-user/__snapshots__/ContextualizedWallet.test.tsx.snap
+++ b/src/wallet-user/__snapshots__/UserDashboard.test.tsx.snap
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`ContextualizedWallet Given connected and account, then renders with router 1`] = `
+exports[`UserDashboard Given connected and account, then renders with router 1`] = `
`;
-exports[`ContextualizedWallet Given connected and no account then renders without router 1`] = `null`;
+exports[`UserDashboard Given connected and no account then renders without router 1`] = `null`;
-exports[`ContextualizedWallet Given disconnected and accounts then empty 1`] = `
+exports[`UserDashboard Given disconnected and accounts then empty 1`] = `
}
@@ -70,7 +70,7 @@ exports[`renders 1`] = `
element={
}
@@ -96,7 +96,7 @@ exports[`renders 1`] = `
element={
}
@@ -159,7 +159,7 @@ exports[`renders 1`] = `
path="/loc/identity/:locId"
/>
}
+ element={}
path="/"
/>
{
diff --git a/src/wallet-user/Home.tsx b/src/wallet-user/home/Home.tsx
similarity index 85%
rename from src/wallet-user/Home.tsx
rename to src/wallet-user/home/Home.tsx
index aea772c4..168eaec2 100644
--- a/src/wallet-user/Home.tsx
+++ b/src/wallet-user/home/Home.tsx
@@ -2,32 +2,32 @@ import { Col, Row } from 'react-bootstrap';
import { useNavigate } from 'react-router';
import { Lgnt } from '@logion/node-api';
-import { useCommonContext } from "../common/CommonContext";
-import { FullWidthPane } from '../common/Dashboard';
-import Icon from '../common/Icon';
-import Frame from '../common/Frame';
-import Loader from '../common/Loader';
-import Table, { DateCell, EmptyTableMessage } from '../common/Table';
-import TransferAmountCell, { transferBalance } from '../common/TransferAmountCell';
-import AmountCell from '../common/AmountCell';
-import Reading from '../common/Reading';
-import Button from '../common/Button';
-import { TransactionStatusCell } from "../common/TransactionStatusCell";
-import NetworkWarning from '../common/NetworkWarning';
-import { useLogionChain } from '../logion-chain';
+import { useCommonContext } from "../../common/CommonContext";
+import { FullWidthPane } from '../../common/Dashboard';
+import Icon from '../../common/Icon';
+import Frame from '../../common/Frame';
+import Loader from '../../common/Loader';
+import Table, { DateCell, EmptyTableMessage } from '../../common/Table';
+import TransferAmountCell, { transferBalance } from '../../common/TransferAmountCell';
+import AmountCell from '../../common/AmountCell';
+import Reading from '../../common/Reading';
+import Button from '../../common/Button';
+import { TransactionStatusCell } from "../../common/TransactionStatusCell";
+import NetworkWarning from '../../common/NetworkWarning';
+import { useLogionChain } from '../../logion-chain';
-import { SETTINGS_PATH, transactionsPath } from './UserRouter';
+import { SETTINGS_PATH, transactionsPath } from '../UserPaths';
import './Home.css';
-import TransactionType from 'src/common/TransactionType';
-import { useUserContext } from "./UserContext";
-import Shortcut from 'src/components/shortcuts/Shortcut';
-import Shortcuts from 'src/components/shortcuts/Shortcuts';
-import LocCreation from './LocCreation';
+import TransactionType from '../../common/TransactionType';
+import { useUserContext } from "../UserContext";
+import Shortcut from '../../components/shortcuts/Shortcut';
+import Shortcuts from '../../components/shortcuts/Shortcuts';
+import LocRequestButton from '../../components/locrequest/LocRequestButton';
import { useMemo } from 'react';
import { toFeesClass } from "@logion/client/dist/Fees.js";
-export default function Account() {
+export default function Home() {
const { colorTheme } = useCommonContext();
return (
@@ -140,7 +140,7 @@ export function Content() {
What shall logion protect for you? }
>
- Identity }
/>}
/>
- }
/>
- string;
diff --git a/src/wallet-user/issuer/IssuerClosedLocs.tsx b/src/wallet-user/issuer/IssuerClosedLocs.tsx
index 21522a5f..691e6005 100644
--- a/src/wallet-user/issuer/IssuerClosedLocs.tsx
+++ b/src/wallet-user/issuer/IssuerClosedLocs.tsx
@@ -15,7 +15,7 @@ import { merge } from "./IssuerUtils";
import Icon from "src/common/Icon";
import "./IssuerClosedLocs.css";
import { useNavigate } from "react-router-dom";
-import { issuerTokensRecordPath } from "../UserRouter";
+import { issuerTokensRecordPath } from '../UserPaths';
import { OverlayTrigger, Tooltip } from "react-bootstrap";
export default function IssuerClosedLocs() {
diff --git a/src/wallet-user/issuer/IssuerOpenedLocs.tsx b/src/wallet-user/issuer/IssuerOpenedLocs.tsx
index f5f03997..18491ca0 100644
--- a/src/wallet-user/issuer/IssuerOpenedLocs.tsx
+++ b/src/wallet-user/issuer/IssuerOpenedLocs.tsx
@@ -7,7 +7,7 @@ import LegalOfficerName from '../../common/LegalOfficerNameCell';
import ButtonGroup from "../../common/ButtonGroup";
import Button from "../../common/Button";
import Loader from '../../common/Loader';
-import { issuerDetailsPath } from '../UserRouter';
+import { issuerDetailsPath } from '../UserPaths';
import { useResponsiveContext } from '../../common/Responsive';
import UserIdentityNameCell from "../../common/UserIdentityNameCell";
import { LocData } from "@logion/client";
diff --git a/src/wallet-user/trust-protection/CreateProtectionRequestForm.css b/src/wallet-user/protection/CreateProtectionRequestForm.css
similarity index 100%
rename from src/wallet-user/trust-protection/CreateProtectionRequestForm.css
rename to src/wallet-user/protection/CreateProtectionRequestForm.css
diff --git a/src/wallet-user/trust-protection/CreateProtectionRequestForm.test.tsx b/src/wallet-user/protection/CreateProtectionRequestForm.test.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/CreateProtectionRequestForm.test.tsx
rename to src/wallet-user/protection/CreateProtectionRequestForm.test.tsx
diff --git a/src/wallet-user/trust-protection/CreateProtectionRequestForm.tsx b/src/wallet-user/protection/CreateProtectionRequestForm.tsx
similarity index 99%
rename from src/wallet-user/trust-protection/CreateProtectionRequestForm.tsx
rename to src/wallet-user/protection/CreateProtectionRequestForm.tsx
index 391b584c..365cf118 100644
--- a/src/wallet-user/trust-protection/CreateProtectionRequestForm.tsx
+++ b/src/wallet-user/protection/CreateProtectionRequestForm.tsx
@@ -13,7 +13,7 @@ import { useCommonContext } from "../../common/CommonContext";
import { useUserContext } from "../UserContext";
import { CallCallback, useLogionChain } from '../../logion-chain';
-import { SETTINGS_PATH } from '../UserRouter';
+import { SETTINGS_PATH } from '../UserPaths';
import LegalOfficers from './LegalOfficers';
diff --git a/src/wallet-user/trust-protection/GoToRecovery.tsx b/src/wallet-user/protection/GoToRecovery.tsx
similarity index 95%
rename from src/wallet-user/trust-protection/GoToRecovery.tsx
rename to src/wallet-user/protection/GoToRecovery.tsx
index 2ebd5383..7923319f 100644
--- a/src/wallet-user/trust-protection/GoToRecovery.tsx
+++ b/src/wallet-user/protection/GoToRecovery.tsx
@@ -4,7 +4,7 @@ import { FullWidthPane } from '../../common/Dashboard';
import Alert from '../../common/Alert';
import Button from '../../common/Button';
-import { RECOVERY_PATH } from '../UserRouter';
+import { RECOVERY_PATH } from '../UserPaths';
export default function GoToRecovery() {
const navigate = useNavigate();
diff --git a/src/wallet-user/trust-protection/LegalOfficers.css b/src/wallet-user/protection/LegalOfficers.css
similarity index 100%
rename from src/wallet-user/trust-protection/LegalOfficers.css
rename to src/wallet-user/protection/LegalOfficers.css
diff --git a/src/wallet-user/trust-protection/LegalOfficers.tsx b/src/wallet-user/protection/LegalOfficers.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/LegalOfficers.tsx
rename to src/wallet-user/protection/LegalOfficers.tsx
diff --git a/src/wallet-user/trust-protection/Officer.css b/src/wallet-user/protection/Officer.css
similarity index 100%
rename from src/wallet-user/trust-protection/Officer.css
rename to src/wallet-user/protection/Officer.css
diff --git a/src/wallet-user/trust-protection/Officer.tsx b/src/wallet-user/protection/Officer.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/Officer.tsx
rename to src/wallet-user/protection/Officer.tsx
diff --git a/src/wallet-user/trust-protection/ProtectionRecoveryRequest.css b/src/wallet-user/protection/ProtectionRecoveryRequest.css
similarity index 100%
rename from src/wallet-user/trust-protection/ProtectionRecoveryRequest.css
rename to src/wallet-user/protection/ProtectionRecoveryRequest.css
diff --git a/src/wallet-user/trust-protection/ProtectionRecoveryRequest.test.tsx b/src/wallet-user/protection/ProtectionRecoveryRequest.test.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/ProtectionRecoveryRequest.test.tsx
rename to src/wallet-user/protection/ProtectionRecoveryRequest.test.tsx
diff --git a/src/wallet-user/trust-protection/ProtectionRecoveryRequest.tsx b/src/wallet-user/protection/ProtectionRecoveryRequest.tsx
similarity index 99%
rename from src/wallet-user/trust-protection/ProtectionRecoveryRequest.tsx
rename to src/wallet-user/protection/ProtectionRecoveryRequest.tsx
index 32c1d573..50172ce7 100644
--- a/src/wallet-user/trust-protection/ProtectionRecoveryRequest.tsx
+++ b/src/wallet-user/protection/ProtectionRecoveryRequest.tsx
@@ -17,7 +17,7 @@ import { useCommonContext } from '../../common/CommonContext';
import NetworkWarning from '../../common/NetworkWarning';
import { useUserContext } from '../UserContext';
-import { SETTINGS_PATH } from '../UserRouter';
+import { SETTINGS_PATH } from '../UserPaths';
import SelectLegalOfficer from './SelectLegalOfficer';
diff --git a/src/wallet-user/trust-protection/RecoveryRefusal.css b/src/wallet-user/protection/RecoveryRefusal.css
similarity index 100%
rename from src/wallet-user/trust-protection/RecoveryRefusal.css
rename to src/wallet-user/protection/RecoveryRefusal.css
diff --git a/src/wallet-user/trust-protection/RecoveryRefusal.tsx b/src/wallet-user/protection/RecoveryRefusal.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/RecoveryRefusal.tsx
rename to src/wallet-user/protection/RecoveryRefusal.tsx
diff --git a/src/wallet-user/trust-protection/SelectLegalOfficer.css b/src/wallet-user/protection/SelectLegalOfficer.css
similarity index 100%
rename from src/wallet-user/trust-protection/SelectLegalOfficer.css
rename to src/wallet-user/protection/SelectLegalOfficer.css
diff --git a/src/wallet-user/trust-protection/SelectLegalOfficer.tsx b/src/wallet-user/protection/SelectLegalOfficer.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/SelectLegalOfficer.tsx
rename to src/wallet-user/protection/SelectLegalOfficer.tsx
diff --git a/src/wallet-user/trust-protection/SelectLegalOfficerAndLoc.css b/src/wallet-user/protection/SelectLegalOfficerAndLoc.css
similarity index 100%
rename from src/wallet-user/trust-protection/SelectLegalOfficerAndLoc.css
rename to src/wallet-user/protection/SelectLegalOfficerAndLoc.css
diff --git a/src/wallet-user/trust-protection/SelectLegalOfficerAndLoc.tsx b/src/wallet-user/protection/SelectLegalOfficerAndLoc.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/SelectLegalOfficerAndLoc.tsx
rename to src/wallet-user/protection/SelectLegalOfficerAndLoc.tsx
diff --git a/src/wallet-user/trust-protection/TestData.ts b/src/wallet-user/protection/TestData.ts
similarity index 100%
rename from src/wallet-user/trust-protection/TestData.ts
rename to src/wallet-user/protection/TestData.ts
diff --git a/src/wallet-user/trust-protection/TrustProtection.css b/src/wallet-user/protection/TrustProtection.css
similarity index 100%
rename from src/wallet-user/trust-protection/TrustProtection.css
rename to src/wallet-user/protection/TrustProtection.css
diff --git a/src/wallet-user/trust-protection/TrustProtection.test.tsx b/src/wallet-user/protection/TrustProtection.test.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/TrustProtection.test.tsx
rename to src/wallet-user/protection/TrustProtection.test.tsx
diff --git a/src/wallet-user/trust-protection/TrustProtection.tsx b/src/wallet-user/protection/TrustProtection.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/TrustProtection.tsx
rename to src/wallet-user/protection/TrustProtection.tsx
diff --git a/src/wallet-user/trust-protection/__snapshots__/CreateProtectionRequestForm.test.tsx.snap b/src/wallet-user/protection/__snapshots__/CreateProtectionRequestForm.test.tsx.snap
similarity index 100%
rename from src/wallet-user/trust-protection/__snapshots__/CreateProtectionRequestForm.test.tsx.snap
rename to src/wallet-user/protection/__snapshots__/CreateProtectionRequestForm.test.tsx.snap
diff --git a/src/wallet-user/trust-protection/__snapshots__/ProtectionRecoveryRequest.test.tsx.snap b/src/wallet-user/protection/__snapshots__/ProtectionRecoveryRequest.test.tsx.snap
similarity index 100%
rename from src/wallet-user/trust-protection/__snapshots__/ProtectionRecoveryRequest.test.tsx.snap
rename to src/wallet-user/protection/__snapshots__/ProtectionRecoveryRequest.test.tsx.snap
diff --git a/src/wallet-user/trust-protection/__snapshots__/TrustProtection.test.tsx.snap b/src/wallet-user/protection/__snapshots__/TrustProtection.test.tsx.snap
similarity index 100%
rename from src/wallet-user/trust-protection/__snapshots__/TrustProtection.test.tsx.snap
rename to src/wallet-user/protection/__snapshots__/TrustProtection.test.tsx.snap
diff --git a/src/wallet-user/trust-protection/GoToTrustProtection.css b/src/wallet-user/recovery/GoToTrustProtection.css
similarity index 100%
rename from src/wallet-user/trust-protection/GoToTrustProtection.css
rename to src/wallet-user/recovery/GoToTrustProtection.css
diff --git a/src/wallet-user/trust-protection/GoToTrustProtection.tsx b/src/wallet-user/recovery/GoToTrustProtection.tsx
similarity index 97%
rename from src/wallet-user/trust-protection/GoToTrustProtection.tsx
rename to src/wallet-user/recovery/GoToTrustProtection.tsx
index 914832bd..b59d504d 100644
--- a/src/wallet-user/trust-protection/GoToTrustProtection.tsx
+++ b/src/wallet-user/recovery/GoToTrustProtection.tsx
@@ -5,7 +5,7 @@ import Alert from '../../common/Alert';
import Button from '../../common/Button';
import { useCommonContext } from '../../common/CommonContext';
-import { TRUST_PROTECTION_PATH } from '../UserRouter';
+import { TRUST_PROTECTION_PATH } from '../UserPaths';
import './GoToTrustProtection.css';
import Frame from '../../common/Frame';
diff --git a/src/wallet-user/trust-protection/Recovery.test.tsx b/src/wallet-user/recovery/Recovery.test.tsx
similarity index 95%
rename from src/wallet-user/trust-protection/Recovery.test.tsx
rename to src/wallet-user/recovery/Recovery.test.tsx
index 9ad3c4a0..b0a6dbb9 100644
--- a/src/wallet-user/trust-protection/Recovery.test.tsx
+++ b/src/wallet-user/recovery/Recovery.test.tsx
@@ -4,10 +4,10 @@ jest.unmock("@logion/client");
import {shallowRender} from "../../tests";
import Recovery from "./Recovery";
import { setProtectionState } from '../__mocks__/UserContextMock';
-import { PENDING_RECOVERY_REQUESTS, ACCEPTED_RECOVERY_REQUESTS, ACTIVATED_RECOVERY_REQUESTS } from "./TestData";
+import { PENDING_RECOVERY_REQUESTS, ACCEPTED_RECOVERY_REQUESTS, ACTIVATED_RECOVERY_REQUESTS } from "../protection/TestData";
import { PendingProtection, AcceptedProtection, PendingRecovery, ClaimedRecovery } from "@logion/client";
import { RecoverySharedState } from "@logion/client/dist/Recovery.js";
-import { GUILLAUME, PATRICK } from "src/common/TestData";
+import { GUILLAUME, PATRICK } from "../../common/TestData";
test("renders", () => {
setProtectionState(undefined);
diff --git a/src/wallet-user/trust-protection/Recovery.tsx b/src/wallet-user/recovery/Recovery.tsx
similarity index 91%
rename from src/wallet-user/trust-protection/Recovery.tsx
rename to src/wallet-user/recovery/Recovery.tsx
index 65b63866..afa68e4c 100644
--- a/src/wallet-user/trust-protection/Recovery.tsx
+++ b/src/wallet-user/recovery/Recovery.tsx
@@ -1,8 +1,8 @@
import { useUserContext } from "../UserContext";
import GoToTrustProtection from './GoToTrustProtection';
-import CreateProtectionRequestForm from "./CreateProtectionRequestForm";
-import ProtectionRecoveryRequest from './ProtectionRecoveryRequest';
+import CreateProtectionRequestForm from "../protection/CreateProtectionRequestForm";
+import ProtectionRecoveryRequest from '../protection/ProtectionRecoveryRequest';
import RecoveryProcess from './RecoveryProcess';
import {
AcceptedProtection,
diff --git a/src/wallet-user/trust-protection/RecoveryProcess.css b/src/wallet-user/recovery/RecoveryProcess.css
similarity index 100%
rename from src/wallet-user/trust-protection/RecoveryProcess.css
rename to src/wallet-user/recovery/RecoveryProcess.css
diff --git a/src/wallet-user/trust-protection/RecoveryProcess.tsx b/src/wallet-user/recovery/RecoveryProcess.tsx
similarity index 98%
rename from src/wallet-user/trust-protection/RecoveryProcess.tsx
rename to src/wallet-user/recovery/RecoveryProcess.tsx
index e7f8da75..3778e2bd 100644
--- a/src/wallet-user/trust-protection/RecoveryProcess.tsx
+++ b/src/wallet-user/recovery/RecoveryProcess.tsx
@@ -6,7 +6,7 @@ import Tabs from '../../common/Tabs';
import Icon from '../../common/Icon';
import NetworkWarning from '../../common/NetworkWarning';
-import { SETTINGS_PATH } from '../UserRouter';
+import { SETTINGS_PATH } from '../UserPaths';
import { useUserContext } from '../UserContext';
import WalletRecoveryProcessTab from "./WalletRecoveryProcessTab";
diff --git a/src/wallet-user/trust-protection/VaultRecoveryProcessTab.css b/src/wallet-user/recovery/VaultRecoveryProcessTab.css
similarity index 100%
rename from src/wallet-user/trust-protection/VaultRecoveryProcessTab.css
rename to src/wallet-user/recovery/VaultRecoveryProcessTab.css
diff --git a/src/wallet-user/trust-protection/VaultRecoveryProcessTab.tsx b/src/wallet-user/recovery/VaultRecoveryProcessTab.tsx
similarity index 97%
rename from src/wallet-user/trust-protection/VaultRecoveryProcessTab.tsx
rename to src/wallet-user/recovery/VaultRecoveryProcessTab.tsx
index 0adad799..35fd2dd3 100644
--- a/src/wallet-user/trust-protection/VaultRecoveryProcessTab.tsx
+++ b/src/wallet-user/recovery/VaultRecoveryProcessTab.tsx
@@ -18,12 +18,12 @@ import ButtonGroup from "../../common/ButtonGroup";
import { useUserContext } from "../UserContext";
-import { buildOptions } from "./SelectLegalOfficer";
+import { buildOptions } from "../protection/SelectLegalOfficer";
import "./VaultRecoveryProcessTab.css"
-import CoinIcon from "src/components/coin/CoinIcon";
-import ExtrinsicSubmissionStateView from "src/ExtrinsicSubmissionStateView";
-import AmountCell from "src/common/AmountCell";
-import AssetNameCell from "src/common/AssetNameCell";
+import CoinIcon from "../../components/coin/CoinIcon";
+import ExtrinsicSubmissionStateView from "../../ExtrinsicSubmissionStateView";
+import AmountCell from "../../common/AmountCell";
+import AssetNameCell from "../../common/AssetNameCell";
interface FormValues {
legalOfficer: string | null;
diff --git a/src/wallet-user/trust-protection/WalletRecoveryProcessTab.test.tsx b/src/wallet-user/recovery/WalletRecoveryProcessTab.test.tsx
similarity index 100%
rename from src/wallet-user/trust-protection/WalletRecoveryProcessTab.test.tsx
rename to src/wallet-user/recovery/WalletRecoveryProcessTab.test.tsx
diff --git a/src/wallet-user/trust-protection/WalletRecoveryProcessTab.tsx b/src/wallet-user/recovery/WalletRecoveryProcessTab.tsx
similarity index 94%
rename from src/wallet-user/trust-protection/WalletRecoveryProcessTab.tsx
rename to src/wallet-user/recovery/WalletRecoveryProcessTab.tsx
index 111f45de..ee77081a 100644
--- a/src/wallet-user/trust-protection/WalletRecoveryProcessTab.tsx
+++ b/src/wallet-user/recovery/WalletRecoveryProcessTab.tsx
@@ -12,11 +12,11 @@ import IconTextRow from "../../common/IconTextRow";
import { CallCallback, useLogionChain } from "../../logion-chain";
import { useUserContext } from "../UserContext";
-import CoinIcon from "src/components/coin/CoinIcon";
-import ExtrinsicSubmissionStateView from "src/ExtrinsicSubmissionStateView";
-import AmountCell from "src/common/AmountCell";
-import { ExpectNewTransactionStatus, useCommonContext } from "src/common/CommonContext";
-import AssetNameCell from "src/common/AssetNameCell";
+import CoinIcon from "../../components/coin/CoinIcon";
+import ExtrinsicSubmissionStateView from "../../ExtrinsicSubmissionStateView";
+import AmountCell from "../../common/AmountCell";
+import { ExpectNewTransactionStatus, useCommonContext } from "../../common/CommonContext";
+import AssetNameCell from "../../common/AssetNameCell";
interface Props {
vaultFirst: boolean
@@ -164,7 +164,7 @@ export default function WalletRecoveryProcessTab(props: Props) {
Transfer successful, waiting for the transaction to be finalized.
Note that this may take up to 30 seconds. If you want to proceed, you can safely
- click on cancel but your transaction may not show up yet.
+ click on close but your transaction may not show up yet.
}
diff --git a/src/wallet-user/trust-protection/__snapshots__/Recovery.test.tsx.snap b/src/wallet-user/recovery/__snapshots__/Recovery.test.tsx.snap
similarity index 100%
rename from src/wallet-user/trust-protection/__snapshots__/Recovery.test.tsx.snap
rename to src/wallet-user/recovery/__snapshots__/Recovery.test.tsx.snap
diff --git a/src/wallet-user/trust-protection/__mocks__/Model.tsx b/src/wallet-user/trust-protection/__mocks__/Model.tsx
deleted file mode 100644
index 1da181db..00000000
--- a/src/wallet-user/trust-protection/__mocks__/Model.tsx
+++ /dev/null
@@ -1,3 +0,0 @@
-export function checkActivation() {
- return Promise.resolve();
-}