Browse Source

feat: set default value of checkbox field as false/0

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/4885/head
Pranav C 2 years ago
parent
commit
d53209c4ae
  1. 1
      packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts
  2. 2
      packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts
  3. 1
      packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts
  4. 1
      packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts
  5. 2
      packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts
  6. 3
      packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

1
packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts

@ -1084,6 +1084,7 @@ export class MssqlUi {
case 'Checkbox': case 'Checkbox':
colProp.dt = 'tinyint'; colProp.dt = 'tinyint';
colProp.dtxp = 1; colProp.dtxp = 1;
colProp.cdf = '0';
break; break;
case 'MultiSelect': case 'MultiSelect':
colProp.dt = 'text'; colProp.dt = 'text';

2
packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts

@ -597,7 +597,6 @@ export class MysqlUi {
} }
static onCheckboxChangeAI(col) { static onCheckboxChangeAI(col) {
console.log(col);
if ( if (
col.dt === 'int' || col.dt === 'int' ||
col.dt === 'bigint' || col.dt === 'bigint' ||
@ -977,6 +976,7 @@ export class MysqlUi {
case 'Checkbox': case 'Checkbox':
colProp.dt = 'tinyint'; colProp.dt = 'tinyint';
colProp.dtxp = 1; colProp.dtxp = 1;
colProp.cdf = '0';
break; break;
case 'MultiSelect': case 'MultiSelect':
colProp.dt = 'set'; colProp.dt = 'set';

1
packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts

@ -824,6 +824,7 @@ export class OracleUi {
case 'Checkbox': case 'Checkbox':
colProp.dt = 'tinyint'; colProp.dt = 'tinyint';
colProp.dtxp = 1; colProp.dtxp = 1;
colProp.cdf = '0';
break; break;
case 'MultiSelect': case 'MultiSelect':
colProp.dt = 'varchar2'; colProp.dt = 'varchar2';

1
packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts

@ -1596,6 +1596,7 @@ export class PgUi {
break; break;
case 'Checkbox': case 'Checkbox':
colProp.dt = 'bool'; colProp.dt = 'bool';
colProp.cdf = 'false';
break; break;
case 'MultiSelect': case 'MultiSelect':
colProp.dt = 'text'; colProp.dt = 'text';

2
packages/nocodb-sdk/src/lib/sqlUi/SnowflakeUi.ts

@ -688,6 +688,7 @@ export class SnowflakeUi {
break; break;
case 'Checkbox': case 'Checkbox':
colProp.dt = 'BOOLEAN'; colProp.dt = 'BOOLEAN';
colProp.cdf = '0';
break; break;
case 'MultiSelect': case 'MultiSelect':
colProp.dt = 'TEXT'; colProp.dt = 'TEXT';
@ -700,7 +701,6 @@ export class SnowflakeUi {
break; break;
case 'Date': case 'Date':
colProp.dt = 'DATE'; colProp.dt = 'DATE';
break; break;
case 'Year': case 'Year':
colProp.dt = 'INT'; colProp.dt = 'INT';

3
packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

@ -788,9 +788,8 @@ export class SqliteUi {
colProp.dt = 'text'; colProp.dt = 'text';
break; break;
case 'Checkbox': case 'Checkbox':
// colProp.dt = 'tinyint';
// colProp.dtxp = 1;
colProp.dt = 'boolean'; colProp.dt = 'boolean';
colProp.cdf = '0';
break; break;
case 'MultiSelect': case 'MultiSelect':
colProp.dt = 'text'; colProp.dt = 'text';

Loading…
Cancel
Save