Browse Source

chore: lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5848/head
Pranav C 1 year ago
parent
commit
f608c4fcf1
  1. 2
      packages/nocodb/src/db/genRollupSelectv2.ts
  2. 2
      packages/nocodb/src/helpers/populateMeta.ts
  3. 2
      packages/nocodb/src/models/Column.ts
  4. 1
      packages/nocodb/src/models/View.ts
  5. 4
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts
  6. 6
      packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts
  7. 4
      packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts
  8. 2
      packages/nocodb/src/services/bases.service.ts
  9. 1
      packages/nocodb/src/services/projects.service.ts
  10. 2
      packages/nocodb/src/services/public-metas.service.ts
  11. 17
      packages/nocodb/src/services/tables.service.ts

2
packages/nocodb/src/db/genRollupSelectv2.ts

@ -1,5 +1,5 @@
import { RelationTypes } from 'nocodb-sdk';
import { LinksColumn } from '../models'
import type { LinksColumn } from '../models';
import type { RollupColumn } from '../models';
import type { XKnex } from '../db/CustomKnex';
import type { LinkToAnotherRecordColumn } from '../models';

2
packages/nocodb/src/helpers/populateMeta.ts

@ -1,7 +1,7 @@
import { ModelTypes, UITypes, ViewTypes } from 'nocodb-sdk';
import { isVirtualCol, RelationTypes } from 'nocodb-sdk';
import { pluralize, singularize } from 'inflection';
import { isLinksOrLTAR } from 'nocodb-sdk'
import { isLinksOrLTAR } from 'nocodb-sdk';
import { GridViewColumn } from '../models';
import Column from '../models/Column';
import Model from '../models/Model';

2
packages/nocodb/src/models/Column.ts

