mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
console: fix remove source cascading
[DSF-437]: https://hasurahq.atlassian.net/browse/DSF-437?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ PR-URL: https://github.com/hasura/graphql-engine-mono/pull/9642 GitOrigin-RevId: fc18f90cc328b78124b3254783b44da6cb51022e
This commit is contained in:
parent
5dc4630b5e
commit
3af0d49dd7
@ -108,6 +108,8 @@ export const ListConnectedDatabases = (props?: { className?: string }) => {
|
||||
resourceName: databaseItem.dataSourceName,
|
||||
resourceType: 'Data Source',
|
||||
destroyTerm: 'remove',
|
||||
appendTerm:
|
||||
'Any metadata dependent objects (relationships, permissions etc.) from other sources will also be dropped as a result.',
|
||||
onConfirm: async () => {
|
||||
let success = true;
|
||||
|
||||
|
@ -35,6 +35,7 @@ export const useDropSource = (props?: MetadataMigrationOptions) => {
|
||||
type: `${driver}_drop_source`,
|
||||
args: {
|
||||
name: dataSourceName,
|
||||
cascade: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -208,11 +208,13 @@ const useDestructiveConfirm = () => {
|
||||
resourceName,
|
||||
resourceType,
|
||||
destroyTerm = 'remove',
|
||||
appendTerm = '',
|
||||
onConfirm,
|
||||
}: {
|
||||
resourceName: string;
|
||||
resourceType: string;
|
||||
destroyTerm?: 'delete' | 'remove';
|
||||
appendTerm?: string;
|
||||
onConfirm: () => Promise<boolean>;
|
||||
}) => {
|
||||
if (!onConfirm) throw new Error('onCloseAsync() is required.');
|
||||
@ -222,7 +224,7 @@ const useDestructiveConfirm = () => {
|
||||
message: (
|
||||
<div>
|
||||
Are you sure you want to {destroyTerm} {resourceType}:{' '}
|
||||
<strong>{resourceName}</strong>?
|
||||
<strong>{resourceName}</strong>?{appendTerm ? ` ${appendTerm}` : ''}
|
||||
</div>
|
||||
),
|
||||
confirmText: 'Remove',
|
||||
@ -255,11 +257,13 @@ const useDestructivePrompt = () => {
|
||||
resourceName,
|
||||
resourceType,
|
||||
destroyTerm = 'remove',
|
||||
appendTerm = '',
|
||||
onConfirm,
|
||||
}: {
|
||||
resourceName: string;
|
||||
resourceType: string;
|
||||
destroyTerm?: 'delete' | 'remove';
|
||||
appendTerm?: string;
|
||||
onConfirm: () => Promise<boolean>;
|
||||
}) => {
|
||||
if (!onConfirm) throw new Error('onCloseAsync() is required.');
|
||||
@ -269,7 +273,7 @@ const useDestructivePrompt = () => {
|
||||
message: (
|
||||
<div>
|
||||
Are you sure you want to {destroyTerm} {resourceType}:{' '}
|
||||
<strong>{resourceName}</strong>?
|
||||
<strong>{resourceName}</strong>?{appendTerm ? ` ${appendTerm}` : ''}
|
||||
</div>
|
||||
),
|
||||
confirmText: 'Remove',
|
||||
|
Loading…
Reference in New Issue
Block a user