Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6557,6 +6557,8 @@ const translations = {
: `changed the "${categoryName}" category description hint to “${newValue}” (previously “${oldValue}”)`;
},
updateTagListName: ({oldName, newName}: UpdatedPolicyCategoryNameParams) => `changed the tag list name to "${newName}" (previously "${oldName}")`,
updateTagListRequired: ({tagListsName, isRequired}: {tagListsName: string; isRequired: boolean}) =>
`updated the tag list "${tagListsName}" to be "${isRequired ? 'required' : 'not required'}"`,
addTag: ({tagListName, tagName}: UpdatedPolicyTagParams) => `added the tag "${tagName}" to the list "${tagListName}"`,
updateTagName: ({tagListName, newName, oldName}: UpdatedPolicyTagNameParams) => `updated the tag list "${tagListName}" by changing the tag "${oldName}" to "${newName}`,
updateTagEnabled: ({tagListName, tagName, enabled}: UpdatedPolicyTagParams) => `${enabled ? 'enabled' : 'disabled'} the tag "${tagName}" on the list "${tagListName}"`,
Expand Down
12 changes: 12 additions & 0 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2772,6 +2772,17 @@ function getTagListNameUpdatedMessage(translate: LocalizedTranslate, action: Rep
return getReportActionText(action);
}

function getTagListRequiredUpdatedMessage(translate: LocalizedTranslate, action: ReportAction): string {
const {tagListsName, isRequired} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_REQUIRED>) ?? {};
if (tagListsName !== undefined && isRequired !== undefined) {
return translate('workspaceActions.updateTagListRequired', {
tagListsName,
isRequired,
});
}
return getReportActionText(action);
}

function getWorkspaceCustomUnitUpdatedMessage(translate: LocalizedTranslate, action: ReportAction): string {
const {oldValue, newValue, customUnitName, updatedField} = getOriginalMessage(action as ReportAction<typeof CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CUSTOM_UNIT>) ?? {};

Expand Down Expand Up @@ -3996,6 +4007,7 @@ export {
getAddedConnectionMessage,
getWorkspaceCustomUnitRateUpdatedMessage,
getTagListNameUpdatedMessage,
getTagListRequiredUpdatedMessage,
getWorkspaceCustomUnitUpdatedMessage,
getRoomChangeLogMessage,
shouldShowActivateCard,
Expand Down
3 changes: 3 additions & 0 deletions src/libs/SidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import {
getSettlementAccountLockedMessage,
getSubmitsToUpdateMessage,
getTagListNameUpdatedMessage,
getTagListRequiredUpdatedMessage,
getTravelUpdateMessage,
getUpdateACHAccountMessage,
getUpdatedApprovalRuleMessage,
Expand Down Expand Up @@ -890,6 +891,8 @@ function getOptionData({
result.alternateText = getWorkspaceTaxUpdateMessage(translate, lastAction);
} else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_NAME)) {
result.alternateText = getCleanedTagName(getTagListNameUpdatedMessage(translate, lastAction) ?? '');
} else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_REQUIRED)) {
result.alternateText = getCleanedTagName(getTagListRequiredUpdatedMessage(translate, lastAction) ?? '');
} else if (isTagModificationAction(lastAction?.actionName ?? '')) {
result.alternateText = getCleanedTagName(getWorkspaceTagUpdateMessage(translate, lastAction) ?? '');
} else if (isActionOfType(lastAction, CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CUSTOM_UNIT)) {
Expand Down
3 changes: 3 additions & 0 deletions src/pages/inbox/report/ContextMenu/ContextMenuActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import {
getSettlementAccountLockedMessage,
getSubmitsToUpdateMessage,
getTagListNameUpdatedMessage,
getTagListRequiredUpdatedMessage,
getTravelUpdateMessage,
getUpdateACHAccountMessage,
getUpdatedApprovalRuleMessage,
Expand Down Expand Up @@ -781,6 +782,8 @@ const ContextMenuActions: ContextMenuAction[] = [
Clipboard.setString(getWorkspaceTaxUpdateMessage(translate, reportAction));
} else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_NAME) {
Clipboard.setString(getCleanedTagName(getTagListNameUpdatedMessage(translate, reportAction)));
} else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_REQUIRED) {
Clipboard.setString(getCleanedTagName(getTagListRequiredUpdatedMessage(translate, reportAction)));
} else if (isTagModificationAction(reportAction.actionName)) {
Clipboard.setString(getCleanedTagName(getWorkspaceTagUpdateMessage(translate, reportAction)));
} else if (reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CUSTOM_UNIT) {
Expand Down
3 changes: 3 additions & 0 deletions src/pages/inbox/report/PureReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ import {
getSettlementAccountLockedMessage,
getSubmitsToUpdateMessage,
getTagListNameUpdatedMessage,
getTagListRequiredUpdatedMessage,
getTravelUpdateMessage,
getUpdateACHAccountMessage,
getUpdatedApprovalRuleMessage,
Expand Down Expand Up @@ -1501,6 +1502,8 @@ function PureReportActionItem({
children = <ReportActionItemBasicMessage message={getWorkspaceTaxUpdateMessage(translate, action)} />;
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_NAME) {
children = <ReportActionItemBasicMessage message={getCleanedTagName(getTagListNameUpdatedMessage(translate, action))} />;
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_TAG_LIST_REQUIRED) {
children = <ReportActionItemBasicMessage message={getCleanedTagName(getTagListRequiredUpdatedMessage(translate, action))} />;
} else if (isTagModificationAction(action.actionName)) {
children = <ReportActionItemBasicMessage message={getCleanedTagName(getWorkspaceTagUpdateMessage(translate, action))} />;
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.POLICY_CHANGE_LOG.UPDATE_CUSTOM_UNIT) {
Expand Down
6 changes: 6 additions & 0 deletions src/types/onyx/OriginalMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,12 @@ type OriginalMessagePolicyChangeLog = {
/** The name of the enabled/disabled feature */
featureName?: string;

/** The name of the tag list being updated */
tagListsName?: string;

/** Whether the tag list is required */
isRequired?: boolean;

/** The new reimburser details */
reimburser?: {
/** The email of the new reimburser */
Expand Down
Loading