From cf01991b76d89dcf4c700e47df981cc0f6e3ed84 Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 9 Jan 2024 20:27:16 +0530 Subject: [PATCH 01/49] Migrate welcome message to room description for report --- src/CONST.ts | 1 - src/ONYXKEYS.ts | 8 +-- src/ROUTES.ts | 6 +-- src/SCREENS.ts | 4 +- src/components/ReportWelcomeText.tsx | 27 ++++++---- src/languages/en.ts | 8 +-- src/languages/es.ts | 8 +-- .../AppNavigator/ModalStackNavigators.tsx | 8 +-- .../Navigators/RightModalNavigator.tsx | 4 +- src/libs/Navigation/linkingConfig.ts | 4 +- src/libs/Navigation/types.ts | 8 +-- src/libs/Permissions.ts | 2 +- src/libs/ReportUtils.ts | 22 +++++--- src/libs/actions/Report.ts | 26 +++++----- ...essagePage.js => ReportDescriptionPage.js} | 52 +++++++++---------- src/pages/ReportDetailsPage.js | 8 +++ src/pages/home/HeaderView.js | 49 +++++++++++++---- .../settings/Report/ReportSettingsPage.js | 11 ---- src/pages/workspace/WorkspaceNewRoomPage.js | 10 ++-- src/types/onyx/Report.ts | 1 - 20 files changed, 155 insertions(+), 112 deletions(-) rename src/pages/{ReportWelcomeMessagePage.js => ReportDescriptionPage.js} (71%) diff --git a/src/CONST.ts b/src/CONST.ts index c6849db630f2..8fcb888d65da 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1534,7 +1534,6 @@ const CONST = { INVITE: 'invite', SETTINGS: 'settings', LEAVE_ROOM: 'leaveRoom', - WELCOME_MESSAGE: 'welcomeMessage', PRIVATE_NOTES: 'privateNotes', }, EDIT_REQUEST_FIELD: { diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 89ddbdc06883..0ef82873e929 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -302,8 +302,8 @@ const ONYXKEYS = { DISPLAY_NAME_FORM_DRAFT: 'displayNameFormDraft', ROOM_NAME_FORM: 'roomNameForm', ROOM_NAME_FORM_DRAFT: 'roomNameFormDraft', - WELCOME_MESSAGE_FORM: 'welcomeMessageForm', - WELCOME_MESSAGE_FORM_DRAFT: 'welcomeMessageFormDraft', + REPORT_DESCRIPTION_FORM: 'reportDescriptionForm', + REPORT_DESCRIPTION_FORM_DRAFT: 'reportDescriptionFormDraft', LEGAL_NAME_FORM: 'legalNameForm', LEGAL_NAME_FORM_DRAFT: 'legalNameFormDraft', WORKSPACE_INVITE_MESSAGE_FORM: 'workspaceInviteMessageForm', @@ -478,8 +478,8 @@ type OnyxValues = { [ONYXKEYS.FORMS.DISPLAY_NAME_FORM_DRAFT]: OnyxTypes.Form; [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_DRAFT]: OnyxTypes.Form; + [ONYXKEYS.FORMS.REPORT_DESCRIPTION_FORM]: OnyxTypes.Form; + [ONYXKEYS.FORMS.REPORT_DESCRIPTION_FORM_DRAFT]: OnyxTypes.Form; [ONYXKEYS.FORMS.LEGAL_NAME_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.LEGAL_NAME_FORM_DRAFT]: OnyxTypes.Form; [ONYXKEYS.FORMS.WORKSPACE_INVITE_MESSAGE_FORM]: OnyxTypes.Form; diff --git a/src/ROUTES.ts b/src/ROUTES.ts index e8a860582bb1..1dfe3a2dcf84 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -195,9 +195,9 @@ const ROUTES = { route: 'r/:reportID/settings/who-can-post', getRoute: (reportID: string) => `r/${reportID}/settings/who-can-post` as const, }, - REPORT_WELCOME_MESSAGE: { - route: 'r/:reportID/welcomeMessage', - getRoute: (reportID: string) => `r/${reportID}/welcomeMessage` as const, + REPORT_DESCRIPTION: { + route: 'r/:reportID/roomDescription', + getRoute: (reportID: string) => `r/${reportID}/roomDescription` as const, }, SPLIT_BILL_DETAILS: { route: 'r/:reportID/split/:reportActionID', diff --git a/src/SCREENS.ts b/src/SCREENS.ts index 703cb309d641..b053782d43be 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -91,7 +91,7 @@ const SCREENS = { PROFILE: 'Profile', REPORT_DETAILS: 'Report_Details', REPORT_SETTINGS: 'Report_Settings', - REPORT_WELCOME_MESSAGE: 'Report_WelcomeMessage', + REPORT_DESCRIPTION: 'Report_Description', PARTICIPANTS: 'Participants', MONEY_REQUEST: 'MoneyRequest', NEW_TASK: 'NewTask', @@ -233,7 +233,7 @@ const SCREENS = { DETAILS_ROOT: 'Details_Root', PROFILE_ROOT: 'Profile_Root', PROCESS_MONEY_REQUEST_HOLD_ROOT: 'ProcessMoneyRequestHold_Root', - REPORT_WELCOME_MESSAGE_ROOT: 'Report_WelcomeMessage_Root', + REPORT_DESCRIPTION_ROOT: 'Report_Description_Root', REPORT_PARTICIPANTS_ROOT: 'ReportParticipants_Root', ROOM_MEMBERS_ROOT: 'RoomMembers_Root', ROOM_INVITE_ROOT: 'RoomInvite_Root', diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index b337c3581213..2c544720a22d 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -12,6 +12,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {PersonalDetailsList, Policy, Report} from '@src/types/onyx'; +import RenderHTML from './RenderHTML'; import Text from './Text'; import UserDetailsTooltip from './UserDetailsTooltip'; @@ -73,17 +74,23 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP )} {isChatRoom && ( <> - {roomWelcomeMessage.phrase1} - {roomWelcomeMessage.showReportName && ( - - {ReportUtils.getReportName(report)} - + {report?.description ? ( + + ) : ( + <> + {roomWelcomeMessage.phrase1} + {roomWelcomeMessage.showReportName && ( + + {ReportUtils.getReportName(report)} + + )} + {roomWelcomeMessage.phrase2 !== undefined && {roomWelcomeMessage.phrase2}} + )} - {roomWelcomeMessage.phrase2 !== undefined && {roomWelcomeMessage.phrase2}} )} {isDefault && ( diff --git a/src/languages/en.ts b/src/languages/en.ts index c57b1ce310b5..e90060b3f740 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1033,10 +1033,10 @@ export default { }, }, }, - welcomeMessagePage: { - welcomeMessage: 'Welcome message', - welcomeMessageOptional: 'Welcome message (optional)', - explainerText: 'Set a custom welcome message that will be sent to users when they join this room.', + reportDescriptionPage: { + roomDescription: 'Room description', + roomDescriptionOptional: 'Room description (optional)', + explainerText: 'Set a custom decription for the room.', }, languagePage: { language: 'Language', diff --git a/src/languages/es.ts b/src/languages/es.ts index b83385b602c8..29688d4a19ae 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1032,10 +1032,10 @@ export default { }, }, }, - welcomeMessagePage: { - welcomeMessage: 'Mensaje de bienvenida', - welcomeMessageOptional: 'Mensaje de bienvenida (opcional)', - explainerText: 'Configura un mensaje de bienvenida privado y personalizado que se enviará cuando los usuarios se unan a esta sala de chat.', + reportDescriptionPage: { + roomDescription: 'Descripción de la habitación', + roomDescriptionOptional: 'Descripción de la habitación (opcional)', + explainerText: 'Establece una descripción personalizada para la habitación.', }, languagePage: { language: 'Idioma', diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 4be1c988561b..e033de853275 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -17,9 +17,9 @@ import type { ProfileNavigatorParamList, ReferralDetailsNavigatorParamList, ReimbursementAccountNavigatorParamList, + ReportDescriptionNavigatorParamList, ReportDetailsNavigatorParamList, ReportSettingsNavigatorParamList, - ReportWelcomeMessageNavigatorParamList, RoomInviteNavigatorParamList, RoomMembersNavigatorParamList, SearchNavigatorParamList, @@ -141,8 +141,8 @@ const TaskModalStackNavigator = createModalStackNavigator require('../../../pages/tasks/TaskAssigneeSelectorModal').default as React.ComponentType, }); -const ReportWelcomeMessageModalStackNavigator = createModalStackNavigator({ - [SCREENS.REPORT_WELCOME_MESSAGE_ROOT]: () => require('../../../pages/ReportWelcomeMessagePage').default as React.ComponentType, +const ReportDescriptionModalStackNavigator = createModalStackNavigator({ + [SCREENS.REPORT_DESCRIPTION_ROOT]: () => require('../../../pages/ReportDescriptionPage').default as React.ComponentType, }); const ReportParticipantsModalStackNavigator = createModalStackNavigator({ @@ -295,7 +295,7 @@ export { ReportDetailsModalStackNavigator, TaskModalStackNavigator, ReportSettingsModalStackNavigator, - ReportWelcomeMessageModalStackNavigator, + ReportDescriptionModalStackNavigator, ReportParticipantsModalStackNavigator, SearchModalStackNavigator, NewChatModalStackNavigator, diff --git a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx index 7721a64adea9..93d2f8fba989 100644 --- a/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx +++ b/src/libs/Navigation/AppNavigator/Navigators/RightModalNavigator.tsx @@ -62,8 +62,8 @@ function RightModalNavigator({navigation}: RightModalNavigatorProps) { component={ModalStackNavigators.ReportSettingsModalStackNavigator} /> = { }, }, }, - [SCREENS.RIGHT_MODAL.REPORT_WELCOME_MESSAGE]: { + [SCREENS.RIGHT_MODAL.REPORT_DESCRIPTION]: { screens: { - [SCREENS.REPORT_WELCOME_MESSAGE_ROOT]: ROUTES.REPORT_WELCOME_MESSAGE.route, + [SCREENS.REPORT_DESCRIPTION_ROOT]: ROUTES.REPORT_DESCRIPTION.route, }, }, [SCREENS.RIGHT_MODAL.NEW_CHAT]: { diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 90f5361f11f4..fd6942f8c9c6 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -161,8 +161,8 @@ type ReportSettingsNavigatorParamList = { [SCREENS.REPORT_SETTINGS.WRITE_CAPABILITY]: undefined; }; -type ReportWelcomeMessageNavigatorParamList = { - [SCREENS.REPORT_WELCOME_MESSAGE_ROOT]: {reportID: string}; +type ReportDescriptionNavigatorParamList = { + [SCREENS.REPORT_DESCRIPTION_ROOT]: {reportID: string}; }; type ParticipantsNavigatorParamList = { @@ -361,7 +361,7 @@ type RightModalNavigatorParamList = { [SCREENS.RIGHT_MODAL.PROFILE]: NavigatorScreenParams; [SCREENS.RIGHT_MODAL.REPORT_DETAILS]: NavigatorScreenParams; [SCREENS.RIGHT_MODAL.REPORT_SETTINGS]: NavigatorScreenParams; - [SCREENS.RIGHT_MODAL.REPORT_WELCOME_MESSAGE]: NavigatorScreenParams; + [SCREENS.RIGHT_MODAL.REPORT_DESCRIPTION]: NavigatorScreenParams; [SCREENS.RIGHT_MODAL.PARTICIPANTS]: NavigatorScreenParams; [SCREENS.RIGHT_MODAL.ROOM_MEMBERS]: NavigatorScreenParams; [SCREENS.RIGHT_MODAL.ROOM_INVITE]: NavigatorScreenParams; @@ -447,7 +447,7 @@ export type { ReportDetailsNavigatorParamList, ReportSettingsNavigatorParamList, TaskDetailsNavigatorParamList, - ReportWelcomeMessageNavigatorParamList, + ReportDescriptionNavigatorParamList, ParticipantsNavigatorParamList, RoomMembersNavigatorParamList, RoomInviteNavigatorParamList, diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index ce5e0e674c59..582115b0a914 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -3,7 +3,7 @@ import CONST from '@src/CONST'; import type Beta from '@src/types/onyx/Beta'; function canUseAllBetas(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.ALL); + return !!betas?.includes(CONST.BETAS.ALL) || true; } function canUseChronos(betas: OnyxEntry): boolean { diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 0d7658adf180..26a69cc51818 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -218,7 +218,7 @@ type OptimisticChatReport = Pick< | 'stateNum' | 'statusNum' | 'visibility' - | 'welcomeMessage' + | 'description' | 'writeCapability' >; @@ -2388,6 +2388,15 @@ function getParsedComment(text: string): string { return text.length <= CONST.MAX_MARKUP_LENGTH ? parser.replace(text) : lodashEscape(text); } +function getReportDescriptionText(report: Report): string { + if (!report.description) { + return ''; + } + + const parser = new ExpensiMark(); + return parser.htmlToText(report.description); +} + function buildOptimisticAddCommentReportAction(text?: string, file?: File): OptimisticReportAction { const parser = new ExpensiMark(); const commentText = getParsedComment(text ?? ''); @@ -3075,7 +3084,7 @@ function buildOptimisticChatReport( notificationPreference: NotificationPreference = CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS, parentReportActionID = '', parentReportID = '', - welcomeMessage = '', + description = '', ): OptimisticChatReport { const currentTime = DateUtils.getDBTime(); const isNewlyCreatedWorkspaceChat = chatType === CONST.REPORT.CHAT_TYPE.POLICY_EXPENSE_CHAT && isOwnPolicyExpenseChat; @@ -3104,7 +3113,7 @@ function buildOptimisticChatReport( stateNum: 0, statusNum: 0, visibility, - welcomeMessage, + description, writeCapability, }; } @@ -3585,7 +3594,7 @@ function canFlagReportAction(reportAction: OnyxEntry, reportID: st reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CHRONOSOOOLIST; if (ReportActionsUtils.isWhisperAction(reportAction)) { // Allow flagging welcome message whispers as they can be set by any room creator - if (report?.welcomeMessage && !isCurrentUserAction && isOriginalMessageHaveHtml && reportAction?.originalMessage?.html === report.welcomeMessage) { + if (report?.description && !isCurrentUserAction && isOriginalMessageHaveHtml && reportAction?.originalMessage?.html === report.description) { return true; } @@ -4270,7 +4279,7 @@ function getRoom(type: ValueOf, policyID: string) /** * We only want policy owners and admins to be able to modify the welcome message, but not in thread chat. */ -function shouldDisableWelcomeMessage(report: OnyxEntry, policy: OnyxEntry): boolean { +function shouldDisableReportDescription(report: OnyxEntry, policy: OnyxEntry): boolean { return isMoneyRequestReport(report) || isArchivedRoom(report) || !isChatRoom(report) || isChatThread(report) || !PolicyUtils.isPolicyAdmin(policy); } /** @@ -4525,13 +4534,14 @@ export { getReimbursementDeQueuedActionMessage, getPersonalDetailsForAccountID, getRoom, - shouldDisableWelcomeMessage, + shouldDisableReportDescription, navigateToPrivateNotes, canEditWriteCapability, hasSmartscanError, shouldAutoFocusOnKeyPress, shouldDisplayThreadReplies, shouldDisableThread, + getReportDescriptionText, }; export type {ExpenseOriginalMessage, OptionData, OptimisticChatReport}; diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 55e91834a803..9cffcb45f9cf 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1481,39 +1481,39 @@ function toggleSubscribeToChildReport(childReportID = '0', parentReportAction: P } } -function updateWelcomeMessage(reportID: string, previousValue: string, newValue: string) { +function updateDescription(reportID: string, previousValue: string, newValue: string) { // No change needed, navigate back if (previousValue === newValue) { - Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(reportID)); + Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID)); return; } - const parsedWelcomeMessage = ReportUtils.getParsedComment(newValue); + const parsedDescription = ReportUtils.getParsedComment(newValue); const optimisticData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: {welcomeMessage: parsedWelcomeMessage}, + value: {description: parsedDescription}, }, ]; const failureData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: {welcomeMessage: previousValue}, + value: {description: previousValue}, }, ]; - type UpdateWelcomeMessageParameters = { + type UpdateReportDescriptionParameters = { reportID: string; - welcomeMessage: string; + description: string; }; - const parameters: UpdateWelcomeMessageParameters = {reportID, welcomeMessage: parsedWelcomeMessage}; + const parameters: UpdateReportDescriptionParameters = {reportID, description: parsedDescription}; - API.write('UpdateWelcomeMessage', parameters, {optimisticData, failureData}); - Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(reportID)); + API.write('UpdateRoomDescription', parameters, {optimisticData, failureData}); + Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID)); } function updateWriteCapabilityAndNavigate(report: Report, newValue: WriteCapability) { @@ -1649,7 +1649,7 @@ function addPolicyReport(policyReport: ReportUtils.OptimisticChatReport) { reportName?: string; visibility?: ValueOf; writeCapability?: WriteCapability; - welcomeMessage?: string; + description?: string; }; const parameters: AddWorkspaceRoomParameters = { @@ -1659,7 +1659,7 @@ function addPolicyReport(policyReport: ReportUtils.OptimisticChatReport) { reportID: policyReport.reportID, createdReportActionID: createdReportAction.reportActionID, writeCapability: policyReport.writeCapability, - welcomeMessage: policyReport.welcomeMessage, + description: policyReport.description, }; API.write('AddWorkspaceRoom', parameters, {optimisticData, successData, failureData}); @@ -2590,7 +2590,7 @@ export { addComment, addAttachment, reconnect, - updateWelcomeMessage, + updateDescription, updateWriteCapabilityAndNavigate, updateNotificationPreference, subscribeToReportTypingEvents, diff --git a/src/pages/ReportWelcomeMessagePage.js b/src/pages/ReportDescriptionPage.js similarity index 71% rename from src/pages/ReportWelcomeMessagePage.js rename to src/pages/ReportDescriptionPage.js index ae8a4635a98e..cba19d25c1d3 100644 --- a/src/pages/ReportWelcomeMessagePage.js +++ b/src/pages/ReportDescriptionPage.js @@ -35,7 +35,7 @@ const propTypes = { /** Route params */ route: PropTypes.shape({ params: PropTypes.shape({ - /** Report ID passed via route r/:reportID/welcomeMessage */ + /** Report ID passed via route r/:reportID/roomDescription */ reportID: PropTypes.string, }), }).isRequired, @@ -45,26 +45,26 @@ const defaultProps = { ...policyDefaultProps, }; -function ReportWelcomeMessagePage(props) { +function ReportDescriptionPage(props) { const styles = useThemeStyles(); const parser = new ExpensiMark(); - const [welcomeMessage, setWelcomeMessage] = useState(() => parser.htmlToMarkdown(props.report.welcomeMessage)); - const welcomeMessageInputRef = useRef(null); + const [description, setdescription] = useState(() => parser.htmlToMarkdown(props.report.description)); + const reportDescriptionInputRef = useRef(null); const focusTimeoutRef = useRef(null); - const handleWelcomeMessageChange = useCallback((value) => { - setWelcomeMessage(value); + const handleReportDescriptionChange = useCallback((value) => { + setdescription(value); }, []); const submitForm = useCallback(() => { - Report.updateWelcomeMessage(props.report.reportID, props.report.welcomeMessage, welcomeMessage.trim()); - }, [props.report.reportID, props.report.welcomeMessage, welcomeMessage]); + Report.updateDescription(props.report.reportID, props.report.description, description.trim()); + }, [props.report.reportID, props.report.description, description]); useFocusEffect( useCallback(() => { focusTimeoutRef.current = setTimeout(() => { - if (welcomeMessageInputRef.current) { - welcomeMessageInputRef.current.focus(); + if (reportDescriptionInputRef.current) { + reportDescriptionInputRef.current.focus(); } return () => { if (!focusTimeoutRef.current) { @@ -80,27 +80,27 @@ function ReportWelcomeMessagePage(props) { - + Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(props.report.reportID))} /> - {props.translate('welcomeMessagePage.explainerText')} + {props.translate('reportDescriptionPage.explainerText')} @@ -123,9 +123,9 @@ function ReportWelcomeMessagePage(props) { ); } -ReportWelcomeMessagePage.displayName = 'ReportWelcomeMessagePage'; -ReportWelcomeMessagePage.propTypes = propTypes; -ReportWelcomeMessagePage.defaultProps = defaultProps; +ReportDescriptionPage.displayName = 'ReportDescriptionPage'; +ReportDescriptionPage.propTypes = propTypes; +ReportDescriptionPage.defaultProps = defaultProps; export default compose( withLocalize, @@ -135,4 +135,4 @@ export default compose( key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`, }, }), -)(ReportWelcomeMessagePage); +)(ReportDescriptionPage); diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index ff9ed62c6a65..57b940374d8a 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -8,6 +8,7 @@ import DisplayNames from '@components/DisplayNames'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import * as Expensicons from '@components/Icon/Expensicons'; import MenuItem from '@components/MenuItem'; +import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import MultipleAvatars from '@components/MultipleAvatars'; import {withNetwork} from '@components/OnyxProvider'; import ParentNavigationSubtitle from '@components/ParentNavigationSubtitle'; @@ -235,6 +236,13 @@ function ReportDetailsPage(props) { )} + Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} + /> {_.map(menuItems, (item) => { const brickRoadIndicator = ReportUtils.hasReportNameError(props.report) && item.key === CONST.REPORT_DETAILS_MENU_ITEM.SETTINGS ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''; diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index edf6b65b2f4a..d2a4e8442b6f 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -116,6 +116,10 @@ function HeaderView(props) { const isPolicyMember = useMemo(() => !_.isEmpty(props.policy), [props.policy]); const canLeaveRoom = ReportUtils.canLeaveRoom(props.report, isPolicyMember); const isArchivedRoom = ReportUtils.isArchivedRoom(props.report); + const reportDescription = ReportUtils.getReportDescriptionText(props.report); + const policyName = ReportUtils.getPolicyName(props.report); + // const policyDescription = ReportUtils.getPolicyDescription(props.report.policyID); + const description = reportDescription; // We hide the button when we are chatting with an automated Expensify account since it's not possible to contact // these users via alternative means. It is possible to request a call with Concierge so we leave the option for them. @@ -271,14 +275,33 @@ function HeaderView(props) { /> )} - + + + {!_.isEmpty(policyName) && + !_.isEmpty(reportDescription) && ( // code for the policyName display + <> + + {translate('threads.in')} + + + {policyName} + + + )} + {!_.isEmpty(parentNavigationSubtitleData) && ( )} - {!_.isEmpty(subtitle) && ( + {!_.isEmpty(subtitle) && _.isEmpty(description) && ( )} + {!_.isEmpty(description) && ( + + {description} + + )} {brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR && ( diff --git a/src/pages/settings/Report/ReportSettingsPage.js b/src/pages/settings/Report/ReportSettingsPage.js index c7cfd9c7850d..fe3953dd0248 100644 --- a/src/pages/settings/Report/ReportSettingsPage.js +++ b/src/pages/settings/Report/ReportSettingsPage.js @@ -63,9 +63,6 @@ function ReportSettingsPage(props) { const shouldDisableRename = useMemo(() => ReportUtils.shouldDisableRename(report, linkedWorkspace), [report, linkedWorkspace]); const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); - // We only want policy owners and admins to be able to modify the welcome message, but not in thread chat - const shouldDisableWelcomeMessage = ReportUtils.shouldDisableWelcomeMessage(report, linkedWorkspace); - const shouldDisableSettings = _.isEmpty(report) || ReportUtils.isArchivedRoom(report); const shouldShowRoomName = !ReportUtils.isPolicyExpenseChat(report) && !ReportUtils.isChatThread(report); const notificationPreference = @@ -192,14 +189,6 @@ function ReportSettingsPage(props) { )} - {!shouldDisableWelcomeMessage && ( - Navigation.navigate(ROUTES.REPORT_WELCOME_MESSAGE.getRoute(report.reportID))} - shouldShowRightIcon - /> - )} diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 21c93b87806a..aa5b24af9958 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -114,7 +114,7 @@ function WorkspaceNewRoomPage(props) { */ const submit = (values) => { const participants = [props.session.accountID]; - const parsedWelcomeMessage = ReportUtils.getParsedComment(values.welcomeMessage); + const parsedDescription = ReportUtils.getParsedComment(values.reportDescription); const policyReport = ReportUtils.buildOptimisticChatReport( participants, values.roomName, @@ -128,7 +128,7 @@ function WorkspaceNewRoomPage(props) { CONST.REPORT.NOTIFICATION_PREFERENCE.ALWAYS, '', '', - parsedWelcomeMessage, + parsedDescription, ); setNewRoomReportID(policyReport.reportID); Report.addPolicyReport(policyReport); @@ -280,9 +280,9 @@ function WorkspaceNewRoomPage(props) { Date: Tue, 9 Jan 2024 20:49:40 +0530 Subject: [PATCH 02/49] =?UTF-8?q?Fix=20style=20=F0=9F=92=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libs/E2E/apiMocks/openReport.ts | 1 - src/pages/home/HeaderView.js | 8 +++----- src/pages/settings/Report/ReportSettingsPage.js | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/libs/E2E/apiMocks/openReport.ts b/src/libs/E2E/apiMocks/openReport.ts index 49d44605592d..4165db650a5c 100644 --- a/src/libs/E2E/apiMocks/openReport.ts +++ b/src/libs/E2E/apiMocks/openReport.ts @@ -24,7 +24,6 @@ export default (): Response => ({ lastMessageText: 'terry+hightraffic@margelo.io owes \u20ac12.00', lastActorAccountID: 14567013, notificationPreference: 'always', - welcomeMessage: '', stateNum: 0, statusNum: 0, oldPolicyName: '', diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index d2a4e8442b6f..0832d789ae35 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -118,8 +118,6 @@ function HeaderView(props) { const isArchivedRoom = ReportUtils.isArchivedRoom(props.report); const reportDescription = ReportUtils.getReportDescriptionText(props.report); const policyName = ReportUtils.getPolicyName(props.report); - // const policyDescription = ReportUtils.getPolicyDescription(props.report.policyID); - const description = reportDescription; // We hide the button when we are chatting with an automated Expensify account since it's not possible to contact // these users via alternative means. It is possible to request a call with Concierge so we leave the option for them. @@ -309,7 +307,7 @@ function HeaderView(props) { pressableStyles={[styles.alignSelfStart, styles.mw100]} /> )} - {!_.isEmpty(subtitle) && _.isEmpty(description) && ( + {!_.isEmpty(subtitle) && _.isEmpty(reportDescription) && ( )} - {!_.isEmpty(description) && ( + {!_.isEmpty(reportDescription) && ( - {description} + {reportDescription} )} diff --git a/src/pages/settings/Report/ReportSettingsPage.js b/src/pages/settings/Report/ReportSettingsPage.js index fe3953dd0248..4c0e3b477a02 100644 --- a/src/pages/settings/Report/ReportSettingsPage.js +++ b/src/pages/settings/Report/ReportSettingsPage.js @@ -7,8 +7,6 @@ import _ from 'underscore'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import DisplayNames from '@components/DisplayNames'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import * as Expensicons from '@components/Icon/Expensicons'; -import MenuItem from '@components/MenuItem'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import ScreenWrapper from '@components/ScreenWrapper'; From 5be28c79dba6f03e364c8f506e452edf54bd36de Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 9 Jan 2024 21:48:40 +0530 Subject: [PATCH 03/49] Fix Permissions --- src/libs/Permissions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/Permissions.ts b/src/libs/Permissions.ts index 582115b0a914..ce5e0e674c59 100644 --- a/src/libs/Permissions.ts +++ b/src/libs/Permissions.ts @@ -3,7 +3,7 @@ import CONST from '@src/CONST'; import type Beta from '@src/types/onyx/Beta'; function canUseAllBetas(betas: OnyxEntry): boolean { - return !!betas?.includes(CONST.BETAS.ALL) || true; + return !!betas?.includes(CONST.BETAS.ALL); } function canUseChronos(betas: OnyxEntry): boolean { From 6e7fc2761fac092106366d45e54e92a9fc10fb63 Mon Sep 17 00:00:00 2001 From: someone-here Date: Sun, 14 Jan 2024 22:16:36 +0530 Subject: [PATCH 04/49] Requested changes --- src/libs/ReportUtils.ts | 8 ++++---- src/pages/ReportDescriptionPage.js | 4 ++-- src/pages/ReportDetailsPage.js | 6 ++++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 26a69cc51818..4f6d2032c8cf 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4277,10 +4277,10 @@ function getRoom(type: ValueOf, policyID: string) } /** - * We only want policy owners and admins to be able to modify the welcome message, but not in thread chat. + * We only want policy owners and admins to be able to modify the report description, but not in thread chat. */ -function shouldDisableReportDescription(report: OnyxEntry, policy: OnyxEntry): boolean { - return isMoneyRequestReport(report) || isArchivedRoom(report) || !isChatRoom(report) || isChatThread(report) || !PolicyUtils.isPolicyAdmin(policy); +function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry): boolean { + return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && PolicyUtils.isPolicyAdmin(policy); } /** * Checks if report action has error when smart scanning @@ -4534,7 +4534,7 @@ export { getReimbursementDeQueuedActionMessage, getPersonalDetailsForAccountID, getRoom, - shouldDisableReportDescription, + canEditReportDescription, navigateToPrivateNotes, canEditWriteCapability, hasSmartscanError, diff --git a/src/pages/ReportDescriptionPage.js b/src/pages/ReportDescriptionPage.js index cba19d25c1d3..9093d165b876 100644 --- a/src/pages/ReportDescriptionPage.js +++ b/src/pages/ReportDescriptionPage.js @@ -82,14 +82,14 @@ function ReportDescriptionPage(props) { includeSafeAreaPaddingBottom={false} testID={ReportDescriptionPage.displayName} > - + Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(props.report.reportID))} /> ReportUtils.isUserCreatedPolicyRoom(props.report), [props.report]); const isArchivedRoom = useMemo(() => ReportUtils.isArchivedRoom(props.report), [props.report]); const isMoneyRequestReport = useMemo(() => ReportUtils.isMoneyRequestReport(props.report), [props.report]); + const canEditReportDescription = useMemo(() => ReportUtils.canEditReportDescription(props.report, policy), [props.report, policy]); // eslint-disable-next-line react-hooks/exhaustive-deps -- policy is a dependency because `getChatRoomSubtitle` calls `getPolicyName` which in turn retrieves the value from the `policy` value stored in Onyx const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy]); @@ -237,10 +238,11 @@ function ReportDetailsPage(props) { Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} /> {_.map(menuItems, (item) => { From e28f6cddaf021ce341d75b4a631b1a5a5ffaa3a4 Mon Sep 17 00:00:00 2001 From: someone-here Date: Sun, 14 Jan 2024 22:36:23 +0530 Subject: [PATCH 05/49] Hide Description conditionally --- src/pages/ReportDetailsPage.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 6be27454a928..f1636d85182f 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -71,6 +71,7 @@ function ReportDetailsPage(props) { const isArchivedRoom = useMemo(() => ReportUtils.isArchivedRoom(props.report), [props.report]); const isMoneyRequestReport = useMemo(() => ReportUtils.isMoneyRequestReport(props.report), [props.report]); const canEditReportDescription = useMemo(() => ReportUtils.canEditReportDescription(props.report, policy), [props.report, policy]); + const shouldShowReportDescription = canEditReportDescription || !_.isEmpty(props.report.description); // eslint-disable-next-line react-hooks/exhaustive-deps -- policy is a dependency because `getChatRoomSubtitle` calls `getPolicyName` which in turn retrieves the value from the `policy` value stored in Onyx const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy]); @@ -237,14 +238,16 @@ function ReportDetailsPage(props) { )} - Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} - /> + {shouldShowReportDescription && ( + Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} + /> + )} {_.map(menuItems, (item) => { const brickRoadIndicator = ReportUtils.hasReportNameError(props.report) && item.key === CONST.REPORT_DETAILS_MENU_ITEM.SETTINGS ? CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR : ''; From 10ef66b7bee3d3b6ad0932bdf2f3c0a046dc7744 Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 16 Jan 2024 20:19:01 +0530 Subject: [PATCH 06/49] Update spanish translations --- src/languages/es.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index 29688d4a19ae..fb872528d916 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -1033,9 +1033,9 @@ export default { }, }, reportDescriptionPage: { - roomDescription: 'Descripción de la habitación', - roomDescriptionOptional: 'Descripción de la habitación (opcional)', - explainerText: 'Establece una descripción personalizada para la habitación.', + roomDescription: 'Descripción de la sala de chat', + roomDescriptionOptional: 'Descripción de la sala de chat (opcional)', + explainerText: 'Establece una descripción personalizada para la sala de chat.', }, languagePage: { language: 'Idioma', From 03567bd9ddcc1bf61fd11b89927f1c7422857893 Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 16 Jan 2024 22:25:27 +0530 Subject: [PATCH 07/49] Fix header for tasks --- src/pages/home/HeaderView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 72013c3f046d..f18a52ed2bb4 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -313,7 +313,7 @@ function HeaderView(props) { {subtitle} )} - {!_.isEmpty(reportDescription) && ( + {!_.isEmpty(reportDescription) && _.isEmpty(parentNavigationSubtitleData) && ( Date: Fri, 19 Jan 2024 22:29:24 +0530 Subject: [PATCH 08/49] Reconcile description route and permission --- src/ROUTES.ts | 6 +- src/SCREENS.ts | 1 - src/components/ReportActionItem/TaskView.js | 2 +- src/libs/Navigation/linkingConfig.ts | 2 - src/libs/ReportUtils.ts | 2 +- src/pages/ReportDescriptionPage.js | 123 ++--------------- src/pages/RoomDescriptionPage.js | 138 ++++++++++++++++++++ 7 files changed, 152 insertions(+), 122 deletions(-) create mode 100644 src/pages/RoomDescriptionPage.js diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 6e07666c052e..4690637a4098 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -195,10 +195,6 @@ const ROUTES = { route: 'r/:reportID/settings/who-can-post', getRoute: (reportID: string) => `r/${reportID}/settings/who-can-post` as const, }, - REPORT_DESCRIPTION: { - route: 'r/:reportID/roomDescription', - getRoute: (reportID: string) => `r/${reportID}/roomDescription` as const, - }, SPLIT_BILL_DETAILS: { route: 'r/:reportID/split/:reportActionID', getRoute: (reportID: string, reportActionID: string) => `r/${reportID}/split/${reportActionID}` as const, @@ -216,7 +212,7 @@ const ROUTES = { route: 'r/:reportID/title', getRoute: (reportID: string) => `r/${reportID}/title` as const, }, - TASK_DESCRIPTION: { + REPORT_DESCRIPTION: { route: 'r/:reportID/description', getRoute: (reportID: string) => `r/${reportID}/description` as const, }, diff --git a/src/SCREENS.ts b/src/SCREENS.ts index b053782d43be..ca33c8b9da15 100644 --- a/src/SCREENS.ts +++ b/src/SCREENS.ts @@ -175,7 +175,6 @@ const SCREENS = { TASK: { TITLE: 'Task_Title', - DESCRIPTION: 'Task_Description', ASSIGNEE: 'Task_Assignee', }, diff --git a/src/components/ReportActionItem/TaskView.js b/src/components/ReportActionItem/TaskView.js index 7f7b177136ed..03b631313750 100644 --- a/src/components/ReportActionItem/TaskView.js +++ b/src/components/ReportActionItem/TaskView.js @@ -150,7 +150,7 @@ function TaskView(props) { shouldParseTitle description={props.translate('task.description')} title={props.report.description || ''} - onPress={() => Navigation.navigate(ROUTES.TASK_DESCRIPTION.getRoute(props.report.reportID))} + onPress={() => Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} shouldShowRightIcon={isOpen} disabled={disableState} wrapperStyle={[styles.pv2, styles.taskDescriptionMenuItem]} diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index de1ef75fcefd..7a4e49be9372 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -335,7 +335,6 @@ const linkingConfig: LinkingOptions = { [SCREENS.NEW_TASK.TASK_SHARE_DESTINATION_SELECTOR]: ROUTES.NEW_TASK_SHARE_DESTINATION, [SCREENS.NEW_TASK.DETAILS]: ROUTES.NEW_TASK_DETAILS, [SCREENS.NEW_TASK.TITLE]: ROUTES.NEW_TASK_TITLE, - [SCREENS.NEW_TASK.DESCRIPTION]: ROUTES.NEW_TASK_DESCRIPTION, }, }, [SCREENS.RIGHT_MODAL.TEACHERS_UNITE]: { @@ -450,7 +449,6 @@ const linkingConfig: LinkingOptions = { [SCREENS.RIGHT_MODAL.TASK_DETAILS]: { screens: { [SCREENS.TASK.TITLE]: ROUTES.TASK_TITLE.route, - [SCREENS.TASK.DESCRIPTION]: ROUTES.TASK_DESCRIPTION.route, [SCREENS.TASK.ASSIGNEE]: ROUTES.TASK_ASSIGNEE.route, }, }, diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index b2da8426e256..7fb640f55168 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4339,7 +4339,7 @@ function getRoom(type: ValueOf, policyID: string) * We only want policy owners and admins to be able to modify the report description, but not in thread chat. */ function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry): boolean { - return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && PolicyUtils.isPolicyAdmin(policy); + return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && isEmpty(policy); } /** * Checks if report action has error when smart scanning diff --git a/src/pages/ReportDescriptionPage.js b/src/pages/ReportDescriptionPage.js index 9093d165b876..9b9680e1e81d 100644 --- a/src/pages/ReportDescriptionPage.js +++ b/src/pages/ReportDescriptionPage.js @@ -1,34 +1,12 @@ -import {useFocusEffect} from '@react-navigation/native'; -import ExpensiMark from 'expensify-common/lib/ExpensiMark'; import PropTypes from 'prop-types'; -import React, {useCallback, useRef, useState} from 'react'; -import {View} from 'react-native'; -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 HeaderWithBackButton from '@components/HeaderWithBackButton'; -import ScreenWrapper from '@components/ScreenWrapper'; -import Text from '@components/Text'; -import TextInput from '@components/TextInput'; -import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; -import useThemeStyles from '@hooks/useThemeStyles'; -import compose from '@libs/compose'; -import Navigation from '@libs/Navigation/Navigation'; +import React from 'react'; import * as ReportUtils from '@libs/ReportUtils'; -import updateMultilineInputRange from '@libs/updateMultilineInputRange'; -import * as Report from '@userActions/Report'; -import CONST from '@src/CONST'; -import ONYXKEYS from '@src/ONYXKEYS'; -import ROUTES from '@src/ROUTES'; import withReportOrNotFound from './home/report/withReportOrNotFound'; import reportPropTypes from './reportPropTypes'; -import {policyDefaultProps, policyPropTypes} from './workspace/withPolicy'; +import RoomDescriptionPage from './RoomDescriptionPage'; +import TaskDescriptionPage from './tasks/TaskDescriptionPage'; const propTypes = { - ...withLocalizePropTypes, - ...policyPropTypes, - /** The report currently being looked at */ report: reportPropTypes.isRequired, @@ -41,98 +19,19 @@ const propTypes = { }).isRequired, }; -const defaultProps = { - ...policyDefaultProps, -}; - function ReportDescriptionPage(props) { - const styles = useThemeStyles(); - const parser = new ExpensiMark(); - const [description, setdescription] = useState(() => parser.htmlToMarkdown(props.report.description)); - const reportDescriptionInputRef = useRef(null); - const focusTimeoutRef = useRef(null); - - const handleReportDescriptionChange = useCallback((value) => { - setdescription(value); - }, []); - - const submitForm = useCallback(() => { - Report.updateDescription(props.report.reportID, props.report.description, description.trim()); - }, [props.report.reportID, props.report.description, description]); + const isTask = ReportUtils.isTaskReport(props.report); - useFocusEffect( - useCallback(() => { - focusTimeoutRef.current = setTimeout(() => { - if (reportDescriptionInputRef.current) { - reportDescriptionInputRef.current.focus(); - } - return () => { - if (!focusTimeoutRef.current) { - return; - } - clearTimeout(focusTimeoutRef.current); - }; - }, CONST.ANIMATED_TRANSITION); - }, []), - ); + if (isTask) { + // eslint-disable-next-line react/jsx-props-no-spreading + return ; + } - return ( - - - Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(props.report.reportID))} - /> - - {props.translate('reportDescriptionPage.explainerText')} - - { - if (!el) { - return; - } - reportDescriptionInputRef.current = el; - updateMultilineInputRange(reportDescriptionInputRef.current); - }} - value={description} - onChangeText={handleReportDescriptionChange} - autoCapitalize="none" - containerStyles={[styles.autoGrowHeightMultilineInput]} - /> - - - - - ); + // eslint-disable-next-line react/jsx-props-no-spreading + return ; } ReportDescriptionPage.displayName = 'ReportDescriptionPage'; ReportDescriptionPage.propTypes = propTypes; -ReportDescriptionPage.defaultProps = defaultProps; -export default compose( - withLocalize, - withReportOrNotFound(), - withOnyx({ - policy: { - key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`, - }, - }), -)(ReportDescriptionPage); +export default withReportOrNotFound()(ReportDescriptionPage); diff --git a/src/pages/RoomDescriptionPage.js b/src/pages/RoomDescriptionPage.js new file mode 100644 index 000000000000..f7c6e621454b --- /dev/null +++ b/src/pages/RoomDescriptionPage.js @@ -0,0 +1,138 @@ +import {useFocusEffect} from '@react-navigation/native'; +import ExpensiMark from 'expensify-common/lib/ExpensiMark'; +import PropTypes from 'prop-types'; +import React, {useCallback, useRef, useState} from 'react'; +import {View} from 'react-native'; +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 HeaderWithBackButton from '@components/HeaderWithBackButton'; +import ScreenWrapper from '@components/ScreenWrapper'; +import Text from '@components/Text'; +import TextInput from '@components/TextInput'; +import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; +import useThemeStyles from '@hooks/useThemeStyles'; +import compose from '@libs/compose'; +import Navigation from '@libs/Navigation/Navigation'; +import * as ReportUtils from '@libs/ReportUtils'; +import updateMultilineInputRange from '@libs/updateMultilineInputRange'; +import * as Report from '@userActions/Report'; +import CONST from '@src/CONST'; +import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; +import withReportOrNotFound from './home/report/withReportOrNotFound'; +import reportPropTypes from './reportPropTypes'; +import {policyDefaultProps, policyPropTypes} from './workspace/withPolicy'; + +const propTypes = { + ...withLocalizePropTypes, + ...policyPropTypes, + + /** The report currently being looked at */ + report: reportPropTypes.isRequired, + + /** Route params */ + route: PropTypes.shape({ + params: PropTypes.shape({ + /** Report ID passed via route r/:reportID/roomDescription */ + reportID: PropTypes.string, + }), + }).isRequired, +}; + +const defaultProps = { + ...policyDefaultProps, +}; + +function RoomDescriptionPage(props) { + const styles = useThemeStyles(); + const parser = new ExpensiMark(); + const [description, setdescription] = useState(() => parser.htmlToMarkdown(props.report.description)); + const reportDescriptionInputRef = useRef(null); + const focusTimeoutRef = useRef(null); + + const handleReportDescriptionChange = useCallback((value) => { + setdescription(value); + }, []); + + const submitForm = useCallback(() => { + Report.updateDescription(props.report.reportID, props.report.description, description.trim()); + }, [props.report.reportID, props.report.description, description]); + + useFocusEffect( + useCallback(() => { + focusTimeoutRef.current = setTimeout(() => { + if (reportDescriptionInputRef.current) { + reportDescriptionInputRef.current.focus(); + } + return () => { + if (!focusTimeoutRef.current) { + return; + } + clearTimeout(focusTimeoutRef.current); + }; + }, CONST.ANIMATED_TRANSITION); + }, []), + ); + + return ( + + + Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(props.report.reportID))} + /> + + {props.translate('reportDescriptionPage.explainerText')} + + { + if (!el) { + return; + } + reportDescriptionInputRef.current = el; + updateMultilineInputRange(reportDescriptionInputRef.current); + }} + value={description} + onChangeText={handleReportDescriptionChange} + autoCapitalize="none" + containerStyles={[styles.autoGrowHeightMultilineInput]} + /> + + + + + ); +} + +RoomDescriptionPage.displayName = 'RoomDescriptionPage'; +RoomDescriptionPage.propTypes = propTypes; +RoomDescriptionPage.defaultProps = defaultProps; + +export default compose( + withLocalize, + withReportOrNotFound(), + withOnyx({ + policy: { + key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`, + }, + }), +)(RoomDescriptionPage); From dd340521434d2ac37e0f5cc1c96309f846e7fe22 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 19 Jan 2024 22:32:20 +0530 Subject: [PATCH 09/49] Fix lint --- src/libs/ReportUtils.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 06d63e552acc..7761ab9cdfed 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4730,7 +4730,6 @@ export { canEditReportDescription, doesTransactionThreadHaveViolations, hasViolations, - shouldDisableWelcomeMessage, navigateToPrivateNotes, canEditWriteCapability, hasSmartscanError, From 0c6a9e4f12c4fa431b8bc1d60452891570039caf Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 19 Jan 2024 22:42:54 +0530 Subject: [PATCH 10/49] Fix TS --- src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx | 1 - src/libs/Navigation/types.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx index 39b977d99946..1b28de32671a 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.tsx @@ -136,7 +136,6 @@ const ReportSettingsModalStackNavigator = createModalStackNavigator({ [SCREENS.TASK.TITLE]: () => require('../../../pages/tasks/TaskTitlePage').default as React.ComponentType, - [SCREENS.TASK.DESCRIPTION]: () => require('../../../pages/tasks/TaskDescriptionPage').default as React.ComponentType, [SCREENS.TASK.ASSIGNEE]: () => require('../../../pages/tasks/TaskAssigneeSelectorModal').default as React.ComponentType, }); diff --git a/src/libs/Navigation/types.ts b/src/libs/Navigation/types.ts index 7f47b95b3562..ae121c6083c0 100644 --- a/src/libs/Navigation/types.ts +++ b/src/libs/Navigation/types.ts @@ -270,7 +270,6 @@ type TeachersUniteNavigatorParamList = { type TaskDetailsNavigatorParamList = { [SCREENS.TASK.TITLE]: undefined; - [SCREENS.TASK.DESCRIPTION]: undefined; [SCREENS.TASK.ASSIGNEE]: { reportID: string; }; From 87131a3bb3473a1439b6e8595b34f08fe347f5b8 Mon Sep 17 00:00:00 2001 From: someone-here Date: Sat, 20 Jan 2024 00:03:24 +0530 Subject: [PATCH 11/49] Fix permission --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 7761ab9cdfed..0f87e6e73f5e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4453,7 +4453,7 @@ function getRoom(type: ValueOf, policyID: string) * We only want policy owners and admins to be able to modify the report description, but not in thread chat. */ function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry): boolean { - return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && isEmpty(policy); + return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && !isEmpty(policy); } /** * Checks if report action has error when smart scanning From 356571da6ff339527b3231e3b4fdfbadea139b49 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 26 Jan 2024 10:55:14 +0530 Subject: [PATCH 12/49] Fix conflict --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 0945225372e4..f31f1e8ab1ac 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -2552,7 +2552,7 @@ function getReportDescriptionText(report: Report): string { return parser.htmlToText(report.description); } -function buildOptimisticAddCommentReportAction(text?: string, file?: File): OptimisticReportAction { +function buildOptimisticAddCommentReportAction(text?: string, file?: File, actorAccountID?: number): OptimisticReportAction { const parser = new ExpensiMark(); const commentText = getParsedComment(text ?? ''); const isAttachment = !text && file !== undefined; From 39dd76bb7356db248d6d6660fb335f7e8618ab53 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 26 Jan 2024 11:58:21 +0530 Subject: [PATCH 13/49] Migrate TS --- src/libs/ReportUtils.ts | 2 +- src/libs/updateMultilineInputRange/types.ts | 3 +- ...riptionPage.js => RoomDescriptionPage.tsx} | 80 +++++++------------ .../home/report/withReportOrNotFound.tsx | 4 + 4 files changed, 35 insertions(+), 54 deletions(-) rename src/pages/{RoomDescriptionPage.js => RoomDescriptionPage.tsx} (59%) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f31f1e8ab1ac..bca7cbe4e445 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4507,7 +4507,7 @@ function getRoom(type: ValueOf, policyID: string) /** * We only want policy owners and admins to be able to modify the report description, but not in thread chat. */ -function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry): boolean { +function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry | undefined | null): boolean { return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && !isEmpty(policy); } /** diff --git a/src/libs/updateMultilineInputRange/types.ts b/src/libs/updateMultilineInputRange/types.ts index ce8f553c51f8..3646c64e4845 100644 --- a/src/libs/updateMultilineInputRange/types.ts +++ b/src/libs/updateMultilineInputRange/types.ts @@ -1,5 +1,6 @@ import type {TextInput} from 'react-native'; +import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types'; -type UpdateMultilineInputRange = (input: HTMLInputElement | TextInput | null, shouldAutoFocus?: boolean) => void; +type UpdateMultilineInputRange = (input: HTMLInputElement | BaseTextInputRef | TextInput | null, shouldAutoFocus?: boolean) => void; export default UpdateMultilineInputRange; diff --git a/src/pages/RoomDescriptionPage.js b/src/pages/RoomDescriptionPage.tsx similarity index 59% rename from src/pages/RoomDescriptionPage.js rename to src/pages/RoomDescriptionPage.tsx index f7c6e621454b..22864334777c 100644 --- a/src/pages/RoomDescriptionPage.js +++ b/src/pages/RoomDescriptionPage.tsx @@ -1,9 +1,8 @@ import {useFocusEffect} from '@react-navigation/native'; import ExpensiMark from 'expensify-common/lib/ExpensiMark'; -import PropTypes from 'prop-types'; import React, {useCallback, useRef, useState} from 'react'; import {View} from 'react-native'; -import {withOnyx} from 'react-native-onyx'; +import type {OnyxCollection} from 'react-native-onyx'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import FormProvider from '@components/Form/FormProvider'; import InputWrapper from '@components/Form/InputWrapper'; @@ -11,9 +10,9 @@ import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; import TextInput from '@components/TextInput'; -import withLocalize, {withLocalizePropTypes} from '@components/withLocalize'; +import type {BaseTextInputRef} from '@components/TextInput/BaseTextInput/types'; +import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; -import compose from '@libs/compose'; import Navigation from '@libs/Navigation/Navigation'; import * as ReportUtils from '@libs/ReportUtils'; import updateMultilineInputRange from '@libs/updateMultilineInputRange'; @@ -21,51 +20,38 @@ import * as Report from '@userActions/Report'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; +import type * as OnyxTypes from '@src/types/onyx'; import withReportOrNotFound from './home/report/withReportOrNotFound'; -import reportPropTypes from './reportPropTypes'; -import {policyDefaultProps, policyPropTypes} from './workspace/withPolicy'; -const propTypes = { - ...withLocalizePropTypes, - ...policyPropTypes, +type RoomDescriptionPageProps = { + /** Policy for the current report */ + policies: OnyxCollection; /** The report currently being looked at */ - report: reportPropTypes.isRequired, - - /** Route params */ - route: PropTypes.shape({ - params: PropTypes.shape({ - /** Report ID passed via route r/:reportID/roomDescription */ - reportID: PropTypes.string, - }), - }).isRequired, -}; - -const defaultProps = { - ...policyDefaultProps, + report: OnyxTypes.Report; }; -function RoomDescriptionPage(props) { +function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { const styles = useThemeStyles(); const parser = new ExpensiMark(); - const [description, setdescription] = useState(() => parser.htmlToMarkdown(props.report.description)); - const reportDescriptionInputRef = useRef(null); - const focusTimeoutRef = useRef(null); + const [description, setdescription] = useState(() => parser.htmlToMarkdown(report?.description ?? '')); + const reportDescriptionInputRef = useRef(null); + const focusTimeoutRef = useRef | null>(null); + const {translate} = useLocalize(); + const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; - const handleReportDescriptionChange = useCallback((value) => { + const handleReportDescriptionChange = useCallback((value: string) => { setdescription(value); }, []); const submitForm = useCallback(() => { - Report.updateDescription(props.report.reportID, props.report.description, description.trim()); - }, [props.report.reportID, props.report.description, description]); + Report.updateDescription(report.reportID, report?.description ?? '', description.trim()); + }, [report.reportID, report.description, description]); useFocusEffect( useCallback(() => { focusTimeoutRef.current = setTimeout(() => { - if (reportDescriptionInputRef.current) { - reportDescriptionInputRef.current.focus(); - } + reportDescriptionInputRef.current?.focus(); return () => { if (!focusTimeoutRef.current) { return; @@ -82,34 +68,34 @@ function RoomDescriptionPage(props) { includeSafeAreaPaddingBottom={false} testID={RoomDescriptionPage.displayName} > - + Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(props.report.reportID))} + title={translate('reportDescriptionPage.roomDescription')} + onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(report.reportID))} /> - {props.translate('reportDescriptionPage.explainerText')} + {translate('reportDescriptionPage.explainerText')} { + ref={(el: BaseTextInputRef | null): void => { if (!el) { return; } reportDescriptionInputRef.current = el; - updateMultilineInputRange(reportDescriptionInputRef.current); + updateMultilineInputRange(el); }} value={description} onChangeText={handleReportDescriptionChange} @@ -124,15 +110,5 @@ function RoomDescriptionPage(props) { } RoomDescriptionPage.displayName = 'RoomDescriptionPage'; -RoomDescriptionPage.propTypes = propTypes; -RoomDescriptionPage.defaultProps = defaultProps; -export default compose( - withLocalize, - withReportOrNotFound(), - withOnyx({ - policy: { - key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report.policyID}`, - }, - }), -)(RoomDescriptionPage); +export default withReportOrNotFound()(RoomDescriptionPage); diff --git a/src/pages/home/report/withReportOrNotFound.tsx b/src/pages/home/report/withReportOrNotFound.tsx index 7613bafeacdc..8476482f8067 100644 --- a/src/pages/home/report/withReportOrNotFound.tsx +++ b/src/pages/home/report/withReportOrNotFound.tsx @@ -23,7 +23,11 @@ type OnyxProps = { }; type ComponentProps = OnyxProps & { + /** Route params */ route: RouteProp<{params: {reportID: string}}>; + + /** The report currently being looked at */ + report: OnyxTypes.Report; }; export default function ( From 7c313591e39c9f45a340da91f751d5f6b919a82f Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 26 Jan 2024 12:09:53 +0530 Subject: [PATCH 14/49] Fix TS --- ...ptionPage.js => ReportDescriptionPage.tsx} | 22 +++++++++---------- src/pages/RoomDescriptionPage.tsx | 3 +-- .../home/report/ReportActionItemCreated.tsx | 3 ++- 3 files changed, 13 insertions(+), 15 deletions(-) rename src/pages/{ReportDescriptionPage.js => ReportDescriptionPage.tsx} (64%) diff --git a/src/pages/ReportDescriptionPage.js b/src/pages/ReportDescriptionPage.tsx similarity index 64% rename from src/pages/ReportDescriptionPage.js rename to src/pages/ReportDescriptionPage.tsx index 9b9680e1e81d..3ccabf30c1b7 100644 --- a/src/pages/ReportDescriptionPage.js +++ b/src/pages/ReportDescriptionPage.tsx @@ -1,25 +1,24 @@ -import PropTypes from 'prop-types'; +import type {RouteProp} from '@react-navigation/native'; import React from 'react'; +import type {OnyxCollection} from 'react-native-onyx'; import * as ReportUtils from '@libs/ReportUtils'; +import type * as OnyxTypes from '@src/types/onyx'; import withReportOrNotFound from './home/report/withReportOrNotFound'; -import reportPropTypes from './reportPropTypes'; import RoomDescriptionPage from './RoomDescriptionPage'; import TaskDescriptionPage from './tasks/TaskDescriptionPage'; -const propTypes = { +type ReportDescriptionPageProps = { /** The report currently being looked at */ - report: reportPropTypes.isRequired, + report: OnyxTypes.Report; + + /** Policy for the current report */ + policies: OnyxCollection; /** Route params */ - route: PropTypes.shape({ - params: PropTypes.shape({ - /** Report ID passed via route r/:reportID/roomDescription */ - reportID: PropTypes.string, - }), - }).isRequired, + route: RouteProp<{params: {reportID: string}}>; }; -function ReportDescriptionPage(props) { +function ReportDescriptionPage(props: ReportDescriptionPageProps) { const isTask = ReportUtils.isTaskReport(props.report); if (isTask) { @@ -32,6 +31,5 @@ function ReportDescriptionPage(props) { } ReportDescriptionPage.displayName = 'ReportDescriptionPage'; -ReportDescriptionPage.propTypes = propTypes; export default withReportOrNotFound()(ReportDescriptionPage); diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index 22864334777c..57d5302939ed 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -21,7 +21,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx'; -import withReportOrNotFound from './home/report/withReportOrNotFound'; type RoomDescriptionPageProps = { /** Policy for the current report */ @@ -111,4 +110,4 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { RoomDescriptionPage.displayName = 'RoomDescriptionPage'; -export default withReportOrNotFound()(RoomDescriptionPage); +export default RoomDescriptionPage; diff --git a/src/pages/home/report/ReportActionItemCreated.tsx b/src/pages/home/report/ReportActionItemCreated.tsx index 82c6bebd9ba1..48ded284f7df 100644 --- a/src/pages/home/report/ReportActionItemCreated.tsx +++ b/src/pages/home/report/ReportActionItemCreated.tsx @@ -115,6 +115,7 @@ export default withOnyx Date: Fri, 26 Jan 2024 21:16:57 +0530 Subject: [PATCH 15/49] Pressable redirect --- src/components/ReportWelcomeText.tsx | 10 +++++++++- src/pages/home/HeaderView.js | 20 +++++++++++++++----- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 2a8d70e81830..0de290db768f 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -12,6 +12,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type {PersonalDetailsList, Policy, Report} from '@src/types/onyx'; +import {PressableWithoutFeedback} from './Pressable'; import RenderHTML from './RenderHTML'; import Text from './Text'; import UserDetailsTooltip from './UserDetailsTooltip'; @@ -71,7 +72,14 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP {isChatRoom && ( <> {report?.description ? ( - + { + Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(report.reportID)); + }} + accessibilityLabel={translate('reportDescriptionPage.roomDescription')} + > + + ) : ( <> {roomWelcomeMessage.phrase1} diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 44a1c5f9f9a3..de2e7d5b3ceb 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -26,6 +26,7 @@ import useThemeStyles from '@hooks/useThemeStyles'; import useWindowDimensions from '@hooks/useWindowDimensions'; import {getGroupChatName} from '@libs/GroupChatUtils'; import * as HeaderUtils from '@libs/HeaderUtils'; +import Navigation from '@libs/Navigation/Navigation'; import reportWithoutHasDraftSelector from '@libs/OnyxSelectors/reportWithoutHasDraftSelector'; import * as OptionsListUtils from '@libs/OptionsListUtils'; import * as ReportActionsUtils from '@libs/ReportActionsUtils'; @@ -37,6 +38,7 @@ import * as Session from '@userActions/Session'; import * as Task from '@userActions/Task'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; +import ROUTES from '@src/ROUTES'; const propTypes = { /** Toggles the navigationMenu open and closed */ @@ -317,12 +319,20 @@ function HeaderView(props) { )} {!_.isEmpty(reportDescription) && _.isEmpty(parentNavigationSubtitleData) && ( - { + Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.reportID)); + }} + style={[styles.alignSelfStart, styles.mw100]} + accessibilityLabel={translate('reportDescriptionPage.roomDescription')} > - {reportDescription} - + + {reportDescription} + + )} {brickRoadIndicator === CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR && ( From 300a161fbdfe521a5f804d129e3df9f114ff8882 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 26 Jan 2024 21:26:28 +0530 Subject: [PATCH 16/49] Fix --- src/libs/ReportUtils.ts | 2 +- src/pages/RoomDescriptionPage.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index bca7cbe4e445..1cd3e04c7cda 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4507,7 +4507,7 @@ function getRoom(type: ValueOf, policyID: string) /** * We only want policy owners and admins to be able to modify the report description, but not in thread chat. */ -function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry | undefined | null): boolean { +function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry | undefined): boolean { return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && !isEmpty(policy); } /** diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index 57d5302939ed..c9615be6d77e 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -70,7 +70,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { Navigation.goBack(ROUTES.REPORT_SETTINGS.getRoute(report.reportID))} + onBackButtonPress={() => Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID))} /> Date: Fri, 26 Jan 2024 21:43:41 +0530 Subject: [PATCH 17/49] Make permission changes --- src/components/ReportWelcomeText.tsx | 6 +++++- src/libs/ReportUtils.ts | 9 ++++++++- src/pages/home/HeaderView.js | 6 +++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 0de290db768f..5151639ce1be 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -74,7 +74,11 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP {report?.description ? ( { - Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(report.reportID)); + if (ReportUtils.canEditReportDescription(report, policy)) { + Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(report.reportID)); + return; + } + Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID)); }} accessibilityLabel={translate('reportDescriptionPage.roomDescription')} > diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 1cd3e04c7cda..1a5c2e8ee436 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4508,7 +4508,14 @@ function getRoom(type: ValueOf, policyID: string) * We only want policy owners and admins to be able to modify the report description, but not in thread chat. */ function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry | undefined): boolean { - return !isMoneyRequestReport(report) && !isArchivedRoom(report) && isChatRoom(report) && !isChatThread(report) && !isEmpty(policy); + return ( + !isMoneyRequestReport(report) && + !isArchivedRoom(report) && + isChatRoom(report) && + !isChatThread(report) && + !isEmpty(policy) && + getVisibleMemberIDs(report).includes(currentUserAccountID ?? 0) + ); } /** * Checks if report action has error when smart scanning diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index de2e7d5b3ceb..6efd71e0b683 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -321,7 +321,11 @@ function HeaderView(props) { {!_.isEmpty(reportDescription) && _.isEmpty(parentNavigationSubtitleData) && ( { - Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.reportID)); + if (ReportUtils.canEditReportDescription(props.report, props.policy)) { + Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.reportID)); + return; + } + Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.reportID)); }} style={[styles.alignSelfStart, styles.mw100]} accessibilityLabel={translate('reportDescriptionPage.roomDescription')} From 1dd6943016b8eec1f5f9d07ae34b9dbc28a0475b Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 30 Jan 2024 18:31:04 +0530 Subject: [PATCH 18/49] Fix conflict --- src/libs/API/parameters/AddWorkspaceRoomParams.ts | 2 +- src/libs/API/parameters/UpdateRoomDescriptionParams.ts | 6 ++++++ src/libs/API/parameters/UpdateWelcomeMessageParams.ts | 6 ------ src/libs/API/parameters/index.ts | 2 +- src/libs/API/types.ts | 4 ++-- src/libs/actions/Report.ts | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 src/libs/API/parameters/UpdateRoomDescriptionParams.ts delete mode 100644 src/libs/API/parameters/UpdateWelcomeMessageParams.ts diff --git a/src/libs/API/parameters/AddWorkspaceRoomParams.ts b/src/libs/API/parameters/AddWorkspaceRoomParams.ts index f7cbff9565ef..847324586cb5 100644 --- a/src/libs/API/parameters/AddWorkspaceRoomParams.ts +++ b/src/libs/API/parameters/AddWorkspaceRoomParams.ts @@ -9,7 +9,7 @@ type AddWorkspaceRoomParams = { reportName?: string; visibility?: ValueOf; writeCapability?: WriteCapability; - welcomeMessage?: string; + description?: string; }; export default AddWorkspaceRoomParams; diff --git a/src/libs/API/parameters/UpdateRoomDescriptionParams.ts b/src/libs/API/parameters/UpdateRoomDescriptionParams.ts new file mode 100644 index 000000000000..4d78d07a9189 --- /dev/null +++ b/src/libs/API/parameters/UpdateRoomDescriptionParams.ts @@ -0,0 +1,6 @@ +type UpdateRoomDescriptionParams = { + reportID: string; + description: string; +}; + +export default UpdateRoomDescriptionParams; diff --git a/src/libs/API/parameters/UpdateWelcomeMessageParams.ts b/src/libs/API/parameters/UpdateWelcomeMessageParams.ts deleted file mode 100644 index a2d3b59fe3fa..000000000000 --- a/src/libs/API/parameters/UpdateWelcomeMessageParams.ts +++ /dev/null @@ -1,6 +0,0 @@ -type UpdateWelcomeMessageParams = { - reportID: string; - welcomeMessage: string; -}; - -export default UpdateWelcomeMessageParams; diff --git a/src/libs/API/parameters/index.ts b/src/libs/API/parameters/index.ts index 039398c0fbf6..58b1e4fa9d3c 100644 --- a/src/libs/API/parameters/index.ts +++ b/src/libs/API/parameters/index.ts @@ -83,7 +83,7 @@ export type {default as TogglePinnedChatParams} from './TogglePinnedChatParams'; export type {default as DeleteCommentParams} from './DeleteCommentParams'; export type {default as UpdateCommentParams} from './UpdateCommentParams'; export type {default as UpdateReportNotificationPreferenceParams} from './UpdateReportNotificationPreferenceParams'; -export type {default as UpdateWelcomeMessageParams} from './UpdateWelcomeMessageParams'; +export type {default as UpdateRoomDescriptionParams} from './UpdateRoomDescriptionParams'; export type {default as UpdateReportWriteCapabilityParams} from './UpdateReportWriteCapabilityParams'; export type {default as AddWorkspaceRoomParams} from './AddWorkspaceRoomParams'; export type {default as UpdatePolicyRoomNameParams} from './UpdatePolicyRoomNameParams'; diff --git a/src/libs/API/types.ts b/src/libs/API/types.ts index f58ebc30b4a2..203bac4eecc6 100644 --- a/src/libs/API/types.ts +++ b/src/libs/API/types.ts @@ -84,7 +84,7 @@ const WRITE_COMMANDS = { DELETE_COMMENT: 'DeleteComment', UPDATE_COMMENT: 'UpdateComment', UPDATE_REPORT_NOTIFICATION_PREFERENCE: 'UpdateReportNotificationPreference', - UPDATE_WELCOME_MESSAGE: 'UpdateWelcomeMessage', + UPDATE_ROOM_DESCRIPTION: 'UpdateRoomDescription', UPDATE_REPORT_WRITE_CAPABILITY: 'UpdateReportWriteCapability', ADD_WORKSPACE_ROOM: 'AddWorkspaceRoom', UPDATE_POLICY_ROOM_NAME: 'UpdatePolicyRoomName', @@ -192,7 +192,7 @@ type WriteCommandParameters = { [WRITE_COMMANDS.DELETE_COMMENT]: Parameters.DeleteCommentParams; [WRITE_COMMANDS.UPDATE_COMMENT]: Parameters.UpdateCommentParams; [WRITE_COMMANDS.UPDATE_REPORT_NOTIFICATION_PREFERENCE]: Parameters.UpdateReportNotificationPreferenceParams; - [WRITE_COMMANDS.UPDATE_WELCOME_MESSAGE]: Parameters.UpdateWelcomeMessageParams; + [WRITE_COMMANDS.UPDATE_ROOM_DESCRIPTION]: Parameters.UpdateRoomDescriptionParams; [WRITE_COMMANDS.UPDATE_REPORT_WRITE_CAPABILITY]: Parameters.UpdateReportWriteCapabilityParams; [WRITE_COMMANDS.ADD_WORKSPACE_ROOM]: Parameters.AddWorkspaceRoomParams; [WRITE_COMMANDS.UPDATE_POLICY_ROOM_NAME]: Parameters.UpdatePolicyRoomNameParams; diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index 40644276722a..dd8d6f4ed186 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -38,7 +38,7 @@ import type { UpdateReportNotificationPreferenceParams, UpdateReportPrivateNoteParams, UpdateReportWriteCapabilityParams, - UpdateWelcomeMessageParams, + UpdateRoomDescriptionParams, } from '@libs/API/parameters'; import {READ_COMMANDS, SIDE_EFFECT_REQUEST_COMMANDS, WRITE_COMMANDS} from '@libs/API/types'; import * as CollectionUtils from '@libs/CollectionUtils'; @@ -1486,9 +1486,9 @@ function updateDescription(reportID: string, previousValue: string, newValue: st }, ]; - const parameters: UpdateWelcomeMessageParams = {reportID, description: parsedDescription}; + const parameters: UpdateRoomDescriptionParams = {reportID, description: parsedDescription}; - API.write(WRITE_COMMANDS.UPDATE_WELCOME_MESSAGE, parameters, {optimisticData, failureData}); + API.write(WRITE_COMMANDS.UPDATE_ROOM_DESCRIPTION, parameters, {optimisticData, failureData}); Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID)); } From 7fa751411ff362974c35cd4e48b6116729e8c627 Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 30 Jan 2024 21:55:46 +0530 Subject: [PATCH 19/49] Limit characters to 1024 --- src/CONST.ts | 4 ++++ src/pages/RoomDescriptionPage.tsx | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/CONST.ts b/src/CONST.ts index 02b8717d9644..cfab40253380 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -99,6 +99,10 @@ const CONST = { MAX_LENGTH: 40, }, + REPORT_DESCRIPTION: { + MAX_LENGTH: 1024, + }, + PULL_REQUEST_NUMBER, MERCHANT_NAME_MAX_LENGTH: 255, diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index c9615be6d77e..ac56076c809d 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -6,6 +6,7 @@ import type {OnyxCollection} 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 ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; @@ -21,6 +22,7 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx'; +import type {Errors} from '@src/types/onyx/OnyxCommon'; type RoomDescriptionPageProps = { /** Policy for the current report */ @@ -61,6 +63,14 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { }, []), ); + const limitCharacters = (values: OnyxFormValuesFields) => { + const errors: Errors = {}; + if (String(values.reportDescription).length > CONST.REPORT_DESCRIPTION.MAX_LENGTH) { + errors['reportDescription'] = translate('common.error.characterLimit', {limit: CONST.REPORT_DESCRIPTION.MAX_LENGTH}); + } + return errors; + }; + return ( {translate('reportDescriptionPage.explainerText')} From 2efe2db14d72427c7d594843b434ae3f6f23b0d5 Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 30 Jan 2024 22:02:41 +0530 Subject: [PATCH 20/49] Fix lint --- src/pages/RoomDescriptionPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index ac56076c809d..969d19f58a67 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -66,7 +66,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { const limitCharacters = (values: OnyxFormValuesFields) => { const errors: Errors = {}; if (String(values.reportDescription).length > CONST.REPORT_DESCRIPTION.MAX_LENGTH) { - errors['reportDescription'] = translate('common.error.characterLimit', {limit: CONST.REPORT_DESCRIPTION.MAX_LENGTH}); + errors.reportDescription = translate('common.error.characterLimit', {limit: CONST.REPORT_DESCRIPTION.MAX_LENGTH}); } return errors; }; From 71dda56c541df3b029175f7d9644826f318b2e34 Mon Sep 17 00:00:00 2001 From: someone-here Date: Tue, 30 Jan 2024 23:23:03 +0530 Subject: [PATCH 21/49] Improvement of header for small screens --- .../DisplayNames/DisplayNamesWithTooltip.tsx | 3 +- .../DisplayNamesWithoutTooltip.tsx | 7 +++- src/components/DisplayNames/index.tsx | 4 +- src/components/DisplayNames/types.ts | 4 ++ src/pages/home/HeaderView.js | 40 +++++++------------ 5 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/components/DisplayNames/DisplayNamesWithTooltip.tsx b/src/components/DisplayNames/DisplayNamesWithTooltip.tsx index ce0ae7ddcf4f..77396b4d8999 100644 --- a/src/components/DisplayNames/DisplayNamesWithTooltip.tsx +++ b/src/components/DisplayNames/DisplayNamesWithTooltip.tsx @@ -11,7 +11,7 @@ import type DisplayNamesProps from './types'; type HTMLElementWithText = HTMLElement & RNText; -function DisplayNamesWithToolTip({shouldUseFullTitle, fullTitle, displayNamesWithTooltips, textStyles = [], numberOfLines = 1}: DisplayNamesProps) { +function DisplayNamesWithToolTip({shouldUseFullTitle, fullTitle, displayNamesWithTooltips, textStyles = [], numberOfLines = 1, AdditionalComponent}: DisplayNamesProps) { const styles = useThemeStyles(); const containerRef = useRef(null); const childRefs = useRef([]); @@ -72,6 +72,7 @@ function DisplayNamesWithToolTip({shouldUseFullTitle, fullTitle, displayNamesWit {index < displayNamesWithTooltips.length - 1 && } ))} + {AdditionalComponent && } {Boolean(isEllipsisActive) && ( diff --git a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx index 177bdb6a9fc4..e3a2dc503666 100644 --- a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx +++ b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx @@ -1,4 +1,5 @@ import React from 'react'; +import type {ComponentType} from 'react'; import type {StyleProp, TextStyle} from 'react-native'; import Text from '@components/Text'; import useThemeStyles from '@hooks/useThemeStyles'; @@ -12,9 +13,12 @@ type DisplayNamesWithoutTooltipProps = { /** Number of lines before wrapping */ numberOfLines?: number; + + /** Additional component to render after the text */ + AdditionalComponent?: ComponentType; }; -function DisplayNamesWithoutTooltip({textStyles = [], numberOfLines = 1, fullTitle = ''}: DisplayNamesWithoutTooltipProps) { +function DisplayNamesWithoutTooltip({textStyles = [], numberOfLines = 1, fullTitle = '', AdditionalComponent}: DisplayNamesWithoutTooltipProps) { const styles = useThemeStyles(); return ( {fullTitle} + {AdditionalComponent && } ); } diff --git a/src/components/DisplayNames/index.tsx b/src/components/DisplayNames/index.tsx index 155193368cc5..73439ea02396 100644 --- a/src/components/DisplayNames/index.tsx +++ b/src/components/DisplayNames/index.tsx @@ -4,7 +4,7 @@ import DisplayNamesWithoutTooltip from './DisplayNamesWithoutTooltip'; import DisplayNamesWithToolTip from './DisplayNamesWithTooltip'; import type DisplayNamesProps from './types'; -function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips}: DisplayNamesProps) { +function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips, AdditionalComponent}: DisplayNamesProps) { const {translate} = useLocalize(); const title = fullTitle || translate('common.hidden'); @@ -14,6 +14,7 @@ function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, sho textStyles={textStyles} numberOfLines={numberOfLines} fullTitle={title} + AdditionalComponent={AdditionalComponent} /> ); } @@ -25,6 +26,7 @@ function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, sho displayNamesWithTooltips={displayNamesWithTooltips} textStyles={textStyles} numberOfLines={numberOfLines} + AdditionalComponent={AdditionalComponent} /> ); } diff --git a/src/components/DisplayNames/types.ts b/src/components/DisplayNames/types.ts index 2e6f36d5cc07..26bd263bdbd8 100644 --- a/src/components/DisplayNames/types.ts +++ b/src/components/DisplayNames/types.ts @@ -1,3 +1,4 @@ +import type {ComponentType} from 'react'; import type {StyleProp, TextStyle} from 'react-native'; import type {AvatarSource} from '@libs/UserUtils'; @@ -39,6 +40,9 @@ type DisplayNamesProps = { /** If the full title needs to be displayed */ shouldUseFullTitle?: boolean; + + /** Additional component to display after the display names */ + AdditionalComponent?: ComponentType; }; export default DisplayNamesProps; diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 611eab5375bd..bc7ec0abc19d 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -278,33 +278,23 @@ function HeaderView(props) { /> )} - - - {!_.isEmpty(policyName) && - !_.isEmpty(reportDescription) && ( // code for the policyName display + + !_.isEmpty(policyName) && + !_.isEmpty(reportDescription) && ( <> - - {translate('threads.in')} - - - {policyName} - + {translate('threads.in')} + {policyName} - )} - + ) + } + /> {!_.isEmpty(parentNavigationSubtitleData) && ( Date: Tue, 30 Jan 2024 23:33:22 +0530 Subject: [PATCH 22/49] Add offline pattern --- src/libs/actions/Report.ts | 13 ++++++++++--- src/pages/ReportDetailsPage.js | 19 +++++++++++-------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index dd8d6f4ed186..ccc4c6ebc065 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -1475,20 +1475,27 @@ function updateDescription(reportID: string, previousValue: string, newValue: st { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: {description: parsedDescription}, + value: {description: parsedDescription, pendingFields: {description: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE}}, }, ]; const failureData: OnyxUpdate[] = [ { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: {description: previousValue}, + value: {description: previousValue, pendingFields: {description: null}}, + }, + ]; + const successData: OnyxUpdate[] = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: {pendingFields: {description: null}}, }, ]; const parameters: UpdateRoomDescriptionParams = {reportID, description: parsedDescription}; - API.write(WRITE_COMMANDS.UPDATE_ROOM_DESCRIPTION, parameters, {optimisticData, failureData}); + API.write(WRITE_COMMANDS.UPDATE_ROOM_DESCRIPTION, parameters, {optimisticData, failureData, successData}); Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(reportID)); } diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 55ab85e8c3e5..effc51a9a2ec 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -10,6 +10,7 @@ import * as Expensicons from '@components/Icon/Expensicons'; import MenuItem from '@components/MenuItem'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import MultipleAvatars from '@components/MultipleAvatars'; +import OfflineWithFeedback from '@components/OfflineWithFeedback'; import {withNetwork} from '@components/OnyxProvider'; import ParentNavigationSubtitle from '@components/ParentNavigationSubtitle'; import participantPropTypes from '@components/participantPropTypes'; @@ -242,14 +243,16 @@ function ReportDetailsPage(props) { {shouldShowReportDescription && ( - Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} - /> + + Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} + /> + )} {_.map(menuItems, (item) => { const brickRoadIndicator = From c2ad5db8ab4eeff30cb0569d68dd905138ad0864 Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 17:25:21 +0530 Subject: [PATCH 23/49] Fix new task description --- src/libs/Navigation/linkingConfig.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/Navigation/linkingConfig.ts b/src/libs/Navigation/linkingConfig.ts index d6e0aeabf5d6..df0ee800ec38 100644 --- a/src/libs/Navigation/linkingConfig.ts +++ b/src/libs/Navigation/linkingConfig.ts @@ -337,6 +337,7 @@ const linkingConfig: LinkingOptions = { [SCREENS.NEW_TASK.TASK_SHARE_DESTINATION_SELECTOR]: ROUTES.NEW_TASK_SHARE_DESTINATION, [SCREENS.NEW_TASK.DETAILS]: ROUTES.NEW_TASK_DETAILS, [SCREENS.NEW_TASK.TITLE]: ROUTES.NEW_TASK_TITLE, + [SCREENS.NEW_TASK.DESCRIPTION]: ROUTES.NEW_TASK_DESCRIPTION, }, }, [SCREENS.RIGHT_MODAL.TEACHERS_UNITE]: { From 52db819f43e7e1ecc5eda1a574d9d52d7ae20849 Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 17:29:54 +0530 Subject: [PATCH 24/49] hide description menuItem for tasks --- src/pages/ReportDetailsPage.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index effc51a9a2ec..6db4cf4cf3b7 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -68,11 +68,12 @@ function ReportDetailsPage(props) { const shouldUseFullTitle = useMemo(() => ReportUtils.shouldUseFullTitleToDisplay(props.report), [props.report]); const isChatRoom = useMemo(() => ReportUtils.isChatRoom(props.report), [props.report]); const isThread = useMemo(() => ReportUtils.isChatThread(props.report), [props.report]); + const isTask = useMemo(() => ReportUtils.isTaskReport(props.report), [props.report]); const isUserCreatedPolicyRoom = useMemo(() => ReportUtils.isUserCreatedPolicyRoom(props.report), [props.report]); const isArchivedRoom = useMemo(() => ReportUtils.isArchivedRoom(props.report), [props.report]); const isMoneyRequestReport = useMemo(() => ReportUtils.isMoneyRequestReport(props.report), [props.report]); const canEditReportDescription = useMemo(() => ReportUtils.canEditReportDescription(props.report, policy), [props.report, policy]); - const shouldShowReportDescription = canEditReportDescription || !_.isEmpty(props.report.description); + const shouldShowReportDescription = !isTask && (canEditReportDescription || !_.isEmpty(props.report.description)); // eslint-disable-next-line react-hooks/exhaustive-deps -- policy is a dependency because `getChatRoomSubtitle` calls `getPolicyName` which in turn retrieves the value from the `policy` value stored in Onyx const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy]); From 0dffd611153236052abf098521b8bc8c0c344f98 Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 17:47:18 +0530 Subject: [PATCH 25/49] rename AdditionalComponent -> renderAdditionalText --- .../DisplayNames/DisplayNamesWithTooltip.tsx | 4 ++-- .../DisplayNamesWithoutTooltip.tsx | 8 +++---- src/components/DisplayNames/index.tsx | 6 ++--- src/components/DisplayNames/types.ts | 4 ++-- src/pages/home/HeaderView.js | 22 +++++++++++-------- 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/components/DisplayNames/DisplayNamesWithTooltip.tsx b/src/components/DisplayNames/DisplayNamesWithTooltip.tsx index 77396b4d8999..6efb256123a4 100644 --- a/src/components/DisplayNames/DisplayNamesWithTooltip.tsx +++ b/src/components/DisplayNames/DisplayNamesWithTooltip.tsx @@ -11,7 +11,7 @@ import type DisplayNamesProps from './types'; type HTMLElementWithText = HTMLElement & RNText; -function DisplayNamesWithToolTip({shouldUseFullTitle, fullTitle, displayNamesWithTooltips, textStyles = [], numberOfLines = 1, AdditionalComponent}: DisplayNamesProps) { +function DisplayNamesWithToolTip({shouldUseFullTitle, fullTitle, displayNamesWithTooltips, textStyles = [], numberOfLines = 1, renderAdditionalText}: DisplayNamesProps) { const styles = useThemeStyles(); const containerRef = useRef(null); const childRefs = useRef([]); @@ -72,7 +72,7 @@ function DisplayNamesWithToolTip({shouldUseFullTitle, fullTitle, displayNamesWit {index < displayNamesWithTooltips.length - 1 && } ))} - {AdditionalComponent && } + {renderAdditionalText?.()} {Boolean(isEllipsisActive) && ( diff --git a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx index e3a2dc503666..a636df025523 100644 --- a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx +++ b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx @@ -14,11 +14,11 @@ type DisplayNamesWithoutTooltipProps = { /** Number of lines before wrapping */ numberOfLines?: number; - /** Additional component to render after the text */ - AdditionalComponent?: ComponentType; + /** Additional Text component to render after the displayNames */ + renderAdditionalText?: () => React.ReactNode; }; -function DisplayNamesWithoutTooltip({textStyles = [], numberOfLines = 1, fullTitle = '', AdditionalComponent}: DisplayNamesWithoutTooltipProps) { +function DisplayNamesWithoutTooltip({textStyles = [], numberOfLines = 1, fullTitle = '', renderAdditionalText}: DisplayNamesWithoutTooltipProps) { const styles = useThemeStyles(); return ( {fullTitle} - {AdditionalComponent && } + {renderAdditionalText?.()} ); } diff --git a/src/components/DisplayNames/index.tsx b/src/components/DisplayNames/index.tsx index 73439ea02396..e85e068976f9 100644 --- a/src/components/DisplayNames/index.tsx +++ b/src/components/DisplayNames/index.tsx @@ -4,7 +4,7 @@ import DisplayNamesWithoutTooltip from './DisplayNamesWithoutTooltip'; import DisplayNamesWithToolTip from './DisplayNamesWithTooltip'; import type DisplayNamesProps from './types'; -function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips, AdditionalComponent}: DisplayNamesProps) { +function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, shouldUseFullTitle, displayNamesWithTooltips, renderAdditionalText}: DisplayNamesProps) { const {translate} = useLocalize(); const title = fullTitle || translate('common.hidden'); @@ -14,7 +14,7 @@ function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, sho textStyles={textStyles} numberOfLines={numberOfLines} fullTitle={title} - AdditionalComponent={AdditionalComponent} + renderAdditionalText={renderAdditionalText} /> ); } @@ -26,7 +26,7 @@ function DisplayNames({fullTitle, tooltipEnabled, textStyles, numberOfLines, sho displayNamesWithTooltips={displayNamesWithTooltips} textStyles={textStyles} numberOfLines={numberOfLines} - AdditionalComponent={AdditionalComponent} + renderAdditionalText={renderAdditionalText} /> ); } diff --git a/src/components/DisplayNames/types.ts b/src/components/DisplayNames/types.ts index 26bd263bdbd8..69be2f01a530 100644 --- a/src/components/DisplayNames/types.ts +++ b/src/components/DisplayNames/types.ts @@ -41,8 +41,8 @@ type DisplayNamesProps = { /** If the full title needs to be displayed */ shouldUseFullTitle?: boolean; - /** Additional component to display after the display names */ - AdditionalComponent?: ComponentType; + /** Additional Text component to render after the displayNames */ + renderAdditionalText?: () => React.ReactNode; }; export default DisplayNamesProps; diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index bc7ec0abc19d..56839abb3e14 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -187,6 +187,18 @@ function HeaderView(props) { /> ); + const renderAdditionalText = () => { + if (_.isEmpty(policyName) || _.isEmpty(reportDescription)) { + return null; + } + return ( + <> + {translate('threads.in')} + {policyName} + + ); + }; + threeDotMenuItems.push(HeaderUtils.getPinMenuItem(props.report)); if (isConcierge && props.guideCalendarLink) { @@ -285,15 +297,7 @@ function HeaderView(props) { numberOfLines={1} textStyles={[styles.headerText, styles.pre]} shouldUseFullTitle={isChatRoom || isPolicyExpenseChat || isChatThread || isTaskReport} - AdditionalComponent={() => - !_.isEmpty(policyName) && - !_.isEmpty(reportDescription) && ( - <> - {translate('threads.in')} - {policyName} - - ) - } + renderAdditionalText={renderAdditionalText} /> {!_.isEmpty(parentNavigationSubtitleData) && ( Date: Wed, 31 Jan 2024 17:48:37 +0530 Subject: [PATCH 26/49] Fix lint --- src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx | 1 - src/components/DisplayNames/types.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx index a636df025523..c66d1698bbd6 100644 --- a/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx +++ b/src/components/DisplayNames/DisplayNamesWithoutTooltip.tsx @@ -1,5 +1,4 @@ import React from 'react'; -import type {ComponentType} from 'react'; import type {StyleProp, TextStyle} from 'react-native'; import Text from '@components/Text'; import useThemeStyles from '@hooks/useThemeStyles'; diff --git a/src/components/DisplayNames/types.ts b/src/components/DisplayNames/types.ts index 69be2f01a530..d76c8b671975 100644 --- a/src/components/DisplayNames/types.ts +++ b/src/components/DisplayNames/types.ts @@ -1,4 +1,3 @@ -import type {ComponentType} from 'react'; import type {StyleProp, TextStyle} from 'react-native'; import type {AvatarSource} from '@libs/UserUtils'; From d4f9e1ec591b9ee4ab68bc9caf29643fcbb00eee Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 18:10:32 +0530 Subject: [PATCH 27/49] Fix header --- src/pages/home/HeaderView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 56839abb3e14..ab7021542f14 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -188,7 +188,7 @@ function HeaderView(props) { ); const renderAdditionalText = () => { - if (_.isEmpty(policyName) || _.isEmpty(reportDescription)) { + if (_.isEmpty(policyName) || _.isEmpty(reportDescription) || !_.isEmpty(parentNavigationSubtitleData)) { return null; } return ( From 2a7f09799678ba6f9d6f7b4b54011bfb64e8b856 Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 18:31:09 +0530 Subject: [PATCH 28/49] Make in lowercase --- src/languages/en.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 73be93af5a93..e8fdd4689b31 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -1950,7 +1950,7 @@ export default { replies: 'Replies', reply: 'Reply', from: 'From', - in: 'In', + in: 'in', parentNavigationSummary: ({rootReportName, workspaceName}: ParentNavigationSummaryParams) => `From ${rootReportName}${workspaceName ? ` in ${workspaceName}` : ''}`, }, qrCodes: { From c614c34627680953444272448282666fdaacd23d Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 19:05:46 +0530 Subject: [PATCH 29/49] Fixed 'in' bold issue --- src/components/MenuItem.tsx | 2 +- src/pages/home/HeaderView.js | 2 +- src/styles/index.ts | 4 ++++ src/styles/utils/FontUtils/index.ts | 1 + 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index e53c7915da8a..23ce3017522a 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -378,7 +378,7 @@ function MenuItem( {(isHovered) => ( shouldBlockSelection && isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} onPressOut={ControlSelection.unblock} onSecondaryInteraction={onSecondaryInteraction} diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index ab7021542f14..90b12b9ff969 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -193,7 +193,7 @@ function HeaderView(props) { } return ( <> - {translate('threads.in')} + {translate('threads.in')} {policyName} ); diff --git a/src/styles/index.ts b/src/styles/index.ts index d52e876d2e8e..6bc80e847626 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -415,6 +415,10 @@ const styles = (theme: ThemeColors) => fontWeight: FontUtils.fontWeight.bold, }, + fontWeightNormal: { + fontWeight: FontUtils.fontWeight.normal, + }, + textHeadline: { ...headlineFont, ...whiteSpace.preWrap, diff --git a/src/styles/utils/FontUtils/index.ts b/src/styles/utils/FontUtils/index.ts index ac07fdbf026e..b93655fdf63d 100644 --- a/src/styles/utils/FontUtils/index.ts +++ b/src/styles/utils/FontUtils/index.ts @@ -11,6 +11,7 @@ const FontUtils = { }, fontWeight: { bold: fontWeightBold, + normal: '400', }, }; From 8e0b7dc6164fca0e42041ca283b6ffd855d9f14f Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 19:58:52 +0530 Subject: [PATCH 30/49] Change condition --- src/pages/ReportDetailsPage.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 6db4cf4cf3b7..4f880c29c2b4 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -68,12 +68,11 @@ function ReportDetailsPage(props) { const shouldUseFullTitle = useMemo(() => ReportUtils.shouldUseFullTitleToDisplay(props.report), [props.report]); const isChatRoom = useMemo(() => ReportUtils.isChatRoom(props.report), [props.report]); const isThread = useMemo(() => ReportUtils.isChatThread(props.report), [props.report]); - const isTask = useMemo(() => ReportUtils.isTaskReport(props.report), [props.report]); const isUserCreatedPolicyRoom = useMemo(() => ReportUtils.isUserCreatedPolicyRoom(props.report), [props.report]); const isArchivedRoom = useMemo(() => ReportUtils.isArchivedRoom(props.report), [props.report]); const isMoneyRequestReport = useMemo(() => ReportUtils.isMoneyRequestReport(props.report), [props.report]); const canEditReportDescription = useMemo(() => ReportUtils.canEditReportDescription(props.report, policy), [props.report, policy]); - const shouldShowReportDescription = !isTask && (canEditReportDescription || !_.isEmpty(props.report.description)); + const shouldShowReportDescription = isChatRoom && (canEditReportDescription || !_.isEmpty(props.report.description)); // eslint-disable-next-line react-hooks/exhaustive-deps -- policy is a dependency because `getChatRoomSubtitle` calls `getPolicyName` which in turn retrieves the value from the `policy` value stored in Onyx const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(props.report), [props.report, policy]); From ecbfc7255c470c22aed915923de438c7748dc77b Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 31 Jan 2024 20:49:13 +0530 Subject: [PATCH 31/49] Remove welcome message --- src/types/onyx/Form.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/Form.ts b/src/types/onyx/Form.ts index c015627bfbc2..a8c837570142 100644 --- a/src/types/onyx/Form.ts +++ b/src/types/onyx/Form.ts @@ -33,7 +33,7 @@ type DisplayNameForm = Form<{ type NewRoomForm = Form<{ roomName?: string; - welcomeMessage?: string; + reportDescription?: string; policyID?: string; writeCapability?: string; visibility?: string; From 1b811d1bb1b01f12a57b721c3b8c68990a98bbdb Mon Sep 17 00:00:00 2001 From: someone-here Date: Thu, 1 Feb 2024 14:16:25 +0530 Subject: [PATCH 32/49] Fix android --- src/components/DisplayNames/index.native.tsx | 4 +++- src/components/ReportWelcomeText.tsx | 5 +++-- src/pages/home/HeaderView.js | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/DisplayNames/index.native.tsx b/src/components/DisplayNames/index.native.tsx index b3eceb794bcb..02b18de3892f 100644 --- a/src/components/DisplayNames/index.native.tsx +++ b/src/components/DisplayNames/index.native.tsx @@ -2,9 +2,10 @@ import React from 'react'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import type DisplayNamesProps from './types'; +import {View} from 'react-native'; // As we don't have to show tooltips of the Native platform so we simply render the full display names list. -function DisplayNames({accessibilityLabel, fullTitle, textStyles = [], numberOfLines = 1}: DisplayNamesProps) { +function DisplayNames({accessibilityLabel, fullTitle, textStyles = [], numberOfLines = 1, renderAdditionalText}: DisplayNamesProps) { const {translate} = useLocalize(); return ( {fullTitle || translate('common.hidden')} + {renderAdditionalText?.()} ); } diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 5151639ce1be..21abf2742f43 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -59,7 +59,7 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP {isChatRoom ? translate('reportActionsView.welcomeToRoom', {roomName: ReportUtils.getReportName(report)}) : translate('reportActionsView.sayHello')} - + {isPolicyExpenseChat && ( <> {translate('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartOne')} @@ -80,6 +80,7 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP } Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID)); }} + style={styles.mw100} accessibilityLabel={translate('reportDescriptionPage.roomDescription')} > @@ -131,7 +132,7 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP {(moneyRequestOptions.includes(CONST.IOU.TYPE.SEND) || moneyRequestOptions.includes(CONST.IOU.TYPE.REQUEST)) && ( {translate('reportActionsView.usePlusButton', {additionalText})} )} - + ); } diff --git a/src/pages/home/HeaderView.js b/src/pages/home/HeaderView.js index 90b12b9ff969..a336ab17edeb 100644 --- a/src/pages/home/HeaderView.js +++ b/src/pages/home/HeaderView.js @@ -193,8 +193,8 @@ function HeaderView(props) { } return ( <> - {translate('threads.in')} - {policyName} + {translate('threads.in')} + {policyName} ); }; From 23d88069a3e7be1e6b94054e1b1247b1bbebc997 Mon Sep 17 00:00:00 2001 From: someone-here Date: Thu, 1 Feb 2024 15:02:48 +0530 Subject: [PATCH 33/49] Fix chat mast head text --- src/components/ReportWelcomeText.tsx | 9 ++++----- src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index 21abf2742f43..a979833001cd 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -61,13 +61,13 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP {isPolicyExpenseChat && ( - <> + {translate('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartOne')} {ReportUtils.getDisplayNameForParticipant(report?.ownerAccountID)} {translate('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartTwo')} {ReportUtils.getPolicyName(report)} {translate('reportActionsView.beginningOfChatHistoryPolicyExpenseChatPartThree')} - + )} {isChatRoom && ( <> @@ -80,13 +80,12 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP } Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID)); }} - style={styles.mw100} accessibilityLabel={translate('reportDescriptionPage.roomDescription')} > ) : ( - <> + {roomWelcomeMessage.phrase1} {roomWelcomeMessage.showReportName && ( )} {roomWelcomeMessage.phrase2 !== undefined && {roomWelcomeMessage.phrase2}} - + )} )} diff --git a/src/languages/en.ts b/src/languages/en.ts index b4bad56608d2..ed91b9776aa8 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -488,7 +488,7 @@ export default { chatWithAccountManager: 'Chat with your account manager here', sayHello: 'Say hello!', welcomeToRoom: ({roomName}: WelcomeToRoomParams) => `Welcome to ${roomName}!`, - usePlusButton: ({additionalText}: UsePlusButtonParams) => `\n\nYou can also use the + button to ${additionalText}, or assign a task!`, + usePlusButton: ({additionalText}: UsePlusButtonParams) => `\nYou can also use the + button to ${additionalText}, or assign a task!`, iouTypes: { send: 'send money', split: 'split a bill', diff --git a/src/languages/es.ts b/src/languages/es.ts index 9a4d85a1b366..1ef02df63f15 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -480,7 +480,7 @@ export default { chatWithAccountManager: 'Chatea con tu gestor de cuenta aquí', sayHello: '¡Saluda!', welcomeToRoom: ({roomName}: WelcomeToRoomParams) => `¡Bienvenido a ${roomName}!`, - usePlusButton: ({additionalText}: UsePlusButtonParams) => `\n\n¡También puedes usar el botón + de abajo para ${additionalText}, o asignar una tarea!`, + usePlusButton: ({additionalText}: UsePlusButtonParams) => `\n¡También puedes usar el botón + de abajo para ${additionalText}, o asignar una tarea!`, iouTypes: { send: 'enviar dinero', split: 'dividir una factura', From 2d8818093601520554a7ab037b884e0a713b00dd Mon Sep 17 00:00:00 2001 From: someone-here Date: Thu, 1 Feb 2024 15:04:11 +0530 Subject: [PATCH 34/49] Fix lint --- src/components/DisplayNames/index.native.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/DisplayNames/index.native.tsx b/src/components/DisplayNames/index.native.tsx index 02b18de3892f..ceee34586e8b 100644 --- a/src/components/DisplayNames/index.native.tsx +++ b/src/components/DisplayNames/index.native.tsx @@ -2,7 +2,6 @@ import React from 'react'; import Text from '@components/Text'; import useLocalize from '@hooks/useLocalize'; import type DisplayNamesProps from './types'; -import {View} from 'react-native'; // As we don't have to show tooltips of the Native platform so we simply render the full display names list. function DisplayNames({accessibilityLabel, fullTitle, textStyles = [], numberOfLines = 1, renderAdditionalText}: DisplayNamesProps) { From 901d57e28dc72200867992d7f6dc3c1c610c33df Mon Sep 17 00:00:00 2001 From: someone-here Date: Thu, 1 Feb 2024 15:35:10 +0530 Subject: [PATCH 35/49] Fix tests --- tests/ui/UnreadIndicatorsTest.js | 12 +-- tests/unit/SidebarFilterTest.js | 12 +-- tests/unit/SidebarOrderTest.js | 124 +++++++++++++++---------------- tests/unit/SidebarTest.js | 5 +- 4 files changed, 77 insertions(+), 76 deletions(-) diff --git a/tests/ui/UnreadIndicatorsTest.js b/tests/ui/UnreadIndicatorsTest.js index e4d4d877f66b..9bf5d9ef49e4 100644 --- a/tests/ui/UnreadIndicatorsTest.js +++ b/tests/ui/UnreadIndicatorsTest.js @@ -438,11 +438,11 @@ describe('Unread Indicators', () => { expect(displayNameTexts).toHaveLength(2); const firstReportOption = displayNameTexts[0]; expect(lodashGet(firstReportOption, ['props', 'style', 'fontWeight'])).toBe(FontUtils.fontWeight.bold); - expect(lodashGet(firstReportOption, ['props', 'children'])).toBe('C User'); + expect(lodashGet(firstReportOption, ['props', 'children', 0])).toBe('C User'); const secondReportOption = displayNameTexts[1]; expect(lodashGet(secondReportOption, ['props', 'style', 'fontWeight'])).toBe(FontUtils.fontWeight.bold); - expect(lodashGet(secondReportOption, ['props', 'children'])).toBe('B User'); + expect(lodashGet(secondReportOption, ['props', 'children', 0])).toBe('B User'); // Tap the new report option and navigate back to the sidebar again via the back button return navigateToSidebarOption(0); @@ -455,9 +455,9 @@ describe('Unread Indicators', () => { const displayNameTexts = screen.queryAllByLabelText(hintText); expect(displayNameTexts).toHaveLength(2); expect(lodashGet(displayNameTexts[0], ['props', 'style', 'fontWeight'])).toBe(undefined); - expect(lodashGet(displayNameTexts[0], ['props', 'children'])).toBe('C User'); + expect(lodashGet(displayNameTexts[0], ['props', 'children', 0])).toBe('C User'); expect(lodashGet(displayNameTexts[1], ['props', 'style', 'fontWeight'])).toBe(FontUtils.fontWeight.bold); - expect(lodashGet(displayNameTexts[1], ['props', 'children'])).toBe('B User'); + expect(lodashGet(displayNameTexts[1], ['props', 'children', 0])).toBe('B User'); })); xit('Manually marking a chat message as unread shows the new line indicator and updates the LHN', () => @@ -489,7 +489,7 @@ describe('Unread Indicators', () => { const displayNameTexts = screen.queryAllByLabelText(hintText); expect(displayNameTexts).toHaveLength(1); expect(lodashGet(displayNameTexts[0], ['props', 'style', 'fontWeight'])).toBe(FontUtils.fontWeight.bold); - expect(lodashGet(displayNameTexts[0], ['props', 'children'])).toBe('B User'); + expect(lodashGet(displayNameTexts[0], ['props', 'children', 0])).toBe('B User'); // Navigate to the report again and back to the sidebar return navigateToSidebarOption(0); @@ -501,7 +501,7 @@ describe('Unread Indicators', () => { const displayNameTexts = screen.queryAllByLabelText(hintText); expect(displayNameTexts).toHaveLength(1); expect(lodashGet(displayNameTexts[0], ['props', 'style', 'fontWeight'])).toBe(undefined); - expect(lodashGet(displayNameTexts[0], ['props', 'children'])).toBe('B User'); + expect(lodashGet(displayNameTexts[0], ['props', 'children', 0])).toBe('B User'); // Navigate to the report again and verify the new line indicator is missing return navigateToSidebarOption(0); diff --git a/tests/unit/SidebarFilterTest.js b/tests/unit/SidebarFilterTest.js index 0a219667c97b..2e86858baeb6 100644 --- a/tests/unit/SidebarFilterTest.js +++ b/tests/unit/SidebarFilterTest.js @@ -338,7 +338,7 @@ describe('Sidebar', () => { const navigatesToChatHintText = Localize.translateLocal('accessibilityHints.navigatesToChat'); expect(screen.queryAllByAccessibilityHint(navigatesToChatHintText)).toHaveLength(1); expect(displayNames).toHaveLength(1); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Three, Four'); } else { // Both reports visible const navigatesToChatHintText = Localize.translateLocal('accessibilityHints.navigatesToChat'); @@ -379,8 +379,8 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(2); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Three, Four'); }) // When report3 becomes unread @@ -449,8 +449,8 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(2); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); }) ); }); @@ -662,7 +662,7 @@ describe('Sidebar', () => { const navigatesToChatHintText = Localize.translateLocal('accessibilityHints.navigatesToChat'); expect(screen.queryAllByAccessibilityHint(navigatesToChatHintText)).toHaveLength(1); expect(displayNames).toHaveLength(1); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Three, Four'); } else { // Both reports visible const navigatesToChatHintText = Localize.translateLocal('accessibilityHints.navigatesToChat'); diff --git a/tests/unit/SidebarOrderTest.js b/tests/unit/SidebarOrderTest.js index ed0f210d1da6..7ae8c4e1e9b3 100644 --- a/tests/unit/SidebarOrderTest.js +++ b/tests/unit/SidebarOrderTest.js @@ -140,9 +140,9 @@ describe('Sidebar', () => { const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('One, Two'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('One, Two'); }) ); }); @@ -189,9 +189,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('One, Two'); // this has `hasDraft` flag enabled so it will be on top - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('One, Two'); // this has `hasDraft` flag enabled so it will be on top + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); }) ); }); @@ -236,9 +236,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); }) ); }); @@ -286,10 +286,10 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(4); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe(taskReportName); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [3, 'props', 'children'])).toBe('One, Two'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe(taskReportName); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [3, 'props', 'children', 0])).toBe('One, Two'); }) ); }); @@ -346,10 +346,10 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(4); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Email Two owes $100.00'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [3, 'props', 'children'])).toBe('One, Two'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Email Two owes $100.00'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [3, 'props', 'children', 0])).toBe('One, Two'); }) ); }); @@ -410,10 +410,10 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(4); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Workspace owes $100.00'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Email Five'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [3, 'props', 'children'])).toBe('One, Two'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Workspace owes $100.00'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Email Five'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [3, 'props', 'children', 0])).toBe('One, Two'); }) ); }); @@ -465,9 +465,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('One, Two'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('One, Two'); }) ); }); @@ -607,9 +607,9 @@ describe('Sidebar', () => { expect(displayNames).toHaveLength(3); expect(screen.queryAllByTestId('Pin Icon')).toHaveLength(1); expect(screen.queryAllByTestId('Pencil Icon')).toHaveLength(1); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Email Two owes $100.00'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Email Two owes $100.00'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); }) ); }); @@ -653,9 +653,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); }) // When a new report is added @@ -666,10 +666,10 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(4); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Seven, Eight'); - expect(lodashGet(displayNames, [3, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Seven, Eight'); + expect(lodashGet(displayNames, [3, 'props', 'children', 0])).toBe('Three, Four'); }) ); }); @@ -713,9 +713,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); }) // When a new report is added @@ -726,10 +726,10 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(4); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Seven, Eight'); - expect(lodashGet(displayNames, [3, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Seven, Eight'); + expect(lodashGet(displayNames, [3, 'props', 'children', 0])).toBe('Three, Four'); }) ); }); @@ -773,9 +773,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Report (archived)'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Report (archived)'); }) ); }); @@ -810,9 +810,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); }) // When a new report is added @@ -823,10 +823,10 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(4); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Seven, Eight'); - expect(lodashGet(displayNames, [3, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Seven, Eight'); + expect(lodashGet(displayNames, [3, 'props', 'children', 0])).toBe('Three, Four'); }) ); }); @@ -865,9 +865,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Three, Four'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Report (archived)'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Three, Four'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Report (archived)'); }) ); }); @@ -1000,11 +1000,11 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(5); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Email Five owes $100.00'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('Email Four owes $1,000.00'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Email Six owes $100.00'); - expect(lodashGet(displayNames, [3, 'props', 'children'])).toBe('Email Three owes $100.00'); - expect(lodashGet(displayNames, [4, 'props', 'children'])).toBe('Email Two owes $100.00'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Email Five owes $100.00'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('Email Four owes $1,000.00'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Email Six owes $100.00'); + expect(lodashGet(displayNames, [3, 'props', 'children', 0])).toBe('Email Three owes $100.00'); + expect(lodashGet(displayNames, [4, 'props', 'children', 0])).toBe('Email Two owes $100.00'); }) ); }); @@ -1050,9 +1050,9 @@ describe('Sidebar', () => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); expect(displayNames).toHaveLength(3); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Five, Six'); - expect(lodashGet(displayNames, [1, 'props', 'children'])).toBe('One, Two'); - expect(lodashGet(displayNames, [2, 'props', 'children'])).toBe('Three, Four'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Five, Six'); + expect(lodashGet(displayNames, [1, 'props', 'children', 0])).toBe('One, Two'); + expect(lodashGet(displayNames, [2, 'props', 'children', 0])).toBe('Three, Four'); }) ); }); diff --git a/tests/unit/SidebarTest.js b/tests/unit/SidebarTest.js index dba1365626ba..eb4e8f1c2b4e 100644 --- a/tests/unit/SidebarTest.js +++ b/tests/unit/SidebarTest.js @@ -83,7 +83,8 @@ describe('Sidebar', () => { .then(() => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Report (archived)'); + console.log(displayNames); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Report (archived)'); const hintMessagePreviewText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview'); const messagePreviewTexts = screen.queryAllByLabelText(hintMessagePreviewText); @@ -127,7 +128,7 @@ describe('Sidebar', () => { .then(() => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); - expect(lodashGet(displayNames, [0, 'props', 'children'])).toBe('Report (archived)'); + expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Report (archived)'); const hintMessagePreviewText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview'); const messagePreviewTexts = screen.queryAllByLabelText(hintMessagePreviewText); From fcd576303a7389f030bd2157fca75186ac6da9f2 Mon Sep 17 00:00:00 2001 From: someone-here Date: Thu, 1 Feb 2024 15:39:49 +0530 Subject: [PATCH 36/49] Fix lint --- tests/unit/SidebarTest.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/unit/SidebarTest.js b/tests/unit/SidebarTest.js index eb4e8f1c2b4e..6a813ef1fa8c 100644 --- a/tests/unit/SidebarTest.js +++ b/tests/unit/SidebarTest.js @@ -83,7 +83,6 @@ describe('Sidebar', () => { .then(() => { const hintText = Localize.translateLocal('accessibilityHints.chatUserDisplayNames'); const displayNames = screen.queryAllByLabelText(hintText); - console.log(displayNames); expect(lodashGet(displayNames, [0, 'props', 'children', 0])).toBe('Report (archived)'); const hintMessagePreviewText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview'); From 9b0250793fa22d4366b38c4899e5bdcfcdce1ce0 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 2 Feb 2024 18:34:33 +0530 Subject: [PATCH 37/49] Limit length --- src/pages/RoomDescriptionPage.tsx | 11 +---------- src/pages/workspace/WorkspaceNewRoomPage.js | 2 +- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index 969d19f58a67..e0a287df912f 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -63,14 +63,6 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { }, []), ); - const limitCharacters = (values: OnyxFormValuesFields) => { - const errors: Errors = {}; - if (String(values.reportDescription).length > CONST.REPORT_DESCRIPTION.MAX_LENGTH) { - errors.reportDescription = translate('common.error.characterLimit', {limit: CONST.REPORT_DESCRIPTION.MAX_LENGTH}); - } - return errors; - }; - return ( {translate('reportDescriptionPage.explainerText')} @@ -99,7 +90,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { accessibilityLabel={translate('reportDescriptionPage.roomDescription')} role={CONST.ROLE.PRESENTATION} autoGrowHeight - maxLength={CONST.MAX_COMMENT_LENGTH} + maxLength={CONST.REPORT_DESCRIPTION.MAX_LENGTH} ref={(el: BaseTextInputRef | null): void => { if (!el) { return; diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 56cb89899d92..32ec99320d6b 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -308,7 +308,7 @@ function WorkspaceNewRoomPage(props) { accessibilityLabel={translate('reportDescriptionPage.roomDescriptionOptional')} role={CONST.ACCESSIBILITY_ROLE.TEXT} autoGrowHeight - maxLength={CONST.MAX_COMMENT_LENGTH} + maxLength={CONST.REPORT_DESCRIPTION.MAX_LENGTH} autoCapitalize="none" containerStyles={[styles.autoGrowHeightMultilineInput]} /> From c67793ee7d39fdf25c705f099884736101512f84 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 2 Feb 2024 19:14:26 +0530 Subject: [PATCH 38/49] Fix lint --- src/pages/RoomDescriptionPage.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index e0a287df912f..7e96fc44a983 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -6,7 +6,6 @@ import type {OnyxCollection} 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 ScreenWrapper from '@components/ScreenWrapper'; import Text from '@components/Text'; @@ -22,7 +21,6 @@ import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; import type * as OnyxTypes from '@src/types/onyx'; -import type {Errors} from '@src/types/onyx/OnyxCommon'; type RoomDescriptionPageProps = { /** Policy for the current report */ From f56e6c8b8da9272069003549e47d19cdb27c26a3 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 2 Feb 2024 19:50:20 +0530 Subject: [PATCH 39/49] wrap html --- src/components/ReportWelcomeText.tsx | 1 + src/styles/index.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/components/ReportWelcomeText.tsx b/src/components/ReportWelcomeText.tsx index a979833001cd..5e39e0adb93d 100644 --- a/src/components/ReportWelcomeText.tsx +++ b/src/components/ReportWelcomeText.tsx @@ -80,6 +80,7 @@ function ReportWelcomeText({report, policy, personalDetails}: ReportWelcomeTextP } Navigation.navigate(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(report.reportID)); }} + style={styles.renderHTML} accessibilityLabel={translate('reportDescriptionPage.roomDescription')} > diff --git a/src/styles/index.ts b/src/styles/index.ts index 6bc80e847626..87d5a3665b25 100644 --- a/src/styles/index.ts +++ b/src/styles/index.ts @@ -1778,6 +1778,12 @@ const styles = (theme: ThemeColors) => ...wordBreak.breakWord, }, + renderHTML: { + maxWidth: '100%', + ...whiteSpace.preWrap, + ...wordBreak.breakWord, + }, + chatItemComposeWithFirstRow: { minHeight: 90, }, From 9e8dd6d12d746146b49c11833dc061cb9cc46599 Mon Sep 17 00:00:00 2001 From: someone-here Date: Fri, 2 Feb 2024 21:47:16 +0530 Subject: [PATCH 40/49] Fix conflicts --- src/libs/Navigation/linkingConfig/config.ts | 5 ++--- src/libs/ReportUtils.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/Navigation/linkingConfig/config.ts b/src/libs/Navigation/linkingConfig/config.ts index f1c9c316fe93..afac2bde8ad6 100644 --- a/src/libs/Navigation/linkingConfig/config.ts +++ b/src/libs/Navigation/linkingConfig/config.ts @@ -280,9 +280,9 @@ const config: LinkingOptions['config'] = { }, }, }, - [SCREENS.RIGHT_MODAL.REPORT_WELCOME_MESSAGE]: { + [SCREENS.RIGHT_MODAL.REPORT_DESCRIPTION]: { screens: { - [SCREENS.REPORT_WELCOME_MESSAGE_ROOT]: ROUTES.REPORT_WELCOME_MESSAGE.route, + [SCREENS.REPORT_DESCRIPTION_ROOT]: ROUTES.REPORT_DESCRIPTION.route, }, }, [SCREENS.RIGHT_MODAL.NEW_CHAT]: { @@ -425,7 +425,6 @@ const config: LinkingOptions['config'] = { [SCREENS.RIGHT_MODAL.TASK_DETAILS]: { screens: { [SCREENS.TASK.TITLE]: ROUTES.TASK_TITLE.route, - [SCREENS.TASK.DESCRIPTION]: ROUTES.TASK_DESCRIPTION.route, [SCREENS.TASK.ASSIGNEE]: ROUTES.TASK_ASSIGNEE.route, }, }, diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index a5265f036db4..a6b3f1839eda 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4593,7 +4593,7 @@ function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry

Date: Sat, 3 Feb 2024 08:02:43 +0530 Subject: [PATCH 41/49] Disable enter prop --- src/components/Form/FormWrapper.tsx | 3 ++- src/components/Form/types.ts | 3 +++ src/pages/workspace/WorkspaceNewRoomPage.js | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Form/FormWrapper.tsx b/src/components/Form/FormWrapper.tsx index d5b47761e4c0..7630cea4ff2d 100644 --- a/src/components/Form/FormWrapper.tsx +++ b/src/components/Form/FormWrapper.tsx @@ -54,6 +54,7 @@ function FormWrapper({ formID, scrollContextEnabled = false, shouldHideFixErrorsAlert = false, + disablePressOnEnter = true, }: FormWrapperProps) { const styles = useThemeStyles(); const formRef = useRef(null); @@ -112,7 +113,7 @@ function FormWrapper({ containerStyles={[styles.mh0, styles.mt5, styles.flex1, submitButtonStyles]} enabledWhenOffline={enabledWhenOffline} isSubmitActionDangerous={isSubmitActionDangerous} - disablePressOnEnter + disablePressOnEnter={disablePressOnEnter} /> )} diff --git a/src/components/Form/types.ts b/src/components/Form/types.ts index 447f3205ad68..b2c7aea3f3cf 100644 --- a/src/components/Form/types.ts +++ b/src/components/Form/types.ts @@ -84,6 +84,9 @@ type FormProps = { /** Custom content to display in the footer after submit button */ footerContent?: ReactNode; + + /** Disable press on enter for submit button */ + disablePressOnEnter?: boolean; }; type RegisterInput = (inputID: keyof Form, inputProps: TInputProps) => TInputProps; diff --git a/src/pages/workspace/WorkspaceNewRoomPage.js b/src/pages/workspace/WorkspaceNewRoomPage.js index 32ec99320d6b..b32637e8e219 100644 --- a/src/pages/workspace/WorkspaceNewRoomPage.js +++ b/src/pages/workspace/WorkspaceNewRoomPage.js @@ -289,6 +289,7 @@ function WorkspaceNewRoomPage(props) { validate={validate} onSubmit={submit} enabledWhenOffline + disablePressOnEnter={false} > Date: Sat, 3 Feb 2024 08:07:21 +0530 Subject: [PATCH 42/49] Fix lint --- src/components/Form/FormWrapper.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Form/FormWrapper.tsx b/src/components/Form/FormWrapper.tsx index 7630cea4ff2d..aa3aa5b40b5a 100644 --- a/src/components/Form/FormWrapper.tsx +++ b/src/components/Form/FormWrapper.tsx @@ -138,6 +138,7 @@ function FormWrapper({ submitButtonText, shouldHideFixErrorsAlert, onFixTheErrorsLinkPressed, + disablePressOnEnter, ], ); From fc60fa62c9584f1db0a89ad1a0cf9dd7caa361e7 Mon Sep 17 00:00:00 2001 From: someone-here Date: Sun, 4 Feb 2024 14:29:08 +0530 Subject: [PATCH 43/49] Anonymous action check --- src/components/MenuItem.tsx | 2 +- src/pages/ReportDetailsPage.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/MenuItem.tsx b/src/components/MenuItem.tsx index fd4afdfbc948..cc0de763f515 100644 --- a/src/components/MenuItem.tsx +++ b/src/components/MenuItem.tsx @@ -386,7 +386,7 @@ function MenuItem( {(isHovered) => ( shouldBlockSelection && isSmallScreenWidth && DeviceCapabilities.canUseTouchScreen() && ControlSelection.block()} onPressOut={ControlSelection.unblock} onSecondaryInteraction={onSecondaryInteraction} diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 19162bb756e3..99e1cea8280a 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -249,6 +249,7 @@ function ReportDetailsPage(props) { interactive={canEditReportDescription} title={props.report.description} shouldRenderAsHTML + shouldCheckActionAllowedOnPress={false} description={props.translate('reportDescriptionPage.roomDescription')} onPress={() => Navigation.navigate(ROUTES.REPORT_DESCRIPTION.getRoute(props.report.reportID))} /> From d2b78af2cac24549a7cab43bcc83fb02a1b8c666 Mon Sep 17 00:00:00 2001 From: someone-here Date: Mon, 5 Feb 2024 21:53:45 +0530 Subject: [PATCH 44/49] Fix conflict --- src/pages/settings/Report/ReportSettingsPage.tsx | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/pages/settings/Report/ReportSettingsPage.tsx b/src/pages/settings/Report/ReportSettingsPage.tsx index e1a4b1025a34..3fc21a9b5e03 100644 --- a/src/pages/settings/Report/ReportSettingsPage.tsx +++ b/src/pages/settings/Report/ReportSettingsPage.tsx @@ -5,8 +5,6 @@ import {ScrollView, View} from 'react-native'; import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; import DisplayNames from '@components/DisplayNames'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; -import * as Expensicons from '@components/Icon/Expensicons'; -import MenuItem from '@components/MenuItem'; import MenuItemWithTopDescription from '@components/MenuItemWithTopDescription'; import OfflineWithFeedback from '@components/OfflineWithFeedback'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -36,9 +34,6 @@ function ReportSettingsPage({report, policies}: ReportSettingsPageProps) { const shouldDisableRename = useMemo(() => ReportUtils.shouldDisableRename(report, linkedWorkspace), [report, linkedWorkspace]); const isMoneyRequestReport = ReportUtils.isMoneyRequestReport(report); - // We only want policy owners and admins to be able to modify the welcome message, but not in thread chat - const shouldDisableWelcomeMessage = ReportUtils.shouldDisableWelcomeMessage(report, linkedWorkspace); - const shouldDisableSettings = isEmptyObject(report) || ReportUtils.isArchivedRoom(report); const shouldShowRoomName = !ReportUtils.isPolicyExpenseChat(report) && !ReportUtils.isChatThread(report); const notificationPreference = @@ -165,14 +160,6 @@ function ReportSettingsPage({report, policies}: ReportSettingsPageProps) { )} - {!shouldDisableWelcomeMessage && ( - Navigation.navigate(ROUTES.REPORT_WELCOME_MESSAGE.getRoute(reportID))} - shouldShowRightIcon - /> - )} From a97a63c9eddc8f14576e829e353a9372e2cf0ef9 Mon Sep 17 00:00:00 2001 From: someone-here Date: Mon, 5 Feb 2024 22:00:18 +0530 Subject: [PATCH 45/49] Prettify --- src/pages/settings/Report/ReportSettingsPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/settings/Report/ReportSettingsPage.tsx b/src/pages/settings/Report/ReportSettingsPage.tsx index 3fc21a9b5e03..613dcd460e26 100644 --- a/src/pages/settings/Report/ReportSettingsPage.tsx +++ b/src/pages/settings/Report/ReportSettingsPage.tsx @@ -1,4 +1,3 @@ - import type {StackScreenProps} from '@react-navigation/stack'; import React, {useMemo} from 'react'; import {ScrollView, View} from 'react-native'; From 5c4177fc1088ad5bd97ea2f02fe7eca21a237836 Mon Sep 17 00:00:00 2001 From: someone-here Date: Mon, 5 Feb 2024 22:42:40 +0530 Subject: [PATCH 46/49] Remove openReport --- src/libs/E2E/apiMocks/openReport.ts | 1971 --------------------------- 1 file changed, 1971 deletions(-) delete mode 100644 src/libs/E2E/apiMocks/openReport.ts diff --git a/src/libs/E2E/apiMocks/openReport.ts b/src/libs/E2E/apiMocks/openReport.ts deleted file mode 100644 index 4165db650a5c..000000000000 --- a/src/libs/E2E/apiMocks/openReport.ts +++ /dev/null @@ -1,1971 +0,0 @@ -/* eslint-disable @typescript-eslint/naming-convention */ -import type Response from '@src/types/onyx/Response'; - -export default (): Response => ({ - onyxData: [ - { - onyxMethod: 'merge', - key: 'report_98345625', - value: { - reportID: '98345625', - reportName: 'Chat Report', - type: 'chat', - chatType: null, - ownerAccountID: 0, - managerID: 0, - policyID: '_FAKE_', - participantAccountIDs: [14567013], - isPinned: false, - lastReadTime: '2023-09-14 11:50:21.768', - lastMentionedTime: '2023-07-27 07:37:43.100', - lastReadSequenceNumber: 0, - lastVisibleActionCreated: '2023-08-29 12:38:16.070', - lastVisibleActionLastModified: '2023-08-29 12:38:16.070', - lastMessageText: 'terry+hightraffic@margelo.io owes \u20ac12.00', - lastActorAccountID: 14567013, - notificationPreference: 'always', - stateNum: 0, - statusNum: 0, - oldPolicyName: '', - visibility: null, - isOwnPolicyExpenseChat: false, - lastMessageHtml: 'terry+hightraffic@margelo.io owes \u20ac12.00', - iouReportID: '206636935813547', - hasOutstandingChildRequest: false, - policyName: null, - hasParentAccess: null, - parentReportID: null, - parentReportActionID: null, - writeCapability: 'all', - description: null, - isDeletedParentAction: null, - total: 0, - currency: 'USD', - chatReportID: null, - isWaitingOnBankAccount: false, - }, - }, - { - onyxMethod: 'mergecollection', - key: 'transactions_', - value: { - transactions_5509240412000765850: { - amount: 1200, - billable: false, - cardID: 15467728, - category: '', - comment: { - comment: '', - }, - created: '2023-08-29', - currency: 'EUR', - filename: '', - merchant: 'Request', - modifiedAmount: 0, - modifiedCreated: '', - modifiedCurrency: '', - modifiedMerchant: '', - originalAmount: 0, - originalCurrency: '', - parentTransactionID: '', - receipt: {}, - reimbursable: true, - reportID: '206636935813547', - status: 'Pending', - tag: '', - transactionID: '5509240412000765850', - hasEReceipt: false, - }, - }, - }, - { - onyxMethod: 'merge', - key: 'reportActions_98345625', - value: { - '885570376575240776': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: '', - text: '', - isEdited: true, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - edits: [], - html: '', - lastModified: '2023-09-01 07:43:29.374', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-31 07:23:52.892', - timestamp: 1693466632, - reportActionTimestamp: 1693466632892, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '885570376575240776', - previousReportActionID: '6576518341807837187', - lastModified: '2023-09-01 07:43:29.374', - whisperedToAccountIDs: [], - }, - '6576518341807837187': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'terry+hightraffic@margelo.io owes \u20ac12.00', - text: 'terry+hightraffic@margelo.io owes \u20ac12.00', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - lastModified: '2023-08-29 12:38:16.070', - linkedReportID: '206636935813547', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-08-29 12:38:16.070', - timestamp: 1693312696, - reportActionTimestamp: 1693312696070, - automatic: false, - actionName: 'REPORTPREVIEW', - shouldShow: true, - reportActionID: '6576518341807837187', - previousReportActionID: '2658221912430757962', - lastModified: '2023-08-29 12:38:16.070', - childReportID: '206636935813547', - childType: 'iou', - childStatusNum: 1, - childStateNum: 1, - childMoneyRequestCount: 1, - whisperedToAccountIDs: [], - }, - '2658221912430757962': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'Hshshdhdhejje
Cuududdke

F
D
R
D
R
Jfj c
D

D
D
R
D
R', - text: 'Hshshdhdhejje\nCuududdke\n\nF\nD\nR\nD\nR\nJfj c\nD\n\nD\nD\nR\nD\nR', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [ - { - emoji: 'heart', - users: [ - { - accountID: 12883048, - skinTone: -1, - }, - ], - }, - ], - }, - ], - originalMessage: { - html: 'Hshshdhdhejje
Cuududdke

F
D
R
D
R
Jfj c
D

D
D
R
D
R', - lastModified: '2023-08-25 12:39:48.121', - reactions: [ - { - emoji: 'heart', - users: [ - { - accountID: 12883048, - skinTone: -1, - }, - ], - }, - ], - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-25 08:54:06.972', - timestamp: 1692953646, - reportActionTimestamp: 1692953646972, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '2658221912430757962', - previousReportActionID: '6551789403725495383', - lastModified: '2023-08-25 12:39:48.121', - childReportID: '1411015346900020', - childType: 'chat', - childOldestFourAccountIDs: '12883048', - childCommenterCount: 1, - childLastVisibleActionCreated: '2023-08-29 06:08:59.247', - childVisibleActionCount: 1, - whisperedToAccountIDs: [], - }, - '6551789403725495383': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'Typing with the composer is now also reasonably fast again', - text: 'Typing with the composer is now also reasonably fast again', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'Typing with the composer is now also reasonably fast again', - lastModified: '2023-08-25 08:53:57.490', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-25 08:53:57.490', - timestamp: 1692953637, - reportActionTimestamp: 1692953637490, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6551789403725495383', - previousReportActionID: '6184477005811241106', - lastModified: '2023-08-25 08:53:57.490', - whisperedToAccountIDs: [], - }, - '6184477005811241106': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: '\ud83d\ude3a', - text: '\ud83d\ude3a', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: '\ud83d\ude3a', - lastModified: '2023-08-25 08:53:41.689', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-25 08:53:41.689', - timestamp: 1692953621, - reportActionTimestamp: 1692953621689, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6184477005811241106', - previousReportActionID: '7473953427765241164', - lastModified: '2023-08-25 08:53:41.689', - whisperedToAccountIDs: [], - }, - '7473953427765241164': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'Skkkkkkrrrrrrrr', - text: 'Skkkkkkrrrrrrrr', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'Skkkkkkrrrrrrrr', - lastModified: '2023-08-25 08:53:31.900', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-25 08:53:31.900', - timestamp: 1692953611, - reportActionTimestamp: 1692953611900, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '7473953427765241164', - previousReportActionID: '872421684593496491', - lastModified: '2023-08-25 08:53:31.900', - whisperedToAccountIDs: [], - }, - '872421684593496491': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'hello this is a new test will my version sync though? i doubt it lolasdasdasdaoe f t asdasd okay und das ging jetzt eh oder? ja schaut ganz gut aus okay geht das immer noch ? schaut gut aus ja true ghw test test 2 test 4 tse 3 oida', - text: 'hello this is a new test will my version sync though? i doubt it lolasdasdasdaoe f t asdasd okay und das ging jetzt eh oder? ja schaut ganz gut aus okay geht das immer noch ? schaut gut aus ja true ghw test test 2 test 4 tse 3 oida', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'hello this is a new test will my version sync though? i doubt it lolasdasdasdaoe f t asdasd okay und das ging jetzt eh oder? ja schaut ganz gut aus okay geht das immer noch ? schaut gut aus ja true ghw test test 2 test 4 tse 3 oida', - lastModified: '2023-08-11 13:35:03.962', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-11 13:35:03.962', - timestamp: 1691760903, - reportActionTimestamp: 1691760903962, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '872421684593496491', - previousReportActionID: '175680146540578558', - lastModified: '2023-08-11 13:35:03.962', - whisperedToAccountIDs: [], - }, - '175680146540578558': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: '', - text: '[Attachment]', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: '', - lastModified: '2023-08-10 06:59:21.381', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-10 06:59:21.381', - timestamp: 1691650761, - reportActionTimestamp: 1691650761381, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '175680146540578558', - previousReportActionID: '1264289784533901723', - lastModified: '2023-08-10 06:59:21.381', - whisperedToAccountIDs: [], - }, - '1264289784533901723': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: '', - text: '[Attachment]', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: '', - lastModified: '2023-08-10 06:59:16.922', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-10 06:59:16.922', - timestamp: 1691650756, - reportActionTimestamp: 1691650756922, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '1264289784533901723', - previousReportActionID: '4870277010164688289', - lastModified: '2023-08-10 06:59:16.922', - whisperedToAccountIDs: [], - }, - '4870277010164688289': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'send test', - text: 'send test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'send test', - lastModified: '2023-08-09 06:43:25.209', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-09 06:43:25.209', - timestamp: 1691563405, - reportActionTimestamp: 1691563405209, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '4870277010164688289', - previousReportActionID: '7931783095143103530', - lastModified: '2023-08-09 06:43:25.209', - whisperedToAccountIDs: [], - }, - '7931783095143103530': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'hello terry \ud83d\ude04 this is a test @terry+hightraffic@margelo.io', - text: 'hello terry \ud83d\ude04 this is a test @terry+hightraffic@margelo.io', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'hello terry \ud83d\ude04 this is a test @terry+hightraffic@margelo.io', - lastModified: '2023-08-08 14:38:45.035', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-08 14:38:45.035', - timestamp: 1691505525, - reportActionTimestamp: 1691505525035, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '7931783095143103530', - previousReportActionID: '4598496324774172433', - lastModified: '2023-08-08 14:38:45.035', - whisperedToAccountIDs: [], - }, - '4598496324774172433': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: '\ud83d\uddff', - text: '\ud83d\uddff', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: '\ud83d\uddff', - lastModified: '2023-08-08 13:21:42.102', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-08 13:21:42.102', - timestamp: 1691500902, - reportActionTimestamp: 1691500902102, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '4598496324774172433', - previousReportActionID: '3324110555952451144', - lastModified: '2023-08-08 13:21:42.102', - whisperedToAccountIDs: [], - }, - '3324110555952451144': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'test \ud83d\uddff', - text: 'test \ud83d\uddff', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test \ud83d\uddff', - lastModified: '2023-08-08 13:21:32.101', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-08 13:21:32.101', - timestamp: 1691500892, - reportActionTimestamp: 1691500892101, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '3324110555952451144', - previousReportActionID: '5389364980227777980', - lastModified: '2023-08-08 13:21:32.101', - whisperedToAccountIDs: [], - }, - '5389364980227777980': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'okay now it will work again y \ud83d\udc42', - text: 'okay now it will work again y \ud83d\udc42', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'okay now it will work again y \ud83d\udc42', - lastModified: '2023-08-07 10:54:38.141', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-08-07 10:54:38.141', - timestamp: 1691405678, - reportActionTimestamp: 1691405678141, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '5389364980227777980', - previousReportActionID: '4717622390560689493', - lastModified: '2023-08-07 10:54:38.141', - whisperedToAccountIDs: [], - }, - '4717622390560689493': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'hmmmm', - text: 'hmmmm', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'hmmmm', - lastModified: '2023-07-27 18:13:45.322', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-27 18:13:45.322', - timestamp: 1690481625, - reportActionTimestamp: 1690481625322, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '4717622390560689493', - previousReportActionID: '745721424446883075', - lastModified: '2023-07-27 18:13:45.322', - whisperedToAccountIDs: [], - }, - '745721424446883075': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'test', - text: 'test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test', - lastModified: '2023-07-27 18:13:32.595', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-27 18:13:32.595', - timestamp: 1690481612, - reportActionTimestamp: 1690481612595, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '745721424446883075', - previousReportActionID: '3986429677777110818', - lastModified: '2023-07-27 18:13:32.595', - whisperedToAccountIDs: [], - }, - '3986429677777110818': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'I will', - text: 'I will', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'I will', - lastModified: '2023-07-27 17:03:11.250', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 17:03:11.250', - timestamp: 1690477391, - reportActionTimestamp: 1690477391250, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '3986429677777110818', - previousReportActionID: '7317910228472011573', - lastModified: '2023-07-27 17:03:11.250', - childReportID: '3338245207149134', - childType: 'chat', - whisperedToAccountIDs: [], - }, - '7317910228472011573': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'will you>', - text: 'will you>', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'will you>', - lastModified: '2023-07-27 16:46:58.988', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-27 16:46:58.988', - timestamp: 1690476418, - reportActionTimestamp: 1690476418988, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '7317910228472011573', - previousReportActionID: '6779343397958390319', - lastModified: '2023-07-27 16:46:58.988', - whisperedToAccountIDs: [], - }, - '6779343397958390319': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'i will always send :#', - text: 'i will always send :#', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'i will always send :#', - lastModified: '2023-07-27 07:55:33.468', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:55:33.468', - timestamp: 1690444533, - reportActionTimestamp: 1690444533468, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6779343397958390319', - previousReportActionID: '5084145419388195535', - lastModified: '2023-07-27 07:55:33.468', - whisperedToAccountIDs: [], - }, - '5084145419388195535': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'new test', - text: 'new test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'new test', - lastModified: '2023-07-27 07:55:22.309', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:55:22.309', - timestamp: 1690444522, - reportActionTimestamp: 1690444522309, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '5084145419388195535', - previousReportActionID: '6742067600980190659', - lastModified: '2023-07-27 07:55:22.309', - whisperedToAccountIDs: [], - }, - '6742067600980190659': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'okay good', - text: 'okay good', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'okay good', - lastModified: '2023-07-27 07:55:15.362', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:55:15.362', - timestamp: 1690444515, - reportActionTimestamp: 1690444515362, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6742067600980190659', - previousReportActionID: '7811212427986810247', - lastModified: '2023-07-27 07:55:15.362', - whisperedToAccountIDs: [], - }, - '7811212427986810247': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'test 2', - text: 'test 2', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test 2', - lastModified: '2023-07-27 07:55:10.629', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:55:10.629', - timestamp: 1690444510, - reportActionTimestamp: 1690444510629, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '7811212427986810247', - previousReportActionID: '4544757211729131829', - lastModified: '2023-07-27 07:55:10.629', - whisperedToAccountIDs: [], - }, - '4544757211729131829': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'new test', - text: 'new test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'new test', - lastModified: '2023-07-27 07:53:41.960', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:53:41.960', - timestamp: 1690444421, - reportActionTimestamp: 1690444421960, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '4544757211729131829', - previousReportActionID: '8290114634148431001', - lastModified: '2023-07-27 07:53:41.960', - whisperedToAccountIDs: [], - }, - '8290114634148431001': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'something was real', - text: 'something was real', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'something was real', - lastModified: '2023-07-27 07:53:27.836', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:53:27.836', - timestamp: 1690444407, - reportActionTimestamp: 1690444407836, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '8290114634148431001', - previousReportActionID: '5597494166918965742', - lastModified: '2023-07-27 07:53:27.836', - whisperedToAccountIDs: [], - }, - '5597494166918965742': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'oida', - text: 'oida', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'oida', - lastModified: '2023-07-27 07:53:20.783', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:53:20.783', - timestamp: 1690444400, - reportActionTimestamp: 1690444400783, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '5597494166918965742', - previousReportActionID: '7445709165354739065', - lastModified: '2023-07-27 07:53:20.783', - whisperedToAccountIDs: [], - }, - '7445709165354739065': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'test 12', - text: 'test 12', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test 12', - lastModified: '2023-07-27 07:53:17.393', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:53:17.393', - timestamp: 1690444397, - reportActionTimestamp: 1690444397393, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '7445709165354739065', - previousReportActionID: '1985264407541504554', - lastModified: '2023-07-27 07:53:17.393', - whisperedToAccountIDs: [], - }, - '1985264407541504554': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'new test', - text: 'new test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'new test', - lastModified: '2023-07-27 07:53:07.894', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:53:07.894', - timestamp: 1690444387, - reportActionTimestamp: 1690444387894, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '1985264407541504554', - previousReportActionID: '6101278009725036288', - lastModified: '2023-07-27 07:53:07.894', - whisperedToAccountIDs: [], - }, - '6101278009725036288': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'grrr', - text: 'grrr', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'grrr', - lastModified: '2023-07-27 07:52:56.421', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:52:56.421', - timestamp: 1690444376, - reportActionTimestamp: 1690444376421, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6101278009725036288', - previousReportActionID: '6913024396112106680', - lastModified: '2023-07-27 07:52:56.421', - whisperedToAccountIDs: [], - }, - '6913024396112106680': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'ne w test', - text: 'ne w test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'ne w test', - lastModified: '2023-07-27 07:52:53.352', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:52:53.352', - timestamp: 1690444373, - reportActionTimestamp: 1690444373352, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6913024396112106680', - previousReportActionID: '3663318486255461038', - lastModified: '2023-07-27 07:52:53.352', - whisperedToAccountIDs: [], - }, - '3663318486255461038': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'well', - text: 'well', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'well', - lastModified: '2023-07-27 07:52:47.044', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:52:47.044', - timestamp: 1690444367, - reportActionTimestamp: 1690444367044, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '3663318486255461038', - previousReportActionID: '6652909175804277965', - lastModified: '2023-07-27 07:52:47.044', - whisperedToAccountIDs: [], - }, - '6652909175804277965': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'hu', - text: 'hu', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'hu', - lastModified: '2023-07-27 07:52:43.489', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:52:43.489', - timestamp: 1690444363, - reportActionTimestamp: 1690444363489, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6652909175804277965', - previousReportActionID: '4738491624635492834', - lastModified: '2023-07-27 07:52:43.489', - whisperedToAccountIDs: [], - }, - '4738491624635492834': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'test', - text: 'test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test', - lastModified: '2023-07-27 07:52:40.145', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:52:40.145', - timestamp: 1690444360, - reportActionTimestamp: 1690444360145, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '4738491624635492834', - previousReportActionID: '1621235410433805703', - lastModified: '2023-07-27 07:52:40.145', - whisperedToAccountIDs: [], - }, - '1621235410433805703': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'test 4', - text: 'test 4', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test 4', - lastModified: '2023-07-27 07:48:36.809', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-27 07:48:36.809', - timestamp: 1690444116, - reportActionTimestamp: 1690444116809, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '1621235410433805703', - previousReportActionID: '1024550225871474566', - lastModified: '2023-07-27 07:48:36.809', - whisperedToAccountIDs: [], - }, - '1024550225871474566': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'test 3', - text: 'test 3', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test 3', - lastModified: '2023-07-27 07:48:24.183', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:48:24.183', - timestamp: 1690444104, - reportActionTimestamp: 1690444104183, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '1024550225871474566', - previousReportActionID: '5598482410513625723', - lastModified: '2023-07-27 07:48:24.183', - whisperedToAccountIDs: [], - }, - '5598482410513625723': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'test2', - text: 'test2', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test2', - lastModified: '2023-07-27 07:42:25.340', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:42:25.340', - timestamp: 1690443745, - reportActionTimestamp: 1690443745340, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '5598482410513625723', - previousReportActionID: '115121137377026405', - lastModified: '2023-07-27 07:42:25.340', - whisperedToAccountIDs: [], - }, - '115121137377026405': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'test', - text: 'test', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'test', - lastModified: '2023-07-27 07:42:22.583', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-27 07:42:22.583', - timestamp: 1690443742, - reportActionTimestamp: 1690443742583, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '115121137377026405', - previousReportActionID: '2167420855737359171', - lastModified: '2023-07-27 07:42:22.583', - whisperedToAccountIDs: [], - }, - '2167420855737359171': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'new message', - text: 'new message', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'new message', - lastModified: '2023-07-27 07:42:09.177', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:42:09.177', - timestamp: 1690443729, - reportActionTimestamp: 1690443729177, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '2167420855737359171', - previousReportActionID: '6106926938128802897', - lastModified: '2023-07-27 07:42:09.177', - whisperedToAccountIDs: [], - }, - '6106926938128802897': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'oh', - text: 'oh', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'oh', - lastModified: '2023-07-27 07:42:03.902', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:42:03.902', - timestamp: 1690443723, - reportActionTimestamp: 1690443723902, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '6106926938128802897', - previousReportActionID: '4366704007455141347', - lastModified: '2023-07-27 07:42:03.902', - whisperedToAccountIDs: [], - }, - '4366704007455141347': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'hm lol', - text: 'hm lol', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'hm lol', - lastModified: '2023-07-27 07:42:00.734', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:42:00.734', - timestamp: 1690443720, - reportActionTimestamp: 1690443720734, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '4366704007455141347', - previousReportActionID: '2078794664797360607', - lastModified: '2023-07-27 07:42:00.734', - whisperedToAccountIDs: [], - }, - '2078794664797360607': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'hi?', - text: 'hi?', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'hi?', - lastModified: '2023-07-27 07:41:49.724', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:41:49.724', - timestamp: 1690443709, - reportActionTimestamp: 1690443709724, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '2078794664797360607', - previousReportActionID: '2030060194258527427', - lastModified: '2023-07-27 07:41:49.724', - whisperedToAccountIDs: [], - }, - '2030060194258527427': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'lets have a thread about it, will ya?', - text: 'lets have a thread about it, will ya?', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'lets have a thread about it, will ya?', - lastModified: '2023-07-27 07:40:49.146', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-27 07:40:49.146', - timestamp: 1690443649, - reportActionTimestamp: 1690443649146, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '2030060194258527427', - previousReportActionID: '5540483153987237906', - lastModified: '2023-07-27 07:40:49.146', - childReportID: '5860710623453234', - childType: 'chat', - childOldestFourAccountIDs: '14567013,12883048', - childCommenterCount: 2, - childLastVisibleActionCreated: '2023-07-27 07:41:03.550', - childVisibleActionCount: 2, - whisperedToAccountIDs: [], - }, - '5540483153987237906': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: '@hanno@margelo.io i mention you lasagna :)', - text: '@hanno@margelo.io i mention you lasagna :)', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: '@hanno@margelo.io i mention you lasagna :)', - lastModified: '2023-07-27 07:37:43.100', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:37:43.100', - timestamp: 1690443463, - reportActionTimestamp: 1690443463100, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '5540483153987237906', - previousReportActionID: '8050559753491913991', - lastModified: '2023-07-27 07:37:43.100', - whisperedToAccountIDs: [], - }, - '8050559753491913991': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: '@terry+hightraffic@margelo.io', - text: '@terry+hightraffic@margelo.io', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: '@terry+hightraffic@margelo.io', - lastModified: '2023-07-27 07:36:41.708', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:36:41.708', - timestamp: 1690443401, - reportActionTimestamp: 1690443401708, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '8050559753491913991', - previousReportActionID: '881015235172878574', - lastModified: '2023-07-27 07:36:41.708', - whisperedToAccountIDs: [], - }, - '881015235172878574': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'yeah lets see', - text: 'yeah lets see', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'yeah lets see', - lastModified: '2023-07-27 07:25:15.997', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-27 07:25:15.997', - timestamp: 1690442715, - reportActionTimestamp: 1690442715997, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '881015235172878574', - previousReportActionID: '4800357767877651330', - lastModified: '2023-07-27 07:25:15.997', - whisperedToAccountIDs: [], - }, - '4800357767877651330': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'asdasdasd', - text: 'asdasdasd', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'asdasdasd', - lastModified: '2023-07-27 07:25:03.093', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-27 07:25:03.093', - timestamp: 1690442703, - reportActionTimestamp: 1690442703093, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '4800357767877651330', - previousReportActionID: '9012557872554910346', - lastModified: '2023-07-27 07:25:03.093', - whisperedToAccountIDs: [], - }, - '9012557872554910346': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'yeah', - text: 'yeah', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'yeah', - lastModified: '2023-07-26 19:49:40.471', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-26 19:49:40.471', - timestamp: 1690400980, - reportActionTimestamp: 1690400980471, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '9012557872554910346', - previousReportActionID: '8440677969068645500', - lastModified: '2023-07-26 19:49:40.471', - whisperedToAccountIDs: [], - }, - '8440677969068645500': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'hello motor', - text: 'hello motor', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'hello motor', - lastModified: '2023-07-26 19:49:36.262', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-26 19:49:36.262', - timestamp: 1690400976, - reportActionTimestamp: 1690400976262, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '8440677969068645500', - previousReportActionID: '306887996337608775', - lastModified: '2023-07-26 19:49:36.262', - whisperedToAccountIDs: [], - }, - '306887996337608775': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'a new messagfe', - text: 'a new messagfe', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'a new messagfe', - lastModified: '2023-07-26 19:49:29.512', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-26 19:49:29.512', - timestamp: 1690400969, - reportActionTimestamp: 1690400969512, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '306887996337608775', - previousReportActionID: '587892433077506227', - lastModified: '2023-07-26 19:49:29.512', - whisperedToAccountIDs: [], - }, - '587892433077506227': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Hanno J. G\u00f6decke', - }, - ], - actorAccountID: 12883048, - message: [ - { - type: 'COMMENT', - html: 'good', - text: 'good', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'good', - lastModified: '2023-07-26 19:49:20.473', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/fc1b8880216a5a76c8fd9998aaa33c080dacda5d_128.jpeg', - created: '2023-07-26 19:49:20.473', - timestamp: 1690400960, - reportActionTimestamp: 1690400960473, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '587892433077506227', - previousReportActionID: '1433103421804347060', - lastModified: '2023-07-26 19:49:20.473', - whisperedToAccountIDs: [], - }, - '1433103421804347060': { - person: [ - { - type: 'TEXT', - style: 'strong', - text: 'Terry Hightraffic1337', - }, - ], - actorAccountID: 14567013, - message: [ - { - type: 'COMMENT', - html: 'ah', - text: 'ah', - isEdited: false, - whisperedTo: [], - isDeletedParentAction: false, - reactions: [], - }, - ], - originalMessage: { - html: 'ah', - lastModified: '2023-07-26 19:49:12.762', - }, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - created: '2023-07-26 19:49:12.762', - timestamp: 1690400952, - reportActionTimestamp: 1690400952762, - automatic: false, - actionName: 'ADDCOMMENT', - shouldShow: true, - reportActionID: '1433103421804347060', - previousReportActionID: '8774157052628183778', - lastModified: '2023-07-26 19:49:12.762', - whisperedToAccountIDs: [], - }, - }, - }, - { - onyxMethod: 'mergecollection', - key: 'reportActionsReactions_', - value: { - reportActionsReactions_2658221912430757962: { - heart: { - createdAt: '2023-08-25 12:37:45', - users: { - 12883048: { - skinTones: { - '-1': '2023-08-25 12:37:45', - }, - }, - }, - }, - }, - }, - }, - { - onyxMethod: 'merge', - key: 'personalDetailsList', - value: { - 14567013: { - accountID: 14567013, - avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/49a4c96c366f9a32905b30462f91ea39e5eee5e8_128.jpeg', - displayName: 'Terry Hightraffic1337', - firstName: 'Terry', - lastName: 'Hightraffic1337', - status: null, - login: 'terry+hightraffic@margelo.io', - pronouns: '', - timezone: { - automatic: true, - selected: 'Europe/Kyiv', - }, - phoneNumber: '', - validated: true, - }, - }, - }, - ], - jsonCode: 200, - requestID: '81b8b8509a7f5b54-VIE', -}); From 5630493b45ea3d3a3ecd55332370c2b0dc53bfe0 Mon Sep 17 00:00:00 2001 From: Esh Tanya Gupta <77237602+esh-g@users.noreply.github.com> Date: Tue, 6 Feb 2024 00:18:21 +0530 Subject: [PATCH 47/49] Update src/libs/ReportUtils.ts Co-authored-by: Puneet Lath --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index fa7f193494e4..b5f567f7e5f1 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -4594,7 +4594,7 @@ function getRoom(type: ValueOf, policyID: string) } /** - * We only want policy owners and admins to be able to modify the report description, but not in thread chat. + * We only want policy members who are members of the report to be able to modify the report description, but not in thread chat. */ function canEditReportDescription(report: OnyxEntry, policy: OnyxEntry | undefined): boolean { return ( From 00f6681fb09bcb9af3eb18d7b8b2bd2182e17992 Mon Sep 17 00:00:00 2001 From: Esh Tanya Gupta <77237602+esh-g@users.noreply.github.com> Date: Tue, 6 Feb 2024 00:19:54 +0530 Subject: [PATCH 48/49] Update src/pages/RoomDescriptionPage.tsx Co-authored-by: Puneet Lath --- src/pages/RoomDescriptionPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index 7e96fc44a983..55da01ed622e 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -40,7 +40,7 @@ function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; const handleReportDescriptionChange = useCallback((value: string) => { - setdescription(value); + setDescription(value); }, []); const submitForm = useCallback(() => { From 2df9043c51f5446f50ccf402037865063e322f99 Mon Sep 17 00:00:00 2001 From: Esh Tanya Gupta <77237602+esh-g@users.noreply.github.com> Date: Tue, 6 Feb 2024 00:20:04 +0530 Subject: [PATCH 49/49] Update src/pages/RoomDescriptionPage.tsx Co-authored-by: Puneet Lath --- src/pages/RoomDescriptionPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/RoomDescriptionPage.tsx b/src/pages/RoomDescriptionPage.tsx index 55da01ed622e..bc46587814e3 100644 --- a/src/pages/RoomDescriptionPage.tsx +++ b/src/pages/RoomDescriptionPage.tsx @@ -33,7 +33,7 @@ type RoomDescriptionPageProps = { function RoomDescriptionPage({report, policies}: RoomDescriptionPageProps) { const styles = useThemeStyles(); const parser = new ExpensiMark(); - const [description, setdescription] = useState(() => parser.htmlToMarkdown(report?.description ?? '')); + const [description, setDescription] = useState(() => parser.htmlToMarkdown(report?.description ?? '')); const reportDescriptionInputRef = useRef(null); const focusTimeoutRef = useRef | null>(null); const {translate} = useLocalize();