@ -18,7 +18,6 @@ import { ConfirmationModal } from '@/ui/layout/modal/components/ConfirmationModa
|
|||||||
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 { t } from '@lingui/core/macro';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
import { getOsControlSymbol } from 'twenty-ui';
|
|
||||||
import { isDefined } from 'twenty-shared/utils';
|
import { isDefined } from 'twenty-shared/utils';
|
||||||
|
|
||||||
export const useDeleteMultipleRecordsAction: ActionHookWithObjectMetadataItem =
|
export const useDeleteMultipleRecordsAction: ActionHookWithObjectMetadataItem =
|
||||||
@ -110,14 +109,12 @@ 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={t`Are you sure you want to delete these records? They can be recovered from the Command menu (${osControlSymbol} + K).`}
|
subtitle={t`Are you sure you want to delete these records? They can be recovered from the Command menu.`}
|
||||||
onConfirmClick={handleDeleteClick}
|
onConfirmClick={handleDeleteClick}
|
||||||
confirmButtonText={'Delete Records'}
|
confirmButtonText={'Delete Records'}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import { t } from '@lingui/core/macro';
|
|||||||
import { isNull } from '@sniptt/guards';
|
import { isNull } from '@sniptt/guards';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { getOsControlSymbol } from 'twenty-ui';
|
|
||||||
import { isDefined } from 'twenty-shared/utils';
|
import { isDefined } from 'twenty-shared/utils';
|
||||||
|
|
||||||
export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
||||||
@ -72,8 +71,6 @@ export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
|||||||
setIsDeleteRecordsModalOpen(true);
|
setIsDeleteRecordsModalOpen(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const osControlSymbol = getOsControlSymbol();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
shouldBeRegistered,
|
shouldBeRegistered,
|
||||||
onClick,
|
onClick,
|
||||||
@ -82,7 +79,7 @@ export const useDeleteSingleRecordAction: ActionHookWithObjectMetadataItem = ({
|
|||||||
isOpen={isDeleteRecordsModalOpen}
|
isOpen={isDeleteRecordsModalOpen}
|
||||||
setIsOpen={setIsDeleteRecordsModalOpen}
|
setIsOpen={setIsDeleteRecordsModalOpen}
|
||||||
title={'Delete Record'}
|
title={'Delete Record'}
|
||||||
subtitle={t`Are you sure you want to delete this record? It can be recovered from the Command menu (${osControlSymbol} + K).`}
|
subtitle={t`Are you sure you want to delete this record? It can be recovered from the Command menu.`}
|
||||||
onConfirmClick={() => {
|
onConfirmClick={() => {
|
||||||
handleDeleteClick();
|
handleDeleteClick();
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user