Browse Source

qrcode: form validation

pull/4142/head
Daniel Spaude 2 years ago
parent
commit
b2fc5115d1
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 30
      packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue
  2. 2
      packages/nc-gui/lang/de.json
  3. 2
      packages/nc-gui/lang/en.json

30
packages/nc-gui/components/smartsheet/column/QrCodeOptions.vue

@ -18,7 +18,7 @@ const { fields, metaColumnById } = useViewColumns(activeView, meta, () => reload
const vModel = useVModel(props, 'value', emit)
const { column } = useColumnCreateStoreOrThrow()
const { setAdditionalValidations, validateInfos, column } = useColumnCreateStoreOrThrow()
const allowedColumnTypesForQrValue = [UITypes.Formula, UITypes.SingleLineText, UITypes.LongText] as string[]
@ -35,24 +35,30 @@ const columnsAllowedAsQrValue = computed<SelectProps['options']>(() => {
// set default value
vModel.value.fk_qr_value_column_id = (column?.value?.colOptions as Record<string, any>)?.fk_qr_value_column_id || ''
setAdditionalValidations({
fk_qr_value_column_id: [{ required: true, message: 'Required' }],
})
</script>
<template>
<a-row>
<a-col :span="24">
<div>
<span class="font-bold"> {{ $t('labels.chooseQrValueColumn') }}</span>
<a-divider class="!my-2" />
</div>
<div class="nc-fields-list py-1">
<div class="grouping-field">
<a-select
v-model:value="vModel.fk_qr_value_column_id"
class="w-full nc-kanban-grouping-field-select"
:options="columnsAllowedAsQrValue"
placeholder="Select a Grouping Field"
@click.stop
/>
<a-form-item
class="flex w-1/2 pb-2"
:label="$t('labels.qrCodeValueColumn')"
v-bind="validateInfos.fk_qr_value_column_id"
>
<a-select
v-model:value="vModel.fk_qr_value_column_id"
class="w-full nc-kanban-grouping-field-select"
:options="columnsAllowedAsQrValue"
placeholder="Select a Grouping Field"
@click.stop
/>
</a-form-item>
</div>
</div>
</a-col>

2
packages/nc-gui/lang/de.json

@ -238,7 +238,7 @@
"created": "Erstellt",
"sqlOutput": "SQL-Ausgabe",
"addOption": "Option hinzufügen",
"chooseQrValueColumn": "Spalte für den QR-Code-Inhalt wählen",
"qrCodeValueColumn": "Spalte mit QR-Code-Inhalt",
"aggregateFunction": "Globale Funktion",
"dbCreateIfNotExists": "Datenbank: Erstellen, falls nicht vorhanden",
"clientKey": "Client-Schlüssel",

2
packages/nc-gui/lang/en.json

@ -238,7 +238,7 @@
"created": "Created",
"sqlOutput": "SQL Output",
"addOption": "Add option",
"chooseQrValueColumn": "Column to use for the QR code value",
"qrCodeValueColumn": "Column with QR code value",
"aggregateFunction": "Aggregate function",
"dbCreateIfNotExists": "Database : create if not exists",
"clientKey": "Client Key",

Loading…
Cancel
Save