From cc309a48bafd065feb35aab658775890a48f4267 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Mon, 23 Jan 2023 14:31:41 +0530 Subject: [PATCH 1/5] feat(nc-gui): Added fullscreen support to ERD --- .../dashboard/settings/DataSources.vue | 2 +- .../components/dashboard/settings/Erd.vue | 2 +- .../components/erd/FullScreenToggle.vue | 28 +++++++++++++++++++ packages/nc-gui/components/erd/View.vue | 14 ++++++++-- packages/nc-gui/components/erd/utils.ts | 1 + 5 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 packages/nc-gui/components/erd/FullScreenToggle.vue diff --git a/packages/nc-gui/components/dashboard/settings/DataSources.vue b/packages/nc-gui/components/dashboard/settings/DataSources.vue index 8416dc186a..5bb4f89287 100644 --- a/packages/nc-gui/components/dashboard/settings/DataSources.vue +++ b/packages/nc-gui/components/dashboard/settings/DataSources.vue @@ -381,7 +381,7 @@ watch(
-
+
diff --git a/packages/nc-gui/components/dashboard/settings/Erd.vue b/packages/nc-gui/components/dashboard/settings/Erd.vue index 73025e8eef..0bdc501409 100644 --- a/packages/nc-gui/components/dashboard/settings/Erd.vue +++ b/packages/nc-gui/components/dashboard/settings/Erd.vue @@ -5,7 +5,7 @@ const props = defineProps<{ diff --git a/packages/nc-gui/components/erd/FullScreenToggle.vue b/packages/nc-gui/components/erd/FullScreenToggle.vue new file mode 100644 index 0000000000..4162801e33 --- /dev/null +++ b/packages/nc-gui/components/erd/FullScreenToggle.vue @@ -0,0 +1,28 @@ + + + diff --git a/packages/nc-gui/components/erd/View.vue b/packages/nc-gui/components/erd/View.vue index 6d5be40fdb..f6dc6cd06e 100644 --- a/packages/nc-gui/components/erd/View.vue +++ b/packages/nc-gui/components/erd/View.vue @@ -21,6 +21,7 @@ const config = reactive({ singleTableMode: !!props.table, showMMTables: false, showJunctionTableNames: false, + isFullScreen: false, }) const loadMetaOfTablesNotInMetas = async (localTables: TableType[]) => { @@ -86,7 +87,15 @@ watch( From 5556dcdf4b013fa69179f6b2ced9a273af7830a4 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Tue, 24 Jan 2023 16:49:22 +0530 Subject: [PATCH 5/5] fix(nc-gui): Reviews --- packages/nc-gui/components/erd/FullScreenToggle.vue | 6 ++++-- packages/nc-gui/components/erd/View.vue | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui/components/erd/FullScreenToggle.vue b/packages/nc-gui/components/erd/FullScreenToggle.vue index 3303baf81b..6ef3545a8b 100644 --- a/packages/nc-gui/components/erd/FullScreenToggle.vue +++ b/packages/nc-gui/components/erd/FullScreenToggle.vue @@ -8,10 +8,12 @@ const props = defineProps<{ config: ERDConfig }>() -const config = useVModel(props, 'config') +const emit = defineEmits(['toggleFullScreen']) + +const { config } = toRefs(props) const toggleFullScreen = () => { - config.value.isFullScreen = !config.value.isFullScreen + emit('toggleFullScreen') } diff --git a/packages/nc-gui/components/erd/View.vue b/packages/nc-gui/components/erd/View.vue index d8fb8527a0..a476a73b17 100644 --- a/packages/nc-gui/components/erd/View.vue +++ b/packages/nc-gui/components/erd/View.vue @@ -66,6 +66,10 @@ const populateTables = async () => { isLoading = false } +const toggleFullScreen = () => { + config.isFullScreen = !config.isFullScreen +} + watch([metas, projectTables], populateTables, { flush: 'post', immediate: true, @@ -104,7 +108,7 @@ watch(
- +