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

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

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

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

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

Loading…
Cancel
Save