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. 7
      packages/nc-gui/components/smartsheet/expanded-form/index.vue
  3. 16
      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

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

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

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

@ -459,12 +459,7 @@ const onIsExpandedUpdate = (v: boolean) => {
const isReadOnlyVirtualCell = (column: ColumnType) => {
return (
isRollup(column) ||
isFormula(column) ||
isBarcode(column) ||
isLookup(column) ||
isQrCode(column) ||
isSystemColumn(column)
isRollup(column) || isFormula(column) || isBarcode(column) || isLookup(column) || isQrCode(column) || isSystemColumn(column)
)
}

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

@ -1,13 +1,13 @@
<script lang="ts" setup>
import tinycolor from 'tinycolor2'
import dayjs from 'dayjs'
import {dateFormats, timeFormats, UITypes} from 'nocodb-sdk'
import { UITypes, dateFormats, timeFormats } from 'nocodb-sdk'
import Table from './Table.vue'
import GroupBy from './GroupBy.vue'
import GroupByTable from './GroupByTable.vue'
import GroupByLabel from './GroupByLabel.vue'
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<{
group: Group
@ -181,7 +181,17 @@ const parseKey = (group: Group) => {
}
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>
<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" />
<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">
<component :is="iconMap.duplicate" class="text-gray-700" />
<!-- Duplicate -->

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

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

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

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

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

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

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

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

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

@ -197,18 +197,22 @@ export const RoleColors = {
export const RoleDescriptions = {
[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.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',
[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.COMMENTER]: 'Can view records and add comment on them',
[ProjectRoles.VIEWER]: 'Can only view records',
[ProjectRoles.NO_ACCESS]: 'Cannot access this base',
[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',
};

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 {
FORM = 1,

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

@ -1,4 +1,3 @@
export function mergeSwaggerSchema(swaggerCE, swaggerEE) {
return {
...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 { MssqlUi } from './MssqlUi';

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

@ -39,9 +39,15 @@ export default async function getColumnPropsFromUIDT(
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';
} 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';
}

Loading…
Cancel
Save