From a4f380e18759861fb23ae3280b0c4a517468789b Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 19:14:56 +0530 Subject: [PATCH 01/10] refactor/gui v2 added Date column --- .../smartsheet-column/DateOptions.vue | 25 +++++++++++++++++++ .../smartsheet-column/EditOrAdd.vue | 1 + packages/nc-gui-v2/utils/dateTimeUtils.ts | 12 +++++++++ 3 files changed, 38 insertions(+) create mode 100644 packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue diff --git a/packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue new file mode 100644 index 0000000000..d8f3b9143c --- /dev/null +++ b/packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue @@ -0,0 +1,25 @@ + + + diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index 638d081e5f..4cd8369692 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -92,6 +92,7 @@ watchEffect(() => { +
{ return dayjs.utc(date).fromNow() } +export const dateFormats = [ + 'DD-MM-YYYY', + 'MM-DD-YYYY', + 'YYYY-MM-DD', + 'DD/MM/YYYY', + 'MM/DD/YYYY', + 'YYYY/MM/DD', + 'DD MM YYYY', + 'MM DD YYYY', + 'YYYY MM DD', +] + export const handleTZ = (val: any) => { if (!val) { return From be32e5a900465867daa6fa9089361abe4d5e6884 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Fri, 5 Aug 2022 10:59:51 +0530 Subject: [PATCH 02/10] chore/removed unnecassary import --- packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue index d8f3b9143c..65807ea64c 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/DateOptions.vue @@ -1,6 +1,6 @@ + + + + From 6f448f06a8a061cf6be669ca483be9f5524d0c71 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Wed, 3 Aug 2022 19:13:43 +0530 Subject: [PATCH 04/10] fix/gui-v2-rollup-column-style-fix --- .../nc-gui-v2/components/smartsheet-column/RollupOptions.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue index 45d0670b57..86bd412256 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue @@ -61,9 +61,9 @@ const columns = $computed(() => { -
+
{{ table.column.title }}
-
({{ relationNames[table.col.type] }} {{ table.title || table.table_name }})
+
({{ relationNames[table.col.type] }} {{ table.title || table.table_name }})
From 0daab21eec7db649c32983ab40a5bc7e8b6a61bd Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 11:14:31 +0530 Subject: [PATCH 05/10] fix/fixed rollup column validation issue --- .../nc-gui-v2/components/smartsheet-column/RollupOptions.vue | 4 ++++ packages/nc-gui-v2/composables/useColumnCreateStore.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue index 86bd412256..e3fa65240d 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/RollupOptions.vue @@ -31,6 +31,10 @@ const aggrFunctionsList = [ { text: 'avgDistinct', value: 'avgDistinct' }, ] +if (!formState.fk_relation_column_id) formState.fk_relation_column_id = null +if (!formState.fk_rollup_column_id) formState.fk_rollup_column_id = null +if (!formState.rollup_function) formState.rollup_function = null + const refTables = $computed(() => { if (!tables || !tables.length) { return [] diff --git a/packages/nc-gui-v2/composables/useColumnCreateStore.ts b/packages/nc-gui-v2/composables/useColumnCreateStore.ts index 59c0b9dc37..f1d37686d1 100644 --- a/packages/nc-gui-v2/composables/useColumnCreateStore.ts +++ b/packages/nc-gui-v2/composables/useColumnCreateStore.ts @@ -198,7 +198,8 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState } onSuccess() } catch (e: any) { - toast.error(await extractSdkResponseErrorMsg(e)) + const error = await extractSdkResponseErrorMsg(e) + if (error) toast.error(await extractSdkResponseErrorMsg(e)) } } From 048c2d45fbdb037c15d7ad6a521d5655f40a270c Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 11:26:31 +0530 Subject: [PATCH 06/10] chore/removed unnecassary rollup option import --- packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index a0a30bb131..3f196a7af4 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -1,6 +1,5 @@ + + + + From be5c44402a9a0c8257222b70d1baabc916889ece Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 16:49:59 +0530 Subject: [PATCH 08/10] chore/removed console statements --- .../smartsheet-column/LinkedToAnotherRecordOptions.vue | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue index 6d4abf34d7..13ffb4f7b5 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue @@ -10,8 +10,6 @@ const { formState, validateInfos, onDataTypeChange, setAdditionalValidations } = const { tables, sqlUi } = $(useProject()) const meta: TableType = $(inject(MetaInj)) -console.log(tables) - setAdditionalValidations({ childId: [{ required: true, message: 'Required' }], }) From 62150e5b801d12a04eb9401f63ba3d2fce926799 Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 17:57:46 +0530 Subject: [PATCH 09/10] chore/removed unnecassry validation binding --- .../smartsheet-column/LinkedToAnotherRecordOptions.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue index 13ffb4f7b5..620405f5b6 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/LinkedToAnotherRecordOptions.vue @@ -68,7 +68,7 @@ const refTables = $computed(() => {
- + { - + {
- + Virtual Relation
From 0e6df780810a3fc6cbc0e6d84c5311a5df3b768f Mon Sep 17 00:00:00 2001 From: Muhammed Mustafa Date: Thu, 4 Aug 2022 18:54:59 +0530 Subject: [PATCH 10/10] refactor/gui v2 added SpecificDBType header --- packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue | 1 + .../components/smartsheet-column/SpecificDBTypeOptions.vue | 3 +++ packages/nc-gui-v2/utils/columnUtils.ts | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 packages/nc-gui-v2/components/smartsheet-column/SpecificDBTypeOptions.vue diff --git a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue index 8d94bdf1eb..2ab00f6aae 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/EditOrAdd.vue @@ -95,6 +95,7 @@ watchEffect(() => { +
+ + diff --git a/packages/nc-gui-v2/utils/columnUtils.ts b/packages/nc-gui-v2/utils/columnUtils.ts index 1020e60851..ecde6a4cfa 100644 --- a/packages/nc-gui-v2/utils/columnUtils.ts +++ b/packages/nc-gui-v2/utils/columnUtils.ts @@ -4,6 +4,7 @@ import TableColumnPlusBefore from '~icons/mdi/table-column-plus-before' import FormatColorText from '~icons/mdi/format-color-text' import TextSubject from '~icons/mdi/text-subject' import JSONIcon from '~icons/mdi/code-json' +import SpecificDBTypeIcon from '~icons/mdi/database-settings' import Attachment from '~icons/mdi/attachment' import CheckboxMarkedOutline from '~icons/mdi/checkbox-marked-outline' import FormatListBulletedSquare from '~icons/mdi/format-list-bulleted-square' @@ -140,7 +141,7 @@ const uiTypes = [ }, { name: UITypes.SpecificDBType, - icon: 'mdi-database-settings', + icon: SpecificDBTypeIcon, }, ]