Browse Source

code scanner for forms - WIP

pull/5114/head
Daniel Spaude 2 years ago
parent
commit
a8fb25e439
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 34
      packages/nc-gui/components/smartsheet/Form.vue
  2. 1
      packages/nocodb-sdk/src/lib/Api.ts
  3. 3
      packages/nocodb/src/lib/models/FormViewColumn.ts
  4. 4
      scripts/sdk/swagger.json

34
packages/nc-gui/components/smartsheet/Form.vue

@ -616,18 +616,28 @@ watch(view, (nextView) => {
/>
</div>
<a-form-item class="my-0 w-1/2 !mb-1" v-if="element.uidt === 'SingleLineText'">
FOO
<a-input
v-model:value="element.enableScanner"
type="text"
class="form-meta-input nc-form-input-label"
data-testid="nc-form-input-label"
:placeholder="$t('general.enableScanner')"
@change="updateColMeta(element)"
>
</a-input>
<a-form-item v-if="element.uidt === 'SingleLineText'" class="my-0 w-1/2 !mb-1">
<div class="flex gap-2 items-center">
<span
class="text-gray-500 mr-2 nc-form-input-required"
data-testid="nc-form-input-enable-scanner"
@click="
() => {
element.general.enable_scanner = !element.general.enable_scanner
updateColMeta(element)
}
"
>
{{ $t('general.enableScanner') }}
</span>
<a-switch
v-model:checked="element.enable_scanner"
v-e="['a:form-view:field:mark-enable-scaner']"
size="small"
@change="updateColMeta(element)"
/>
</div>
</a-form-item>
<a-form-item class="my-0 w-1/2 !mb-1">

1
packages/nocodb-sdk/src/lib/Api.ts

@ -424,6 +424,7 @@ export interface FormColumnType {
uuid?: any;
label?: string;
help?: any;
enable_scanner?: boolean;
required?: boolean;
show?: boolean;
order?: number;

3
packages/nocodb/src/lib/models/FormViewColumn.ts

@ -12,6 +12,7 @@ export default class FormViewColumn implements FormColumnType {
help?: string;
description?: string;
required?: boolean;
enable_scanner?: boolean;
show?: boolean;
order?: number;
@ -68,6 +69,7 @@ export default class FormViewColumn implements FormColumnType {
help: column.help,
description: column.description,
required: column.required,
enable_scanner: column.enable_scanner,
};
if (column.meta) {
@ -158,6 +160,7 @@ export default class FormViewColumn implements FormColumnType {
'show',
'order',
'meta',
'enable_scanner',
]);
// get existing cache

4
scripts/sdk/swagger.json

@ -8831,6 +8831,7 @@
"help": null,
"required": false,
"show": 1,
"enable_scanner": 1,
"order": 1,
"created_at": "2022-02-15 12:39:04",
"updated_at": "2022-02-15 12:39:16",
@ -8856,6 +8857,9 @@
"minLength": 1
},
"help": {},
"enable_scanner": {
"type": "boolean"
},
"required": {
"type": "boolean"
},

Loading…
Cancel
Save