From 92f2a59b88b77b8a77a4cdb928675bcd7a6e2477 Mon Sep 17 00:00:00 2001 From: Pranav C <61551451+pranavxc@users.noreply.github.com> Date: Mon, 21 Jun 2021 20:40:24 +0530 Subject: [PATCH] feat: Has many & belongs to - new record creation Signed-off-by: Pranav C <61551451+pranavxc@users.noreply.github.com> --- .../spreadsheet/components/expandedForm.vue | 18 +- .../spreadsheet/components/virtualCell.vue | 80 +++--- .../components/virtualCell/belogsToCell.vue | 240 +++++++++++++----- .../virtualCell/components/listItems.vue | 112 +++++--- .../components/virtualCell/hasManyCell.vue | 80 +++--- .../lib/dataMapper/lib/sql/BaseModelSql.ts | 142 ++++++++++- 6 files changed, 470 insertions(+), 202 deletions(-) diff --git a/packages/nc-gui/components/project/spreadsheet/components/expandedForm.vue b/packages/nc-gui/components/project/spreadsheet/components/expandedForm.vue index db1b17b38f..29a96ed4d5 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/expandedForm.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/expandedForm.vue @@ -76,7 +76,7 @@
div > input, - & > div div >input, + & > div div > input, & > div > .xc-input > input, & > div > select, & > div > .xc-input > select, @@ -417,7 +417,7 @@ export default { background: #363636; .row-col { - & > div div > input, + & > div div > input, & > div > input, & > div > .xc-input > input, & > div > select, @@ -433,7 +433,7 @@ export default { .row-col { & > div > input, - & > div div >input, + & > div div > input, & > div > .xc-input > input, & > div > select, & > div > .xc-input > select, diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue index 80a5c4ef3c..d0b71d5f57 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/virtualCell.vue @@ -1,44 +1,44 @@ @@ -48,6 +48,8 @@ import hasManyCell from "@/components/project/spreadsheet/components/virtualCell import manyToManyCell from "@/components/project/spreadsheet/components/virtualCell/manyToManyCell"; import belongsToCell from "@/components/project/spreadsheet/components/virtualCell/belogsToCell"; +// todo: optimize parent/child meta extraction + export default { name: "virtual-cell", components: { @@ -67,7 +69,7 @@ export default { type: Boolean, default: false }, - disabledColumns:Object + disabledColumns: Object }, computed: { hm() { diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/belogsToCell.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/belogsToCell.vue index 41872e0a71..46675978d1 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/belogsToCell.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/belogsToCell.vue @@ -2,57 +2,115 @@
-
+
{{ - value ? 'mdi-pencil' : 'mdi-plus' + value ? 'mdi-arrow-expand' : 'mdi-plus' }}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - Add Record - - - -
- -
-
- - - mdi-plus - Add New Record - - -
@@ -62,10 +120,11 @@ @@ -182,24 +304,6 @@ export default { } } - -.child-list-modal { - position: relative; - - .remove-child-icon { - position: absolute; - right: 10px; - top: 10px; - bottom: 10px; - opacity: 0; - } - - &:hover .remove-child-icon { - opacity: 1; - } - -} - .child-card { cursor: pointer; diff --git a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/listItems.vue b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/listItems.vue index 89f375216c..6cbfc48c31 100644 --- a/packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/listItems.vue +++ b/packages/nc-gui/components/project/spreadsheet/components/virtualCell/components/listItems.vue @@ -1,27 +1,29 @@