Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Rename Report Action #45869

Merged
merged 10 commits into from
Aug 5, 2024
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}`,
neonbhai marked this conversation as resolved.
Show resolved Hide resolved
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
Loading