From 63aceb7e9c9d3c68f7903d7728cb4bbd47169bc9 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Wed, 14 Sep 2022 15:16:09 +0530 Subject: [PATCH] feat/Added basic erd support --- .../components/dashboard/settings/Erd.vue | 107 ++++++++++++------ .../dashboard/settings/erd/RelationEdge.vue | 84 ++++++++------ .../dashboard/settings/erd/TableNode.vue | 40 ++++--- 3 files changed, 142 insertions(+), 89 deletions(-) diff --git a/packages/nc-gui/components/dashboard/settings/Erd.vue b/packages/nc-gui/components/dashboard/settings/Erd.vue index 4b7b88156e..ac720f498b 100644 --- a/packages/nc-gui/components/dashboard/settings/Erd.vue +++ b/packages/nc-gui/components/dashboard/settings/Erd.vue @@ -1,29 +1,29 @@ +
+
+ + Show PK and FK +
+
+ + Show views +
+
diff --git a/packages/nc-gui/components/dashboard/settings/erd/RelationEdge.vue b/packages/nc-gui/components/dashboard/settings/erd/RelationEdge.vue index d4ae481581..b8baa47910 100644 --- a/packages/nc-gui/components/dashboard/settings/erd/RelationEdge.vue +++ b/packages/nc-gui/components/dashboard/settings/erd/RelationEdge.vue @@ -1,5 +1,5 @@ + + diff --git a/packages/nc-gui/components/dashboard/settings/erd/TableNode.vue b/packages/nc-gui/components/dashboard/settings/erd/TableNode.vue index a75e68861f..e888123307 100644 --- a/packages/nc-gui/components/dashboard/settings/erd/TableNode.vue +++ b/packages/nc-gui/components/dashboard/settings/erd/TableNode.vue @@ -9,12 +9,14 @@ const props = defineProps({ }, }) -const { data: table } = props -const columns = table.columns -// console.log(table) +const { data } = toRefs(props) -const pkColumn = computed(() => { - return columns.find((col) => col.pk) +provide(MetaInj, data) + +const columns = data.value.columns + +const pkAndFkColumns = computed(() => { + return columns.filter(() => data.value.showPkAndFk).filter((col) => col.pk || col.uidt === UITypes.ForeignKey) }) const nonPkColumns = computed(() => { @@ -25,23 +27,19 @@ const nonPkColumns = computed(() => { + +