From 9378a5341317ade14f390e0141ccc9b428407ccf Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 3 Aug 2022 19:28:58 +0800 Subject: [PATCH 1/3] fix(gui-v2): make meta as {} --- packages/nc-gui-v2/composables/useColumnCreateStore.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nc-gui-v2/composables/useColumnCreateStore.ts b/packages/nc-gui-v2/composables/useColumnCreateStore.ts index 50328a7b0e..b384e9f6d7 100644 --- a/packages/nc-gui-v2/composables/useColumnCreateStore.ts +++ b/packages/nc-gui-v2/composables/useColumnCreateStore.ts @@ -33,6 +33,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState const formState = ref>>({ title: 'title', uidt: UITypes.SingleLineText, + meta: {}, ...(column || {}), }) @@ -92,7 +93,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState const colProp = sqlUi?.value.getDataTypeForUiType(formState?.value as any, idType as any) formState.value = { ...formState.value, - meta: null, + meta: {}, rqd: false, pk: false, ai: false, From 24809e3c06c702b7aa5456b1c8d6f698d721646a Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Wed, 3 Aug 2022 19:29:17 +0800 Subject: [PATCH 2/3] fix(gui-v2): set default value for each option --- .../components/smartsheet-column/CurrencyOptions.vue | 7 +++++++ .../components/smartsheet-column/DurationOptions.vue | 6 ++++++ .../components/smartsheet-column/RatingOptions.vue | 11 +++++++++++ 3 files changed, 24 insertions(+) diff --git a/packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue index 29cf63b9e4..0ac430a8f0 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue @@ -57,6 +57,13 @@ const message = computed(() => { function filterOption(input: string, option: Option) { return option.value.toUpperCase().includes(input.toUpperCase()) } + +// set default value +formState.value.meta = { + currency_locale: 'en-US', + currency_code: 'USD', + ...formState.value.meta, +}