diff --git a/src/components/ArchivedReportFooter.tsx b/src/components/ArchivedReportFooter.tsx
index 083c8340baa6..9713e40136a2 100644
--- a/src/components/ArchivedReportFooter.tsx
+++ b/src/components/ArchivedReportFooter.tsx
@@ -4,6 +4,7 @@ import type {OnyxEntry} from 'react-native-onyx';
import {withOnyx} from 'react-native-onyx';
import useLocalize from '@hooks/useLocalize';
import useThemeStyles from '@hooks/useThemeStyles';
+import {getCurrentUserAccountID} from '@libs/actions/Report';
import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils';
import * as ReportActionsUtils from '@libs/ReportActionsUtils';
import * as ReportUtils from '@libs/ReportUtils';
@@ -31,7 +32,8 @@ function ArchivedReportFooter({report, reportClosedAction, personalDetails = {}}
const originalMessage = reportClosedAction?.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED ? reportClosedAction.originalMessage : null;
const archiveReason = originalMessage?.reason ?? CONST.REPORT.ARCHIVE_REASON.DEFAULT;
- let displayName = PersonalDetailsUtils.getDisplayNameOrDefault(personalDetails?.[report?.ownerAccountID ?? 0]);
+ const actorPersonalDetails = personalDetails?.[reportClosedAction?.actorAccountID ?? 0];
+ let displayName = PersonalDetailsUtils.getDisplayNameOrDefault(actorPersonalDetails);
let oldDisplayName: string | undefined;
if (archiveReason === CONST.REPORT.ARCHIVE_REASON.ACCOUNT_MERGED) {
@@ -56,6 +58,7 @@ function ArchivedReportFooter({report, reportClosedAction, personalDetails = {}}
displayName: `${displayName}`,
oldDisplayName: `${oldDisplayName}`,
policyName: `${policyName}`,
+ shouldUseYou: actorPersonalDetails?.accountID === getCurrentUserAccountID(),
})
: translate(`reportArchiveReasons.${archiveReason}`);
diff --git a/src/languages/en.ts b/src/languages/en.ts
index 4d7041d4a791..861c63b3b1b4 100755
--- a/src/languages/en.ts
+++ b/src/languages/en.ts
@@ -516,14 +516,15 @@ export default {
},
reportArchiveReasons: {
[CONST.REPORT.ARCHIVE_REASON.DEFAULT]: 'This chat room has been archived.',
- [CONST.REPORT.ARCHIVE_REASON.ACCOUNT_CLOSED]: ({displayName}: ReportArchiveReasonsClosedParams) =>
- `This workspace chat is no longer active because ${displayName} closed their account.`,
+ [CONST.REPORT.ARCHIVE_REASON.ACCOUNT_CLOSED]: ({displayName}: ReportArchiveReasonsClosedParams) => `This chat is no longer active because ${displayName} closed their account.`,
[CONST.REPORT.ARCHIVE_REASON.ACCOUNT_MERGED]: ({displayName, oldDisplayName}: ReportArchiveReasonsMergedParams) =>
- `This workspace chat is no longer active because ${oldDisplayName} has merged their account with ${displayName}.`,
- [CONST.REPORT.ARCHIVE_REASON.REMOVED_FROM_POLICY]: ({displayName, policyName}: ReportArchiveReasonsRemovedFromPolicyParams) =>
- `This workspace chat is no longer active because ${displayName} is no longer a member of the ${policyName} workspace.`,
+ `This chat is no longer active because ${oldDisplayName} has merged their account with ${displayName}.`,
+ [CONST.REPORT.ARCHIVE_REASON.REMOVED_FROM_POLICY]: ({displayName, policyName, shouldUseYou = false}: ReportArchiveReasonsRemovedFromPolicyParams) =>
+ shouldUseYou
+ ? `This chat is no longer active because you are no longer a member of the ${policyName} workspace.`
+ : `This chat is no longer active because ${displayName} is no longer a member of the ${policyName} workspace.`,
[CONST.REPORT.ARCHIVE_REASON.POLICY_DELETED]: ({policyName}: ReportArchiveReasonsPolicyDeletedParams) =>
- `This workspace chat is no longer active because ${policyName} is no longer an active workspace.`,
+ `This chat is no longer active because ${policyName} is no longer an active workspace.`,
},
writeCapabilityPage: {
label: 'Who can post',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index c9ff087d0de7..ef150342be4a 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -509,14 +509,15 @@ export default {
},
reportArchiveReasons: {
[CONST.REPORT.ARCHIVE_REASON.DEFAULT]: 'Esta sala de chat ha sido eliminada.',
- [CONST.REPORT.ARCHIVE_REASON.ACCOUNT_CLOSED]: ({displayName}: ReportArchiveReasonsClosedParams) =>
- `Este chat de espacio de trabajo esta desactivado porque ${displayName} ha cerrado su cuenta.`,
+ [CONST.REPORT.ARCHIVE_REASON.ACCOUNT_CLOSED]: ({displayName}: ReportArchiveReasonsClosedParams) => `Este chat está desactivado porque ${displayName} ha cerrado su cuenta.`,
[CONST.REPORT.ARCHIVE_REASON.ACCOUNT_MERGED]: ({displayName, oldDisplayName}: ReportArchiveReasonsMergedParams) =>
- `Este chat de espacio de trabajo esta desactivado porque ${oldDisplayName} ha combinado su cuenta con ${displayName}.`,
- [CONST.REPORT.ARCHIVE_REASON.REMOVED_FROM_POLICY]: ({displayName, policyName}: ReportArchiveReasonsRemovedFromPolicyParams) =>
- `Este chat de espacio de trabajo esta desactivado porque ${displayName} ha dejado de ser miembro del espacio de trabajo ${policyName}.`,
+ `Este chat está desactivado porque ${oldDisplayName} ha combinado su cuenta con ${displayName}`,
+ [CONST.REPORT.ARCHIVE_REASON.REMOVED_FROM_POLICY]: ({displayName, policyName, shouldUseYou = false}: ReportArchiveReasonsRemovedFromPolicyParams) =>
+ shouldUseYou
+ ? `Este chat ya no está activo porque tu ya no eres miembro del espacio de trabajo ${policyName}.`
+ : `Este chat está desactivado porque ${displayName} ha dejado de ser miembro del espacio de trabajo ${policyName}.`,
[CONST.REPORT.ARCHIVE_REASON.POLICY_DELETED]: ({policyName}: ReportArchiveReasonsPolicyDeletedParams) =>
- `Este chat de espacio de trabajo esta desactivado porque el espacio de trabajo ${policyName} se ha eliminado.`,
+ `Este chat está desactivado porque el espacio de trabajo ${policyName} se ha eliminado.`,
},
writeCapabilityPage: {
label: 'Quién puede postear',
diff --git a/src/languages/types.ts b/src/languages/types.ts
index 410c8e1c2085..ed993f79f171 100644
--- a/src/languages/types.ts
+++ b/src/languages/types.ts
@@ -90,6 +90,7 @@ type ReportArchiveReasonsMergedParams = {
type ReportArchiveReasonsRemovedFromPolicyParams = {
displayName: string;
policyName: string;
+ shouldUseYou?: boolean;
};
type ReportArchiveReasonsPolicyDeletedParams = {
diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts
index 2daf337ddb80..d88091e298b4 100644
--- a/src/libs/ReportUtils.ts
+++ b/src/libs/ReportUtils.ts
@@ -2519,7 +2519,11 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu
const parentReportAction = ReportActionsUtils.getParentReportAction(report);
if (isChatThread(report)) {
if (!isEmptyObject(parentReportAction) && ReportActionsUtils.isTransactionThread(parentReportAction)) {
- return getTransactionReportName(parentReportAction);
+ formattedName = getTransactionReportName(parentReportAction);
+ if (isArchivedRoom(report)) {
+ formattedName += ` (${Localize.translateLocal('common.archived')})`;
+ }
+ return formattedName;
}
if (parentReportAction?.message?.[0]?.isDeletedParentAction) {
@@ -2541,6 +2545,9 @@ function getReportName(report: OnyxEntry, policy: OnyxEntry = nu
if (isAdminRoom(report) || isUserCreatedPolicyRoom(report)) {
return getAdminRoomInvitedParticipants(parentReportAction, parentReportActionMessage);
}
+ if (parentReportActionMessage && isArchivedRoom(report)) {
+ return `${parentReportActionMessage} (${Localize.translateLocal('common.archived')})`;
+ }
return parentReportActionMessage;
}
diff --git a/tests/unit/SidebarTest.js b/tests/unit/SidebarTest.js
index 6a813ef1fa8c..de44d858654f 100644
--- a/tests/unit/SidebarTest.js
+++ b/tests/unit/SidebarTest.js
@@ -131,9 +131,7 @@ describe('Sidebar', () => {
const hintMessagePreviewText = Localize.translateLocal('accessibilityHints.lastChatMessagePreview');
const messagePreviewTexts = screen.queryAllByLabelText(hintMessagePreviewText);
- expect(lodashGet(messagePreviewTexts, [0, 'props', 'children'])).toBe(
- 'This workspace chat is no longer active because Vikings Policy is no longer an active workspace.',
- );
+ expect(lodashGet(messagePreviewTexts, [0, 'props', 'children'])).toBe('This chat is no longer active because Vikings Policy is no longer an active workspace.');
})
);
});