From edd2c9e7f506d5ad8c7ac0df1356c70150b0eb19 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 3 Sep 2024 13:11:54 -0600 Subject: [PATCH 01/14] New 'removed from approval chain' report action & type --- src/CONST.ts | 1 + src/types/onyx/OriginalMessage.ts | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 92ab86d93f4d..ba0b886a8627 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -742,6 +742,7 @@ const CONST = { REIMBURSEMENT_SETUP: 'REIMBURSEMENTSETUP', // Deprecated OldDot Action REIMBURSEMENT_SETUP_REQUESTED: 'REIMBURSEMENTSETUPREQUESTED', // Deprecated OldDot Action REJECTED: 'REJECTED', + REMOVED_FROM_APPROVAL_CHAIN: 'REMOVEDFROMAPPROVALCHAIN', RENAMED: 'RENAMED', REPORT_PREVIEW: 'REPORTPREVIEW', SELECTED_FOR_RANDOM_AUDIT: 'SELECTEDFORRANDOMAUDIT', // OldDot Action diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 763f221f56fe..1462fbcabb5e 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -491,6 +491,15 @@ type OriginalMessageUnapproved = { expenseReportID: string; }; +/** Model of `Removed From Approval Chain` report action */ +type OriginalMessageRemovedFromApprovalChain = { + /** The submitter whose approval chain changed such that the approver was removed from their approval chain */ + submitterAccountID: number; + + /** The accountID of the approver who was removed from the submitter's approval chain */ + whisperedTo: number[]; +} + /** * Model of `Add payment card` report action */ @@ -557,8 +566,9 @@ type OriginalMessageMap = { [CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DEQUEUED]: OriginalMessageReimbursementDequeued; [CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DELAYED]: never; [CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED]: OriginalMessageReimbursementQueued; + [CONST.REPORT.ACTIONS.TYPE.REJECTED]: OriginalMessageRemovedFromApprovalChain; + [CONST.REPORT.ACTIONS.TYPE.REMOVED_FROM_APPROVAL_CHAIN]: never; [CONST.REPORT.ACTIONS.TYPE.RENAMED]: OriginalMessageRenamed; - [CONST.REPORT.ACTIONS.TYPE.REJECTED]: never; [CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW]: OriginalMessageReportPreview; [CONST.REPORT.ACTIONS.TYPE.SELECTED_FOR_RANDOM_AUDIT]: never; [CONST.REPORT.ACTIONS.TYPE.SHARE]: never; From 4b57ce80177740af5b0ede5ba50696fb0788a236 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 3 Sep 2024 13:22:37 -0600 Subject: [PATCH 02/14] Add action message translations --- src/languages/en.ts | 1 + src/languages/es.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/src/languages/en.ts b/src/languages/en.ts index 7304ca72e965..923a9c1bd23b 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3736,6 +3736,7 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `updated the name of this workspace from ${oldName} to ${newName}`, + removedFromApprovalWorkflow: ({submitterName}) => `removed you from ${submitterName}'s approval workflow and workspace chat. Previously submitted reports will remain available for approval in your Inbox.`, }, roomMembersPage: { memberNotFound: 'Member not found. To invite a new member to the room, please use the invite button above.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 8fb754143cb2..c26822fa5bb6 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3787,6 +3787,7 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `actualizó el nombre de este espacio de trabajo de ${oldName} a ${newName}`, + removedFromApprovalWorkflow: ({submitterName}) => `te ha eliminado del flujo de trabajo de aprobación de ${submitterName} y del chat del área de trabajo. Los informes enviados anteriormente seguirán disponibles para su aprobación en su bandeja de entrada.`, }, roomMembersPage: { memberNotFound: 'Miembro no encontrado. Para invitar a un nuevo miembro a la sala de chat, por favor, utiliza el botón invitar que está más arriba.', From 366fd89940622ae816d26aae4cce64a1d6080ea6 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 3 Sep 2024 13:31:33 -0600 Subject: [PATCH 03/14] Update spanish copy --- src/languages/es.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/languages/es.ts b/src/languages/es.ts index c26822fa5bb6..395bcb528c02 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3787,7 +3787,7 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `actualizó el nombre de este espacio de trabajo de ${oldName} a ${newName}`, - removedFromApprovalWorkflow: ({submitterName}) => `te ha eliminado del flujo de trabajo de aprobación de ${submitterName} y del chat del área de trabajo. Los informes enviados anteriormente seguirán disponibles para su aprobación en su bandeja de entrada.`, + removedFromApprovalWorkflow: ({submitterName}) => `te eliminó del flujo de trabajo de aprobaciones y del chat del espacio de trabajo de ${submitterName}. Los informes enviados anteriormente seguirán estando disponibles para su aprobación en tu bandeja de entrada.`, }, roomMembersPage: { memberNotFound: 'Miembro no encontrado. Para invitar a un nuevo miembro a la sala de chat, por favor, utiliza el botón invitar que está más arriba.', From fecc14c33da4b2305308119a87442379e800e4c9 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Tue, 3 Sep 2024 14:55:13 -0600 Subject: [PATCH 04/14] Build action message correctly --- src/libs/ReportActionsUtils.ts | 15 ++++++++++++--- src/pages/home/report/ReportActionItem.tsx | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 4d126cf9cbf4..f6e88dc1ec10 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1648,10 +1648,18 @@ function getPolicyChangeLogDeleteMemberMessage(reportAction: OnyxInputOrEntry>) { - const initialMessage = getOriginalMessage(reportAction); + const originalMessage = getOriginalMessage(reportAction); return Localize.translateLocal('newRoomPage.renamedRoomAction', { - oldName: initialMessage?.oldName ?? '', - newName: initialMessage?.newName ?? '', + oldName: originalMessage?.oldName ?? '', + newName: originalMessage?.newName ?? '', + }); +} + +function getRemovedFromApprovalChainMessage(reportAction: OnyxEntry>) { + const originalMessage = getOriginalMessage(reportAction); + const submitterDetails = PersonalDetailsUtils.getPersonalDetailsByIDs([originalMessage?.submitterAccountID ?? 0], currentUserAccountID ?? -1)[0]; + return Localize.translateLocal('workspaceActions.removedFromApprovalWorkflow', { + submitterName: submitterDetails?.displayName ?? submitterDetails?.login ?? 'Unknown Submitter', }); } @@ -1681,6 +1689,7 @@ export { getOneTransactionThreadReportID, getOriginalMessage, getParentReportAction, + getRemovedFromApprovalChainMessage, getReportAction, getReportActionHtml, getReportActionMessage, diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index ff7fb4ff9238..e3e59302cece 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -664,6 +664,8 @@ function ReportActionItem({ children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_EMPLOYEE) { children = ; + } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REMOVED_FROM_APPROVAL_CHAIN) { + children = ; } else if ( ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED, CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL, CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS) ) { From 420e152e490de082c2c5439a2f860730fa2fab9b Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 5 Sep 2024 16:11:26 -0600 Subject: [PATCH 05/14] Update translations for multiple submitters --- src/languages/en.ts | 14 +++++++++++++- src/languages/es.ts | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 45d99c9638b8..a40c9fe58100 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3790,7 +3790,19 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `updated the name of this workspace from ${oldName} to ${newName}`, - removedFromApprovalWorkflow: ({submitterName}) => `removed you from ${submitterName}'s approval workflow and workspace chat. Previously submitted reports will remain available for approval in your Inbox.`, + removedFromApprovalWorkflow: ({submittersNames}) => { + let joinedNames: string = ''; + if (submittersNames.length === 1) { + joinedNames = submittersNames[0]; + } else if (submittersNames.length === 2) { + joinedNames = submittersNames.join(' and '); + } else if (submittersNames.length > 2) { + joinedNames = submittersNames.slice(0, submittersNames.length - 1).join(', ') + ' and ' + submittersNames[submittersNames.length - 1]; + } + const workflowWord = Str.pluralize('workflow', 'workflows', submittersNames.length); + const chatWord = Str.pluralize('chat', 'chats', submittersNames.length); + return `removed you from ${submittersNames}'s approval ${workflowWord} and workspace chat${chatWord}. Previously submitted reports will remain available for approval in your Inbox.`; + }, }, roomMembersPage: { memberNotFound: 'Member not found. To invite a new member to the room, please use the invite button above.', diff --git a/src/languages/es.ts b/src/languages/es.ts index 1469a62fa5e3..15e1f282b2db 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3841,7 +3841,19 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `actualizó el nombre de este espacio de trabajo de ${oldName} a ${newName}`, - removedFromApprovalWorkflow: ({submitterName}) => `te eliminó del flujo de trabajo de aprobaciones y del chat del espacio de trabajo de ${submitterName}. Los informes enviados anteriormente seguirán estando disponibles para su aprobación en tu bandeja de entrada.`, + removedFromApprovalWorkflow: ({submittersNames}) => { + let joinedNames: string = ''; + if (submittersNames.length === 1) { + joinedNames = submittersNames[0]; + } else if (submittersNames.length === 2) { + joinedNames = submittersNames.join(' y '); + } else if (submittersNames.length > 2) { + joinedNames = submittersNames.slice(0, submittersNames.length - 1).join(', ') + ' y ' + submittersNames[submittersNames.length - 1]; + } + const workflowWord = Str.pluralize('del flujo', 'de los flujos', submittersNames.length); + const chatWord = Str.pluralize('del chat', 'de los chats', submittersNames.length); + return `te eliminó ${workflowWord} de trabajo de aprobaciones y ${chatWord} del espacio de trabajo de ${joinedNames}. Los informes enviados anteriormente seguirán estando disponibles para su aprobación en tu bandeja de entrada.`; + }, }, roomMembersPage: { memberNotFound: 'Miembro no encontrado. Para invitar a un nuevo miembro a la sala de chat, por favor, utiliza el botón invitar que está más arriba.', From 423ff6eda33aaa6d12d66a2ad7810b190e730d00 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 5 Sep 2024 16:12:29 -0600 Subject: [PATCH 06/14] Remove dupe --- 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 a40c9fe58100..b72109bb8a44 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3801,7 +3801,7 @@ export default { } const workflowWord = Str.pluralize('workflow', 'workflows', submittersNames.length); const chatWord = Str.pluralize('chat', 'chats', submittersNames.length); - return `removed you from ${submittersNames}'s approval ${workflowWord} and workspace chat${chatWord}. Previously submitted reports will remain available for approval in your Inbox.`; + return `removed you from ${submittersNames}'s approval ${workflowWord} and workspace ${chatWord}. Previously submitted reports will remain available for approval in your Inbox.`; }, }, roomMembersPage: { From 0f6c687a2799f935feb383d3e1a2e3b32f00b1cd Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 5 Sep 2024 16:21:47 -0600 Subject: [PATCH 07/14] Update action type and fix misplaced type --- src/types/onyx/OriginalMessage.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index 1462fbcabb5e..cfa20641de68 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -493,8 +493,8 @@ type OriginalMessageUnapproved = { /** Model of `Removed From Approval Chain` report action */ type OriginalMessageRemovedFromApprovalChain = { - /** The submitter whose approval chain changed such that the approver was removed from their approval chain */ - submitterAccountID: number; + /** The submitter IDs whose approval chains changed such that the approver was removed from their approval chains */ + submittersAccountIDs: number[]; /** The accountID of the approver who was removed from the submitter's approval chain */ whisperedTo: number[]; @@ -566,8 +566,8 @@ type OriginalMessageMap = { [CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DEQUEUED]: OriginalMessageReimbursementDequeued; [CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_DELAYED]: never; [CONST.REPORT.ACTIONS.TYPE.REIMBURSEMENT_QUEUED]: OriginalMessageReimbursementQueued; - [CONST.REPORT.ACTIONS.TYPE.REJECTED]: OriginalMessageRemovedFromApprovalChain; - [CONST.REPORT.ACTIONS.TYPE.REMOVED_FROM_APPROVAL_CHAIN]: never; + [CONST.REPORT.ACTIONS.TYPE.REJECTED]: never; + [CONST.REPORT.ACTIONS.TYPE.REMOVED_FROM_APPROVAL_CHAIN]: OriginalMessageRemovedFromApprovalChain; [CONST.REPORT.ACTIONS.TYPE.RENAMED]: OriginalMessageRenamed; [CONST.REPORT.ACTIONS.TYPE.REPORT_PREVIEW]: OriginalMessageReportPreview; [CONST.REPORT.ACTIONS.TYPE.SELECTED_FOR_RANDOM_AUDIT]: never; From 4b091aacae43ce5480c9785f346ff46309590480 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 5 Sep 2024 16:21:57 -0600 Subject: [PATCH 08/14] Handle building multiple submitter names --- src/libs/ReportActionsUtils.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index f6e88dc1ec10..59c57fe3444f 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1657,10 +1657,9 @@ function getRenamedAction(reportAction: OnyxEntry>) { const originalMessage = getOriginalMessage(reportAction); - const submitterDetails = PersonalDetailsUtils.getPersonalDetailsByIDs([originalMessage?.submitterAccountID ?? 0], currentUserAccountID ?? -1)[0]; - return Localize.translateLocal('workspaceActions.removedFromApprovalWorkflow', { - submitterName: submitterDetails?.displayName ?? submitterDetails?.login ?? 'Unknown Submitter', - }); + const submittersNames = PersonalDetailsUtils.getPersonalDetailsByIDs(originalMessage?.submittersAccountIDs ?? [], currentUserAccountID ?? -1) + .map(({displayName, login}) => displayName ?? login ?? 'Unknown Submitter'); + return Localize.translateLocal('workspaceActions.removedFromApprovalWorkflow', {submittersNames}); } export { From d0ab84d2509bc2cc6af329d2f9e01bb05e0a9f2d Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Thu, 5 Sep 2024 16:22:18 -0600 Subject: [PATCH 09/14] Added semicolon --- src/types/onyx/OriginalMessage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types/onyx/OriginalMessage.ts b/src/types/onyx/OriginalMessage.ts index cfa20641de68..1e2328688e90 100644 --- a/src/types/onyx/OriginalMessage.ts +++ b/src/types/onyx/OriginalMessage.ts @@ -498,7 +498,7 @@ type OriginalMessageRemovedFromApprovalChain = { /** The accountID of the approver who was removed from the submitter's approval chain */ whisperedTo: number[]; -} +}; /** * Model of `Add payment card` report action From f7b6c56feb3436654295b91f58d7031f3389f7a1 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Fri, 6 Sep 2024 12:51:20 -0600 Subject: [PATCH 10/14] Add type to destructured param --- src/languages/en.ts | 2 +- src/languages/es.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index a04fece911f9..d57e351bc32a 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3790,7 +3790,7 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `updated the name of this workspace from ${oldName} to ${newName}`, - removedFromApprovalWorkflow: ({submittersNames}) => { + removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: Array}) => { let joinedNames: string = ''; if (submittersNames.length === 1) { joinedNames = submittersNames[0]; diff --git a/src/languages/es.ts b/src/languages/es.ts index b1732e0b5fa0..fe2fced45979 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3841,7 +3841,7 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `actualizó el nombre de este espacio de trabajo de ${oldName} a ${newName}`, - removedFromApprovalWorkflow: ({submittersNames}) => { + removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: Array}) => { let joinedNames: string = ''; if (submittersNames.length === 1) { joinedNames = submittersNames[0]; From 5cf7977395752d80d9a8e69d1e1f7ebdb9d42572 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Fri, 6 Sep 2024 13:03:21 -0600 Subject: [PATCH 11/14] Specify type before calling function --- src/pages/home/report/ReportActionItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionItem.tsx b/src/pages/home/report/ReportActionItem.tsx index e68f25d7529a..2c773f93ecba 100644 --- a/src/pages/home/report/ReportActionItem.tsx +++ b/src/pages/home/report/ReportActionItem.tsx @@ -664,7 +664,7 @@ function ReportActionItem({ children = ; } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.DELETE_EMPLOYEE) { children = ; - } else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.REMOVED_FROM_APPROVAL_CHAIN) { + } else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.REMOVED_FROM_APPROVAL_CHAIN)) { children = ; } else if ( ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED, CONST.REPORT.ACTIONS.TYPE.CARD_ISSUED_VIRTUAL, CONST.REPORT.ACTIONS.TYPE.CARD_MISSING_ADDRESS) From e380ce76c72a771101290d1dd0a6ddf95e996e33 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Fri, 6 Sep 2024 13:04:12 -0600 Subject: [PATCH 12/14] prettify --- src/libs/ReportActionsUtils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 59c57fe3444f..1f3fb35dc5ad 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -1657,8 +1657,9 @@ function getRenamedAction(reportAction: OnyxEntry>) { const originalMessage = getOriginalMessage(reportAction); - const submittersNames = PersonalDetailsUtils.getPersonalDetailsByIDs(originalMessage?.submittersAccountIDs ?? [], currentUserAccountID ?? -1) - .map(({displayName, login}) => displayName ?? login ?? 'Unknown Submitter'); + const submittersNames = PersonalDetailsUtils.getPersonalDetailsByIDs(originalMessage?.submittersAccountIDs ?? [], currentUserAccountID ?? -1).map( + ({displayName, login}) => displayName ?? login ?? 'Unknown Submitter', + ); return Localize.translateLocal('workspaceActions.removedFromApprovalWorkflow', {submittersNames}); } From 5b9b439c3f78de0947fd9fe0cd8c33e9378cfc40 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Fri, 6 Sep 2024 13:53:30 -0600 Subject: [PATCH 13/14] Fix array type and bug --- src/languages/en.ts | 4 ++-- src/languages/es.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index d57e351bc32a..4b5cfaebdc9a 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3790,7 +3790,7 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `updated the name of this workspace from ${oldName} to ${newName}`, - removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: Array}) => { + removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: string[]}) => { let joinedNames: string = ''; if (submittersNames.length === 1) { joinedNames = submittersNames[0]; @@ -3801,7 +3801,7 @@ export default { } const workflowWord = Str.pluralize('workflow', 'workflows', submittersNames.length); const chatWord = Str.pluralize('chat', 'chats', submittersNames.length); - return `removed you from ${submittersNames}'s approval ${workflowWord} and workspace ${chatWord}. Previously submitted reports will remain available for approval in your Inbox.`; + return `removed you from ${joinedNames}'s approval ${workflowWord} and workspace ${chatWord}. Previously submitted reports will remain available for approval in your Inbox.`; }, }, roomMembersPage: { diff --git a/src/languages/es.ts b/src/languages/es.ts index fe2fced45979..b48277371725 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3841,7 +3841,7 @@ export default { }, workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `actualizó el nombre de este espacio de trabajo de ${oldName} a ${newName}`, - removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: Array}) => { + removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: string[]}) => { let joinedNames: string = ''; if (submittersNames.length === 1) { joinedNames = submittersNames[0]; From 7f4bd94722749a14f71650566292cc1c4a608dc2 Mon Sep 17 00:00:00 2001 From: Alex Beaman Date: Fri, 6 Sep 2024 14:16:28 -0600 Subject: [PATCH 14/14] Lint plz be happy --- src/languages/en.ts | 4 ++-- src/languages/es.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/languages/en.ts b/src/languages/en.ts index 4b5cfaebdc9a..9be0eb0ca030 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -3791,13 +3791,13 @@ export default { workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `updated the name of this workspace from ${oldName} to ${newName}`, removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: string[]}) => { - let joinedNames: string = ''; + let joinedNames = ''; if (submittersNames.length === 1) { joinedNames = submittersNames[0]; } else if (submittersNames.length === 2) { joinedNames = submittersNames.join(' and '); } else if (submittersNames.length > 2) { - joinedNames = submittersNames.slice(0, submittersNames.length - 1).join(', ') + ' and ' + submittersNames[submittersNames.length - 1]; + joinedNames = `${submittersNames.slice(0, submittersNames.length - 1).join(', ')} and ${submittersNames[submittersNames.length - 1]}`; } const workflowWord = Str.pluralize('workflow', 'workflows', submittersNames.length); const chatWord = Str.pluralize('chat', 'chats', submittersNames.length); diff --git a/src/languages/es.ts b/src/languages/es.ts index b48277371725..58ba20d96e08 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -3842,13 +3842,13 @@ export default { workspaceActions: { renamedWorkspaceNameAction: ({oldName, newName}) => `actualizó el nombre de este espacio de trabajo de ${oldName} a ${newName}`, removedFromApprovalWorkflow: ({submittersNames}: {submittersNames: string[]}) => { - let joinedNames: string = ''; + let joinedNames = ''; if (submittersNames.length === 1) { joinedNames = submittersNames[0]; } else if (submittersNames.length === 2) { joinedNames = submittersNames.join(' y '); } else if (submittersNames.length > 2) { - joinedNames = submittersNames.slice(0, submittersNames.length - 1).join(', ') + ' y ' + submittersNames[submittersNames.length - 1]; + joinedNames = `${submittersNames.slice(0, submittersNames.length - 1).join(', ')} y ${submittersNames[submittersNames.length - 1]}`; } const workflowWord = Str.pluralize('del flujo', 'de los flujos', submittersNames.length); const chatWord = Str.pluralize('del chat', 'de los chats', submittersNames.length);