Browse Source

refactor(nocodb-sdk): fix lint

pull/4237/head
Wing-Kam Wong 2 years ago
parent
commit
2db77f5694
  1. 24
      packages/nocodb-sdk/src/lib/XcUIBuilder.ts
  2. 2
      packages/nocodb-sdk/src/lib/passwordHelpers.ts
  3. 2
      packages/nocodb-sdk/src/lib/sqlUi/MssqlUi.ts
  4. 11
      packages/nocodb-sdk/src/lib/sqlUi/MysqlUi.ts
  5. 1
      packages/nocodb-sdk/src/lib/sqlUi/OracleUi.ts
  6. 1
      packages/nocodb-sdk/src/lib/sqlUi/PgUi.ts
  7. 1
      packages/nocodb-sdk/src/lib/sqlUi/SqlUiFactory.ts
  8. 1
      packages/nocodb-sdk/src/lib/sqlUi/SqliteUi.ts

24
packages/nocodb-sdk/src/lib/XcUIBuilder.ts

@ -1,13 +1,12 @@
interface XcForm { interface XcForm {
title: string; title: string;
items: XcItem[]; items: XcItem[];
actions: XcButton[], actions: XcButton[];
msgOnInstall: string, msgOnInstall: string;
msgOnUninstall: string, msgOnUninstall: string;
[key: string]: any [key: string]: any;
} }
enum XcType { enum XcType {
ID = 'ID', ID = 'ID',
ForeignKey = 'ForeignKey', ForeignKey = 'ForeignKey',
@ -43,7 +42,6 @@ enum XcType {
Password = 'Password', Password = 'Password',
} }
interface XcItem { interface XcItem {
label: string; label: string;
key: string; key: string;
@ -61,24 +59,16 @@ interface XcItem {
validations?: any; validations?: any;
} }
interface XcButton extends XcItem { interface XcButton extends XcItem {
type: XcType.Button; type: XcType.Button;
actionType: XcActionType actionType: XcActionType;
} }
enum XcActionType { enum XcActionType {
SUBMIT = 'SUBMIT', SUBMIT = 'SUBMIT',
TEST = 'TEST', TEST = 'TEST',
CLEAR = 'CLEAR', CLEAR = 'CLEAR',
CANCEL = 'CANCEL' CANCEL = 'CANCEL',
} }
export { XcForm, XcItem, XcType, XcButton, XcActionType };
export {
XcForm,
XcItem,
XcType,
XcButton,
XcActionType
}

2
packages/nocodb-sdk/src/lib/passwordHelpers.ts

@ -1,6 +1,6 @@
export function validatePassword(p) { export function validatePassword(p) {
let error = ''; let error = '';
let hint = null; const hint = null;
let valid = true; let valid = true;
if (!p) { if (!p) {

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

@ -415,7 +415,6 @@ export class MssqlUi {
case 'nchar': case 'nchar':
case 'ntext': case 'ntext':
case 'numeric': case 'numeric':
case 'nvarchar':
case 'real': case 'real':
case 'json': case 'json':
case 'smalldatetime': case 'smalldatetime':
@ -1346,4 +1345,3 @@ export class MssqlUi {
} }
// module.exports = PgUiHelp; // module.exports = PgUiHelp;

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

@ -944,7 +944,10 @@ export class MysqlUi {
} }
} }
static getDataTypeForUiType(col: { uidt: UITypes, dtxp?: string, colOptions?: any }, idType?: IDType) { static getDataTypeForUiType(
col: { uidt: UITypes; dtxp?: string; colOptions?: any },
idType?: IDType
) {
const colProp: any = {}; const colProp: any = {};
switch (col.uidt) { switch (col.uidt) {
case 'ID': case 'ID':
@ -977,7 +980,10 @@ export class MysqlUi {
break; break;
case 'MultiSelect': case 'MultiSelect':
colProp.dt = 'set'; colProp.dt = 'set';
if (col.colOptions?.options.length > 64 || col.dtxp?.split(',').length > 64) { if (
col.colOptions?.options.length > 64 ||
col.dtxp?.split(',').length > 64
) {
colProp.dt = 'text'; colProp.dt = 'text';
} }
break; break;
@ -1281,4 +1287,3 @@ export class MysqlUi {
} }
// module.exports = MysqlUiHelp; // module.exports = MysqlUiHelp;

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

@ -934,4 +934,3 @@ export class OracleUi {
} }
// module.exports = PgUiHelp; // module.exports = PgUiHelp;

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

@ -1978,4 +1978,3 @@ export class PgUi {
} }
// module.exports = PgUiHelp; // module.exports = PgUiHelp;

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

@ -68,4 +68,3 @@ export type SqlUIColumn = {
uicn?: string; uicn?: string;
altered?: number; altered?: number;
}; };

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

@ -1119,4 +1119,3 @@ export class SqliteUi {
} }
// module.exports = PgUiHelp; // module.exports = PgUiHelp;

Loading…
Cancel
Save