Browse Source

chore: lint

pull/7304/head
Pranav C 12 months ago
parent
commit
dfa7a6be61
  1. 5
      packages/nc-gui/components/smartsheet/VirtualCell.vue
  2. 9
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 18
      packages/nc-gui/components/smartsheet/grid/GroupBy.vue
  4. 2
      packages/nc-gui/components/smartsheet/header/Menu.vue
  5. 2
      packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue
  6. 2
      packages/nocodb-sdk/src/lib/CustomAPI.ts
  7. 7
      packages/nocodb-sdk/src/lib/UITypes.ts
  8. 2
      packages/nocodb-sdk/src/lib/columnRules/QrAndBarcodeRules.ts
  9. 12
      packages/nocodb-sdk/src/lib/enums.ts
  10. 2
      packages/nocodb-sdk/src/lib/globals.ts
  11. 1
      packages/nocodb-sdk/src/lib/mergeSwaggerSchema.ts
  12. 2
      packages/nocodb-sdk/src/lib/sqlUi/SqlUiFactory.ts
  13. 10
      packages/nocodb/src/helpers/getColumnPropsFromUIDT.ts
  14. 2
      packages/nocodb/src/modules/jobs/jobs/export-import/import.service.ts

5
packages/nc-gui/components/smartsheet/VirtualCell.vue

