1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-22 17:33:23 +01:00

[MMI] adds some constants and necessary routes (#17868)

* MMI adds constants and routes

* MMI lint fix

* prettier
This commit is contained in:
António Regadas 2023-04-28 10:52:12 +01:00 committed by GitHub
parent 49f01406c4
commit a501ce0f3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 104 additions and 3 deletions

View File

@ -358,6 +358,20 @@ export type MetaMetricsUserTraits = {
* Whether the security provider feature has been enabled.
*/
security_providers?: string[];
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
/**
* The address of the MMI account in question
*/
mmi_account_address?: string;
/**
* What is the MMI extension ID
*/
mmi_extension_id?: string;
/**
* Is the user using a custodian account
*/
mmi_is_custodian?: boolean;
///: END:ONLY_INCLUDE_IN
};
export enum MetaMetricsUserTrait {
@ -427,6 +441,20 @@ export enum MetaMetricsUserTrait {
* Identified when the security provider feature is enabled.
*/
SecurityProviders = 'security_providers',
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
/**
* Identified when we get the current account in question
*/
MmiAccountAddress = 'mmi_account_address',
/**
* Identified when we the user has the extension
*/
MmiExtensionId = 'mmi_extension_id',
/**
* Identified when the user connects a custodian
*/
MmiIsCustodian = 'mmi_is_custodian',
///: END:ONLY_INCLUDE_IN
}
/**

View File

@ -32,6 +32,12 @@ const CONNECT_HARDWARE_ROUTE = '/new-account/connect';
const CUSTODY_ACCOUNT_ROUTE = '/new-account/custody';
const INSTITUTIONAL_FEATURES_DONE_ROUTE = '/institutional-features/done';
const CUSTODY_ACCOUNT_DONE_ROUTE = '/new-account/custody/done';
const COMPLIANCE_FEATURE_ROUTE = '/compliance-feature';
const CONFIRM_INSTITUTIONAL_FEATURE_CONNECT =
'/confirm-institutional-feature-connect';
const CONFIRM_ADD_CUSTODIAN_TOKEN = '/confirm-add-custodian-token';
const INTERACTIVE_REPLACEMENT_TOKEN_PAGE =
'/interactive-replacement-token-page';
///: END:ONLY_INCLUDE_IN
const SEND_ROUTE = '/send';
const TOKEN_DETAILS = '/token-details';
@ -127,6 +133,13 @@ const PATH_NAME_MAP = {
[CONNECT_HARDWARE_ROUTE]: 'Connect Hardware Wallet Page',
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
[INSTITUTIONAL_FEATURES_DONE_ROUTE]: 'Institutional Features Done Page',
[CUSTODY_ACCOUNT_ROUTE]: 'Connect Custody',
[CUSTODY_ACCOUNT_DONE_ROUTE]: 'Connect Custody Account done',
[COMPLIANCE_FEATURE_ROUTE]: 'Compliance Feature Page',
[CONFIRM_INSTITUTIONAL_FEATURE_CONNECT]:
'Confirm Institutional Feature Connect',
[CONFIRM_ADD_CUSTODIAN_TOKEN]: 'Confirm Add Custodian Token',
[INTERACTIVE_REPLACEMENT_TOKEN_PAGE]: 'Interactive replacement token page',
///: END:ONLY_INCLUDE_IN
[SEND_ROUTE]: 'Send Page',
[`${TOKEN_DETAILS}/:address`]: 'Token Details Page',
@ -161,9 +174,6 @@ const PATH_NAME_MAP = {
'Decrypt Message Request Page',
[`${CONFIRM_TRANSACTION_ROUTE}/:id${ENCRYPTION_PUBLIC_KEY_REQUEST_PATH}`]:
'Encryption Public Key Request Page',
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
[INSTITUTIONAL_FEATURES_DONE_ROUTE]: 'Institutional Features Done Page',
///: END:ONLY_INCLUDE_IN
[BUILD_QUOTE_ROUTE]: 'Swaps Build Quote Page',
[VIEW_QUOTE_ROUTE]: 'Swaps View Quotes Page',
[LOADING_QUOTES_ROUTE]: 'Swaps Loading Quotes Page',
@ -216,6 +226,10 @@ export {
CUSTODY_ACCOUNT_DONE_ROUTE,
CUSTODY_ACCOUNT_ROUTE,
INSTITUTIONAL_FEATURES_DONE_ROUTE,
COMPLIANCE_FEATURE_ROUTE,
CONFIRM_INSTITUTIONAL_FEATURE_CONNECT,
CONFIRM_ADD_CUSTODIAN_TOKEN,
INTERACTIVE_REPLACEMENT_TOKEN_PAGE,
///: END:ONLY_INCLUDE_IN
NETWORKS_ROUTE,
NETWORKS_FORM_ROUTE,

View File

@ -48,6 +48,14 @@ import { registerOnDesktopDisconnect } from '../../hooks/desktopHooks';
import DesktopErrorPage from '../desktop-error';
import DesktopPairingPage from '../desktop-pairing';
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
import ComplianceFeaturePage from '../institutional/compliance-feature-page';
import InstitutionalEntityDonePage from '../institutional/institutional-entity-done-page';
import InteractiveReplacementTokenNotification from '../../components/institutional/interactive-replacement-token-notification';
import ConfirmAddInstitutionalFeature from '../institutional/confirm-add-institutional-feature';
import ConfirmAddCustodianToken from '../institutional/confirm-add-custodian-token';
import InteractiveReplacementTokenPage from '../institutional/interactive-replacement-token-page';
///: END:ONLY_INCLUDE_IN
import {
IMPORT_TOKEN_ROUTE,
@ -71,6 +79,14 @@ import {
ADD_NFT_ROUTE,
ONBOARDING_UNLOCK_ROUTE,
TOKEN_DETAILS,
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
COMPLIANCE_FEATURE_ROUTE,
INSTITUTIONAL_FEATURES_DONE_ROUTE,
CUSTODY_ACCOUNT_DONE_ROUTE,
CONFIRM_INSTITUTIONAL_FEATURE_CONNECT,
CONFIRM_ADD_CUSTODIAN_TOKEN,
INTERACTIVE_REPLACEMENT_TOKEN_PAGE,
///: END:ONLY_INCLUDE_IN
///: BEGIN:ONLY_INCLUDE_IN(snaps)
NOTIFICATIONS_ROUTE,
///: END:ONLY_INCLUDE_IN
@ -273,6 +289,44 @@ export default class Routes extends Component {
path={CONFIRMATION_V_NEXT_ROUTE}
component={ConfirmationPage}
/>
{
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
}
<Authenticated
path={CUSTODY_ACCOUNT_DONE_ROUTE}
component={InstitutionalEntityDonePage}
exact
/>
<Authenticated
path={INSTITUTIONAL_FEATURES_DONE_ROUTE}
component={InstitutionalEntityDonePage}
exact
/>
<Authenticated
path={CONFIRM_ADD_CUSTODIAN_TOKEN}
component={ConfirmAddCustodianToken}
exact
/>
<Authenticated
path={INTERACTIVE_REPLACEMENT_TOKEN_PAGE}
component={InteractiveReplacementTokenPage}
exact
/>
<Authenticated
path={COMPLIANCE_FEATURE_ROUTE}
component={ComplianceFeaturePage}
/>
<Authenticated
path={CONFIRM_INSTITUTIONAL_FEATURE_CONNECT}
component={ConfirmAddInstitutionalFeature}
/>
<Authenticated
path={CONFIRM_ADD_CUSTODIAN_TOKEN}
component={ConfirmAddCustodianToken}
/>
{
///: END:ONLY_INCLUDE_IN
}
<Authenticated path={NEW_ACCOUNT_ROUTE} component={CreateAccountPage} />
<Authenticated
path={`${CONNECT_ROUTE}/:id`}
@ -500,6 +554,11 @@ export default class Routes extends Component {
))}
{this.showOnboardingHeader() && <OnboardingAppHeader />}
{completedOnboarding ? <NetworkDropdown /> : null}
{
///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
isUnlocked ? <InteractiveReplacementTokenNotification /> : null
///: END:ONLY_INCLUDE_IN
}
{process.env.MULTICHAIN ? null : <AccountMenu />}
{process.env.MULTICHAIN && isAccountMenuOpen ? (
<AccountListMenu onClose={() => toggleAccountMenu()} />