From aa3348ae164de24e2b93b9f17e8b753ac1b1ff20 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 15 Dec 2021 23:56:04 +0530 Subject: [PATCH] chore(publish): v0.83.8 Signed-off-by: Pranav C --- .../components/editColumn/lookupOptions.vue | 18 ++- .../components/editColumn/rollupOptions.vue | 16 ++- packages/nc-gui/components/utils/betterUX.vue | 70 +++++++++++ packages/nc-gui/layouts/default.vue | 5 + packages/nc-lib-gui/package.json | 2 +- packages/nocodb/package-lock.json | 8 +- packages/nocodb/package.json | 4 +- packages/nocodb/src/lib/noco/Noco.ts | 2 +- .../src/lib/noco/common/BaseApiBuilder.ts | 25 ++-- .../jobs/ncRemoveDuplicatedRelationRows.ts | 113 ++++++++++++++++++ .../nocodb/src/lib/noco/gql/GqlApiBuilder.ts | 7 +- .../src/lib/noco/rest/RestApiBuilder.ts | 7 +- 12 files changed, 250 insertions(+), 27 deletions(-) create mode 100644 packages/nc-gui/components/utils/betterUX.vue create mode 100644 packages/nocodb/src/lib/noco/common/jobs/ncRemoveDuplicatedRelationRows.ts diff --git a/packages/nc-gui/components/project/spreadsheet/components/editColumn/lookupOptions.vue b/packages/nc-gui/components/project/spreadsheet/components/editColumn/lookupOptions.vue index b8a9c334c4..a34ea3b37e 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editColumn/lookupOptions.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editColumn/lookupOptions.vue @@ -59,11 +59,12 @@ export default { mm: 'Many To Many', hm: 'Has Many', bt: 'Belongs To' - } + }, + tables: [] }), computed: { refTables() { - return this.meta + return (this.meta ? [ ...(this.meta.belongsTo || []).map(({ rtn, _rtn, rcn, tn, cn }) => ({ type: 'bt', @@ -106,7 +107,7 @@ export default { _ltn: _rtn })) ] - : [] + : []).filter(t => this.tables.includes(t.ltn)) }, columnList() { return (( @@ -121,7 +122,18 @@ export default { })) } }, + async mounted() { + await this.loadTablesList() + }, methods: { + async loadTablesList() { + const result = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ + env: this.nodes.env, + dbAlias: this.nodes.dbAlias + }, 'tableList']) + + this.tables = result.data.list.map(({ tn }) => tn) + }, checkLookupExist(v) { return (this.lookup.table && (this.meta.v || []).every(c => !( c.lk && diff --git a/packages/nc-gui/components/project/spreadsheet/components/editColumn/rollupOptions.vue b/packages/nc-gui/components/project/spreadsheet/components/editColumn/rollupOptions.vue index 94765a6b5b..2f4019b0ab 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/editColumn/rollupOptions.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/editColumn/rollupOptions.vue @@ -70,6 +70,7 @@ export default { data: () => ({ rollup: {}, loadingColumns: false, + tables: [], relationNames: { mm: 'Many To Many', hm: 'Has Many' @@ -89,7 +90,7 @@ export default { }), computed: { refTables() { - return this.meta + return (this.meta ? [ // ...(this.meta.belongsTo || []).map(({ rtn, _rtn, rcn, tn, cn }) => ({ // type: 'bt', @@ -132,7 +133,7 @@ export default { _rltn: _rtn })) ] - : [] + : []).filter(t => this.tables.includes(t.rltn)) }, columnList() { return (( @@ -147,7 +148,18 @@ export default { })) } }, + async mounted() { + await this.loadTablesList() + }, methods: { + async loadTablesList() { + const result = await this.$store.dispatch('sqlMgr/ActSqlOp', [{ + env: this.nodes.env, + dbAlias: this.nodes.dbAlias + }, 'tableList']) + + this.tables = result.data.list.map(({ tn }) => tn) + }, async onTableChange() { this.loadingColumns = true if (this.rollup.table) { diff --git a/packages/nc-gui/components/utils/betterUX.vue b/packages/nc-gui/components/utils/betterUX.vue new file mode 100644 index 0000000000..f220d1f274 --- /dev/null +++ b/packages/nc-gui/components/utils/betterUX.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/packages/nc-gui/layouts/default.vue b/packages/nc-gui/layouts/default.vue index df71712717..7d81a50a3b 100644 --- a/packages/nc-gui/layouts/default.vue +++ b/packages/nc-gui/layouts/default.vue @@ -49,6 +49,8 @@ target="_blank" >Docs + +