From ebf46e001de722da46bf8aab9fb9558d2145af02 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 26 Dec 2023 21:00:37 +0530 Subject: [PATCH 01/42] Added limit exceed error message with new limit --- src/CONST.ts | 5 ++++- src/pages/EditRequestDescriptionPage.js | 17 ++++++++++++++++ src/pages/ReportWelcomeMessagePage.js | 20 +++++++++++++++++++ src/pages/iou/MoneyRequestDescriptionPage.js | 20 +++++++++++++++++++ .../request/step/IOURequestStepDescription.js | 20 +++++++++++++++++++ src/pages/tasks/NewTaskDescriptionPage.js | 19 ++++++++++++++++++ src/pages/tasks/NewTaskDetailsPage.js | 7 +++++++ src/pages/tasks/NewTaskTitlePage.js | 2 ++ src/pages/tasks/TaskDescriptionPage.js | 16 ++++++++++++++- src/pages/tasks/TaskTitlePage.js | 3 +++ src/pages/workspace/WorkspaceNewRoomPage.js | 2 ++ src/pages/workspace/WorkspaceSettingsPage.js | 6 +++--- 12 files changed, 132 insertions(+), 5 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index edfea995ed9b..bc3cfee9cb3b 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1488,7 +1488,10 @@ const CONST = { FORM_CHARACTER_LIMIT: 50, LEGAL_NAMES_CHARACTER_LIMIT: 150, LOGIN_CHARACTER_LIMIT: 254, - WORKSPACE_NAME_CHARACTER_LIMIT: 80, + + TITLE_CHARACTER_LIMIT: 100, + SUPPORTING_CHARACTER_LIMIT: 500, + AVATAR_CROP_MODAL: { // The next two constants control what is min and max value of the image crop scale. // Values define in how many times the image can be bigger than its container. diff --git a/src/pages/EditRequestDescriptionPage.js b/src/pages/EditRequestDescriptionPage.js index 9b2a9e465746..39d1399aad9d 100644 --- a/src/pages/EditRequestDescriptionPage.js +++ b/src/pages/EditRequestDescriptionPage.js @@ -10,6 +10,7 @@ import TextInput from '@components/TextInput'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Browser from '@libs/Browser'; +import * as ErrorUtils from '@libs/ErrorUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -28,6 +29,21 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) { const descriptionInputRef = useRef(null); const focusTimeoutRef = useRef(null); + /** + * @param {Object} values + * @param {String} values.title + * @returns {Object} - An object containing the errors for each inputID + */ + const validate = useCallback((values) => { + const errors = {}; + + if (values.comment.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'comment', ['common.error.characterLimitExceedCounter', {length: values.comment.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}]); + } + + return errors; + }, []); + useFocusEffect( useCallback(() => { focusTimeoutRef.current = setTimeout(() => { @@ -55,6 +71,7 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) { style={[styles.flexGrow1, styles.ph5]} formID={ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM} onSubmit={onSubmit} + validate={validate} submitButtonText={translate('common.save')} enabledWhenOffline > diff --git a/src/pages/ReportWelcomeMessagePage.js b/src/pages/ReportWelcomeMessagePage.js index ae8a4635a98e..218c8523e2b0 100644 --- a/src/pages/ReportWelcomeMessagePage.js +++ b/src/pages/ReportWelcomeMessagePage.js @@ -14,6 +14,7 @@ import TextInput from '@components/TextInput'; import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import compose from '@libs/compose'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; @@ -56,6 +57,24 @@ function ReportWelcomeMessagePage(props) { setWelcomeMessage(value); }, []); + /** + * @param {Object} values + * @param {String} values.title + * @returns {Object} - An object containing the errors for each inputID + */ + const validate = useCallback((values) => { + const errors = {}; + + if (values.welcomeMessage.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'welcomeMessage', [ + 'common.error.characterLimitExceedCounter', + {length: values.welcomeMessage.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, + ]); + } + + return errors; + }, []); + const submitForm = useCallback(() => { Report.updateWelcomeMessage(props.report.reportID, props.report.welcomeMessage, welcomeMessage.trim()); }, [props.report.reportID, props.report.welcomeMessage, welcomeMessage]); @@ -91,6 +110,7 @@ function ReportWelcomeMessagePage(props) { style={[styles.flexGrow1, styles.ph5]} formID={ONYXKEYS.FORMS.WELCOME_MESSAGE_FORM} onSubmit={submitForm} + validate={validate} submitButtonText={props.translate('common.save')} enabledWhenOffline > diff --git a/src/pages/iou/MoneyRequestDescriptionPage.js b/src/pages/iou/MoneyRequestDescriptionPage.js index fe3100b8c3bd..643a068efb45 100644 --- a/src/pages/iou/MoneyRequestDescriptionPage.js +++ b/src/pages/iou/MoneyRequestDescriptionPage.js @@ -14,6 +14,7 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as IOU from '@libs/actions/IOU'; import * as Browser from '@libs/Browser'; +import * as ErrorUtils from '@libs/ErrorUtils'; import * as MoneyRequestUtils from '@libs/MoneyRequestUtils'; import Navigation from '@libs/Navigation/Navigation'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; @@ -95,6 +96,24 @@ function MoneyRequestDescriptionPage({iou, route, selectedTab}) { Navigation.goBack(ROUTES.MONEY_REQUEST_CONFIRMATION.getRoute(iouType, reportID)); } + /** + * @param {Object} values + * @param {String} values.title + * @returns {Object} - An object containing the errors for each inputID + */ + const validate = useCallback((values) => { + const errors = {}; + + if (values.moneyRequestComment.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'moneyRequestComment', [ + 'common.error.characterLimitExceedCounter', + {length: values.moneyRequestComment.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, + ]); + } + + return errors; + }, []); + /** * Sets the money request comment by saving it to Onyx. * @@ -121,6 +140,7 @@ function MoneyRequestDescriptionPage({iou, route, selectedTab}) { style={[styles.flexGrow1, styles.ph5]} formID={ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM} onSubmit={(value) => updateComment(value)} + validate={validate} submitButtonText={translate('common.save')} enabledWhenOffline > diff --git a/src/pages/iou/request/step/IOURequestStepDescription.js b/src/pages/iou/request/step/IOURequestStepDescription.js index 849f3276667e..addad5af97c9 100644 --- a/src/pages/iou/request/step/IOURequestStepDescription.js +++ b/src/pages/iou/request/step/IOURequestStepDescription.js @@ -10,6 +10,7 @@ import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Browser from '@libs/Browser'; import compose from '@libs/compose'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import * as IOU from '@userActions/IOU'; @@ -61,6 +62,24 @@ function IOURequestStepDescription({ }, []), ); + /** + * @param {Object} values + * @param {String} values.title + * @returns {Object} - An object containing the errors for each inputID + */ + const validate = useCallback((values) => { + const errors = {}; + + if (values.moneyRequestComment.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'moneyRequestComment', [ + 'common.error.characterLimitExceedCounter', + {length: values.moneyRequestComment.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, + ]); + } + + return errors; + }, []); + const navigateBack = () => { Navigation.goBack(backTo || ROUTES.HOME); }; @@ -85,6 +104,7 @@ function IOURequestStepDescription({ style={[styles.flexGrow1, styles.ph5]} formID={ONYXKEYS.FORMS.MONEY_REQUEST_DESCRIPTION_FORM} onSubmit={updateComment} + validate={validate} submitButtonText={translate('common.save')} enabledWhenOffline > diff --git a/src/pages/tasks/NewTaskDescriptionPage.js b/src/pages/tasks/NewTaskDescriptionPage.js index b11e7c163755..cf9b00cc308a 100644 --- a/src/pages/tasks/NewTaskDescriptionPage.js +++ b/src/pages/tasks/NewTaskDescriptionPage.js @@ -13,6 +13,7 @@ import useAutoFocusInput from '@hooks/useAutoFocusInput'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Browser from '@libs/Browser'; import compose from '@libs/compose'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; import * as Task from '@userActions/Task'; @@ -47,6 +48,23 @@ function NewTaskDescriptionPage(props) { Navigation.goBack(ROUTES.NEW_TASK); }; + /** + * @param {Object} values - form input values passed by the Form component + * @returns {Boolean} + */ + function validate(values) { + const errors = {}; + + if (values.taskDescription.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'taskDescription', [ + 'common.error.characterLimitExceedCounter', + {length: values.taskDescription.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, + ]); + } + + return errors; + } + return ( validate(values)} onSubmit={(values) => onSubmit(values)} enabledWhenOffline > diff --git a/src/pages/tasks/NewTaskDetailsPage.js b/src/pages/tasks/NewTaskDetailsPage.js index 3dab58dfad04..f57cca7799ca 100644 --- a/src/pages/tasks/NewTaskDetailsPage.js +++ b/src/pages/tasks/NewTaskDetailsPage.js @@ -58,6 +58,13 @@ function NewTaskDetailsPage(props) { if (!values.taskTitle) { // We error if the user doesn't enter a task name ErrorUtils.addErrorMessage(errors, 'taskTitle', 'newTaskPage.pleaseEnterTaskName'); + } else if (values.taskTitle.length > CONST.TITLE_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'taskTitle', ['common.error.characterLimitExceedCounter', {length: values.taskTitle.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); + } else if (values.taskDescription.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'taskDescription', [ + 'common.error.characterLimitExceedCounter', + {length: values.taskDescription.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, + ]); } return errors; diff --git a/src/pages/tasks/NewTaskTitlePage.js b/src/pages/tasks/NewTaskTitlePage.js index 7bf6065625c0..e6da2a06435d 100644 --- a/src/pages/tasks/NewTaskTitlePage.js +++ b/src/pages/tasks/NewTaskTitlePage.js @@ -48,6 +48,8 @@ function NewTaskTitlePage(props) { if (!values.taskTitle) { // We error if the user doesn't enter a task name ErrorUtils.addErrorMessage(errors, 'taskTitle', 'newTaskPage.pleaseEnterTaskName'); + } else if (values.taskTitle.length > CONST.TITLE_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'taskTitle', ['common.error.characterLimitExceedCounter', {length: values.taskTitle.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } return errors; diff --git a/src/pages/tasks/TaskDescriptionPage.js b/src/pages/tasks/TaskDescriptionPage.js index 3a6999d4408a..45b7f786cb2b 100644 --- a/src/pages/tasks/TaskDescriptionPage.js +++ b/src/pages/tasks/TaskDescriptionPage.js @@ -17,6 +17,7 @@ import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Browser from '@libs/Browser'; import compose from '@libs/compose'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import StringUtils from '@libs/StringUtils'; @@ -49,7 +50,20 @@ const defaultProps = { const parser = new ExpensiMark(); function TaskDescriptionPage(props) { const styles = useThemeStyles(); - const validate = useCallback(() => ({}), []); + + /** + * @param {Object} values - form input values passed by the Form component + * @returns {Boolean} + */ + const validate = useCallback((values) => { + const errors = {}; + + if (values.description.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'description', ['common.error.characterLimitExceedCounter', {length: values.description.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}]); + } + + return errors; + }, []); const submit = useCallback( (values) => { diff --git a/src/pages/tasks/TaskTitlePage.js b/src/pages/tasks/TaskTitlePage.js index 9b393a8a2374..e9856c85e0d2 100644 --- a/src/pages/tasks/TaskTitlePage.js +++ b/src/pages/tasks/TaskTitlePage.js @@ -14,6 +14,7 @@ import withCurrentUserPersonalDetails from '@components/withCurrentUserPersonalD import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import compose from '@libs/compose'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import withReportOrNotFound from '@pages/home/report/withReportOrNotFound'; @@ -53,6 +54,8 @@ function TaskTitlePage(props) { if (_.isEmpty(values.title)) { errors.title = 'newTaskPage.pleaseEnterTaskName'; + } else if (values.title.length > CONST.TITLE_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'title', ['common.error.characterLimitExceedCounter', {length: values.title.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } return errors; diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 6f86e871e8ae..bde8f3b37f8c 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -183,6 +183,8 @@ function WorkspaceNewRoomPage(props) { } else if (ValidationUtils.isExistingRoomName(values.roomName, props.reports, values.policyID)) { // Certain names are reserved for default rooms and should not be used for policy rooms. ErrorUtils.addErrorMessage(errors, 'roomName', 'newRoomPage.roomAlreadyExistsError'); + } else if (values.roomName.length > CONST.TITLE_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'roomName', ['common.error.characterLimitExceedCounter', {length: values.roomName.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } if (!values.policyID) { diff --git a/src/pages/workspace/WorkspaceSettingsPage.js b/src/pages/workspace/WorkspaceSettingsPage.js index 9bc4b755fce9..9ec33b834521 100644 --- a/src/pages/workspace/WorkspaceSettingsPage.js +++ b/src/pages/workspace/WorkspaceSettingsPage.js @@ -18,6 +18,7 @@ import withWindowDimensions, {windowDimensionsPropTypes} from '@components/withW import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; import compose from '@libs/compose'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import * as UserUtils from '@libs/UserUtils'; @@ -81,10 +82,10 @@ function WorkspaceSettingsPage({policy, currencyList, windowWidth, route}) { if (!ValidationUtils.isRequiredFulfilled(name)) { errors.name = 'workspace.editor.nameIsRequiredError'; - } else if ([...name].length > CONST.WORKSPACE_NAME_CHARACTER_LIMIT) { + } else if ([...name].length > CONST.TITLE_CHARACTER_LIMIT) { // Uses the spread syntax to count the number of Unicode code points instead of the number of UTF-16 // code units. - errors.name = 'workspace.editor.nameIsTooLongError'; + ErrorUtils.addErrorMessage(errors, 'name', ['common.error.characterLimitExceedCounter', {length: [...name].length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } return errors; @@ -148,7 +149,6 @@ function WorkspaceSettingsPage({policy, currencyList, windowWidth, route}) { label={translate('workspace.editor.nameInputLabel')} accessibilityLabel={translate('workspace.editor.nameInputLabel')} defaultValue={policy.name} - maxLength={CONST.WORKSPACE_NAME_CHARACTER_LIMIT} containerStyles={[styles.mt4]} spellCheck={false} /> From d791082cff83e311765ee8ea1a25bfe7663e5fbc Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 26 Dec 2023 21:06:42 +0530 Subject: [PATCH 02/42] type fixes --- src/languages/en.ts | 1 - src/languages/es.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index b2c08ac80974..59f61c434ee7 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1600,7 +1600,6 @@ export default { nameInputLabel: 'Name', nameInputHelpText: 'This is the name you will see on your workspace.', nameIsRequiredError: 'You need to define a name for your workspace.', - nameIsTooLongError: `Your workspace name can be at most ${CONST.WORKSPACE_NAME_CHARACTER_LIMIT} characters long.`, currencyInputLabel: 'Default currency', currencyInputHelpText: 'All expenses on this workspace will be converted to this currency.', currencyInputDisabledText: "The default currency can't be changed because this workspace is linked to a USD bank account.", diff --git a/src/languages/es.ts b/src/languages/es.ts index dfd6dab6c388..1dbd99eea92e 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1624,7 +1624,6 @@ export default { nameInputLabel: 'Nombre', nameInputHelpText: 'Este es el nombre que verás en tu espacio de trabajo.', nameIsRequiredError: 'Debes definir un nombre para tu espacio de trabajo.', - nameIsTooLongError: `El nombre de su espacio de trabajo no puede tener más de ${CONST.WORKSPACE_NAME_CHARACTER_LIMIT} caracteres.`, currencyInputLabel: 'Moneda por defecto', currencyInputHelpText: 'Todas los gastos en este espacio de trabajo serán convertidos a esta moneda.', currencyInputDisabledText: 'La moneda predeterminada no se puede cambiar porque este espacio de trabajo está vinculado a una cuenta bancaria en USD.', From 84164558cc37b74a0b762e82d4beb16f10092fb3 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Fri, 29 Dec 2023 00:18:35 +0530 Subject: [PATCH 03/42] added for remaning room --- src/pages/settings/Report/RoomNamePage.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/settings/Report/RoomNamePage.js b/src/pages/settings/Report/RoomNamePage.js index 5f64faca50fc..ab600161a686 100644 --- a/src/pages/settings/Report/RoomNamePage.js +++ b/src/pages/settings/Report/RoomNamePage.js @@ -69,6 +69,8 @@ function RoomNamePage({policy, report, reports, translate}) { } else if (ValidationUtils.isExistingRoomName(values.roomName, reports, report.policyID)) { // The room name can't be set to one that already exists on the policy ErrorUtils.addErrorMessage(errors, 'roomName', 'newRoomPage.roomAlreadyExistsError'); + } else if (values.roomName.length > CONST.TITLE_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'roomName', ['common.error.characterLimitExceedCounter', {length: values.roomName.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } return errors; From cb61222097aebd1a4719e1d177a038d392f967c5 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 9 Jan 2024 21:53:10 +0530 Subject: [PATCH 04/42] limit on legal name --- .../settings/Profile/PersonalDetails/LegalNamePage.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js b/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js index 365ea62184ab..c96bc41ec0e1 100644 --- a/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js +++ b/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js @@ -60,8 +60,8 @@ function LegalNamePage(props) { } else if (_.isEmpty(values.legalFirstName)) { errors.legalFirstName = 'common.error.fieldRequired'; } - if (values.legalFirstName.length > CONST.LEGAL_NAME.MAX_LENGTH) { - ErrorUtils.addErrorMessage(errors, 'legalFirstName', ['common.error.characterLimitExceedCounter', {length: values.legalFirstName.length, limit: CONST.LEGAL_NAME.MAX_LENGTH}]); + if (values.legalFirstName.length > CONST.TITLE_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'legalFirstName', ['common.error.characterLimitExceedCounter', {length: values.legalFirstName.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } if (!ValidationUtils.isValidLegalName(values.legalLastName)) { @@ -69,8 +69,8 @@ function LegalNamePage(props) { } else if (_.isEmpty(values.legalLastName)) { errors.legalLastName = 'common.error.fieldRequired'; } - if (values.legalLastName.length > CONST.LEGAL_NAME.MAX_LENGTH) { - ErrorUtils.addErrorMessage(errors, 'legalLastName', ['common.error.characterLimitExceedCounter', {length: values.legalLastName.length, limit: CONST.LEGAL_NAME.MAX_LENGTH}]); + if (values.legalLastName.length > CONST.TITLE_CHARACTER_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'legalLastName', ['common.error.characterLimitExceedCounter', {length: values.legalLastName.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } return errors; @@ -106,7 +106,6 @@ function LegalNamePage(props) { aria-label={props.translate('privatePersonalDetails.legalFirstName')} role={CONST.ROLE.PRESENTATION} defaultValue={legalFirstName} - maxLength={CONST.LEGAL_NAME.MAX_LENGTH + CONST.SEARCH_MAX_LENGTH} spellCheck={false} /> @@ -119,7 +118,6 @@ function LegalNamePage(props) { aria-label={props.translate('privatePersonalDetails.legalLastName')} role={CONST.ROLE.PRESENTATION} defaultValue={legalLastName} - maxLength={CONST.LEGAL_NAME.MAX_LENGTH + CONST.SEARCH_MAX_LENGTH} spellCheck={false} /> From 36492af9f46ced30292587ce7b13802d480128a5 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 16 Jan 2024 23:15:08 +0530 Subject: [PATCH 05/42] Fix to display both error validation --- src/pages/tasks/NewTaskDetailsPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/tasks/NewTaskDetailsPage.js b/src/pages/tasks/NewTaskDetailsPage.js index f57cca7799ca..8a1357efa9ae 100644 --- a/src/pages/tasks/NewTaskDetailsPage.js +++ b/src/pages/tasks/NewTaskDetailsPage.js @@ -60,7 +60,8 @@ function NewTaskDetailsPage(props) { ErrorUtils.addErrorMessage(errors, 'taskTitle', 'newTaskPage.pleaseEnterTaskName'); } else if (values.taskTitle.length > CONST.TITLE_CHARACTER_LIMIT) { ErrorUtils.addErrorMessage(errors, 'taskTitle', ['common.error.characterLimitExceedCounter', {length: values.taskTitle.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); - } else if (values.taskDescription.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + } + if (values.taskDescription.length > CONST.SUPPORTING_CHARACTER_LIMIT) { ErrorUtils.addErrorMessage(errors, 'taskDescription', [ 'common.error.characterLimitExceedCounter', {length: values.taskDescription.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, From 69a50b1f2379e331bf694bcbced96486c9e08e19 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Wed, 17 Jan 2024 00:45:52 +0530 Subject: [PATCH 06/42] Fix legal name errors --- src/pages/settings/Profile/PersonalDetails/LegalNamePage.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js b/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js index c96bc41ec0e1..61d9a5a8aa8f 100644 --- a/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js +++ b/src/pages/settings/Profile/PersonalDetails/LegalNamePage.js @@ -59,8 +59,7 @@ function LegalNamePage(props) { ErrorUtils.addErrorMessage(errors, 'legalFirstName', 'privatePersonalDetails.error.hasInvalidCharacter'); } else if (_.isEmpty(values.legalFirstName)) { errors.legalFirstName = 'common.error.fieldRequired'; - } - if (values.legalFirstName.length > CONST.TITLE_CHARACTER_LIMIT) { + } else if (values.legalFirstName.length > CONST.TITLE_CHARACTER_LIMIT) { ErrorUtils.addErrorMessage(errors, 'legalFirstName', ['common.error.characterLimitExceedCounter', {length: values.legalFirstName.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } @@ -68,8 +67,7 @@ function LegalNamePage(props) { ErrorUtils.addErrorMessage(errors, 'legalLastName', 'privatePersonalDetails.error.hasInvalidCharacter'); } else if (_.isEmpty(values.legalLastName)) { errors.legalLastName = 'common.error.fieldRequired'; - } - if (values.legalLastName.length > CONST.TITLE_CHARACTER_LIMIT) { + } else if (values.legalLastName.length > CONST.TITLE_CHARACTER_LIMIT) { ErrorUtils.addErrorMessage(errors, 'legalLastName', ['common.error.characterLimitExceedCounter', {length: values.legalLastName.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } From a0dcf260c7ebf060fc79fbe813ce147ca75eb007 Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 18 Jan 2024 16:45:49 -0800 Subject: [PATCH 07/42] Migrate LogOutPreviousUserPage to TS --- src/libs/Navigation/types.ts | 2 +- src/libs/SessionUtils.ts | 4 +- src/pages/LogOutPreviousUserPage.tsx | 60 ++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 3 deletions(-) create mode 100644 src/pages/LogOutPreviousUserPage.tsx diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 8d227fa6f697..0f2d717399c5 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -409,7 +409,7 @@ type AuthScreensParamList = { shouldForceLogin: string; email: string; shortLivedAuthToken: string; - exitTo: string; + exitTo: Routes; }; [SCREENS.CONCIERGE]: undefined; [SCREENS.REPORT_ATTACHMENTS]: { diff --git a/src/libs/SessionUtils.ts b/src/libs/SessionUtils.ts index c73513c747af..52521d5146cc 100644 --- a/src/libs/SessionUtils.ts +++ b/src/libs/SessionUtils.ts @@ -4,7 +4,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; /** * Determine if the transitioning user is logging in as a new user. */ -function isLoggingInAsNewUser(transitionURL: string, sessionEmail: string): boolean { +function isLoggingInAsNewUser(transitionURL?: string, sessionEmail?: string): boolean { // The OldDot mobile app does not URL encode the parameters, but OldDot web // does. We don't want to deploy OldDot mobile again, so as a work around we // compare the session email to both the decoded and raw email from the transition link. @@ -20,7 +20,7 @@ function isLoggingInAsNewUser(transitionURL: string, sessionEmail: string): bool // If they do not match it might be due to encoding, so check the raw value // Capture the un-encoded text in the email param const emailParamRegex = /[?&]email=([^&]*)/g; - const matches = emailParamRegex.exec(transitionURL); + const matches = emailParamRegex.exec(transitionURL ?? ''); const linkedEmail = matches?.[1] ?? null; return linkedEmail !== sessionEmail; } diff --git a/src/pages/LogOutPreviousUserPage.tsx b/src/pages/LogOutPreviousUserPage.tsx new file mode 100644 index 000000000000..8d2d1a5f9b1d --- /dev/null +++ b/src/pages/LogOutPreviousUserPage.tsx @@ -0,0 +1,60 @@ +import type {StackScreenProps} from '@react-navigation/stack'; +import React, {useEffect} from 'react'; +import {Linking} from 'react-native'; +import {withOnyx} from 'react-native-onyx'; +import type {OnyxEntry} from 'react-native-onyx/lib/types'; +import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; +import * as SessionUtils from '@libs/SessionUtils'; +import type {AuthScreensParamList} from '@navigation/types'; +import * as SessionActions from '@userActions/Session'; +import ONYXKEYS from '@src/ONYXKEYS'; +import type SCREENS from '@src/SCREENS'; +import type {Session} from '@src/types/onyx'; + +type LogOutPreviousUserPageOnyxProps = { + /** The data about the current session which will be set once the user is authenticated and we return to this component as an AuthScreen */ + session: OnyxEntry; +}; + +type LogOutPreviousUserPageProps = LogOutPreviousUserPageOnyxProps & StackScreenProps; + +// This page is responsible for handling transitions from OldDot. Specifically, it logs the current user +// out if the transition is for another user. +// +// This component should not do any other navigation as that handled in App.setUpPoliciesAndNavigate +function LogOutPreviousUserPage({session, route}: LogOutPreviousUserPageProps) { + useEffect(() => { + Linking.getInitialURL().then((transitionURL) => { + const sessionEmail = session?.email; + const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionURL ?? undefined, sessionEmail); + + if (isLoggingInAsNewUser) { + SessionActions.signOutAndRedirectToSignIn(); + } + + // We need to signin and fetch a new authToken, if a user was already authenticated in NewDot, and was redirected to OldDot + // and their authToken stored in Onyx becomes invalid. + // This workflow is triggered while setting up VBBA. User is redirected from NewDot to OldDot to set up 2FA, and then redirected back to NewDot + // On Enabling 2FA, authToken stored in Onyx becomes expired and hence we need to fetch new authToken + const shouldForceLogin = route.params.shouldForceLogin === 'true'; + if (shouldForceLogin) { + const email = route.params.email; + const shortLivedAuthToken = route.params.shortLivedAuthToken; + SessionActions.signInWithShortLivedAuthToken(email, shortLivedAuthToken); + } + }); + + // We only want to run this effect once on mount (when the page first loads after transitioning from OldDot) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + return ; +} + +LogOutPreviousUserPage.displayName = 'LogOutPreviousUserPage'; + +export default withOnyx({ + session: { + key: ONYXKEYS.SESSION, + }, +})(LogOutPreviousUserPage); From 1a58bfb1826f89452ae1b127d40d003e8a82a60b Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 18 Jan 2024 17:23:36 -0800 Subject: [PATCH 08/42] Remove unnecessary change --- src/libs/Navigation/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 0f2d717399c5..8d227fa6f697 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -409,7 +409,7 @@ type AuthScreensParamList = { shouldForceLogin: string; email: string; shortLivedAuthToken: string; - exitTo: Routes; + exitTo: string; }; [SCREENS.CONCIERGE]: undefined; [SCREENS.REPORT_ATTACHMENTS]: { From 93121c7470d259307234fa821b4e0cc68b4640ba Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Fri, 19 Jan 2024 14:07:49 +0530 Subject: [PATCH 09/42] fix typo From cd2009409c880b488a34cf932d951cf94f4c78c7 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Thu, 1 Feb 2024 23:26:27 +0530 Subject: [PATCH 10/42] Change const name to more relavent --- src/CONST.ts | 2 +- src/pages/EditRequestDescriptionPage.js | 4 ++-- src/pages/ReportWelcomeMessagePage.js | 7 ++----- src/pages/iou/MoneyRequestDescriptionPage.js | 4 ++-- src/pages/iou/request/step/IOURequestStepDescription.js | 4 ++-- src/pages/tasks/NewTaskDescriptionPage.js | 7 ++----- src/pages/tasks/NewTaskDetailsPage.js | 7 ++----- src/pages/tasks/TaskDescriptionPage.js | 4 ++-- 8 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/CONST.ts b/src/CONST.ts index 7f815ad4c1df..5a476fd3c5d6 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1521,7 +1521,7 @@ const CONST = { LOGIN_CHARACTER_LIMIT: 254, TITLE_CHARACTER_LIMIT: 100, - SUPPORTING_CHARACTER_LIMIT: 500, + DESCRIPTION_LIMIT: 500, AVATAR_CROP_MODAL: { // The next two constants control what is min and max value of the image crop scale. diff --git a/src/pages/EditRequestDescriptionPage.js b/src/pages/EditRequestDescriptionPage.js index 39d1399aad9d..45fe1a238934 100644 --- a/src/pages/EditRequestDescriptionPage.js +++ b/src/pages/EditRequestDescriptionPage.js @@ -37,8 +37,8 @@ function EditRequestDescriptionPage({defaultDescription, onSubmit}) { const validate = useCallback((values) => { const errors = {}; - if (values.comment.length > CONST.SUPPORTING_CHARACTER_LIMIT) { - ErrorUtils.addErrorMessage(errors, 'comment', ['common.error.characterLimitExceedCounter', {length: values.comment.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}]); + if (values.comment.length > CONST.DESCRIPTION_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'comment', ['common.error.characterLimitExceedCounter', {length: values.comment.length, limit: CONST.DESCRIPTION_LIMIT}]); } return errors; diff --git a/src/pages/ReportWelcomeMessagePage.js b/src/pages/ReportWelcomeMessagePage.js index 218c8523e2b0..c44886dee763 100644 --- a/src/pages/ReportWelcomeMessagePage.js +++ b/src/pages/ReportWelcomeMessagePage.js @@ -65,11 +65,8 @@ function ReportWelcomeMessagePage(props) { const validate = useCallback((values) => { const errors = {}; - if (values.welcomeMessage.length > CONST.SUPPORTING_CHARACTER_LIMIT) { - ErrorUtils.addErrorMessage(errors, 'welcomeMessage', [ - 'common.error.characterLimitExceedCounter', - {length: values.welcomeMessage.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, - ]); + if (values.welcomeMessage.length > CONST.DESCRIPTION_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'welcomeMessage', ['common.error.characterLimitExceedCounter', {length: values.welcomeMessage.length, limit: CONST.DESCRIPTION_LIMIT}]); } return errors; diff --git a/src/pages/iou/MoneyRequestDescriptionPage.js b/src/pages/iou/MoneyRequestDescriptionPage.js index 643a068efb45..7a7f08f01c41 100644 --- a/src/pages/iou/MoneyRequestDescriptionPage.js +++ b/src/pages/iou/MoneyRequestDescriptionPage.js @@ -104,10 +104,10 @@ function MoneyRequestDescriptionPage({iou, route, selectedTab}) { const validate = useCallback((values) => { const errors = {}; - if (values.moneyRequestComment.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + if (values.moneyRequestComment.length > CONST.DESCRIPTION_LIMIT) { ErrorUtils.addErrorMessage(errors, 'moneyRequestComment', [ 'common.error.characterLimitExceedCounter', - {length: values.moneyRequestComment.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, + {length: values.moneyRequestComment.length, limit: CONST.DESCRIPTION_LIMIT}, ]); } diff --git a/src/pages/iou/request/step/IOURequestStepDescription.js b/src/pages/iou/request/step/IOURequestStepDescription.js index addad5af97c9..76ff056e4e84 100644 --- a/src/pages/iou/request/step/IOURequestStepDescription.js +++ b/src/pages/iou/request/step/IOURequestStepDescription.js @@ -70,10 +70,10 @@ function IOURequestStepDescription({ const validate = useCallback((values) => { const errors = {}; - if (values.moneyRequestComment.length > CONST.SUPPORTING_CHARACTER_LIMIT) { + if (values.moneyRequestComment.length > CONST.DESCRIPTION_LIMIT) { ErrorUtils.addErrorMessage(errors, 'moneyRequestComment', [ 'common.error.characterLimitExceedCounter', - {length: values.moneyRequestComment.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, + {length: values.moneyRequestComment.length, limit: CONST.DESCRIPTION_LIMIT}, ]); } diff --git a/src/pages/tasks/NewTaskDescriptionPage.js b/src/pages/tasks/NewTaskDescriptionPage.js index cf9b00cc308a..2a0c867c60a8 100644 --- a/src/pages/tasks/NewTaskDescriptionPage.js +++ b/src/pages/tasks/NewTaskDescriptionPage.js @@ -55,11 +55,8 @@ function NewTaskDescriptionPage(props) { function validate(values) { const errors = {}; - if (values.taskDescription.length > CONST.SUPPORTING_CHARACTER_LIMIT) { - ErrorUtils.addErrorMessage(errors, 'taskDescription', [ - 'common.error.characterLimitExceedCounter', - {length: values.taskDescription.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, - ]); + if (values.taskDescription.length > CONST.DESCRIPTION_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'taskDescription', ['common.error.characterLimitExceedCounter', {length: values.taskDescription.length, limit: CONST.DESCRIPTION_LIMIT}]); } return errors; diff --git a/src/pages/tasks/NewTaskDetailsPage.js b/src/pages/tasks/NewTaskDetailsPage.js index 8a1357efa9ae..e4c1d627a99f 100644 --- a/src/pages/tasks/NewTaskDetailsPage.js +++ b/src/pages/tasks/NewTaskDetailsPage.js @@ -61,11 +61,8 @@ function NewTaskDetailsPage(props) { } else if (values.taskTitle.length > CONST.TITLE_CHARACTER_LIMIT) { ErrorUtils.addErrorMessage(errors, 'taskTitle', ['common.error.characterLimitExceedCounter', {length: values.taskTitle.length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } - if (values.taskDescription.length > CONST.SUPPORTING_CHARACTER_LIMIT) { - ErrorUtils.addErrorMessage(errors, 'taskDescription', [ - 'common.error.characterLimitExceedCounter', - {length: values.taskDescription.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}, - ]); + if (values.taskDescription.length > CONST.DESCRIPTION_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'taskDescription', ['common.error.characterLimitExceedCounter', {length: values.taskDescription.length, limit: CONST.DESCRIPTION_LIMIT}]); } return errors; diff --git a/src/pages/tasks/TaskDescriptionPage.js b/src/pages/tasks/TaskDescriptionPage.js index 45b7f786cb2b..c696448671ac 100644 --- a/src/pages/tasks/TaskDescriptionPage.js +++ b/src/pages/tasks/TaskDescriptionPage.js @@ -58,8 +58,8 @@ function TaskDescriptionPage(props) { const validate = useCallback((values) => { const errors = {}; - if (values.description.length > CONST.SUPPORTING_CHARACTER_LIMIT) { - ErrorUtils.addErrorMessage(errors, 'description', ['common.error.characterLimitExceedCounter', {length: values.description.length, limit: CONST.SUPPORTING_CHARACTER_LIMIT}]); + if (values.description.length > CONST.DESCRIPTION_LIMIT) { + ErrorUtils.addErrorMessage(errors, 'description', ['common.error.characterLimitExceedCounter', {length: values.description.length, limit: CONST.DESCRIPTION_LIMIT}]); } return errors; From 894129033c77450200ea03f037c02de6558fa3d9 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Fri, 2 Feb 2024 02:17:20 +0530 Subject: [PATCH 11/42] Resolve conflict --- src/ONYXKEYS.ts | 2 +- src/pages/ReportWelcomeMessagePage.tsx | 10 ++++++---- src/types/onyx/Form.ts | 5 +++++ src/types/onyx/index.ts | 13 ++++++++++++- 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 2867cb3905a2..d9a5eb3f5433 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -496,7 +496,7 @@ type OnyxValues = { [ONYXKEYS.FORMS.DISPLAY_NAME_FORM_DRAFT]: OnyxTypes.DisplayNameForm; [ONYXKEYS.FORMS.ROOM_NAME_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.ROOM_NAME_FORM_DRAFT]: OnyxTypes.Form; - [ONYXKEYS.FORMS.WELCOME_MESSAGE_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.WELCOME_MESSAGE_FORM]: OnyxTypes.WelcomeMessageForm; [ONYXKEYS.FORMS.WELCOME_MESSAGE_FORM_DRAFT]: OnyxTypes.Form; [ONYXKEYS.FORMS.LEGAL_NAME_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.LEGAL_NAME_FORM_DRAFT]: OnyxTypes.Form; diff --git a/src/pages/ReportWelcomeMessagePage.tsx b/src/pages/ReportWelcomeMessagePage.tsx index fefdbcd174d5..fe6061d9e8c8 100644 --- a/src/pages/ReportWelcomeMessagePage.tsx +++ b/src/pages/ReportWelcomeMessagePage.tsx @@ -8,6 +8,7 @@ import {withOnyx} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import FormProvider from '@components/Form/FormProvider'; import InputWrapper from '@components/Form/InputWrapper'; +import type {OnyxFormValuesFields} from '@components/Form/types'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import type {AnimatedTextInputRef} from '@components/RNTextInput'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -15,6 +16,7 @@ import Text from '@components/Text'; import TextInput from '@components/TextInput'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; @@ -25,6 +27,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type SCREENS from '@src/SCREENS'; import type {Policy} from '@src/types/onyx'; +import type {Errors} from '@src/types/onyx/OnyxCommon'; import type {WithReportOrNotFoundProps} from './home/report/withReportOrNotFound'; import withReportOrNotFound from './home/report/withReportOrNotFound'; @@ -51,12 +54,10 @@ function ReportWelcomeMessagePage({report, policy}: ReportWelcomeMessagePageProp }, []); /** - * @param {Object} values - * @param {String} values.title * @returns {Object} - An object containing the errors for each inputID */ - const validate = useCallback((values) => { - const errors = {}; + const validate = useCallback((values: OnyxFormValuesFields) => { + const errors: Errors = {}; if (values.welcomeMessage.length > CONST.DESCRIPTION_LIMIT) { ErrorUtils.addErrorMessage(errors, 'welcomeMessage', ['common.error.characterLimitExceedCounter', {length: values.welcomeMessage.length, limit: CONST.DESCRIPTION_LIMIT}]); @@ -99,6 +100,7 @@ function ReportWelcomeMessagePage({report, policy}: ReportWelcomeMessagePageProp ; +type WelcomeMessageForm = Form<{ + welcomeMessage: string; +}>; + type PersonalBankAccountForm = Form; type ReportFieldEditForm = Form>; @@ -73,4 +77,5 @@ export type { IntroSchoolPrincipalForm, PersonalBankAccountForm, ReportFieldEditForm, + WelcomeMessageForm, }; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index 64eec736b5bf..c48270dc726a 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -9,7 +9,17 @@ import type Credentials from './Credentials'; import type Currency from './Currency'; import type CustomStatusDraft from './CustomStatusDraft'; import type Download from './Download'; -import type {AddDebitCardForm, DateOfBirthForm, DisplayNameForm, IKnowATeacherForm, IntroSchoolPrincipalForm, NewRoomForm, PrivateNotesForm, ReportFieldEditForm} from './Form'; +import type { + AddDebitCardForm, + DateOfBirthForm, + DisplayNameForm, + IKnowATeacherForm, + IntroSchoolPrincipalForm, + NewRoomForm, + PrivateNotesForm, + ReportFieldEditForm, + WelcomeMessageForm, +} from './Form'; import type Form from './Form'; import type FrequentlyUsedEmoji from './FrequentlyUsedEmoji'; import type {FundList} from './Fund'; @@ -152,4 +162,5 @@ export type { IntroSchoolPrincipalForm, PrivateNotesForm, ReportFieldEditForm, + WelcomeMessageForm, }; From 784d5bc8461204d28b9e658c6df44efe1deafc65 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Fri, 2 Feb 2024 02:21:02 +0530 Subject: [PATCH 12/42] Resolve conflict - 1 --- src/pages/ReportWelcomeMessagePage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReportWelcomeMessagePage.tsx b/src/pages/ReportWelcomeMessagePage.tsx index fe6061d9e8c8..27522fb6aacf 100644 --- a/src/pages/ReportWelcomeMessagePage.tsx +++ b/src/pages/ReportWelcomeMessagePage.tsx @@ -60,7 +60,7 @@ function ReportWelcomeMessagePage({report, policy}: ReportWelcomeMessagePageProp const errors: Errors = {}; if (values.welcomeMessage.length > CONST.DESCRIPTION_LIMIT) { - ErrorUtils.addErrorMessage(errors, 'welcomeMessage', ['common.error.characterLimitExceedCounter', {length: values.welcomeMessage.length, limit: CONST.DESCRIPTION_LIMIT}]); + errors.welcomeMessage = ['common.error.characterLimitExceedCounter', {length: values.welcomeMessage.length, limit: CONST.DESCRIPTION_LIMIT}].toLocaleString(); } return errors; From 02883acc135d35b91abe6d683f2b327451d40e67 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Fri, 2 Feb 2024 03:15:03 +0530 Subject: [PATCH 13/42] Resolve conflict - 3 --- src/CONST.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CONST.ts b/src/CONST.ts index 5c2d3ffd21f0..edaa146ba701 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1563,6 +1563,7 @@ const CONST = { TITLE_CHARACTER_LIMIT: 100, DESCRIPTION_LIMIT: 500, + WORKSPACE_NAME_CHARACTER_LIMIT: 80, AVATAR_CROP_MODAL: { // The next two constants control what is min and max value of the image crop scale. // Values define in how many times the image can be bigger than its container. From 9fca5ec965195b51b8540ad6827a832888d19c35 Mon Sep 17 00:00:00 2001 From: tienifr Date: Fri, 2 Feb 2024 11:19:25 +0700 Subject: [PATCH 14/42] Room-Invited room avatar looks different --- src/pages/ReportAvatar.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/ReportAvatar.tsx b/src/pages/ReportAvatar.tsx index 29142294084c..121b238012bf 100644 --- a/src/pages/ReportAvatar.tsx +++ b/src/pages/ReportAvatar.tsx @@ -22,9 +22,8 @@ type ReportAvatarProps = ReportAvatarOnyxProps & StackScreenProps Date: Fri, 2 Feb 2024 20:52:56 +0530 Subject: [PATCH 15/42] added proper error messages --- src/libs/ErrorUtils.ts | 2 +- src/pages/ReportWelcomeMessagePage.tsx | 2 +- src/pages/workspace/WorkspaceNamePage.tsx | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/libs/ErrorUtils.ts b/src/libs/ErrorUtils.ts index edc24bf94720..6298138a5825 100644 --- a/src/libs/ErrorUtils.ts +++ b/src/libs/ErrorUtils.ts @@ -113,7 +113,7 @@ type ErrorsList = Record; * @param errors - An object containing current errors in the form * @param message - Message to assign to the inputID errors */ -function addErrorMessage(errors: ErrorsList, inputID?: string, message?: TKey) { +function addErrorMessage(errors: ErrorsList, inputID?: string, message?: TKey | Localize.MaybePhraseKey) { if (!message || !inputID) { return; } diff --git a/src/pages/ReportWelcomeMessagePage.tsx b/src/pages/ReportWelcomeMessagePage.tsx index 27522fb6aacf..fe6061d9e8c8 100644 --- a/src/pages/ReportWelcomeMessagePage.tsx +++ b/src/pages/ReportWelcomeMessagePage.tsx @@ -60,7 +60,7 @@ function ReportWelcomeMessagePage({report, policy}: ReportWelcomeMessagePageProp const errors: Errors = {}; if (values.welcomeMessage.length > CONST.DESCRIPTION_LIMIT) { - errors.welcomeMessage = ['common.error.characterLimitExceedCounter', {length: values.welcomeMessage.length, limit: CONST.DESCRIPTION_LIMIT}].toLocaleString(); + ErrorUtils.addErrorMessage(errors, 'welcomeMessage', ['common.error.characterLimitExceedCounter', {length: values.welcomeMessage.length, limit: CONST.DESCRIPTION_LIMIT}]); } return errors; diff --git a/src/pages/workspace/WorkspaceNamePage.tsx b/src/pages/workspace/WorkspaceNamePage.tsx index e9d1ddd021d0..59679456be56 100644 --- a/src/pages/workspace/WorkspaceNamePage.tsx +++ b/src/pages/workspace/WorkspaceNamePage.tsx @@ -8,6 +8,7 @@ import ScreenWrapper from '@components/ScreenWrapper'; import TextInput from '@components/TextInput'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; +import * as ErrorUtils from '@libs/ErrorUtils'; import Navigation from '@libs/Navigation/Navigation'; import * as ValidationUtils from '@libs/ValidationUtils'; import * as Policy from '@userActions/Policy'; @@ -41,10 +42,10 @@ function WorkspaceNamePage({policy}: Props) { if (!ValidationUtils.isRequiredFulfilled(name)) { errors.name = 'workspace.editor.nameIsRequiredError'; - } else if ([...name].length > CONST.WORKSPACE_NAME_CHARACTER_LIMIT) { + } else if ([...name].length > CONST.TITLE_CHARACTER_LIMIT) { // Uses the spread syntax to count the number of Unicode code points instead of the number of UTF-16 // code units. - errors.name = 'workspace.editor.nameIsTooLongError'; + ErrorUtils.addErrorMessage(errors, 'name', ['common.error.characterLimitExceedCounter', {length: [...name].length, limit: CONST.TITLE_CHARACTER_LIMIT}]); } return errors; From e86b069e69db3cfcb0780d8f43d9f8a96f310f4e Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 6 Feb 2024 16:56:38 +0800 Subject: [PATCH 16/42] prioritize required fields error message --- src/components/MoneyRequestConfirmationList.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index b6a91cf7a9c8..b000ee2fb90b 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -286,14 +286,14 @@ function MoneyRequestConfirmationList(props) { const shouldDisplayMerchantError = props.isPolicyExpenseChat && !props.isScanRequest && isMerchantEmpty; useEffect(() => { - if (shouldDisplayFieldError && props.hasSmartScanFailed) { - setFormError('iou.receiptScanningFailed'); - return; - } if (shouldDisplayFieldError && didConfirmSplit) { setFormError('iou.error.genericSmartscanFailureMessage'); return; } + if (shouldDisplayFieldError && props.hasSmartScanFailed) { + setFormError('iou.receiptScanningFailed'); + return; + } // reset the form error whenever the screen gains or loses focus setFormError(''); }, [isFocused, transaction, shouldDisplayFieldError, props.hasSmartScanFailed, didConfirmSplit]); @@ -489,7 +489,6 @@ function MoneyRequestConfirmationList(props) { if (props.isEditingSplitBill && TransactionUtils.areRequiredFieldsEmpty(transaction)) { setDidConfirmSplit(true); - setFormError('iou.error.genericSmartscanFailureMessage'); return; } From 36d9542d19fccff89bfe49ec1372691350480620 Mon Sep 17 00:00:00 2001 From: dhairyasenjaliya Date: Tue, 6 Feb 2024 14:29:17 +0530 Subject: [PATCH 17/42] Remove key for welcome message --- src/types/onyx/Form.ts | 5 ----- src/types/onyx/index.ts | 2 -- 2 files changed, 7 deletions(-) diff --git a/src/types/onyx/Form.ts b/src/types/onyx/Form.ts index c03e6aee4200..6938e17163d2 100644 --- a/src/types/onyx/Form.ts +++ b/src/types/onyx/Form.ts @@ -55,10 +55,6 @@ type PrivateNotesForm = Form<{ privateNotes: string; }>; -type WelcomeMessageForm = Form<{ - welcomeMessage: string; -}>; - type PersonalBankAccountForm = Form; type WorkspaceSettingsForm = Form<{ @@ -91,7 +87,6 @@ export type { PersonalBankAccountForm, WorkspaceSettingsForm, ReportFieldEditForm, - WelcomeMessageForm, CloseAccountForm, RoomNameForm, }; diff --git a/src/types/onyx/index.ts b/src/types/onyx/index.ts index f02c583b5955..4728c8872e75 100644 --- a/src/types/onyx/index.ts +++ b/src/types/onyx/index.ts @@ -20,7 +20,6 @@ import type { PrivateNotesForm, ReportFieldEditForm, RoomNameForm, - WelcomeMessageForm, WorkspaceSettingsForm, } from './Form'; import type Form from './Form'; @@ -169,6 +168,5 @@ export type { IntroSchoolPrincipalForm, PrivateNotesForm, ReportFieldEditForm, - WelcomeMessageForm, RoomNameForm, }; From 347d13969cbd707b2b21609680a7cb356559fa5b Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 6 Feb 2024 15:33:31 -0700 Subject: [PATCH 18/42] Move linked transaction to parent component --- .../LHNOptionsList/LHNOptionsList.tsx | 6 ++++++ .../LHNOptionsList/OptionRowLHNData.tsx | 21 ++++++++++++------- src/components/LHNOptionsList/types.ts | 3 +++ 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index 15c12afb2609..ab5607ffb5dc 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -7,7 +7,9 @@ import withCurrentReportID from '@components/withCurrentReportID'; import usePermissions from '@hooks/usePermissions'; import useThemeStyles from '@hooks/useThemeStyles'; import * as OptionsListUtils from '@libs/OptionsListUtils'; +import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; +import * as TransactionUtils from '@libs/TransactionUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; @@ -64,6 +66,9 @@ function LHNOptionsList({ const itemComment = draftComments?.[`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`] ?? ''; const participants = [...ReportUtils.getParticipantsIDs(itemFullReport), itemFullReport?.ownerAccountID, itemParentReportAction?.actorAccountID].filter(Boolean) as number[]; const participantsPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participants, personalDetails); + const sortedReportActions = ReportActionsUtils.getSortedReportActionsForDisplay(itemReportActions); + const lastReportAction = sortedReportActions[0]; + const lastReportActionTransaction = TransactionUtils.getLinkedTransaction(lastReportAction); return ( (); - const linkedTransaction = useMemo(() => { - const sortedReportActions = ReportActionsUtils.getSortedReportActionsForDisplay(reportActions); - const lastReportAction = sortedReportActions[0]; - return TransactionUtils.getLinkedTransaction(lastReportAction); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [fullReport?.reportID, receiptTransactions, reportActions]); const hasViolations = canUseViolations && ReportUtils.doesTransactionThreadHaveViolations(fullReport, transactionViolations, parentReportAction ?? null); @@ -64,7 +59,19 @@ function OptionRowLHNData({ // Listen parentReportAction to update title of thread report when parentReportAction changed // Listen to transaction to update title of transaction report when transaction changed // eslint-disable-next-line react-hooks/exhaustive-deps - }, [fullReport, linkedTransaction, reportActions, personalDetails, preferredLocale, policy, parentReportAction, transaction, transactionViolations, canUseViolations]); + }, [ + fullReport, + lastReportActionTransaction, + reportActions, + personalDetails, + preferredLocale, + policy, + parentReportAction, + transaction, + transactionViolations, + canUseViolations, + receiptTransactions, + ]); useEffect(() => { if (!optionItem || !!optionItem.hasDraftComment || !comment || comment.length <= 0 || isFocused) { diff --git a/src/components/LHNOptionsList/types.ts b/src/components/LHNOptionsList/types.ts index 1f2c98301f9a..b91a49328e75 100644 --- a/src/components/LHNOptionsList/types.ts +++ b/src/components/LHNOptionsList/types.ts @@ -83,6 +83,9 @@ type OptionRowLHNDataProps = { /** The transaction from the parent report action */ transaction: OnyxEntry; + /** The transaction linked to the report's last action */ + lastReportActionTransaction: OnyxEntry; + /** Comment added to report */ comment: string; From 6e02a92c67ab240787d4aa03e78da5e8c88e30e9 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 6 Feb 2024 15:36:41 -0700 Subject: [PATCH 19/42] Fix types --- src/components/LHNOptionsList/OptionRowLHNData.tsx | 4 +--- src/components/LHNOptionsList/types.ts | 3 ++- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/LHNOptionsList/OptionRowLHNData.tsx b/src/components/LHNOptionsList/OptionRowLHNData.tsx index b23d84ac37a6..a18d5a8ec1ec 100644 --- a/src/components/LHNOptionsList/OptionRowLHNData.tsx +++ b/src/components/LHNOptionsList/OptionRowLHNData.tsx @@ -1,9 +1,7 @@ import {deepEqual} from 'fast-equals'; import React, {useEffect, useMemo, useRef} from 'react'; -import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; import SidebarUtils from '@libs/SidebarUtils'; -import * as TransactionUtils from '@libs/TransactionUtils'; import * as Report from '@userActions/Report'; import CONST from '@src/CONST'; import type {OptionData} from '@src/libs/ReportUtils'; @@ -27,7 +25,7 @@ function OptionRowLHNData({ receiptTransactions, parentReportAction, transaction, - lastReportActionTransaction, + lastReportActionTransaction = {}, transactionViolations, canUseViolations, ...propsToForward diff --git a/src/components/LHNOptionsList/types.ts b/src/components/LHNOptionsList/types.ts index b91a49328e75..58bea97f04c9 100644 --- a/src/components/LHNOptionsList/types.ts +++ b/src/components/LHNOptionsList/types.ts @@ -7,6 +7,7 @@ import type {CurrentReportIDContextValue} from '@components/withCurrentReportID' import type CONST from '@src/CONST'; import type {OptionData} from '@src/libs/ReportUtils'; import type {Locale, PersonalDetailsList, Policy, Report, ReportAction, ReportActions, Transaction, TransactionViolation} from '@src/types/onyx'; +import type {EmptyObject} from '@src/types/utils/EmptyObject'; type OptionMode = ValueOf; @@ -84,7 +85,7 @@ type OptionRowLHNDataProps = { transaction: OnyxEntry; /** The transaction linked to the report's last action */ - lastReportActionTransaction: OnyxEntry; + lastReportActionTransaction?: OnyxEntry; /** Comment added to report */ comment: string; From 25e06351f77e0c557c8e1a702958d3493ee85ba9 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Tue, 6 Feb 2024 15:45:47 -0700 Subject: [PATCH 20/42] Remove deprecated method and use transactions collection --- src/components/LHNOptionsList/LHNOptionsList.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index ab5607ffb5dc..c21f758287e9 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -68,7 +68,14 @@ function LHNOptionsList({ const participantsPersonalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participants, personalDetails); const sortedReportActions = ReportActionsUtils.getSortedReportActionsForDisplay(itemReportActions); const lastReportAction = sortedReportActions[0]; - const lastReportActionTransaction = TransactionUtils.getLinkedTransaction(lastReportAction); + + // Get the transaction for the last report action + let lastReportActionTransactionID = ''; + + if (lastReportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.IOU) { + lastReportActionTransactionID = lastReportAction.originalMessage?.IOUTransactionID ?? ''; + } + const lastReportActionTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${lastReportActionTransactionID}`] ?? {}; return ( Date: Tue, 6 Feb 2024 16:29:27 -0700 Subject: [PATCH 21/42] Remove unused lib --- src/components/LHNOptionsList/LHNOptionsList.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/LHNOptionsList/LHNOptionsList.tsx b/src/components/LHNOptionsList/LHNOptionsList.tsx index c21f758287e9..81ab1ae33268 100644 --- a/src/components/LHNOptionsList/LHNOptionsList.tsx +++ b/src/components/LHNOptionsList/LHNOptionsList.tsx @@ -9,7 +9,6 @@ import useThemeStyles from '@hooks/useThemeStyles'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; import * as ReportUtils from '@libs/ReportUtils'; -import * as TransactionUtils from '@libs/TransactionUtils'; import variables from '@styles/variables'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; From 0a9a13c88c1a8ff61dafac558d68dd2918829678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Wed, 7 Feb 2024 13:07:06 -0600 Subject: [PATCH 22/42] Add isApproved flag from parentReport --- src/components/ReportActionItem/MoneyRequestView.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 3a3aef6cabcd..16f6d004624e 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -114,6 +114,7 @@ function MoneyRequestView({ const formattedOriginalAmount = transactionOriginalAmount && transactionOriginalCurrency && CurrencyUtils.convertToDisplayString(transactionOriginalAmount, transactionOriginalCurrency); const isCardTransaction = TransactionUtils.isCardTransaction(transaction); const cardProgramName = isCardTransaction && transactionCardID !== undefined ? CardUtils.getCardDescription(transactionCardID) : ''; + const isApproved = ReportUtils.isReportApproved(moneyRequestReport); // Flags for allowing or disallowing editing a money request const isSettled = ReportUtils.isSettled(moneyRequestReport?.reportID); @@ -176,7 +177,7 @@ function MoneyRequestView({ if (!isDistanceRequest) { amountDescription += ` • ${translate('iou.cash')}`; } - if (ReportUtils.isReportApproved(report)) { + if (isApproved) { amountDescription += ` • ${translate('iou.approved')}`; } else if (isCancelled) { amountDescription += ` • ${translate('iou.canceled')}`; From 30f8e5da79825d1aabb5a4f725739021937fff45 Mon Sep 17 00:00:00 2001 From: Nicolay Arefyeu Date: Thu, 8 Feb 2024 16:14:10 +0200 Subject: [PATCH 23/42] Update workspace naming from Overview to Profile --- src/CONST.ts | 2 +- src/ROUTES.ts | 18 +++++++++--------- src/SCREENS.ts | 6 +++--- src/components/IFrame.tsx | 2 +- src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- .../AppNavigator/ModalStackNavigators.tsx | 2 +- .../BaseCentralPaneNavigator.tsx | 2 +- .../AppNavigator/getPartialStateDiff.ts | 6 +++--- .../CENTRAL_PANE_TO_RHP_MAPPING.ts | 2 +- .../TAB_TO_CENTRAL_PANE_MAPPING.ts | 2 +- src/libs/Navigation/linkingConfig/config.ts | 6 +++--- src/libs/Navigation/switchPolicyID.ts | 6 +++--- src/libs/Navigation/types.ts | 2 +- src/pages/workspace/WorkspaceInitialPage.js | 6 +++--- ...Page.js => WorkspaceProfileCurrencyPage.js} | 0 ...OverviewPage.js => WorkspaceProfilePage.js} | 18 +++++++++--------- 17 files changed, 42 insertions(+), 42 deletions(-) rename src/pages/workspace/{WorkspaceOverviewCurrencyPage.js => WorkspaceProfileCurrencyPage.js} (100%) rename src/pages/workspace/{WorkspaceOverviewPage.js => WorkspaceProfilePage.js} (93%) diff --git a/src/CONST.ts b/src/CONST.ts index d086eed45a13..2721beff459b 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1508,7 +1508,7 @@ const CONST = { GUIDES_CALL_TASK_IDS: { CONCIERGE_DM: 'NewExpensifyConciergeDM', WORKSPACE_INITIAL: 'WorkspaceHome', - WORKSPACE_OVERVIEW: 'WorkspaceOverview', + WORKSPACE_PROFILE: 'WorkspaceProfile', WORKSPACE_CARD: 'WorkspaceCorporateCards', WORKSPACE_REIMBURSE: 'WorkspaceReimburseReceipts', WORKSPACE_BILLS: 'WorkspacePayBills', diff --git a/src/ROUTES.ts b/src/ROUTES.ts index e3a78cbff39d..5a2ab8cfc7de 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -436,17 +436,17 @@ const ROUTES = { route: 'workspace/:policyID/invite-message', getRoute: (policyID: string) => `workspace/${policyID}/invite-message` as const, }, - WORKSPACE_OVERVIEW: { - route: 'workspace/:policyID/overview', - getRoute: (policyID: string) => `workspace/${policyID}/overview` as const, + WORKSPACE_PROFILE: { + route: 'workspace/:policyID/profile', + getRoute: (policyID: string) => `workspace/${policyID}/profile` as const, }, - WORKSPACE_OVERVIEW_CURRENCY: { - route: 'workspace/:policyID/overview/currency', - getRoute: (policyID: string) => `workspace/${policyID}/overview/currency` as const, + WORKSPACE_PROFILE_CURRENCY: { + route: 'workspace/:policyID/profile/currency', + getRoute: (policyID: string) => `workspace/${policyID}/profile/currency` as const, }, - WORKSPACE_OVERVIEW_NAME: { - route: 'workspace/:policyID/overview/name', - getRoute: (policyID: string) => `workspace/${policyID}/overview/name` as const, + WORKSPACE_PROFILE_NAME: { + route: 'workspace/:policyID/profile/name', + getRoute: (policyID: string) => `workspace/${policyID}/profile/name` as const, }, WORKSPACE_AVATAR: { route: 'workspace/:policyID/avatar', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index cd80937a3864..1d7c77bf129c 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -194,7 +194,7 @@ const SCREENS = { WORKSPACE: { INITIAL: 'Workspace_Initial', - OVERVIEW: 'Workspace_Overview', + PROFILE: 'Workspace_Profile', CARD: 'Workspace_Card', REIMBURSE: 'Workspace_Reimburse', RATE_AND_UNIT: 'Workspace_RateAndUnit', @@ -204,8 +204,8 @@ const SCREENS = { MEMBERS: 'Workspace_Members', INVITE: 'Workspace_Invite', INVITE_MESSAGE: 'Workspace_Invite_Message', - CURRENCY: 'Workspace_Overview_Currency', - NAME: 'Workspace_Overview_Name', + CURRENCY: 'Workspace_Profile_Currency', + NAME: 'Workspace_Profile_Name', }, EDIT_REQUEST: { diff --git a/src/components/IFrame.tsx b/src/components/IFrame.tsx index ab27597aeebd..05da3a1edb9c 100644 --- a/src/components/IFrame.tsx +++ b/src/components/IFrame.tsx @@ -37,7 +37,7 @@ function getNewDotURL(url: string): string { if (pathname === 'policy') { const workspaceID = params.policyID || ''; - const section = urlObj.hash.slice(1) || 'overview'; + const section = urlObj.hash.slice(1) || 'profile'; return `workspace/${workspaceID}/${section}`; } diff --git a/src/languages/en.ts b/src/languages/en.ts index 0781bb6b19f3..6c51cc681ed3 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1539,7 +1539,7 @@ export default { travel: 'Travel', members: 'Members', plan: 'Plan', - overview: 'Overview', + profile: 'Profile', bankAccount: 'Bank account', connectBankAccount: 'Connect bank account', testTransactions: 'Test transactions', diff --git a/src/languages/es.ts b/src/languages/es.ts index f31bc4c367fc..465bc46c8c0b 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1561,7 +1561,7 @@ export default { travel: 'Viajes', members: 'Miembros', plan: 'Plan', - overview: 'Descripción', + profile: 'Perfil', bankAccount: 'Cuenta bancaria', connectBankAccount: 'Conectar cuenta bancaria', testTransactions: 'Transacciones de prueba', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index c7be135e8b57..b0ec6d1f3a94 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -242,7 +242,7 @@ const SettingsModalStackNavigator = createModalStackNavigator require('../../../pages/workspace/WorkspaceInvitePage').default as React.ComponentType, [SCREENS.WORKSPACE.INVITE_MESSAGE]: () => require('../../../pages/workspace/WorkspaceInviteMessagePage').default as React.ComponentType, [SCREENS.WORKSPACE.NAME]: () => require('../../../pages/workspace/WorkspaceNamePage').default as React.ComponentType, - [SCREENS.WORKSPACE.CURRENCY]: () => require('../../../pages/workspace/WorkspaceOverviewCurrencyPage').default as React.ComponentType, + [SCREENS.WORKSPACE.CURRENCY]: () => require('../../../pages/workspace/WorkspaceProfileCurrencyPage').default as React.ComponentType, [SCREENS.REIMBURSEMENT_ACCOUNT]: () => require('../../../pages/ReimbursementAccount/ReimbursementAccountPage').default as React.ComponentType, [SCREENS.GET_ASSISTANCE]: () => require('../../../pages/GetAssistancePage').default as React.ComponentType, [SCREENS.SETTINGS.TWO_FACTOR_AUTH]: () => require('../../../pages/settings/Security/TwoFactorAuth/TwoFactorAuthPage').default as React.ComponentType, diff --git a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx index 53928b71be4e..087e963b3892 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/CentralPaneNavigator/BaseCentralPaneNavigator.tsx @@ -15,7 +15,7 @@ type Screens = Partial React.C const workspaceSettingsScreens = { [SCREENS.SETTINGS.WORKSPACES]: () => require('../../../../../pages/workspace/WorkspacesListPage').default as React.ComponentType, - [SCREENS.WORKSPACE.OVERVIEW]: () => require('../../../../../pages/workspace/WorkspaceOverviewPage').default as React.ComponentType, + [SCREENS.WORKSPACE.PROFILE]: () => require('../../../../../pages/workspace/WorkspaceProfilePage').default as React.ComponentType, [SCREENS.WORKSPACE.CARD]: () => require('../../../../../pages/workspace/card/WorkspaceCardPage').default as React.ComponentType, [SCREENS.WORKSPACE.REIMBURSE]: () => require('../../../../../pages/workspace/reimburse/WorkspaceReimbursePage').default as React.ComponentType, [SCREENS.WORKSPACE.BILLS]: () => require('../../../../../pages/workspace/bills/WorkspaceBillsPage').default as React.ComponentType, diff --git a/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts b/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts index a22185422a11..b0825b4b2991 100644 --- a/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts +++ b/src/libs/Navigation/AppNavigator/getPartialStateDiff.ts @@ -26,9 +26,9 @@ type GetPartialStateDiffReturnType = { * This function returns partial additive diff between the two states. * * Example: Let's start with state A on route /r/123. If the screen is wide we will have a HOME opened on bottom tab and REPORT on central pane. - * Now let's say we want to navigate to /workspace/345/overview. We will generate state B from this path. - * State B will have WORKSPACE_INITIAL on the bottom tab and WORKSPACE_OVERVIEW on the central pane. - * Now we will generate partial diff between state A and state B. The diff will tell us that we need to push WORKSPACE_INITIAL on the bottom tab and WORKSPACE_OVERVIEW on the central pane. + * Now let's say we want to navigate to /workspace/345/profile. We will generate state B from this path. + * State B will have WORKSPACE_INITIAL on the bottom tab and WORKSPACE_PROFILE on the central pane. + * Now we will generate partial diff between state A and state B. The diff will tell us that we need to push WORKSPACE_INITIAL on the bottom tab and WORKSPACE_PROFILE on the central pane. * * Then we can generate actions from this diff and dispatch them to the linkTo function. * diff --git a/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts b/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts index d61b36871434..d96ad416832d 100755 --- a/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/CENTRAL_PANE_TO_RHP_MAPPING.ts @@ -2,7 +2,7 @@ import type {CentralPaneName} from '@libs/Navigation/types'; import SCREENS from '@src/SCREENS'; const CENTRAL_PANE_TO_RHP_MAPPING: Partial> = { - [SCREENS.WORKSPACE.OVERVIEW]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.CURRENCY], + [SCREENS.WORKSPACE.PROFILE]: [SCREENS.WORKSPACE.NAME, SCREENS.WORKSPACE.CURRENCY], [SCREENS.WORKSPACE.REIMBURSE]: [SCREENS.WORKSPACE.RATE_AND_UNIT], [SCREENS.WORKSPACE.MEMBERS]: [SCREENS.WORKSPACE.INVITE, SCREENS.WORKSPACE.INVITE_MESSAGE], }; diff --git a/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts b/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts index 3344cffe94ae..446fb479ea09 100755 --- a/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts +++ b/src/libs/Navigation/linkingConfig/TAB_TO_CENTRAL_PANE_MAPPING.ts @@ -5,7 +5,7 @@ const TAB_TO_CENTRAL_PANE_MAPPING: Record = { [SCREENS.HOME]: [SCREENS.REPORT], [SCREENS.ALL_SETTINGS]: [SCREENS.SETTINGS.WORKSPACES], [SCREENS.WORKSPACE.INITIAL]: [ - SCREENS.WORKSPACE.OVERVIEW, + SCREENS.WORKSPACE.PROFILE, SCREENS.WORKSPACE.CARD, SCREENS.WORKSPACE.REIMBURSE, SCREENS.WORKSPACE.BILLS, diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index 12577e360784..ab218adc3879 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -42,7 +42,7 @@ const config: LinkingOptions['config'] = { [SCREENS.REPORT]: ROUTES.REPORT_WITH_ID.route, [SCREENS.SETTINGS.WORKSPACES]: ROUTES.SETTINGS_WORKSPACES, - [SCREENS.WORKSPACE.OVERVIEW]: ROUTES.WORKSPACE_OVERVIEW.route, + [SCREENS.WORKSPACE.PROFILE]: ROUTES.WORKSPACE_PROFILE.route, [SCREENS.WORKSPACE.CARD]: { path: ROUTES.WORKSPACE_CARD.route, }, @@ -224,7 +224,7 @@ const config: LinkingOptions['config'] = { path: ROUTES.SETTINGS_STATUS_CLEAR_AFTER_TIME, }, [SCREENS.WORKSPACE.CURRENCY]: { - path: ROUTES.WORKSPACE_OVERVIEW_CURRENCY.route, + path: ROUTES.WORKSPACE_PROFILE_CURRENCY.route, }, [SCREENS.WORKSPACE.RATE_AND_UNIT]: { path: ROUTES.WORKSPACE_RATE_AND_UNIT.route, @@ -245,7 +245,7 @@ const config: LinkingOptions['config'] = { [SCREENS.KEYBOARD_SHORTCUTS]: { path: ROUTES.KEYBOARD_SHORTCUTS, }, - [SCREENS.WORKSPACE.NAME]: ROUTES.WORKSPACE_OVERVIEW_NAME.route, + [SCREENS.WORKSPACE.NAME]: ROUTES.WORKSPACE_PROFILE_NAME.route, }, }, [SCREENS.RIGHT_MODAL.PRIVATE_NOTES]: { diff --git a/src/libs/Navigation/switchPolicyID.ts b/src/libs/Navigation/switchPolicyID.ts index 4b9259c76ad7..02c52c09d0cf 100644 --- a/src/libs/Navigation/switchPolicyID.ts +++ b/src/libs/Navigation/switchPolicyID.ts @@ -122,9 +122,9 @@ export default function switchPolicyID(navigation: NavigationContainerRef Navigation.navigate(ROUTES.WORKSPACE_OVERVIEW.getRoute(policy.id)))), + action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE.getRoute(policy.id)))), brickRoadIndicator: hasGeneralSettingsError ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : '', - routeName: SCREENS.WORKSPACE.OVERVIEW, + routeName: SCREENS.WORKSPACE.PROFILE, }, ].concat(shouldShowProtectedItems ? protectedMenuItems : []); diff --git a/src/pages/workspace/WorkspaceOverviewCurrencyPage.js b/src/pages/workspace/WorkspaceProfileCurrencyPage.js similarity index 100% rename from src/pages/workspace/WorkspaceOverviewCurrencyPage.js rename to src/pages/workspace/WorkspaceProfileCurrencyPage.js diff --git a/src/pages/workspace/WorkspaceOverviewPage.js b/src/pages/workspace/WorkspaceProfilePage.js similarity index 93% rename from src/pages/workspace/WorkspaceOverviewPage.js rename to src/pages/workspace/WorkspaceProfilePage.js index dd3945136c47..990ad3c717ae 100644 --- a/src/pages/workspace/WorkspaceOverviewPage.js +++ b/src/pages/workspace/WorkspaceProfilePage.js @@ -50,23 +50,23 @@ const defaultProps = { ...policyDefaultProps, }; -function WorkspaceOverviewPage({policy, currencyList, route}) { +function WorkspaceProfilePage({policy, currencyList, route}) { const styles = useThemeStyles(); const {translate} = useLocalize(); const formattedCurrency = !_.isEmpty(policy) && !_.isEmpty(currencyList) ? `${policy.outputCurrency} - ${currencyList[policy.outputCurrency].symbol}` : ''; - const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_OVERVIEW_CURRENCY.getRoute(policy.id)), [policy.id]); - const onPressName = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_OVERVIEW_NAME.getRoute(policy.id)), [policy.id]); + const onPressCurrency = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_CURRENCY.getRoute(policy.id)), [policy.id]); + const onPressName = useCallback(() => Navigation.navigate(ROUTES.WORKSPACE_PROFILE_NAME.getRoute(policy.id)), [policy.id]); const policyName = lodashGet(policy, 'name', ''); const readOnly = !PolicyUtils.isPolicyAdmin(policy); return ( Date: Thu, 8 Feb 2024 15:08:38 -0700 Subject: [PATCH 24/42] Add connection types to policy object --- src/types/onyx/Policy.ts | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 784cd546a961..5b37c95cf311 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -31,6 +31,27 @@ type DisabledFields = { reimbursable?: boolean; }; +type ConnectionLastSync = { + successfulDate: string; + isSuccessful: boolean; + errorDate?: string; + source: string; +}; + +type ConnectionData = { + // TBD +}; + +type ConnectionConfig = { + // TBD +}; + +type Connection = { + lastSync?: ConnectionLastSync; + data: ConnectionData; + config: ConnectionConfig; +}; + type AutoReportingOffset = number | ValueOf; type Policy = { @@ -158,6 +179,9 @@ type Policy = { /** ReportID of the announce room for this workspace */ chatReportIDAnnounce?: number; + + /** All the integration connections attached to the policy */ + connections?: Record; }; export default Policy; From 56103e700ed4d52e78dbbc487448f6e797ccac1f Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 8 Feb 2024 23:38:33 -0800 Subject: [PATCH 25/42] Default email and shortLivedAuthToken to empty string --- src/pages/LogOutPreviousUserPage.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/LogOutPreviousUserPage.tsx b/src/pages/LogOutPreviousUserPage.tsx index 8d2d1a5f9b1d..f68344604dfa 100644 --- a/src/pages/LogOutPreviousUserPage.tsx +++ b/src/pages/LogOutPreviousUserPage.tsx @@ -2,7 +2,7 @@ import type {StackScreenProps} from '@react-navigation/stack'; import React, {useEffect} from 'react'; import {Linking} from 'react-native'; import {withOnyx} from 'react-native-onyx'; -import type {OnyxEntry} from 'react-native-onyx/lib/types'; +import type {OnyxEntry} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import * as SessionUtils from '@libs/SessionUtils'; import type {AuthScreensParamList} from '@navigation/types'; @@ -38,8 +38,8 @@ function LogOutPreviousUserPage({session, route}: LogOutPreviousUserPageProps) { // On Enabling 2FA, authToken stored in Onyx becomes expired and hence we need to fetch new authToken const shouldForceLogin = route.params.shouldForceLogin === 'true'; if (shouldForceLogin) { - const email = route.params.email; - const shortLivedAuthToken = route.params.shortLivedAuthToken; + const email = route.params.email ?? ''; + const shortLivedAuthToken = route.params.shortLivedAuthToken ?? ''; SessionActions.signInWithShortLivedAuthToken(email, shortLivedAuthToken); } }); From 21711bc0ed1e9dd9e8e0042b539a85e91649d9a1 Mon Sep 17 00:00:00 2001 From: rory Date: Thu, 8 Feb 2024 23:40:24 -0800 Subject: [PATCH 26/42] Delete js page --- src/pages/LogOutPreviousUserPage.js | 96 ----------------------------- 1 file changed, 96 deletions(-) delete mode 100644 src/pages/LogOutPreviousUserPage.js diff --git a/src/pages/LogOutPreviousUserPage.js b/src/pages/LogOutPreviousUserPage.js deleted file mode 100644 index 0d1bf4f47025..000000000000 --- a/src/pages/LogOutPreviousUserPage.js +++ /dev/null @@ -1,96 +0,0 @@ -import lodashGet from 'lodash/get'; -import PropTypes from 'prop-types'; -import React, {useContext, useEffect} from 'react'; -import {Linking, NativeModules} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; -import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; -import InitialUrlContext from '@libs/InitialUrlContext'; -import Log from '@libs/Log'; -import Navigation from '@libs/Navigation/Navigation'; -import * as SessionUtils from '@libs/SessionUtils'; -import * as Session from '@userActions/Session'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; - -const propTypes = { - /** The details about the account that the user is signing in with */ - account: PropTypes.shape({ - /** Whether the account data is loading */ - isLoading: PropTypes.bool, - }), - - /** The data about the current session which will be set once the user is authenticated and we return to this component as an AuthScreen */ - session: PropTypes.shape({ - /** The user's email for the current session */ - email: PropTypes.string, - }), -}; - -const defaultProps = { - account: { - isLoading: false, - }, - session: { - email: null, - }, -}; - -// This page is responsible for handling transitions from OldDot. Specifically, it logs the current user -// out if the transition is for another user. -// -// This component should not do any other navigation as that handled in App.setUpPoliciesAndNavigate -function LogOutPreviousUserPage(props) { - const initUrl = useContext(InitialUrlContext); - useEffect(() => { - Linking.getInitialURL().then((url) => { - const sessionEmail = props.session.email; - const transitionUrl = NativeModules.HybridAppModule ? CONST.DEEPLINK_BASE_URL + initUrl : url; - const isLoggingInAsNewUser = SessionUtils.isLoggingInAsNewUser(transitionUrl, sessionEmail); - - if (isLoggingInAsNewUser) { - Session.signOutAndRedirectToSignIn(); - } - - // We need to signin and fetch a new authToken, if a user was already authenticated in NewDot, and was redirected to OldDot - // and their authToken stored in Onyx becomes invalid. - // This workflow is triggered while setting up VBBA. User is redirected from NewDot to OldDot to set up 2FA, and then redirected back to NewDot - // On Enabling 2FA, authToken stored in Onyx becomes expired and hence we need to fetch new authToken - const shouldForceLogin = lodashGet(props, 'route.params.shouldForceLogin', '') === 'true'; - if (shouldForceLogin) { - Log.info('LogOutPreviousUserPage - forcing login with shortLivedAuthToken'); - const email = lodashGet(props, 'route.params.email', ''); - const shortLivedAuthToken = lodashGet(props, 'route.params.shortLivedAuthToken', ''); - Session.signInWithShortLivedAuthToken(email, shortLivedAuthToken); - } - - const exitTo = lodashGet(props, 'route.params.exitTo', ''); - // We don't want to navigate to the exitTo route when creating a new workspace from a deep link, - // because we already handle creating the optimistic policy and navigating to it in App.setUpPoliciesAndNavigate, - // which is already called when AuthScreens mounts. - if (exitTo && exitTo !== ROUTES.WORKSPACE_NEW && !props.account.isLoading && !isLoggingInAsNewUser) { - Navigation.isNavigationReady().then(() => { - // remove this screen and navigate to exit route - const exitUrl = NativeModules.HybridAppModule ? Navigation.parseHybridAppUrl(exitTo) : exitTo; - Navigation.goBack(); - Navigation.navigate(exitUrl); - }); - } - }); - }, [initUrl, props]); - - return ; -} - -LogOutPreviousUserPage.propTypes = propTypes; -LogOutPreviousUserPage.defaultProps = defaultProps; -LogOutPreviousUserPage.displayName = 'LogOutPreviousUserPage'; - -export default withOnyx({ - account: { - key: ONYXKEYS.ACCOUNT, - }, - session: { - key: ONYXKEYS.SESSION, - }, -})(LogOutPreviousUserPage); From bb89d57fac220d51a1d6bdf84b8ab6d824bbce5b Mon Sep 17 00:00:00 2001 From: ruben-rebelo Date: Fri, 9 Feb 2024 09:38:15 +0000 Subject: [PATCH 27/42] [TS migration] Migrate CardUtilsTest to Typescript --- tests/unit/{CardUtilsTest.js => CardUtilsTest.ts} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tests/unit/{CardUtilsTest.js => CardUtilsTest.ts} (97%) diff --git a/tests/unit/CardUtilsTest.js b/tests/unit/CardUtilsTest.ts similarity index 97% rename from tests/unit/CardUtilsTest.js rename to tests/unit/CardUtilsTest.ts index f754b0895c6d..010d5fba23ab 100644 --- a/tests/unit/CardUtilsTest.js +++ b/tests/unit/CardUtilsTest.ts @@ -1,4 +1,4 @@ -const cardUtils = require('../../src/libs/CardUtils'); +import * as cardUtils from '../../src/libs/CardUtils'; const shortDate = '0924'; const shortDateSlashed = '09/24'; From 7b1f51c8978bb02c1bd331c1d5c5f8c11fc630e6 Mon Sep 17 00:00:00 2001 From: Ruben Rebelo <39693995+ruben-rebelo@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:45:53 +0000 Subject: [PATCH 28/42] [TS migration] Code improvements Co-authored-by: Viktoryia Kliushun --- tests/unit/CardUtilsTest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/CardUtilsTest.ts b/tests/unit/CardUtilsTest.ts index 010d5fba23ab..405b588fa93f 100644 --- a/tests/unit/CardUtilsTest.ts +++ b/tests/unit/CardUtilsTest.ts @@ -1,4 +1,4 @@ -import * as cardUtils from '../../src/libs/CardUtils'; +import * as cardUtils from '@src/libs/CardUtils'; const shortDate = '0924'; const shortDateSlashed = '09/24'; From 9860f93f2a151b19e1eed520c1ac710c1c10c2b4 Mon Sep 17 00:00:00 2001 From: Tim Golen Date: Fri, 9 Feb 2024 10:54:20 -0700 Subject: [PATCH 29/42] Use generic types for now --- src/types/onyx/Policy.ts | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/src/types/onyx/Policy.ts b/src/types/onyx/Policy.ts index 5b37c95cf311..87a59da5bd8b 100644 --- a/src/types/onyx/Policy.ts +++ b/src/types/onyx/Policy.ts @@ -31,21 +31,12 @@ type DisabledFields = { reimbursable?: boolean; }; -type ConnectionLastSync = { - successfulDate: string; - isSuccessful: boolean; - errorDate?: string; - source: string; -}; - -type ConnectionData = { - // TBD -}; - -type ConnectionConfig = { - // TBD -}; - +// These types are for the Integration connections for a policy (eg. Quickbooks, Xero, etc). +// This data is not yet used in the codebase which is why it is given a very generic type, but the data is being put into Onyx for future use. +// Once the data is being used, these types should be defined appropriately. +type ConnectionLastSync = Record; +type ConnectionData = Record; +type ConnectionConfig = Record; type Connection = { lastSync?: ConnectionLastSync; data: ConnectionData; From 22856c66af24eb036f97f5c4f391a9570cc5d32f Mon Sep 17 00:00:00 2001 From: situchan Date: Sat, 10 Feb 2024 00:31:23 +0600 Subject: [PATCH 30/42] remove deprecated patches --- patches/react-native-vision-camera+2.16.5.patch | 13 ------------- ...atch => react-native-vision-camera+2.16.8.patch} | 0 2 files changed, 13 deletions(-) delete mode 100644 patches/react-native-vision-camera+2.16.5.patch rename patches/{react-native-vision-camera+2.16.5+001+fix-boost-dependency.patch => react-native-vision-camera+2.16.8.patch} (100%) diff --git a/patches/react-native-vision-camera+2.16.5.patch b/patches/react-native-vision-camera+2.16.5.patch deleted file mode 100644 index d08f7c11f5f3..000000000000 --- a/patches/react-native-vision-camera+2.16.5.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessor/FrameProcessorRuntimeManager.kt b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessor/FrameProcessorRuntimeManager.kt -index c0a8b23..653b51e 100644 ---- a/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessor/FrameProcessorRuntimeManager.kt -+++ b/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/frameprocessor/FrameProcessorRuntimeManager.kt -@@ -40,7 +40,7 @@ class FrameProcessorRuntimeManager(context: ReactApplicationContext, frameProces - val holder = context.catalystInstance.jsCallInvokerHolder as CallInvokerHolderImpl - mScheduler = VisionCameraScheduler(frameProcessorThread) - mContext = WeakReference(context) -- mHybridData = initHybrid(context.javaScriptContextHolder.get(), holder, mScheduler!!) -+ mHybridData = initHybrid(context.javaScriptContextHolder!!.get(), holder, mScheduler!!) - initializeRuntime() - - Log.i(TAG, "Installing JSI Bindings on JS Thread...") diff --git a/patches/react-native-vision-camera+2.16.5+001+fix-boost-dependency.patch b/patches/react-native-vision-camera+2.16.8.patch similarity index 100% rename from patches/react-native-vision-camera+2.16.5+001+fix-boost-dependency.patch rename to patches/react-native-vision-camera+2.16.8.patch From 45aa4e3a138eb3374a17d009ce4e1115aa6c9472 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 9 Feb 2024 09:49:07 -1000 Subject: [PATCH 31/42] Dismiss onboard flow when selecting option --- src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx b/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx index 66d25da28f9d..025dcafd9740 100644 --- a/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx +++ b/src/pages/OnboardEngagement/PurposeForUsingExpensifyPage.tsx @@ -90,7 +90,7 @@ function PurposeForUsingExpensifyModal() { } Report.completeEngagementModal(message, choice); - Report.navigateToConciergeChat(); + Report.navigateToConciergeChat(false, true); }, []); const menuItems: MenuItemProps[] = useMemo( From a5ad8f28b4466f5856169468be40a0cddd9a6898 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Fri, 9 Feb 2024 21:04:13 +0000 Subject: [PATCH 32/42] Update version to 1.4.39-3 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index cbfdb4b0b0a5..4deda998e6cd 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043902 - versionName "1.4.39-2" + versionCode 1001043903 + versionName "1.4.39-3" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 0c53a62c88a6..50f12f077df4 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.39.2 + 1.4.39.3 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index ed74e6865d2f..9cb804d8b76b 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.39.2 + 1.4.39.3 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index 94c770eaf29f..f165590464de 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.39 CFBundleVersion - 1.4.39.2 + 1.4.39.3 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 694646334480..d87b3f702bf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.39-2", + "version": "1.4.39-3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.39-2", + "version": "1.4.39-3", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 0f856afb44e0..f5d82cd477b1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.39-2", + "version": "1.4.39-3", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 3758e3724dd4189d67ef6d8aa678ec67b6492811 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Fri, 9 Feb 2024 21:05:22 +0000 Subject: [PATCH 33/42] Update version to 1.4.39-4 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 4deda998e6cd..96e92df52404 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043903 - versionName "1.4.39-3" + versionCode 1001043904 + versionName "1.4.39-4" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 50f12f077df4..e46568920c19 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.39.3 + 1.4.39.4 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 9cb804d8b76b..f1a55f6f34ff 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.39.3 + 1.4.39.4 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index f165590464de..c9a62d0dd2e5 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.39 CFBundleVersion - 1.4.39.3 + 1.4.39.4 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index d87b3f702bf0..862bdca66463 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.39-3", + "version": "1.4.39-4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.39-3", + "version": "1.4.39-4", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index f5d82cd477b1..73b1ac1837df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.39-3", + "version": "1.4.39-4", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 6e7b4418cabf5ec43cc50f6997d11370466b2db6 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 9 Feb 2024 12:23:45 -1000 Subject: [PATCH 34/42] Remove backTo for money request view --- src/components/ReportActionItem/MoneyRequestView.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 42d932a40315..4789c6d927c6 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -273,7 +273,6 @@ function MoneyRequestView({ CONST.IOU.TYPE.REQUEST, transaction?.transactionID ?? '', report.reportID, - Navigation.getActiveRouteWithoutParams(), ), ) } From 15335665d5de3858054d3f152db5bbf7efe7e292 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 9 Feb 2024 12:32:01 -1000 Subject: [PATCH 35/42] run prettier --- src/components/ReportActionItem/MoneyRequestView.tsx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/components/ReportActionItem/MoneyRequestView.tsx b/src/components/ReportActionItem/MoneyRequestView.tsx index 4789c6d927c6..f0956da948c9 100644 --- a/src/components/ReportActionItem/MoneyRequestView.tsx +++ b/src/components/ReportActionItem/MoneyRequestView.tsx @@ -268,12 +268,7 @@ function MoneyRequestView({ titleStyle={styles.flex1} onPress={() => Navigation.navigate( - ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute( - CONST.IOU.ACTION.EDIT, - CONST.IOU.TYPE.REQUEST, - transaction?.transactionID ?? '', - report.reportID, - ), + ROUTES.MONEY_REQUEST_STEP_DESCRIPTION.getRoute(CONST.IOU.ACTION.EDIT, CONST.IOU.TYPE.REQUEST, transaction?.transactionID ?? '', report.reportID), ) } wrapperStyle={[styles.pv2, styles.taskDescriptionMenuItem]} From 46518e6ce35d61ce100de098a23da5e53cd793ed Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 9 Feb 2024 13:13:43 -1000 Subject: [PATCH 36/42] Patch welcome logic so that we do not get redirected to the workspace chat --- src/libs/actions/Welcome.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Welcome.ts b/src/libs/actions/Welcome.ts index 3f6b2dc99a8f..952d19117679 100644 --- a/src/libs/actions/Welcome.ts +++ b/src/libs/actions/Welcome.ts @@ -136,11 +136,13 @@ function show(routes: NavigationState['routes'], showEngagem const transitionRoute = routes.find( (route): route is NavigationState>['routes'][number] => route.name === SCREENS.TRANSITION_BETWEEN_APPS, ); + const activeRoute = Navigation.getActiveRouteWithoutParams(); + const isOnWorkspaceOverviewPage = activeRoute?.startsWith('/workspace') && activeRoute?.endsWith('/overview'); const isExitingToWorkspaceRoute = transitionRoute?.params?.exitTo === 'workspace/new'; // If we already opened the workspace settings or want the admin room to stay open, do not // navigate away to the workspace chat report - const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute; + const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute && !isOnWorkspaceOverviewPage; const workspaceChatReport = Object.values(allReports ?? {}).find((report) => { if (report) { From 859cca3ad922e1242d4771d2d0cca89e9716cf1a Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 9 Feb 2024 13:25:41 -1000 Subject: [PATCH 37/42] Revert "Patch welcome logic so that we do not get redirected to the workspace chat" This reverts commit 46518e6ce35d61ce100de098a23da5e53cd793ed. --- src/libs/actions/Welcome.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/libs/actions/Welcome.ts b/src/libs/actions/Welcome.ts index 952d19117679..3f6b2dc99a8f 100644 --- a/src/libs/actions/Welcome.ts +++ b/src/libs/actions/Welcome.ts @@ -136,13 +136,11 @@ function show(routes: NavigationState['routes'], showEngagem const transitionRoute = routes.find( (route): route is NavigationState>['routes'][number] => route.name === SCREENS.TRANSITION_BETWEEN_APPS, ); - const activeRoute = Navigation.getActiveRouteWithoutParams(); - const isOnWorkspaceOverviewPage = activeRoute?.startsWith('/workspace') && activeRoute?.endsWith('/overview'); const isExitingToWorkspaceRoute = transitionRoute?.params?.exitTo === 'workspace/new'; // If we already opened the workspace settings or want the admin room to stay open, do not // navigate away to the workspace chat report - const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute && !isOnWorkspaceOverviewPage; + const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute; const workspaceChatReport = Object.values(allReports ?? {}).find((report) => { if (report) { From 11b5ff218b961c45a64a24aef269c22df086aba4 Mon Sep 17 00:00:00 2001 From: Marc Glasser Date: Fri, 9 Feb 2024 13:26:46 -1000 Subject: [PATCH 38/42] Patch welcome logic so that we do not get redirected to the workspace chat --- src/libs/actions/Welcome.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Welcome.ts b/src/libs/actions/Welcome.ts index 3f6b2dc99a8f..952d19117679 100644 --- a/src/libs/actions/Welcome.ts +++ b/src/libs/actions/Welcome.ts @@ -136,11 +136,13 @@ function show(routes: NavigationState['routes'], showEngagem const transitionRoute = routes.find( (route): route is NavigationState>['routes'][number] => route.name === SCREENS.TRANSITION_BETWEEN_APPS, ); + const activeRoute = Navigation.getActiveRouteWithoutParams(); + const isOnWorkspaceOverviewPage = activeRoute?.startsWith('/workspace') && activeRoute?.endsWith('/overview'); const isExitingToWorkspaceRoute = transitionRoute?.params?.exitTo === 'workspace/new'; // If we already opened the workspace settings or want the admin room to stay open, do not // navigate away to the workspace chat report - const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute; + const shouldNavigateToWorkspaceChat = !isExitingToWorkspaceRoute && !isOnWorkspaceOverviewPage; const workspaceChatReport = Object.values(allReports ?? {}).find((report) => { if (report) { From 43e0195c7e652f85150096e5bf6f64e6bbcd8c7a Mon Sep 17 00:00:00 2001 From: OSBotify Date: Sat, 10 Feb 2024 00:14:36 +0000 Subject: [PATCH 39/42] Update version to 1.4.39-5 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 96e92df52404..f2953c9f035f 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043904 - versionName "1.4.39-4" + versionCode 1001043905 + versionName "1.4.39-5" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index e46568920c19..24861dc2b45f 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.39.4 + 1.4.39.5 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index f1a55f6f34ff..96dfbdfdb1c1 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.39.4 + 1.4.39.5 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index c9a62d0dd2e5..dc048e2f18cb 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.39 CFBundleVersion - 1.4.39.4 + 1.4.39.5 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index 862bdca66463..dfcfbdf7d81e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.39-4", + "version": "1.4.39-5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.39-4", + "version": "1.4.39-5", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 73b1ac1837df..6846cc50a111 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.39-4", + "version": "1.4.39-5", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 885a6e880173f3845d604da3caeb44ef0bdbde4e Mon Sep 17 00:00:00 2001 From: OSBotify Date: Sat, 10 Feb 2024 00:14:51 +0000 Subject: [PATCH 40/42] Update version to 1.4.39-6 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index f2953c9f035f..7fdac2cde8ee 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043905 - versionName "1.4.39-5" + versionCode 1001043906 + versionName "1.4.39-6" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 24861dc2b45f..6935f4bc7ae0 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.39.5 + 1.4.39.6 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index 96dfbdfdb1c1..d73254a8757b 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.39.5 + 1.4.39.6 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index dc048e2f18cb..a45598e22bb3 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.39 CFBundleVersion - 1.4.39.5 + 1.4.39.6 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index dfcfbdf7d81e..d4ab5c96d729 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.39-5", + "version": "1.4.39-6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.39-5", + "version": "1.4.39-6", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 6846cc50a111..9c51cab7eac2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.39-5", + "version": "1.4.39-6", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From 1b060129b537a206fdf170239809ad8520ebffd4 Mon Sep 17 00:00:00 2001 From: OSBotify Date: Sat, 10 Feb 2024 00:34:12 +0000 Subject: [PATCH 41/42] Update version to 1.4.39-7 --- android/app/build.gradle | 4 ++-- ios/NewExpensify/Info.plist | 2 +- ios/NewExpensifyTests/Info.plist | 2 +- ios/NotificationServiceExtension/Info.plist | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 7fdac2cde8ee..ed7b2f568b93 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -98,8 +98,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001043906 - versionName "1.4.39-6" + versionCode 1001043907 + versionName "1.4.39-7" } flavorDimensions "default" diff --git a/ios/NewExpensify/Info.plist b/ios/NewExpensify/Info.plist index 6935f4bc7ae0..4f571739ecc7 100644 --- a/ios/NewExpensify/Info.plist +++ b/ios/NewExpensify/Info.plist @@ -40,7 +40,7 @@ CFBundleVersion - 1.4.39.6 + 1.4.39.7 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/NewExpensifyTests/Info.plist b/ios/NewExpensifyTests/Info.plist index d73254a8757b..bc29fdff60c2 100644 --- a/ios/NewExpensifyTests/Info.plist +++ b/ios/NewExpensifyTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.4.39.6 + 1.4.39.7 diff --git a/ios/NotificationServiceExtension/Info.plist b/ios/NotificationServiceExtension/Info.plist index a45598e22bb3..b54ddc36ddf0 100644 --- a/ios/NotificationServiceExtension/Info.plist +++ b/ios/NotificationServiceExtension/Info.plist @@ -13,7 +13,7 @@ CFBundleShortVersionString 1.4.39 CFBundleVersion - 1.4.39.6 + 1.4.39.7 NSExtension NSExtensionPointIdentifier diff --git a/package-lock.json b/package-lock.json index d4ab5c96d729..1cc630ce5dac 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "new.expensify", - "version": "1.4.39-6", + "version": "1.4.39-7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "new.expensify", - "version": "1.4.39-6", + "version": "1.4.39-7", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 9c51cab7eac2..5870241897b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.4.39-6", + "version": "1.4.39-7", "author": "Expensify, Inc.", "homepage": "https://new.expensify.com", "description": "New Expensify is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.", From c7961921796852776729a5f8e178694db93f93e9 Mon Sep 17 00:00:00 2001 From: ImgBotApp Date: Sat, 10 Feb 2024 13:29:54 +0000 Subject: [PATCH 42/42] [ImgBot] Optimize images *Total -- 346.28kb -> 311.27kb (10.11%) /assets/images/chatbubble-unread.svg -- 0.78kb -> 0.63kb (19.07%) /assets/images/chatbubble-add.svg -- 0.91kb -> 0.76kb (16.43%) /assets/images/olddot-wireframe.svg -- 315.31kb -> 280.82kb (10.94%) /assets/images/simple-illustrations/simple-illustration__palmtree.svg -- 2.98kb -> 2.90kb (2.65%) /assets/images/simple-illustrations/simple-illustration__qr-code.svg -- 0.72kb -> 0.71kb (1.35%) /docs/assets/images/info.svg -- 0.68kb -> 0.67kb (1.29%) /assets/images/simple-illustrations/simple-illustration__profile.svg -- 0.99kb -> 0.98kb (0.59%) /assets/images/home.svg -- 0.50kb -> 0.50kb (0.58%) /assets/images/simple-illustrations/simple-illustration__gears.svg -- 19.82kb -> 19.72kb (0.5%) /assets/images/simple-illustrations/simple-illustration__lockclosed.svg -- 3.59kb -> 3.57kb (0.46%) Signed-off-by: ImgBotApp --- assets/images/chatbubble-add.svg | 14 +- assets/images/chatbubble-unread.svg | 13 +- assets/images/home.svg | 4 +- assets/images/olddot-wireframe.svg | 3423 +---------------- .../simple-illustration__gears.svg | 102 +- .../simple-illustration__lockclosed.svg | 18 +- .../simple-illustration__palmtree.svg | 16 +- .../simple-illustration__profile.svg | 7 +- .../simple-illustration__qr-code.svg | 5 +- docs/assets/images/info.svg | 10 +- 10 files changed, 10 insertions(+), 3602 deletions(-) diff --git a/assets/images/chatbubble-add.svg b/assets/images/chatbubble-add.svg index 047a43073b3c..48eebf863cc3 100644 --- a/assets/images/chatbubble-add.svg +++ b/assets/images/chatbubble-add.svg @@ -1,13 +1 @@ - - - - - - + \ No newline at end of file diff --git a/assets/images/chatbubble-unread.svg b/assets/images/chatbubble-unread.svg index 9da789510276..492616cf2ab5 100644 --- a/assets/images/chatbubble-unread.svg +++ b/assets/images/chatbubble-unread.svg @@ -1,12 +1 @@ - - - - - - + \ No newline at end of file diff --git a/assets/images/home.svg b/assets/images/home.svg index 6b2411407be7..d4e02b723fee 100644 --- a/assets/images/home.svg +++ b/assets/images/home.svg @@ -1,3 +1 @@ - - - + \ No newline at end of file diff --git a/assets/images/olddot-wireframe.svg b/assets/images/olddot-wireframe.svg index ee9aa93be255..055059edfd70 100644 --- a/assets/images/olddot-wireframe.svg +++ b/assets/images/olddot-wireframe.svg @@ -1,3422 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/assets/images/simple-illustrations/simple-illustration__gears.svg b/assets/images/simple-illustrations/simple-illustration__gears.svg index 3b4cbc001e3b..2798feb4e04d 100644 --- a/assets/images/simple-illustrations/simple-illustration__gears.svg +++ b/assets/images/simple-illustrations/simple-illustration__gears.svg @@ -1,101 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/assets/images/simple-illustrations/simple-illustration__lockclosed.svg b/assets/images/simple-illustrations/simple-illustration__lockclosed.svg index 3779b92b0b0f..791500c28032 100644 --- a/assets/images/simple-illustrations/simple-illustration__lockclosed.svg +++ b/assets/images/simple-illustrations/simple-illustration__lockclosed.svg @@ -1,17 +1 @@ - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/assets/images/simple-illustrations/simple-illustration__palmtree.svg b/assets/images/simple-illustrations/simple-illustration__palmtree.svg index 2aef4956cde9..c67e871dc434 100644 --- a/assets/images/simple-illustrations/simple-illustration__palmtree.svg +++ b/assets/images/simple-illustrations/simple-illustration__palmtree.svg @@ -1,15 +1 @@ - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/assets/images/simple-illustrations/simple-illustration__profile.svg b/assets/images/simple-illustrations/simple-illustration__profile.svg index 85312f26e186..085f02822bc0 100644 --- a/assets/images/simple-illustrations/simple-illustration__profile.svg +++ b/assets/images/simple-illustrations/simple-illustration__profile.svg @@ -1,6 +1 @@ - - - - - - + \ No newline at end of file diff --git a/assets/images/simple-illustrations/simple-illustration__qr-code.svg b/assets/images/simple-illustrations/simple-illustration__qr-code.svg index 10268d747588..7bd460d5f4e9 100644 --- a/assets/images/simple-illustrations/simple-illustration__qr-code.svg +++ b/assets/images/simple-illustrations/simple-illustration__qr-code.svg @@ -1,4 +1 @@ - - - - + \ No newline at end of file diff --git a/docs/assets/images/info.svg b/docs/assets/images/info.svg index 96924fbb6cf7..fbe9b3612667 100644 --- a/docs/assets/images/info.svg +++ b/docs/assets/images/info.svg @@ -1,9 +1 @@ - - - - - - - - - + \ No newline at end of file