Browse Source

code scanner for forms - WIP

pull/5114/head
Daniel Spaude 2 years ago
parent
commit
c8e933ddab
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 14
      packages/nc-gui/components/smartsheet/Form.vue
  2. 1
      packages/nc-gui/lang/en.json
  3. 4
      packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts
  4. 16
      packages/nocodb/src/lib/migrations/v2/nc_026_add_enable_scanner_in_form_columns_meta_table.ts

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

@ -616,6 +616,20 @@ watch(view, (nextView) => {
/> />
</div> </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>
<a-form-item class="my-0 w-1/2 !mb-1"> <a-form-item class="my-0 w-1/2 !mb-1">
<a-input <a-input
v-model:value="element.label" v-model:value="element.label"

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

@ -39,6 +39,7 @@
"signIn": "SIGN IN", "signIn": "SIGN IN",
"signOut": "Sign Out", "signOut": "Sign Out",
"required": "Required", "required": "Required",
"enableScanner": "Enable Scanner for filling",
"preferred": "Preferred", "preferred": "Preferred",
"mandatory": "Mandatory", "mandatory": "Mandatory",
"loading": "Loading ...", "loading": "Loading ...",

4
packages/nocodb/src/lib/migrations/XcMigrationSourcev2.ts

@ -13,6 +13,7 @@ import * as nc_022_qr_code_column_type from './v2/nc_022_qr_code_column_type';
import * as nc_023_multiple_source from './v2/nc_023_multiple_source'; import * as nc_023_multiple_source from './v2/nc_023_multiple_source';
import * as nc_024_barcode_column_type from './v2/nc_024_barcode_column_type'; import * as nc_024_barcode_column_type from './v2/nc_024_barcode_column_type';
import * as nc_025_add_row_height from './v2/nc_025_add_row_height'; import * as nc_025_add_row_height from './v2/nc_025_add_row_height';
import * as nc_026_add_enable_scanner_in_form_columns_meta_table from './v2/nc_026_add_enable_scanner_in_form_columns_meta_table';
// Create a custom migration source class // Create a custom migration source class
export default class XcMigrationSourcev2 { export default class XcMigrationSourcev2 {
@ -37,6 +38,7 @@ export default class XcMigrationSourcev2 {
'nc_023_multiple_source', 'nc_023_multiple_source',
'nc_024_barcode_column_type', 'nc_024_barcode_column_type',
'nc_025_add_row_height', 'nc_025_add_row_height',
'nc_026_add_enable_scanner_in_form_columns_meta_table',
]); ]);
} }
@ -76,6 +78,8 @@ export default class XcMigrationSourcev2 {
return nc_024_barcode_column_type; return nc_024_barcode_column_type;
case 'nc_025_add_row_height': case 'nc_025_add_row_height':
return nc_025_add_row_height; return nc_025_add_row_height;
case 'nc_026_add_enable_scanner_in_form_columns_meta_table':
return nc_026_add_enable_scanner_in_form_columns_meta_table;
} }
} }
} }

16
packages/nocodb/src/lib/migrations/v2/nc_026_add_enable_scanner_in_form_columns_meta_table.ts

@ -0,0 +1,16 @@
import { Knex } from 'knex';
import { MetaTable } from '../../utils/globals';
const up = async (knex: Knex) => {
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.boolean('enable_scanner');
});
};
const down = async (knex) => {
await knex.schema.alterTable(MetaTable.FORM_VIEW_COLUMNS, (table) => {
table.dropColumns('enable_scanner');
});
};
export { up, down };
Loading…
Cancel
Save