Skip to content

Commit 2b6d0f7

Browse files
authored
Add note about disks to instance delete confirm (#2185)
add note about disks to instance delete confirm
1 parent e649e7b commit 2b6d0f7

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/pages/project/instances/actions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export const useMakeInstanceActions = (
129129
}),
130130
label: instance.name,
131131
resourceKind: 'instance',
132+
extraContent: 'Any attached disks will be detached but not deleted.',
132133
}),
133134
disabled: !instanceCan.delete(instance) && (
134135
<>Only {fancifyStates(instanceCan.delete.states)} instances can be deleted</>

app/stores/confirm-delete.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,22 @@ type DeleteConfig = {
2424
*/
2525
label: React.ReactNode
2626
resourceKind?: string
27+
extraContent?: React.ReactNode
2728
}
2829

2930
export const confirmDelete =
30-
({ doDelete, label, resourceKind }: DeleteConfig) =>
31+
({ doDelete, label, resourceKind, extraContent }: DeleteConfig) =>
3132
() => {
3233
const displayLabel = typeof label === 'string' ? <HL>{label}</HL> : label
3334
const modalTitle = resourceKind ? `Confirm delete ${resourceKind}` : 'Confirm delete'
3435
useConfirmAction.setState({
3536
actionConfig: {
3637
doAction: doDelete,
37-
modalContent: <p>Are you sure you want to delete {displayLabel}?</p>,
38+
modalContent: (
39+
<p>
40+
Are you sure you want to delete {displayLabel}? {extraContent}
41+
</p>
42+
),
3843
errorTitle: 'Could not delete resource',
3944
modalTitle,
4045
actionType: 'danger',

0 commit comments

Comments
 (0)