From bce5ab6d40c93476994fa1b28fd8c865dbae95d6 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Fri, 12 Jul 2024 18:22:05 +0000 Subject: [PATCH] feat: add warning slot --- .../nc-gui/components/general/DeleteModal.vue | 8 +++++- .../smartsheet/header/DeleteColumnModal.vue | 28 +++++++++++++++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui/components/general/DeleteModal.vue b/packages/nc-gui/components/general/DeleteModal.vue index 7dde819a81..e1f8908b9a 100644 --- a/packages/nc-gui/components/general/DeleteModal.vue +++ b/packages/nc-gui/components/general/DeleteModal.vue @@ -56,7 +56,13 @@ onKeyStroke('Enter', () => { - +
{{ $t('general.cancel') }} diff --git a/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue b/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue index 06675bcfd2..1f9dc89d27 100644 --- a/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue +++ b/packages/nc-gui/components/smartsheet/header/DeleteColumnModal.vue @@ -27,6 +27,31 @@ const viewsStore = useViewsStore() const isLoading = ref(false) +// disable for time being - internal discussion required +/* +const warningMsg = computed(() => { + if (!column?.value) return [] + + const columns = meta?.value?.columns.filter((c) => { + if (isLinksOrLTAR(c) && c.colOptions) { + return ( + (c.colOptions as LinkToAnotherRecordType).fk_parent_column_id === column.value?.id || + (c.colOptions as LinkToAnotherRecordType).fk_child_column_id === column.value?.id || + (c.colOptions as LinkToAnotherRecordType).fk_mm_child_column_id === column.value?.id || + (c.colOptions as LinkToAnotherRecordType).fk_mm_parent_column_id === column.value?.id + ) + } + + return false + }) + + if (!columns.length) return null + + return `This column is used in following Link column${columns.length > 1 ? 's' : ''}: '${columns + .map((c) => c.title) + .join("', '")}'. Deleting this column will also delete the related Link column${columns.length > 1 ? 's' : ''}.` +}) */ + const onDelete = async () => { if (!column?.value) return @@ -80,5 +105,8 @@ const onDelete = async () => {
+ + +