diff --git a/src/cheatcodes/pages/CheatcodesMenu.tsx b/src/cheatcodes/pages/CheatcodesMenu.tsx index f0031de225c..768d55c2cbb 100644 --- a/src/cheatcodes/pages/CheatcodesMenu.tsx +++ b/src/cheatcodes/pages/CheatcodesMenu.tsx @@ -15,6 +15,9 @@ import { cheatcodesNavigationProfileButtons } from 'cheatcodes/pages/features/pr import { cheatcodesNavigationSubscriptionButtons } from 'cheatcodes/pages/features/subscription/CheatcodesNavigationSubscription' import { cheatcodesNavigationTrustedDeviceButtons } from 'cheatcodes/pages/features/trustedDevice/CheatcodesNavigationTrustedDevice' import { cheatcodesNavigationTutorialButtons } from 'cheatcodes/pages/features/tutorial/CheatcodesNavigationTutorial' +import { cheatcodesNavigationAccountManagementButtons } from 'cheatcodes/pages/others/CheatcodesNavigationAccountManagement' +import { cheatcodesNavigationErrorsButtons } from 'cheatcodes/pages/others/CheatcodesNavigationErrors' +import { cheatcodesNavigationSignUpButtons } from 'cheatcodes/pages/others/CheatcodesNavigationSignUp' import { CheatcodesButtonsWithSubscreensProps } from 'cheatcodes/types' import { ForceUpdate } from 'features/forceUpdate/pages/ForceUpdate' import { env } from 'libs/environment' @@ -62,16 +65,16 @@ export function CheatcodesMenu(): React.JSX.Element { ] const otherButtons: CheatcodesButtonsWithSubscreensProps[] = [ - { title: 'Nouvelle-Calédonie 🇳🇨', screen: 'CheatcodesScreenNewCaledonia' }, - { title: 'Features flags 🏳️', screen: 'CheatcodesScreenFeatureFlags' }, - { title: 'Remote config 📊', screen: 'CheatcodesScreenRemoteConfig' }, - { title: 'Debug informations 🪲', screen: 'CheatcodesScreenDebugInformations' }, - { title: 'Errors 👾', screen: 'CheatcodesNavigationErrors' }, - { title: 'Pages non écrans ❌', screen: 'CheatcodesNavigationNotScreensPages' }, + ...cheatcodesNavigationAccountManagementButtons, + ...cheatcodesNavigationErrorsButtons, + ...cheatcodesNavigationSignUpButtons, { title: 'AccesLibre 🌈', screen: 'CheatcodesScreenAccesLibre' }, - { title: 'SignUp 🎨', screen: 'CheatcodesNavigationSignUp' }, - { title: 'Account Management ⚙️', screen: 'CheatcodesNavigationAccountManagement' }, + { title: 'Debug informations 🪲', screen: 'CheatcodesScreenDebugInformations' }, { title: 'Envoyer une erreur Sentry 📤', onPress: onPressSentry }, + { title: 'Features flags 🏳️', screen: 'CheatcodesScreenFeatureFlags' }, + { title: 'Nouvelle-Calédonie 🇳🇨', screen: 'CheatcodesScreenNewCaledonia' }, + { title: 'Pages non écrans ❌', screen: 'CheatcodesNavigationNotScreensPages' }, + { title: 'Remote config 📊', screen: 'CheatcodesScreenRemoteConfig' }, ] if (screenError) throw screenError diff --git a/src/cheatcodes/pages/others/CheatcodesNavigationAccountManagement.tsx b/src/cheatcodes/pages/others/CheatcodesNavigationAccountManagement.tsx index b3520d7ba7b..ee7cd785c76 100644 --- a/src/cheatcodes/pages/others/CheatcodesNavigationAccountManagement.tsx +++ b/src/cheatcodes/pages/others/CheatcodesNavigationAccountManagement.tsx @@ -1,26 +1,35 @@ import React from 'react' +import { CheatcodesSubscreensButtonList } from 'cheatcodes/components/CheatcodesSubscreenButtonList' import { CheatcodesTemplateScreen } from 'cheatcodes/components/CheatcodesTemplateScreen' -import { LinkToScreen } from 'cheatcodes/components/LinkToScreen' +import { CheatcodesButtonsWithSubscreensProps } from 'cheatcodes/types' + +export const cheatcodesNavigationAccountManagementButtons: [CheatcodesButtonsWithSubscreensProps] = + [ + { + title: 'Account Management ⚙️', + screen: 'CheatcodesNavigationAccountManagement', + subscreens: [ + { screen: 'FraudulentSuspendedAccount' }, + { screen: 'SuspendedAccountUponUserRequest' }, + { screen: 'AccountReactivationSuccess' }, + { screen: 'DeleteProfileReason' }, + { screen: 'ConfirmDeleteProfile' }, + { screen: 'DeactivateProfileSuccess' }, + { screen: 'DeleteProfileSuccess' }, + { screen: 'DeleteProfileConfirmation' }, + { screen: 'ResetPasswordExpiredLink' }, + { screen: 'DeleteProfileAccountNotDeletable' }, + { screen: 'DeleteProfileAccountHacked' }, + { screen: 'ResetPasswordEmailSent', navigationParams: { email: 'jean.dupont@gmail.com' } }, + ], + }, + ] export function CheatcodesNavigationAccountManagement(): React.JSX.Element { return ( - - - - - - - - - - - - - + + ) } diff --git a/src/cheatcodes/pages/others/CheatcodesNavigationErrors.tsx b/src/cheatcodes/pages/others/CheatcodesNavigationErrors.tsx index b7e9b5671a8..2dd5ba09e54 100644 --- a/src/cheatcodes/pages/others/CheatcodesNavigationErrors.tsx +++ b/src/cheatcodes/pages/others/CheatcodesNavigationErrors.tsx @@ -3,8 +3,10 @@ import React, { createElement, FunctionComponent, useState } from 'react' import { useQuery } from 'react-query' import styled from 'styled-components/native' +import { CheatcodesSubscreensButtonList } from 'cheatcodes/components/CheatcodesSubscreenButtonList' import { CheatcodesTemplateScreen } from 'cheatcodes/components/CheatcodesTemplateScreen' import { LinkToScreen } from 'cheatcodes/components/LinkToScreen' +import { CheatcodesButtonsWithSubscreensProps } from 'cheatcodes/types' import { NoContentError } from 'features/home/pages/NoContentError' import { Maintenance } from 'features/maintenance/pages/Maintenance' import { UseNavigationType } from 'features/navigation/RootNavigator/types' @@ -14,6 +16,14 @@ import { LogTypeEnum } from 'libs/monitoring/errors' import { QueryKeys } from 'libs/queryKeys' import { Typo } from 'ui/theme' +export const cheatcodesNavigationErrorsButtons: [CheatcodesButtonsWithSubscreensProps] = [ + { + title: 'Errors 👾', + screen: 'CheatcodesNavigationErrors', + subscreens: [{ screen: 'BannedCountryError' }], + }, +] + const MAX_ASYNC_TEST_REQ_COUNT = 3 export const CheatcodesNavigationErrors: FunctionComponent = () => { @@ -26,10 +36,7 @@ export const CheatcodesNavigationErrors: FunctionComponent = () => { const { refetch: errorAsyncQuery, isFetching } = useQuery( [QueryKeys.ERROR_ASYNC], () => errorAsync(), - { - cacheTime: 0, - enabled: false, - } + { cacheTime: 0, enabled: false } ) async function errorAsync() { @@ -48,8 +55,9 @@ export const CheatcodesNavigationErrors: FunctionComponent = () => { } return ( - - + + + { disabled={isFetching || asyncTestReqCount >= MAX_ASYNC_TEST_REQ_COUNT} onPress={() => errorAsyncQuery()} /> + @@ -70,10 +79,12 @@ export const CheatcodesNavigationErrors: FunctionComponent = () => { ) } /> + navigate('Offer', { id: 0, from: 'searchresults' })} /> + @@ -87,6 +98,7 @@ export const CheatcodesNavigationErrors: FunctionComponent = () => { ) } /> + { diff --git a/src/cheatcodes/pages/others/CheatcodesNavigationSignUp.tsx b/src/cheatcodes/pages/others/CheatcodesNavigationSignUp.tsx index 3ccb6a1a7c0..c28d5a3da49 100644 --- a/src/cheatcodes/pages/others/CheatcodesNavigationSignUp.tsx +++ b/src/cheatcodes/pages/others/CheatcodesNavigationSignUp.tsx @@ -1,8 +1,10 @@ import React from 'react' +import { CheatcodesSubscreensButtonList } from 'cheatcodes/components/CheatcodesSubscreenButtonList' import { CheatcodesTemplateScreen } from 'cheatcodes/components/CheatcodesTemplateScreen' import { LinkToScreen } from 'cheatcodes/components/LinkToScreen' import { useSomeOfferId } from 'cheatcodes/hooks/useSomeOfferId' +import { CheatcodesButtonsWithSubscreensProps } from 'cheatcodes/types' import { StepperOrigin } from 'features/navigation/RootNavigator/types' import { ApplicationProcessingModal } from 'shared/offer/components/ApplicationProcessingModal/ApplicationProcessingModal' import { AuthenticationModal } from 'shared/offer/components/AuthenticationModal/AuthenticationModal' @@ -10,6 +12,33 @@ import { ErrorApplicationModal } from 'shared/offer/components/ErrorApplicationM import { FinishSubscriptionModal } from 'shared/offer/components/FinishSubscriptionModal/FinishSubscriptionModal' import { useModal } from 'ui/components/modals/useModal' +export const cheatcodesNavigationSignUpButtons: [CheatcodesButtonsWithSubscreensProps] = [ + { + title: 'SignUp 🎨', + screen: 'CheatcodesNavigationSignUp', + subscreens: [ + { screen: 'AccountCreated' }, + { screen: 'BeneficiaryAccountCreated' }, + { screen: 'SignupConfirmationExpiredLink', navigationParams: { email: 'john@wick.com' } }, + { + screen: 'NotYetUnderageEligibility', + navigationParams: { + eligibilityStartDatetime: new Date('2019-12-01T00:00:00Z').toString(), + }, + }, + + { + screen: 'AfterSignupEmailValidationBuffer', + navigationParams: { + token: 'whichTokenDoYouWantReally', + expiration_timestamp: 456789123, + email: 'john@wick.com', + }, + }, + ], + }, +] + export function CheatcodesNavigationSignUp(): React.JSX.Element { const offerId = useSomeOfferId() @@ -38,33 +67,16 @@ export function CheatcodesNavigationSignUp(): React.JSX.Element { } = useModal(false) return ( - - - - - - + + + + + +