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. 30
      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

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

@ -616,18 +616,28 @@ watch(view, (nextView) => {
/> />
</div> </div>
<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-form-item class="my-0 w-1/2 !mb-1" v-if="element.uidt === 'SingleLineText'"> <a-switch
FOO v-model:checked="element.enable_scanner"
<a-input v-e="['a:form-view:field:mark-enable-scaner']"
v-model:value="element.enableScanner" size="small"
type="text"
class="form-meta-input nc-form-input-label"
data-testid="nc-form-input-label"
:placeholder="$t('general.enableScanner')"
@change="updateColMeta(element)" @change="updateColMeta(element)"
> />
</a-input> </div>
</a-form-item> </a-form-item>
<a-form-item class="my-0 w-1/2 !mb-1"> <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; uuid?: any;
label?: string; label?: string;
help?: any; help?: any;
enable_scanner?: boolean;
required?: boolean; required?: boolean;
show?: boolean; show?: boolean;
order?: number; order?: number;

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

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

4
scripts/sdk/swagger.json

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

Loading…
Cancel
Save