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> </div>
<a-form-item v-if="element.uidt === 'SingleLineText'" class="my-0 w-1/2 !mb-1">
<a-form-item class="my-0 w-1/2 !mb-1" v-if="element.uidt === 'SingleLineText'"> <div class="flex gap-2 items-center">
FOO <span
<a-input class="text-gray-500 mr-2 nc-form-input-required"
v-model:value="element.enableScanner" data-testid="nc-form-input-enable-scanner"
type="text" @click="
class="form-meta-input nc-form-input-label" () => {
data-testid="nc-form-input-label" element.general.enable_scanner = !element.general.enable_scanner
:placeholder="$t('general.enableScanner')" updateColMeta(element)
@change="updateColMeta(element)" }
> "
</a-input> >
{{ $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>
<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