From 7ca5f7a1847ec726973242d2e2e7aa039096ff63 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 23 Jul 2024 11:04:54 +0700 Subject: [PATCH 1/2] fix: System message for clearing room description --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + src/libs/ReportActionsUtils.ts | 12 +++++++++++- src/libs/SidebarUtils.ts | 4 +--- src/pages/home/report/ReportActionItem.tsx | 4 ++-- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 0275c90d551b..e3ff0acd20f6 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -4225,5 +4225,6 @@ export default { }, roomChangeLog: { updateRoomDescription: 'set the room description to:', + clearRoomDescription: 'cleared the room description', }, } satisfies TranslationBase; diff --git a/src/languages/es.ts b/src/languages/es.ts index 8a9c5f1e81d9..d5745d98f66a 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -4748,5 +4748,6 @@ export default { }, roomChangeLog: { updateRoomDescription: 'establece la descripción de la sala a:', + clearRoomDescription: 'borrar la descripción de la habitación', }, } satisfies EnglishTranslation; diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 6d4e603e9521..be864aa764f1 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -8,7 +8,7 @@ import CONST from '@src/CONST'; import type {TranslationPaths} from '@src/languages/types'; import ONYXKEYS from '@src/ONYXKEYS'; import type {OnyxInputOrEntry} from '@src/types/onyx'; -import type {JoinWorkspaceResolution, OriginalMessageExportIntegration} from '@src/types/onyx/OriginalMessage'; +import type {JoinWorkspaceResolution, OriginalMessageChangeLog, OriginalMessageExportIntegration} from '@src/types/onyx/OriginalMessage'; import type Report from '@src/types/onyx/Report'; import type ReportAction from '@src/types/onyx/ReportAction'; import type {Message, OldDotReportAction, OriginalMessage, ReportActions} from '@src/types/onyx/ReportAction'; @@ -1551,6 +1551,15 @@ function getExportIntegrationActionFragments(reportAction: OnyxEntry; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.ROOM_CHANGE_LOG.UPDATE_ROOM_DESCRIPTION) { - const message = `${translate('roomChangeLog.updateRoomDescription')} ${(originalMessage as OriginalMessageChangeLog)?.description}`; + const message = ReportActionsUtils.getUpdateRoomDescriptionMessage(action); children = ; } else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.DISMISSED_VIOLATION)) { children = ; From c5f44e257ad7cfff1fbb514ab2b7588eeb4a8820 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Tue, 23 Jul 2024 16:22:30 +0700 Subject: [PATCH 2/2] fix lint --- src/libs/ReportActionsUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index be864aa764f1..e7dfd52eb538 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1553,7 +1553,7 @@ function getExportIntegrationActionFragments(reportAction: OnyxEntry