From 4b8a197c1c966a8b438254c93d2e4632783ca77d Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 15 Aug 2022 18:07:58 +0800 Subject: [PATCH 01/14] feat(gui-v2): add MdiBugOutline --- packages/nc-gui-v2/components.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nc-gui-v2/components.d.ts b/packages/nc-gui-v2/components.d.ts index 38c6f5d873..4ff58356f6 100644 --- a/packages/nc-gui-v2/components.d.ts +++ b/packages/nc-gui-v2/components.d.ts @@ -90,6 +90,7 @@ declare module '@vue/runtime-core' { MdiArrowExpand: typeof import('~icons/mdi/arrow-expand')['default'] MdiArrowLeftBold: typeof import('~icons/mdi/arrow-left-bold')['default'] MdiAt: typeof import('~icons/mdi/at')['default'] + MdiBugOutline: typeof import('~icons/mdi/bug-outline')['default'] MdiCalculator: typeof import('~icons/mdi/calculator')['default'] MdiCalendarMonth: typeof import('~icons/mdi/calendar-month')['default'] MdiCardsHeart: typeof import('~icons/mdi/cards-heart')['default'] From 0207310bebe5ed3e4c5b003febb8d1d502ae94d8 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 15 Aug 2022 18:08:11 +0800 Subject: [PATCH 02/14] chore(gui-v2): remove mx-3 --- .../components/smartsheet/sidebar/toolbar/DeleteCache.vue | 2 +- .../components/smartsheet/sidebar/toolbar/DeleteTable.vue | 2 +- .../components/smartsheet/sidebar/toolbar/ExportCache.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteCache.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteCache.vue index 2eeabc259e..9f0b81fe6b 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteCache.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteCache.vue @@ -17,6 +17,6 @@ async function deleteCache() { - + diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteTable.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteTable.vue index fc82263308..c94301fe70 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteTable.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DeleteTable.vue @@ -14,7 +14,7 @@ const sidebarOpen = inject(RightSidebarInj, ref(true))
- +
diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/ExportCache.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/ExportCache.vue index 7cbaba15d2..6e05077eae 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/ExportCache.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/ExportCache.vue @@ -28,6 +28,6 @@ async function exportCache() { - + From cdb085376fd102364cbd9a4333f290f02c6344aa Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 15 Aug 2022 18:08:22 +0800 Subject: [PATCH 03/14] feat(gui-v2): include DebugMeta --- .../components/smartsheet/sidebar/toolbar/index.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/index.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/index.vue index 30c1acc8c8..9af373d4c3 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/index.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/index.vue @@ -4,6 +4,7 @@ import LockMenu from './LockMenu.vue' import Reload from './Reload.vue' import ExportCache from './ExportCache.vue' import DeleteCache from './DeleteCache.vue' +import DebugMeta from './DebugMeta.vue' const { isUIAllowed } = useUIPermission() @@ -33,8 +34,9 @@ const clickCount = $ref(0)
- - + + +
From 8818227606d5a5769b66bdfa74e0d06e0e684ec1 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 15 Aug 2022 18:59:47 +0800 Subject: [PATCH 04/14] feat(gui-v2): add debug meta --- .../smartsheet/sidebar/toolbar/DebugMeta.vue | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue new file mode 100644 index 0000000000..9d63394eec --- /dev/null +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue @@ -0,0 +1,20 @@ + + + From 199579b5099de210486187445dd6302137e4b75f Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 15 Aug 2022 19:30:59 +0800 Subject: [PATCH 05/14] feat(gui-v2): includeM2M --- .../components/dashboard/settings/Misc.vue | 13 +++++++++++++ .../components/dashboard/settings/Modal.vue | 5 +++++ .../components/dashboard/settings/UIAcl.vue | 6 ++++-- packages/nc-gui-v2/composables/useGlobal/state.ts | 1 + packages/nc-gui-v2/composables/useGlobal/types.ts | 1 + packages/nc-gui-v2/composables/useProject.ts | 5 ++++- 6 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 packages/nc-gui-v2/components/dashboard/settings/Misc.vue diff --git a/packages/nc-gui-v2/components/dashboard/settings/Misc.vue b/packages/nc-gui-v2/components/dashboard/settings/Misc.vue new file mode 100644 index 0000000000..8908ee9ccc --- /dev/null +++ b/packages/nc-gui-v2/components/dashboard/settings/Misc.vue @@ -0,0 +1,13 @@ + + + diff --git a/packages/nc-gui-v2/components/dashboard/settings/Modal.vue b/packages/nc-gui-v2/components/dashboard/settings/Modal.vue index b4a5fbbcff..e280c7c8cb 100644 --- a/packages/nc-gui-v2/components/dashboard/settings/Modal.vue +++ b/packages/nc-gui-v2/components/dashboard/settings/Modal.vue @@ -5,6 +5,7 @@ import AuditTab from './AuditTab.vue' import AppStore from './AppStore.vue' import Metadata from './Metadata.vue' import UIAcl from './UIAcl.vue' +import Misc from './Misc.vue' import ApiTokenManagement from '~/components/tabs/auth/ApiTokenManagement.vue' import UserManagement from '~/components/tabs/auth/UserManagement.vue' import StoreFrontOutline from '~icons/mdi/storefront-outline' @@ -86,6 +87,10 @@ const tabsInfo: TabGroup = { title: 'UI Access Control', body: UIAcl, }, + misc: { + title: 'Misc', + body: Misc, + }, }, }, audit: { diff --git a/packages/nc-gui-v2/components/dashboard/settings/UIAcl.vue b/packages/nc-gui-v2/components/dashboard/settings/UIAcl.vue index 4aaaf11afe..56d438baad 100644 --- a/packages/nc-gui-v2/components/dashboard/settings/UIAcl.vue +++ b/packages/nc-gui-v2/components/dashboard/settings/UIAcl.vue @@ -7,6 +7,8 @@ const { $api, $e } = useNuxtApp() const { project } = useProject() +const { includeM2M } = useGlobal() + const roles = $ref(['editor', 'commenter', 'viewer']) let isLoading = $ref(false) @@ -28,9 +30,9 @@ async function loadTableList() { if (!project.value?.id) return isLoading = true - // TODO includeM2M + tables = await $api.project.modelVisibilityList(project.value?.id, { - includeM2M: false, + includeM2M: includeM2M.value, }) } catch (e) { console.error(e) diff --git a/packages/nc-gui-v2/composables/useGlobal/state.ts b/packages/nc-gui-v2/composables/useGlobal/state.ts index c61b3829cf..3ef7430700 100644 --- a/packages/nc-gui-v2/composables/useGlobal/state.ts +++ b/packages/nc-gui-v2/composables/useGlobal/state.ts @@ -58,6 +58,7 @@ export function useGlobalState(storageKey = 'nocodb-gui-v2'): State { }, filterAutoSave: true, previewAs: null, + includeM2M: false, } /** saves a reactive state, any change to these values will write/delete to localStorage */ diff --git a/packages/nc-gui-v2/composables/useGlobal/types.ts b/packages/nc-gui-v2/composables/useGlobal/types.ts index 0e57222752..d9fc67463d 100644 --- a/packages/nc-gui-v2/composables/useGlobal/types.ts +++ b/packages/nc-gui-v2/composables/useGlobal/types.ts @@ -35,6 +35,7 @@ export interface StoredState { feedbackForm: FeedbackForm filterAutoSave: boolean previewAs: string | null + includeM2M: boolean } export type State = ToRefs> & { diff --git a/packages/nc-gui-v2/composables/useProject.ts b/packages/nc-gui-v2/composables/useProject.ts index f11e5a1124..b32ddf329d 100644 --- a/packages/nc-gui-v2/composables/useProject.ts +++ b/packages/nc-gui-v2/composables/useProject.ts @@ -12,6 +12,7 @@ export function useProject(projectId?: MaybeRef) { const project = useState('project') const tables = useState('tables', () => [] as TableType[]) const route = useRoute() + const { includeM2M } = useGlobal() // todo: refactor path param name and variable name const projectType = $computed(() => route.params.projectType as string) @@ -27,7 +28,9 @@ export function useProject(projectId?: MaybeRef) { async function loadTables() { if (project.value.id) { - const tablesResponse = await $api.dbTable.list(project.value.id) + const tablesResponse = await $api.dbTable.list(project.value.id, { + includeM2M: includeM2M.value, + }) if (tablesResponse.list) tables.value = tablesResponse.list } } From ba55e0597a0b2eb496f178b333b74771c24d161d Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 15 Aug 2022 19:40:14 +0800 Subject: [PATCH 06/14] feat(gui-v2): allow multiple tables in debug meta --- .../smartsheet/sidebar/toolbar/DebugMeta.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue index 9d63394eec..4f111b5a9a 100644 --- a/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue +++ b/packages/nc-gui-v2/components/smartsheet/sidebar/toolbar/DebugMeta.vue @@ -1,9 +1,13 @@ From 832f565a2ead48d28ab0b79e2e718cdb8a6e44ee Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 15 Aug 2022 20:09:24 +0800 Subject: [PATCH 07/14] fix(gui-v2): includeM2M --- packages/nc-gui-v2/components/dashboard/settings/Misc.vue | 6 ++++++ packages/nc-gui-v2/components/dashboard/settings/UIAcl.vue | 3 ++- packages/nc-gui-v2/composables/useProject.ts | 3 ++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui-v2/components/dashboard/settings/Misc.vue b/packages/nc-gui-v2/components/dashboard/settings/Misc.vue index 8908ee9ccc..d20b231175 100644 --- a/packages/nc-gui-v2/components/dashboard/settings/Misc.vue +++ b/packages/nc-gui-v2/components/dashboard/settings/Misc.vue @@ -1,5 +1,11 @@