From 6bf6b8fc5c3d92cfeccae1997b069da22aa8d130 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 27 Apr 2022 15:11:54 +0530 Subject: [PATCH] refactor: error message improvement Signed-off-by: Pranav C --- packages/nc-gui/components/project/table.vue | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/nc-gui/components/project/table.vue b/packages/nc-gui/components/project/table.vue index 828964e6d1..82061fb548 100644 --- a/packages/nc-gui/components/project/table.vue +++ b/packages/nc-gui/components/project/table.vue @@ -109,12 +109,14 @@ export default { const relationColumns = meta.columns.filter(c => c.uidt === UITypes.LinkToAnotherRecord) if (relationColumns.length) { - const referredTables = await Promise.all(relationColumns.map(async(c) => { + const refColMsgs = await Promise.all(relationColumns.map(async(c, i) => { const refMeta = await this.$store.dispatch('meta/ActLoadMeta', { id: c.colOptions.fk_related_model_id }) - return (refMeta && refMeta.title) || c.title + return `${i + 1}. ${c.title} is a LinkToAnotherRecord of a ${(refMeta && refMeta.title) || c.title}` })) - this.$toast.info('Table can\'t be deleted since Table is being referred in following tables : ' + referredTables.join(', ') + - '. Delete relation columns and try again.').goAway(10000) + this.$toast.info(`
Unable to delete tables because of the following. +

${refColMsgs.join('
')}

+ Delete them & try again
+ `).goAway(10000) this.dialogShow = false return }