@ -115,10 +115,7 @@ onUnmounted(() => {
<LazyVirtualCellBarcode v-else-if="isBarcode(column)" /> <LazyVirtualCellBarcode v-else-if="isBarcode(column)" />
<LazyVirtualCellCount v-else-if="isCount(column)" /> <LazyVirtualCellCount v-else-if="isCount(column)" />
<LazyVirtualCellLookup v-else-if="isLookup(column)" /> <LazyVirtualCellLookup v-else-if="isLookup(column)" />
<LazyCellReadOnlyDateTimePicker <LazyCellReadOnlyDateTimePicker v-else-if="isCreatedTimeOrUpdatedTimeCol(column)" :model-value="modelValue" />
v-else-if="isCreatedTimeOrUpdatedTimeCol(column)"
:model-value="modelValue"
/>
</template> </template>
</div> </div>
</template> </template>

9
packages/nc-gui/components/smartsheet/expanded-form/index.vue

@ -459,12 +459,7 @@ const onIsExpandedUpdate = (v: boolean) => {
const isReadOnlyVirtualCell = (column: ColumnType) => { const isReadOnlyVirtualCell = (column: ColumnType) => {
return ( return (
isRollup(column) || isRollup(column) || isFormula(column) || isBarcode(column) || isLookup(column) || isQrCode(column) || isSystemColumn(column)
isFormula(column) ||
isBarcode(column) ||
isLookup(column) ||
isQrCode(column) ||
isSystemColumn(column)
) )
} }
@ -932,7 +927,7 @@ export default {
@apply !border-1 !border-brand-500 !rounded-lg !shadow-none !ring-0; @apply !border-1 !border-brand-500 !rounded-lg !shadow-none !ring-0;
} }
:deep(.nc-system-field input){ :deep(.nc-system-field input) {
@apply bg-transparent; @apply bg-transparent;
} }
</style> </style>

18
packages/nc-gui/components/smartsheet/grid/GroupBy.vue

@ -1,13 +1,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import tinycolor from 'tinycolor2' import tinycolor from 'tinycolor2'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import {dateFormats, timeFormats, UITypes} from 'nocodb-sdk' import { UITypes, dateFormats, timeFormats } from 'nocodb-sdk'
import Table from './Table.vue' import Table from './Table.vue'
import GroupBy from './GroupBy.vue' import GroupBy from './GroupBy.vue'
import GroupByTable from './GroupByTable.vue' import GroupByTable from './GroupByTable.vue'
import GroupByLabel from './GroupByLabel.vue' import GroupByLabel from './GroupByLabel.vue'
import type {Group, Row} from '#imports' import type { Group, Row } from '#imports'
import {computed, GROUP_BY_VARS, ref} from '#imports' import { GROUP_BY_VARS, computed, ref } from '#imports'
const props = defineProps<{ const props = defineProps<{
group: Group group: Group
@ -181,7 +181,17 @@ const parseKey = (group: Group) => {
} }
const shouldRenderCell = (column) => const shouldRenderCell = (column) =>
[UITypes.Lookup, UITypes.Attachment, UITypes.Barcode, UITypes.QrCode, UITypes.Links, UITypes.User, UITypes.DateTime, UITypes.CreatedTime, UITypes.LastModifiedTime].includes(column?.uidt) [
UITypes.Lookup,
UITypes.Attachment,
UITypes.Barcode,
UITypes.QrCode,
UITypes.Links,
UITypes.User,
UITypes.DateTime,
UITypes.CreatedTime,
UITypes.LastModifiedTime,
].includes(column?.uidt)
</script> </script>
<template> <template>

2
packages/nc-gui/components/smartsheet/header/Menu.vue

@ -361,7 +361,7 @@ const isDuplicateAllowed = computed(() => {
<a-divider v-if="!column?.pk" class="!my-0" /> <a-divider v-if="!column?.pk" class="!my-0" />
<NcMenuItem v-if="!column?.pk" @click="openDuplicateDlg" :disabled="!isDuplicateAllowed"> <NcMenuItem v-if="!column?.pk" :disabled="!isDuplicateAllowed" @click="openDuplicateDlg">
<div v-e="['a:field:duplicate']" class="nc-column-duplicate nc-header-menu-item"> <div v-e="['a:field:duplicate']" class="nc-column-duplicate nc-header-menu-item">
<component :is="iconMap.duplicate" class="text-gray-700" /> <component :is="iconMap.duplicate" class="text-gray-700" />
<!-- Duplicate --> <!-- Duplicate -->

2
packages/nc-gui/components/smartsheet/toolbar/FilterInput.vue

@ -11,7 +11,6 @@ import {
isCurrency, isCurrency,
isDate, isDate,
isDateTime, isDateTime,
isReadonlyDateTime,
isDecimal, isDecimal,
isDuration, isDuration,
isFloat, isFloat,
@ -19,6 +18,7 @@ import {
isMultiSelect, isMultiSelect,
isPercent, isPercent,
isRating, isRating,
isReadonlyDateTime,
isSingleSelect, isSingleSelect,
isTextArea, isTextArea,
isTime, isTime,

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

@ -1,9 +1,9 @@
import { import {
Api, Api,
BaseType,
ColumnType, ColumnType,
FilterType, FilterType,
HookType, HookType,
BaseType,
SortType, SortType,
} from './Api'; } from './Api';

7
packages/nocodb-sdk/src/lib/UITypes.ts

@ -95,10 +95,9 @@ export function isCreatedTimeOrUpdatedTimeCol(
| ColumnReqType | ColumnReqType
| ColumnType | ColumnType
) { ) {
return [ return [UITypes.CreatedTime, UITypes.LastModifiedTime].includes(
UITypes.CreatedTime, <UITypes>(typeof col === 'object' ? col?.uidt : col)
UITypes.LastModifiedTime, );
].includes(<UITypes>(typeof col === 'object' ? col?.uidt : col));
} }
export function isLinksOrLTAR( export function isLinksOrLTAR(

2
packages/nocodb-sdk/src/lib/columnRules/QrAndBarcodeRules.ts

@ -10,5 +10,5 @@ export const AllowedColumnTypesForQrAndBarcodes = [
UITypes.Decimal, UITypes.Decimal,
UITypes.Number, UITypes.Number,
UITypes.AutoNumber, UITypes.AutoNumber,
UITypes.ID UITypes.ID,
]; ];

12
packages/nocodb-sdk/src/lib/enums.ts

@ -197,18 +197,22 @@ export const RoleColors = {
export const RoleDescriptions = { export const RoleDescriptions = {
[WorkspaceUserRoles.OWNER]: 'Full access to workspace', [WorkspaceUserRoles.OWNER]: 'Full access to workspace',
[WorkspaceUserRoles.CREATOR]: 'Can create bases, sync tables, views, setup web-hooks and more', [WorkspaceUserRoles.CREATOR]:
'Can create bases, sync tables, views, setup web-hooks and more',
[WorkspaceUserRoles.EDITOR]: 'Can edit data in workspace bases', [WorkspaceUserRoles.EDITOR]: 'Can edit data in workspace bases',
[WorkspaceUserRoles.COMMENTER]: 'Can view and comment data in workspace bases', [WorkspaceUserRoles.COMMENTER]:
'Can view and comment data in workspace bases',
[WorkspaceUserRoles.VIEWER]: 'Can view data in workspace bases', [WorkspaceUserRoles.VIEWER]: 'Can view data in workspace bases',
[ProjectRoles.OWNER]: 'Full access to base', [ProjectRoles.OWNER]: 'Full access to base',
[ProjectRoles.CREATOR]: 'Can create tables, views, setup webhook, invite collaborators and more', [ProjectRoles.CREATOR]:
'Can create tables, views, setup webhook, invite collaborators and more',
[ProjectRoles.EDITOR]: 'Can view, add & modify records, add comments on them', [ProjectRoles.EDITOR]: 'Can view, add & modify records, add comments on them',
[ProjectRoles.COMMENTER]: 'Can view records and add comment on them', [ProjectRoles.COMMENTER]: 'Can view records and add comment on them',
[ProjectRoles.VIEWER]: 'Can only view records', [ProjectRoles.VIEWER]: 'Can only view records',
[ProjectRoles.NO_ACCESS]: 'Cannot access this base', [ProjectRoles.NO_ACCESS]: 'Cannot access this base',
[OrgUserRoles.SUPER_ADMIN]: 'Full access to all', [OrgUserRoles.SUPER_ADMIN]: 'Full access to all',
[OrgUserRoles.CREATOR]: 'Can create bases, sync tables, views, setup web-hooks and more', [OrgUserRoles.CREATOR]:
'Can create bases, sync tables, views, setup web-hooks and more',
[OrgUserRoles.VIEWER]: 'Can only view bases', [OrgUserRoles.VIEWER]: 'Can only view bases',
}; };

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

@ -1,4 +1,4 @@
import { OrgUserRoles, ProjectRoles, WorkspaceUserRoles } from "./enums"; import { OrgUserRoles, ProjectRoles, WorkspaceUserRoles } from './enums';
export enum ViewTypes { export enum ViewTypes {
FORM = 1, FORM = 1,

1
packages/nocodb-sdk/src/lib/mergeSwaggerSchema.ts

@ -1,4 +1,3 @@
export function mergeSwaggerSchema(swaggerCE, swaggerEE) { export function mergeSwaggerSchema(swaggerCE, swaggerEE) {
return { return {
...swaggerCE, ...swaggerCE,

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

@ -1,4 +1,4 @@
import { BoolType } from '../Api' import { BoolType } from '../Api';
import UITypes from '../UITypes'; import UITypes from '../UITypes';
import { MssqlUi } from './MssqlUi'; import { MssqlUi } from './MssqlUi';

10
packages/nocodb/src/helpers/getColumnPropsFromUIDT.ts

@ -39,9 +39,15 @@ export default async function getColumnPropsFromUIDT(
const finalColumnMeta = { ...newColumn, ...column }; const finalColumnMeta = { ...newColumn, ...column };
if (finalColumnMeta.uidt === UITypes.CreatedTime && !('column_name' in finalColumnMeta)) { if (
finalColumnMeta.uidt === UITypes.CreatedTime &&
!('column_name' in finalColumnMeta)
) {
finalColumnMeta.column_name = 'created_at'; finalColumnMeta.column_name = 'created_at';
} else if (finalColumnMeta.uidt === UITypes.LastModifiedTime && !('column_name' in finalColumnMeta)) { } else if (
finalColumnMeta.uidt === UITypes.LastModifiedTime &&
!('column_name' in finalColumnMeta)
) {
finalColumnMeta.column_name = 'updated_at'; finalColumnMeta.column_name = 'updated_at';
} }

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

@ -899,7 +899,7 @@ export class ImportService {
col.uidt === UITypes.CreatedTime || col.uidt === UITypes.CreatedTime ||
col.uidt === UITypes.LastModifiedTime col.uidt === UITypes.LastModifiedTime
) { ) {
if(col.system) continue; if (col.system) continue;
const freshModelData = await this.columnsService.columnAdd({ const freshModelData = await this.columnsService.columnAdd({
tableId: getIdOrExternalId(getParentIdentifier(col.id)), tableId: getIdOrExternalId(getParentIdentifier(col.id)),
column: withoutId({ column: withoutId({

Loading…
Cancel
Save