Update wording to indicate how to restore records (#10686)
This commit is contained in:
@ -16,8 +16,10 @@ import { getRecordIndexIdFromObjectNamePluralAndViewId } from '@/object-record/u
|
|||||||
import { useHasObjectReadOnlyPermission } from '@/settings/roles/hooks/useHasObjectReadOnlyPermission';
|
import { useHasObjectReadOnlyPermission } from '@/settings/roles/hooks/useHasObjectReadOnlyPermission';
|
||||||
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
||||||
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
import { useRecoilComponentValueV2 } from '@/ui/utilities/state/component-state/hooks/useRecoilComponentValueV2';
|
||||||
|
import { t } from '@lingui/core/macro';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
import { isDefined } from 'twenty-shared';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
import { getOsControlSymbol } from 'twenty-ui';
|
||||||
|
|
||||||
export const useDeleteMultipleRecordsAction: ActionHookWithObjectMetadataItem =
|
export const useDeleteMultipleRecordsAction: ActionHookWithObjectMetadataItem =
|
||||||
({ objectMetadataItem }) => {
|
({ objectMetadataItem }) => {
|
||||||
@ -108,12 +110,14 @@ export const useDeleteMultipleRecordsAction: ActionHookWithObjectMetadataItem =
|
|||||||
setIsDeleteRecordsModalOpen(true);
|
setIsDeleteRecordsModalOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const osControlSymbol = getOsControlSymbol();
|
||||||
|
|
||||||
const confirmationModal = (
|
const confirmationModal = (
|
||||||
<ConfirmationModal
|
<ConfirmationModal
|
||||||
isOpen={isDeleteRecordsModalOpen}
|
isOpen={isDeleteRecordsModalOpen}
|
||||||
setIsOpen={setIsDeleteRecordsModalOpen}
|
setIsOpen={setIsDeleteRecordsModalOpen}
|
||||||
title={'Delete Records'}
|
title={'Delete Records'}
|
||||||
subtitle={`Are you sure you want to delete these records? They can be recovered from the Options menu.`}
|
subtitle={t`Are you sure you want to delete these records? They can be recovered from the Command menu (${osControlSymbol} + K).`}
|
||||||
onConfirmClick={handleDeleteClick}
|
onConfirmClick={handleDeleteClick}
|
||||||
confirmButtonText={'Delete Records'}
|
confirmButtonText={'Delete Records'}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -9,10 +9,12 @@ import { useRecordTable } from '@/object-record/record-table/hooks/useRecordTabl
|
|||||||
import { useHasObjectReadOnlyPermission } from '@/settings/roles/hooks/useHasObjectReadOnlyPermission';
|
import { useHasObjectReadOnlyPermission } from '@/settings/roles/hooks/useHasObjectReadOnlyPermission';
|
||||||
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModal';
|
||||||
import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
|
import { useRightDrawer } from '@/ui/layout/right-drawer/hooks/useRightDrawer';
|
||||||
|
import { t } from '@lingui/core/macro';
|
||||||
import { isNull } from '@sniptt/guards';
|
import { isNull } from '@sniptt/guards';
|
||||||
import { useCallback, useContext, useState } from 'react';
|
import { useCallback, useContext, useState } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { isDefined } from 'twenty-shared';
|
import { isDefined } from 'twenty-shared';
|
||||||
|
import { getOsControlSymbol } from 'twenty-ui';
|
||||||
|
|
||||||
export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
||||||
objectMetadataItem,
|
objectMetadataItem,
|
||||||
@ -76,6 +78,8 @@ export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
|||||||
setIsDeleteRecordsModalOpen(true);
|
setIsDeleteRecordsModalOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const osControlSymbol = getOsControlSymbol();
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shouldBeRegistered,
|
shouldBeRegistered,
|
||||||
onClick,
|
onClick,
|
||||||
@ -84,9 +88,7 @@ export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
|||||||
isOpen={isDeleteRecordsModalOpen}
|
isOpen={isDeleteRecordsModalOpen}
|
||||||
setIsOpen={setIsDeleteRecordsModalOpen}
|
setIsOpen={setIsDeleteRecordsModalOpen}
|
||||||
title={'Delete Record'}
|
title={'Delete Record'}
|
||||||
subtitle={
|
subtitle={t`Are you sure you want to delete this record? It can be recovered from the Command menu (${osControlSymbol} + K).`}
|
||||||
'Are you sure you want to delete this record? It can be recovered from the Options menu.'
|
|
||||||
}
|
|
||||||
onConfirmClick={() => {
|
onConfirmClick={() => {
|
||||||
handleDeleteClick();
|
handleDeleteClick();
|
||||||
if (isInRightDrawer) {
|
if (isInRightDrawer) {
|
||||||
|
|||||||
Reference in New Issue
Block a user