@ -12,7 +12,6 @@ import { NcError } from '../helpers/catchError';
import { extractProps } from '../helpers/extractProps';
import { stringifyMetaProp } from '../utils/modelUtils';
import FormulaColumn from './FormulaColumn';
import { LinksColumn } from './index';
import LinkToAnotherRecordColumn from './LinkToAnotherRecordColumn';
import LookupColumn from './LookupColumn';
import RollupColumn from './RollupColumn';
@ -23,6 +22,7 @@ import Sort from './Sort';
import Filter from './Filter';
import QrCodeColumn from './QrCodeColumn';
import BarcodeColumn from './BarcodeColumn';
import { LinksColumn } from './index';
import type { ColumnReqType, ColumnType } from 'nocodb-sdk';
export default class Column<T = any> implements ColumnType {

1
packages/nocodb/src/models/View.ts

@ -1,4 +1,3 @@
import { title } from 'process';
import { isSystemColumn, UITypes, ViewTypes } from 'nocodb-sdk';
import Noco from '../Noco';
import {

4
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -1972,9 +1972,7 @@ export class AtImportProcessor {
migrationStatsObj.aTbl.rollup = aTblRollup.length;
const ncTbl = await nc_getTableSchema(aTblSchema[idx].name);
const linkColumn = ncTbl.columns.filter(
(x) => isLinksOrLTAR(x)
);
const linkColumn = ncTbl.columns.filter((x) => isLinksOrLTAR(x));
const lookup = ncTbl.columns.filter((x) => x.uidt === UITypes.Lookup);
const rollup = ncTbl.columns.filter((x) => x.uidt === UITypes.Rollup);

6
packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts

@ -1,5 +1,5 @@
import { Readable } from 'stream';
import { isLinksOrLTAR, UITypes, ViewTypes } from 'nocodb-sdk'
import { isLinksOrLTAR, UITypes, ViewTypes } from 'nocodb-sdk';
import { unparse } from 'papaparse';
import { Injectable, Logger } from '@nestjs/common';
import NcConnectionMgrv2 from '../../../../utils/common/NcConnectionMgrv2';
@ -357,9 +357,7 @@ export class ExportService {
.join(',');
const mmColumns = model.columns.filter(
(col) =>
isLinksOrLTAR(col) &&
col.colOptions?.type === 'mm',
(col) => isLinksOrLTAR(col) && col.colOptions?.type === 'mm',
);
const hasLink = mmColumns.length > 0;

4
packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts

@ -166,9 +166,7 @@ export class ImportService {
const modelData = data.model;
const table = tableReferences.get(modelData.id);
const linkedColumnSet = modelData.columns.filter(
(a) => isLinksOrLTAR(a)
);
const linkedColumnSet = modelData.columns.filter((a) => isLinksOrLTAR(a));
for (const col of linkedColumnSet) {
if (col.colOptions) {

2
packages/nocodb/src/services/bases.service.ts

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { T } from 'nc-help';
import { populateMeta, validatePayload } from '../helpers';
import { populateRollupColumnAndHideLTAR } from '../helpers/populateMeta'
import { populateRollupColumnAndHideLTAR } from '../helpers/populateMeta';
import { syncBaseMigration } from '../helpers/syncMigration';
import { Base, Project } from '../models';
import type { BaseReqType } from 'nocodb-sdk';

1
packages/nocodb/src/services/projects.service.ts

@ -7,7 +7,6 @@ import { OrgUserRoles } from 'nocodb-sdk';
import { populateMeta, validatePayload } from '../helpers';
import { NcError } from '../helpers/catchError';
import { extractPropsAndSanitize } from '../helpers/extractProps';
import { populateRollupColumnAndHideLTAR } from '../helpers/populateMeta'
import syncMigration from '../helpers/syncMigration';
import { Project, ProjectUser } from '../models';
import Noco from '../Noco';

2
packages/nocodb/src/services/public-metas.service.ts

@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common';
import { ErrorMessages, RelationTypes, UITypes } from 'nocodb-sdk';
import { isLinksOrLTAR } from 'nocodb-sdk'
import { isLinksOrLTAR } from 'nocodb-sdk';
import { NcError } from '../helpers/catchError';
import { Base, Column, Model, Project, View } from '../models';
import type { LinkToAnotherRecordColumn, LookupColumn } from '../models';

17
packages/nocodb/src/services/tables.service.ts

@ -2,11 +2,12 @@ import { Injectable } from '@nestjs/common';
import DOMPurify from 'isomorphic-dompurify';
import {
AuditOperationSubTypes,
AuditOperationTypes, isLinksOrLTAR,
AuditOperationTypes,
isLinksOrLTAR,
isVirtualCol,
ModelTypes,
UITypes,
} from 'nocodb-sdk'
} from 'nocodb-sdk';
import { T } from 'nc-help';
import ProjectMgrv2 from '../db/sql-mgr/v2/ProjectMgrv2';
import { NcError } from '../helpers/catchError';
@ -14,13 +15,7 @@ import getColumnPropsFromUIDT from '../helpers/getColumnPropsFromUIDT';
import getColumnUiType from '../helpers/getColumnUiType';
import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName';
import mapDefaultDisplayValue from '../helpers/mapDefaultDisplayValue';
import {
Audit,
Column,
Model,
ModelRoleVisibility,
Project,
} from '../models';
import { Audit, Column, Model, ModelRoleVisibility, Project } from '../models';
import Noco from '../Noco';
import NcConnectionMgrv2 from '../utils/common/NcConnectionMgrv2';
import { validatePayload } from '../helpers';
@ -156,9 +151,7 @@ export class TablesService {
const project = await Project.getWithInfo(table.project_id);
const base = project.bases.find((b) => b.id === table.base_id);
const relationColumns = table.columns.filter(
(c) => isLinksOrLTAR(c),
);
const relationColumns = table.columns.filter((c) => isLinksOrLTAR(c));
if (relationColumns?.length && !base.is_meta) {
const referredTables = await Promise.all(

Loading…
Cancel
Save