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 @@ -3466,7 +3466,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
11 changes: 7 additions & 4 deletions src/pages/home/report/ReportActionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import ActionableItemButtons from '@components/ReportActionItem/ActionableItemBu
import ChronosOOOListActions from '@components/ReportActionItem/ChronosOOOListActions';
import ExportIntegration from '@components/ReportActionItem/ExportIntegration';
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 = <ReportActionItemBasicMessage message={PolicyUtils.getCleanedTagName(ReportActionsUtils.getReportActionMessage(action)?.text ?? '')} />;
} else if (ReportActionsUtils.isActionOfType(action, CONST.REPORT.ACTIONS.TYPE.EXPORTED_TO_INTEGRATION)) {
children = <ExportIntegration action={action} />;
} else if (action.actionName === CONST.REPORT.ACTIONS.TYPE.RENAMED) {
neonbhai marked this conversation as resolved.
Show resolved Hide resolved
const initialMessage = ReportActionsUtils.isRenamedAction(action) ? ReportActionsUtils.getOriginalMessage(action) : null;
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