diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx index 1352306c4d..6d7f99de6e 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveBatchActions.tsx @@ -17,13 +17,13 @@ import { ArchivedFeatureReviveConfirm } from './ArchivedFeatureActionCell/Archiv interface IArchiveBatchActionsProps { selectedIds: string[]; projectId: string; - onReviveConfirm?: () => void; + onConfirm?: () => void; } export const ArchiveBatchActions: FC = ({ selectedIds, projectId, - onReviveConfirm, + onConfirm, }) => { const { refetchArchived } = useFeaturesArchive(projectId); const [deleteModalOpen, setDeleteModalOpen] = useState(false); @@ -73,6 +73,7 @@ export const ArchiveBatchActions: FC = ({ setOpen={setDeleteModalOpen} refetch={() => { refetchArchived(); + onConfirm?.(); trackEvent('batch_operations', { props: { eventType: 'features deleted', @@ -87,7 +88,7 @@ export const ArchiveBatchActions: FC = ({ setOpen={setReviveModalOpen} refetch={() => { refetchArchived(); - onReviveConfirm?.(); + onConfirm?.(); trackEvent('batch_operations', { props: { eventType: 'features revived', diff --git a/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx b/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx index fa05953b52..df8d4d696f 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchiveTable.tsx @@ -349,7 +349,7 @@ export const ArchiveTable = ({ toggleAllRowsSelected(false)} + onConfirm={() => toggleAllRowsSelected(false)} /> } diff --git a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx index da31864edf..7955a5bdc1 100644 --- a/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx +++ b/frontend/src/component/archive/ArchiveTable/ArchivedFeatureActionCell/ArchivedFeatureDeleteConfirm/ArchivedFeatureDeleteConfirm.tsx @@ -36,6 +36,9 @@ export const ArchivedFeatureDeleteConfirm = ({ const { setToastData, setToastApiError } = useToast(); const { deleteFeatures } = useProjectApi(); + const singularOrPluralToggles = + deletedFeatures.length > 1 ? 'toggles' : 'toggle'; + const onDeleteFeatureToggle = async () => { try { if (deletedFeatures.length === 0) { @@ -46,8 +49,8 @@ export const ArchivedFeatureDeleteConfirm = ({ await refetch(); setToastData({ type: 'success', - title: 'Feature toggles deleted', - text: `You have successfully deleted following features toggles: ${deletedFeatures.join( + title: `Feature ${singularOrPluralToggles} deleted`, + text: `You have successfully deleted the following feature ${singularOrPluralToggles}: ${deletedFeatures.join( ', ', )}.`, }); @@ -67,9 +70,9 @@ export const ArchivedFeatureDeleteConfirm = ({ return ( - In order to delete feature toggles, please enter the following - confirmation text in the text field below:{' '} + You are about to delete the following feature{' '} + {singularOrPluralToggles}:{' '} + {deletedFeatures.join(', ')}. + + + ({ marginTop: theme.spacing(2) })} + > + In order to delete the feature {singularOrPluralToggles}, please + enter the following confirmation text in the text field below:{' '} I want to delete