Skip to content

Commit d0d77c1

Browse files
authored
Merge pull request #34925 from Expensify/Rory-TransitionSurvey
Mandatory exit survey for users going back to OldDot
2 parents 88a0f35 + bd00fc3 commit d0d77c1

34 files changed

+875
-60
lines changed
Lines changed: 142 additions & 0 deletions
Loading

package-lock.json

Lines changed: 24 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
"style-loader": "^2.0.0",
286286
"time-analytics-webpack-plugin": "^0.1.17",
287287
"ts-node": "^10.9.2",
288-
"type-fest": "^3.12.0",
288+
"type-fest": "^4.10.2",
289289
"typescript": "^5.3.2",
290290
"wait-port": "^0.2.9",
291291
"webpack": "^5.76.0",

src/CONST.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3311,6 +3311,14 @@ const CONST = {
33113311
ADDRESS: 3,
33123312
},
33133313
},
3314+
3315+
EXIT_SURVEY: {
3316+
REASONS: {
3317+
FEATURE_NOT_AVAILABLE: 'featureNotAvailable',
3318+
DONT_UNDERSTAND: 'dontUnderstand',
3319+
PREFER_CLASSIC: 'preferClassic',
3320+
},
3321+
},
33143322
} as const;
33153323

33163324
type Country = keyof typeof CONST.ALL_COUNTRIES;

src/ONYXKEYS.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ const ONYXKEYS = {
205205
/** Is report data loading? */
206206
IS_LOADING_APP: 'isLoadingApp',
207207

208+
/** Is the user in the process of switching to OldDot? */
209+
IS_SWITCHING_TO_OLD_DOT: 'isSwitchingToOldDot',
210+
208211
/** Is the test tools modal open? */
209212
IS_TEST_TOOLS_MODAL_OPEN: 'isTestToolsModalOpen',
210213

@@ -388,6 +391,10 @@ const ONYXKEYS = {
388391
REIMBURSEMENT_ACCOUNT_FORM_DRAFT: 'reimbursementAccountDraft',
389392
PERSONAL_BANK_ACCOUNT: 'personalBankAccountForm',
390393
PERSONAL_BANK_ACCOUNT_DRAFT: 'personalBankAccountFormDraft',
394+
EXIT_SURVEY_REASON_FORM: 'exitSurveyReasonForm',
395+
EXIT_SURVEY_REASON_FORM_DRAFT: 'exitSurveyReasonFormDraft',
396+
EXIT_SURVEY_RESPONSE_FORM: 'exitSurveyResponseForm',
397+
EXIT_SURVEY_RESPONSE_FORM_DRAFT: 'exitSurveyResponseFormDraft',
391398
},
392399
} as const;
393400

@@ -410,6 +417,8 @@ type OnyxFormValuesMapping = {
410417
[ONYXKEYS.FORMS.ROOM_SETTINGS_FORM]: FormTypes.RoomSettingsForm;
411418
[ONYXKEYS.FORMS.NEW_TASK_FORM]: FormTypes.NewTaskForm;
412419
[ONYXKEYS.FORMS.EDIT_TASK_FORM]: FormTypes.EditTaskForm;
420+
[ONYXKEYS.FORMS.EXIT_SURVEY_REASON_FORM]: FormTypes.ExitSurveyReasonForm;
421+
[ONYXKEYS.FORMS.EXIT_SURVEY_RESPONSE_FORM]: FormTypes.ExitSurveyResponseForm;
413422
[ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM]: FormTypes.MoneyRequestDescriptionForm;
414423
[ONYXKEYS.FORMS.MONEY_REQUEST_MERCHANT_FORM]: FormTypes.MoneyRequestMerchantForm;
415424
[ONYXKEYS.FORMS.MONEY_REQUEST_AMOUNT_FORM]: FormTypes.MoneyRequestAmountForm;
@@ -534,6 +543,7 @@ type OnyxValuesMapping = {
534543
[ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean;
535544
[ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean;
536545
[ONYXKEYS.IS_LOADING_APP]: boolean;
546+
[ONYXKEYS.IS_SWITCHING_TO_OLD_DOT]: boolean;
537547
[ONYXKEYS.WALLET_TRANSFER]: OnyxTypes.WalletTransfer;
538548
[ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string;
539549
[ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: boolean;

src/ROUTES.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,17 @@ const ROUTES = {
159159
getRoute: (source: string) => `settings/troubleshoot/console/share-log?source=${encodeURI(source)}` as const,
160160
},
161161

162+
SETTINGS_EXIT_SURVEY_REASON: 'settings/exit-survey/reason',
163+
SETTINGS_EXIT_SURVEY_RESPONSE: {
164+
route: 'settings/exit-survey/response',
165+
getRoute: (reason?: ValueOf<typeof CONST.EXIT_SURVEY.REASONS>, backTo?: string) =>
166+
getUrlWithBackToParam(`settings/exit-survey/response${reason ? `?reason=${encodeURIComponent(reason)}` : ''}`, backTo),
167+
},
168+
SETTINGS_EXIT_SURVEY_CONFIRM: {
169+
route: 'settings/exit-survey/confirm',
170+
getRoute: (backTo?: string) => getUrlWithBackToParam('settings/exit-survey/confirm', backTo),
171+
},
172+
162173
KEYBOARD_SHORTCUTS: 'keyboard-shortcuts',
163174

164175
NEW: 'new',

src/SCREENS.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ const SCREENS = {
8080
REPORT_VIRTUAL_CARD_FRAUD: 'Settings_Wallet_ReportVirtualCardFraud',
8181
CARDS_DIGITAL_DETAILS_UPDATE_ADDRESS: 'Settings_Wallet_Cards_Digital_Details_Update_Address',
8282
},
83+
84+
EXIT_SURVEY: {
85+
REASON: 'Settings_ExitSurvey_Reason',
86+
RESPONSE: 'Settings_ExitSurvey_Response',
87+
CONFIRM: 'Settings_ExitSurvey_Confirm',
88+
},
8389
},
8490
SAVE_THE_WORLD: {
8591
ROOT: 'SaveTheWorld_Root',

src/components/Form/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import type AmountTextInput from '@components/AmountTextInput';
77
import type CheckboxWithLabel from '@components/CheckboxWithLabel';
88
import type CountrySelector from '@components/CountrySelector';
99
import type Picker from '@components/Picker';
10+
import type RadioButtons from '@components/RadioButtons';
1011
import type SingleChoiceQuestion from '@components/SingleChoiceQuestion';
1112
import type StatePicker from '@components/StatePicker';
1213
import type TextInput from '@components/TextInput';
@@ -34,7 +35,8 @@ type ValidInputs =
3435
| typeof AmountForm
3536
| typeof BusinessTypePicker
3637
| typeof StatePicker
37-
| typeof ValuePicker;
38+
| typeof ValuePicker
39+
| typeof RadioButtons;
3840

3941
type ValueTypeKey = 'string' | 'boolean' | 'date';
4042
type ValueTypeMap = {

0 commit comments

Comments
 (0)