Skip to content

Commit

Permalink
Merge pull request #34925 from Expensify/Rory-TransitionSurvey
Browse files Browse the repository at this point in the history
Mandatory exit survey for users going back to OldDot
  • Loading branch information
roryabraham authored Feb 24, 2024
2 parents 88a0f35 + bd00fc3 commit d0d77c1
Show file tree
Hide file tree
Showing 34 changed files with 875 additions and 60 deletions.
142 changes: 142 additions & 0 deletions assets/images/product-illustrations/mushroom-top-hat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 24 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
"style-loader": "^2.0.0",
"time-analytics-webpack-plugin": "^0.1.17",
"ts-node": "^10.9.2",
"type-fest": "^3.12.0",
"type-fest": "^4.10.2",
"typescript": "^5.3.2",
"wait-port": "^0.2.9",
"webpack": "^5.76.0",
Expand Down
8 changes: 8 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3311,6 +3311,14 @@ const CONST = {
ADDRESS: 3,
},
},

EXIT_SURVEY: {
REASONS: {
FEATURE_NOT_AVAILABLE: 'featureNotAvailable',
DONT_UNDERSTAND: 'dontUnderstand',
PREFER_CLASSIC: 'preferClassic',
},
},
} as const;

type Country = keyof typeof CONST.ALL_COUNTRIES;
Expand Down
10 changes: 10 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ const ONYXKEYS = {
/** Is report data loading? */
IS_LOADING_APP: 'isLoadingApp',

/** Is the user in the process of switching to OldDot? */
IS_SWITCHING_TO_OLD_DOT: 'isSwitchingToOldDot',

/** Is the test tools modal open? */
IS_TEST_TOOLS_MODAL_OPEN: 'isTestToolsModalOpen',

Expand Down Expand Up @@ -388,6 +391,10 @@ const ONYXKEYS = {
REIMBURSEMENT_ACCOUNT_FORM_DRAFT: 'reimbursementAccountDraft',
PERSONAL_BANK_ACCOUNT: 'personalBankAccountForm',
PERSONAL_BANK_ACCOUNT_DRAFT: 'personalBankAccountFormDraft',
EXIT_SURVEY_REASON_FORM: 'exitSurveyReasonForm',
EXIT_SURVEY_REASON_FORM_DRAFT: 'exitSurveyReasonFormDraft',
EXIT_SURVEY_RESPONSE_FORM: 'exitSurveyResponseForm',
EXIT_SURVEY_RESPONSE_FORM_DRAFT: 'exitSurveyResponseFormDraft',
},
} as const;

Expand All @@ -410,6 +417,8 @@ type OnyxFormValuesMapping = {
[ONYXKEYS.FORMS.ROOM_SETTINGS_FORM]: FormTypes.RoomSettingsForm;
[ONYXKEYS.FORMS.NEW_TASK_FORM]: FormTypes.NewTaskForm;
[ONYXKEYS.FORMS.EDIT_TASK_FORM]: FormTypes.EditTaskForm;
[ONYXKEYS.FORMS.EXIT_SURVEY_REASON_FORM]: FormTypes.ExitSurveyReasonForm;
[ONYXKEYS.FORMS.EXIT_SURVEY_RESPONSE_FORM]: FormTypes.ExitSurveyResponseForm;
[ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM]: FormTypes.MoneyRequestDescriptionForm;
[ONYXKEYS.FORMS.MONEY_REQUEST_MERCHANT_FORM]: FormTypes.MoneyRequestMerchantForm;
[ONYXKEYS.FORMS.MONEY_REQUEST_AMOUNT_FORM]: FormTypes.MoneyRequestAmountForm;
Expand Down Expand Up @@ -534,6 +543,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean;
[ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean;
[ONYXKEYS.IS_LOADING_APP]: boolean;
[ONYXKEYS.IS_SWITCHING_TO_OLD_DOT]: boolean;
[ONYXKEYS.WALLET_TRANSFER]: OnyxTypes.WalletTransfer;
[ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string;
[ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: boolean;
Expand Down
11 changes: 11 additions & 0 deletions src/ROUTES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ const ROUTES = {
getRoute: (source: string) => `settings/troubleshoot/console/share-log?source=${encodeURI(source)}` as const,
},

SETTINGS_EXIT_SURVEY_REASON: 'settings/exit-survey/reason',
SETTINGS_EXIT_SURVEY_RESPONSE: {
route: 'settings/exit-survey/response',
getRoute: (reason?: ValueOf<typeof CONST.EXIT_SURVEY.REASONS>, backTo?: string) =>
getUrlWithBackToParam(`settings/exit-survey/response${reason ? `?reason=${encodeURIComponent(reason)}` : ''}`, backTo),
},
SETTINGS_EXIT_SURVEY_CONFIRM: {
route: 'settings/exit-survey/confirm',
getRoute: (backTo?: string) => getUrlWithBackToParam('settings/exit-survey/confirm', backTo),
},

KEYBOARD_SHORTCUTS: 'keyboard-shortcuts',

NEW: 'new',
Expand Down
6 changes: 6 additions & 0 deletions src/SCREENS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ const SCREENS = {
REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud',
CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address',
},

EXIT_SURVEY: {
REASON: 'Settings_ExitSurvey_Reason',
RESPONSE: 'Settings_ExitSurvey_Response',
CONFIRM: 'Settings_ExitSurvey_Confirm',
},
},
SAVE_THE_WORLD: {
ROOT: 'SaveTheWorld_Root',
Expand Down
4 changes: 3 additions & 1 deletion src/components/Form/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type AmountTextInput from '@components/AmountTextInput';
import type CheckboxWithLabel from '@components/CheckboxWithLabel';
import type CountrySelector from '@components/CountrySelector';
import type Picker from '@components/Picker';
import type RadioButtons from '@components/RadioButtons';
import type SingleChoiceQuestion from '@components/SingleChoiceQuestion';
import type StatePicker from '@components/StatePicker';
import type TextInput from '@components/TextInput';
Expand Down Expand Up @@ -34,7 +35,8 @@ type ValidInputs =
| typeof AmountForm
| typeof BusinessTypePicker
| typeof StatePicker
| typeof ValuePicker;
| typeof ValuePicker
| typeof RadioButtons;

type ValueTypeKey = 'string' | 'boolean' | 'date';
type ValueTypeMap = {
Expand Down
Loading

0 comments on commit d0d77c1

Please sign in to comment.