From 6358a4bc3911d6687bef0b0c9587a5aee850329d Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 24 Nov 2021 13:25:04 +0530 Subject: [PATCH 1/3] refactor: optimize tab reload on tab switch re #767 Signed-off-by: Pranav C --- .../components/project/spreadsheet/rowsXcDataTable.vue | 10 +++++++++- packages/nc-gui/components/project/table.vue | 4 +++- packages/nc-gui/components/projectTabs.vue | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue index 6be60c7fd3..2ffee39118 100644 --- a/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue +++ b/packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue @@ -583,6 +583,7 @@ export default { }, mixins: [spreadsheet], props: { + isActive: Boolean, tabId: String, env: String, nodes: Object, @@ -670,6 +671,11 @@ export default { rowContextMenu: null }), watch: { + isActive(n, o) { + if (!o && n) { + this.reload() + } + }, page(p) { this.$store.commit('tabs/MutSetTabState', { id: this.uniqueId, @@ -1159,7 +1165,9 @@ export default { } }, computed: { - tabsState() { return this.$store.state.tabs.tabsState || {} }, + tabsState() { + return this.$store.state.tabs.tabsState || {} + }, uniqueId() { return `${this.tabId}_${this.selectedViewId}` }, diff --git a/packages/nc-gui/components/project/table.vue b/packages/nc-gui/components/project/table.vue index 29e3090256..3a0ea1c9d3 100644 --- a/packages/nc-gui/components/project/table.vue +++ b/packages/nc-gui/components/project/table.vue @@ -317,6 +317,7 @@ > diff --git a/packages/nc-gui/components/projectTabs.vue b/packages/nc-gui/components/projectTabs.vue index 89cbd7d27e..bab9ad1370 100644 --- a/packages/nc-gui/components/projectTabs.vue +++ b/packages/nc-gui/components/projectTabs.vue @@ -61,8 +61,8 @@ > Date: Wed, 24 Nov 2021 13:25:14 +0530 Subject: [PATCH 2/3] feat: load tables list in alphabetic order re #737 Signed-off-by: Pranav C --- packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts b/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts index b181164a09..9e7d8310ee 100644 --- a/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts +++ b/packages/nocodb/src/lib/noco/meta/NcMetaMgr.ts @@ -4568,7 +4568,9 @@ export default class NcMetaMgr { result[d.title].disabled[d.role] = !!d.disabled; } - return Object.values(result); + return Object.values(result)?.sort((a: any, b: any) => + (a?._tn || a?.tn)?.localeCompare(b?._tn || b?.tn) + ); } break; case 'view': From 6ffdc57b44825d6c61845a78d47e9a72204eb1af Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 24 Nov 2021 15:34:47 +0530 Subject: [PATCH 3/3] feat(gui): add table list filter option re #783 Signed-off-by: Pranav C --- .../nc-gui/components/ProjectTreeView.vue | 79 +++++++++++++------ 1 file changed, 57 insertions(+), 22 deletions(-) diff --git a/packages/nc-gui/components/ProjectTreeView.vue b/packages/nc-gui/components/ProjectTreeView.vue index 6905481f0f..f53a8d887b 100644 --- a/packages/nc-gui/components/ProjectTreeView.vue +++ b/packages/nc-gui/components/ProjectTreeView.vue @@ -26,16 +26,24 @@ <!– mdi-arrow-expand-horizontal–> --> - - - - - - - - - - + + + + - + @@ -186,6 +202,7 @@ n.type === 'tableDir'); } @@ -1165,7 +1182,7 @@ export default { await this.loadViews(this.menuItem); this.$toast.success('Views refreshed').goAway(1000); } else if (action === 'IMPORT_EXCEL') { - this.excelImportDialog=true + this.excelImportDialog = true } else if (action === 'ENV_DB_FUNCTIONS_REFRESH') { await this.loadFunctions(this.menuItem); this.$toast.success('Functions refreshed').goAway(1000); @@ -1768,6 +1785,24 @@ export default { .nested:hover .action { opacity: 1; } + +/deep/ .nc-table-list-filter .v-input__slot { + min-height: 30px !important; +} +/deep/ .nc-table-list-filter .v-input__slot label { + top: 6px; +} + + + +/deep/ .nc-table-list-filter.theme--light.v-text-field > .v-input__control > .v-input__slot:before { + border-top-color: rgba(0, 0, 0, 0.12) !important; +} + +/deep/ .nc-table-list-filter.theme--dark.v-text-field > .v-input__control > .v-input__slot:before { + border-top-color: rgba(255, 255, 255, 0.12) !important; +} +