Skip to content

Commit

Permalink
Merge pull request Expensify#45869 from neonbhai/rename-action-fix
Browse files Browse the repository at this point in the history
Fix Rename Report Action
  • Loading branch information
roryabraham authored Aug 5, 2024
2 parents a4e5a52 + f80d19b commit 0a17821
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 43 deletions.
37 changes: 0 additions & 37 deletions src/components/ReportActionItem/RenameAction.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3540,7 +3540,7 @@ export default {
roomNameInvalidError: 'Room names can only include lowercase letters, numbers, and hyphens.',
pleaseEnterRoomName: 'Please enter a room name.',
pleaseSelectWorkspace: 'Please select a workspace.',
renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => ` renamed this room from ${oldName} to ${newName}`,
renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => `renamed this room from ${oldName} to ${newName}`,
roomRenamedTo: ({newName}: RoomRenamedToParams) => `Room renamed to ${newName}`,
social: 'social',
selectAWorkspace: 'Select a workspace',
Expand Down
2 changes: 1 addition & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3594,7 +3594,7 @@ export default {
roomNameInvalidError: 'Los nombres de las salas solo pueden contener minúsculas, números y guiones.',
pleaseEnterRoomName: 'Por favor, escribe el nombre de una sala.',
pleaseSelectWorkspace: 'Por favor, selecciona un espacio de trabajo.',
renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => ` cambió el nombre de la sala de ${oldName} a ${newName}`,
renamedRoomAction: ({oldName, newName}: RenamedRoomActionParams) => `cambió el nombre de la sala de ${oldName} a ${newName}`,
roomRenamedTo: ({newName}: RoomRenamedToParams) => `Sala renombrada a ${newName}`,
social: 'social',
selectAWorkspace: 'Seleccionar un espacio de trabajo',
Expand Down
11 changes: 7 additions & 4 deletions src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import ChronosOOOListActions from '@components/ReportActionItem/ChronosOOOListAc
import ExportIntegration from '@components/ReportActionItem/ExportIntegration';
import IssueCardMessage from '@components/ReportActionItem/IssueCardMessage';
import MoneyRequestAction from '@components/ReportActionItem/MoneyRequestAction';
import RenameAction from '@components/ReportActionItem/RenameAction';
import ReportPreview from '@components/ReportActionItem/ReportPreview';
import TaskAction from '@components/ReportActionItem/TaskAction';
import TaskPreview from '@components/ReportActionItem/TaskPreview';
Expand Down Expand Up @@ -658,6 +657,13 @@ function ReportActionItem({
children = <IssueCardMessage action={action} />;
} else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION)) {
children = <ExportIntegration action={action} />;
} else if (ReportActionsUtils.isRenamedAction(action)) {
const initialMessage = ReportActionsUtils.getOriginalMessage(action);
const message = translate('newRoomPage.renamedRoomAction', {
oldName: initialMessage?.oldName ?? '',
newName: initialMessage?.newName ?? '',
});
children = <ReportActionItemBasicMessage message={message} />;
} else {
const hasBeenFlagged =
![CONST.MODERATION.MODERATOR_DECISION_APPROVED, CONST.MODERATION.MODERATOR_DECISION_PENDING].some((item) => item === moderationDecision) &&
Expand Down Expand Up @@ -839,9 +845,6 @@ function ReportActionItem({
/>
);
}
if (action.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
return <RenameAction action={action} />;
}
if (ReportActionsUtils.isChronosOOOListAction(action)) {
return (
<ChronosOOOListActions
Expand Down

0 comments on commit 0a17821

Please sign in to comment.