Browse Source

fix(gui-v2): revise based on PR comments

pull/2963/head
Wing-Kam Wong 2 years ago
parent
commit
048815d650
  1. 16
      packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue

16
packages/nc-gui-v2/components/smartsheet-column/CurrencyOptions.vue

@ -9,8 +9,7 @@ interface Option {
const { formState, validateInfos, setAdditionalValidations, sqlUi, onDataTypeChange, onAlter } = useColumnCreateStoreOrThrow()
const validators = computed(() => {
return {
const validators = {
'meta.currency_locale': [
{
validator: (_: any, locale: any) => {
@ -35,19 +34,18 @@ const validators = computed(() => {
},
},
],
}
})
}
// set additional validations
setAdditionalValidations({
...validators.value,
...validators,
})
const { isPg } = useProject()
const currencyList = ref(currencyCodes)
const currencyList = currencyCodes || []
const currencyLocaleList = ref(currencyLocales())
const currencyLocaleList = currencyLocales() || []
const isMoney = computed(() => formState.value.dt === 'money')
@ -73,7 +71,7 @@ function filterOption(input: string, option: Option) {
:filter-option="filterOption"
:disabled="isMoney && isPg"
>
<a-select-option v-for="(currencyLocale, i) in currencyLocaleList ?? []" :key="i" :value="currencyLocale.value">
<a-select-option v-for="(currencyLocale, i) of currencyLocaleList" :key="i" :value="currencyLocale.value">
{{ currencyLocale.text }}
</a-select-option>
</a-select>
@ -89,7 +87,7 @@ function filterOption(input: string, option: Option) {
size="small"
:disabled="isMoney && isPg"
>
<a-select-option v-for="(currencyCode, i) in currencyList ?? []" :key="i" :value="currencyCode">
<a-select-option v-for="(currencyCode, i) of currencyList" :key="i" :value="currencyCode">
{{ currencyCode }}
</a-select-option>
</a-select>

Loading…
Cancel
Save