Browse Source

chore: lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5936/head
Pranav C 1 year ago
parent
commit
14757d6b0d
  1. 4
      packages/nc-gui/components/cell/MultiSelect.vue
  2. 6
      packages/nc-gui/components/cell/SingleSelect.vue
  3. 2
      packages/nc-gui/components/dashboard/TreeView.vue
  4. 11
      packages/nc-gui/components/smartsheet/Form.vue
  5. 2
      packages/nc-gui/components/smartsheet/Grid.vue
  6. 8
      packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue
  7. 2
      packages/nc-gui/composables/useColumnCreateStore.ts
  8. 10
      packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue
  9. 12
      packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
  10. 27
      packages/nocodb/src/db/sql-mgr/v2/ProjectMgrv2.ts
  11. 1
      packages/nocodb/src/services/tables.service.ts
  12. 5
      packages/nocodb/src/services/users/users.service.ts

4
packages/nc-gui/components/cell/MultiSelect.vue

@ -8,6 +8,7 @@ import {
ActiveCellInj,
CellClickHookInj,
ColumnInj,
EditModeInj,
IsKanbanInj,
ReadonlyInj,
RowHeightInj,
@ -27,7 +28,6 @@ import {
useRoles,
useSelectedCellKeyupListener,
watch,
EditModeInj
} from '#imports'
import MdiCloseCircle from '~icons/mdi/close-circle'
@ -101,7 +101,7 @@ const isOptionMissing = computed(() => {
const hasEditRoles = computed(() => hasRole('owner', true) || hasRole('creator', true) || hasRole('editor', true))
const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && (active.value))
const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && active.value)
const vModel = computed({
get: () => {

6
packages/nc-gui/components/cell/SingleSelect.vue

@ -8,6 +8,7 @@ import {
ActiveCellInj,
CellClickHookInj,
ColumnInj,
EditModeInj,
IsFormInj,
IsKanbanInj,
ReadonlyInj,
@ -23,7 +24,6 @@ import {
useRoles,
useSelectedCellKeyupListener,
watch,
EditModeInj
} from '#imports'
interface Props {
@ -96,7 +96,7 @@ const isOptionMissing = computed(() => {
const hasEditRoles = computed(() => hasRole('owner', true) || hasRole('creator', true) || hasRole('editor', true))
const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && (active.value))
const editAllowed = computed(() => (hasEditRoles.value || isForm.value) && active.value)
const vModel = computed({
get: () => tempSelectedOptState.value ?? modelValue,
@ -257,7 +257,7 @@ const selectedOpt = computed(() => {
<template>
<div class="h-full w-full flex items-center nc-single-select" :class="{ 'read-only': readOnly }" @click="toggleMenu">
<div v-if="!(active || isEditable) ">
<div v-if="!(active || isEditable)">
<a-tag v-if="selectedOpt" class="rounded-tag" :color="selectedOpt.color">
<span
:style="{

2
packages/nc-gui/components/dashboard/TreeView.vue

@ -97,7 +97,7 @@ const initSortable = (el: Element) => {
onEnd: async (evt) => {
const { newIndex = 0, oldIndex = 0 } = evt
if(newIndex === oldIndex) return
if (newIndex === oldIndex) return
const itemEl = evt.item as HTMLLIElement
const item = tablesById[itemEl.dataset.id as string]

11
packages/nc-gui/components/smartsheet/Form.vue

@ -535,7 +535,7 @@ watch(view, (nextView) => {
<a-textarea
v-model:value="formViewData.heading"
class="w-full !font-bold !text-4xl !border-0 !border-b-1 !border-dashed !rounded-none !border-gray-400"
:style="{ borderRightWidth: '0px !important', 'height': '54px', 'min-height': '54px', resize: 'vertical' }"
:style="{ 'borderRightWidth': '0px !important', 'height': '54px', 'min-height': '54px', 'resize': 'vertical' }"
size="large"
hide-details
placeholder="Form Title"
@ -554,7 +554,7 @@ watch(view, (nextView) => {
<a-textarea
v-model:value="formViewData.subheading"
class="w-full !border-0 !border-b-1 !border-dashed !rounded-none !border-gray-400"
:style="{ borderRightWidth: '0px !important', height: '40px', 'min-height': '40px', resize: 'vertical' }"
:style="{ 'borderRightWidth': '0px !important', 'height': '40px', 'min-height': '40px', 'resize': 'vertical' }"
size="large"
hide-details
:placeholder="$t('msg.info.formDesc')"
@ -743,7 +743,9 @@ watch(view, (nextView) => {
</LazySmartsheetDivDataCell>
</a-form-item>
<div class="nc-form-help-text text-gray-500 text-xs" data-testid="nc-form-input-help-text-label">{{ element.description }}</div>
<div class="nc-form-help-text text-gray-500 text-xs" data-testid="nc-form-input-help-text-label">
{{ element.description }}
</div>
</div>
</template>
@ -861,7 +863,8 @@ watch(view, (nextView) => {
}
}
.nc-form-help-text, .nc-input-required-error {
.nc-form-help-text,
.nc-input-required-error {
max-width: 100%;
word-break: break-all;
white-space: pre-line;

2
packages/nc-gui/components/smartsheet/Grid.vue

@ -746,7 +746,7 @@ const saveOrUpdateRecords = async (args: { metaValue?: TableType; viewMetaValue?
async function reloadViewDataHandler(shouldShowLoading: boolean | void) {
// save any unsaved data before reload
await saveOrUpdateRecords();
await saveOrUpdateRecords()
// set value if spinner should be hidden
showLoading.value = !!shouldShowLoading

8
packages/nc-gui/components/smartsheet/column/LinkedToAnotherRecordOptions.vue

@ -129,11 +129,9 @@ const filterOption = (value: string, option: { key: string }) => option.key.toLo
<div class="flex flex-row">
<a-form-item>
<a-checkbox v-model:checked="vModel.virtual" :disabled="appInfo.isCloud" name="virtual"
@change="onDataTypeChange"
>Virtual Relation
</a-checkbox
>
<a-checkbox v-model:checked="vModel.virtual" :disabled="appInfo.isCloud" name="virtual" @change="onDataTypeChange"
>Virtual Relation
</a-checkbox>
</a-form-item>
</div>
</div>

2
packages/nc-gui/composables/useColumnCreateStore.ts

@ -291,7 +291,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
isMssql,
isPg,
isMysql,
isXcdbBase
isXcdbBase,
}
},
)

10
packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue

@ -75,10 +75,7 @@ const onDecode = async (scannedCodeValue: string) => {
class="color-transition relative flex flex-col justify-center gap-2 w-full max-w-[max(33%,600px)] m-auto py-4 pb-8 px-16 md:(bg-white dark:bg-slate-700 rounded-lg border-1 border-gray-200 shadow-xl)"
>
<template v-if="sharedFormView">
<h1
class="prose-2xl font-bold self-center my-4"
style="word-break: break-all"
>
<h1 class="prose-2xl font-bold self-center my-4" style="word-break: break-all">
{{ sharedFormView.heading }}
</h1>
@ -189,7 +186,10 @@ const onDecode = async (scannedCodeValue: string) => {
</a-button>
</LazySmartsheetDivDataCell>
<div class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1" style="word-break: break-all">
<div
class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1"
style="word-break: break-all"
>
<div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500">
{{ error.$message }}
</div>

12
packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue

@ -244,10 +244,7 @@ onMounted(() => {
class="max-w-[max(33%,600px)] mx-auto flex flex-col justify-end"
>
<div class="px-4 md:px-0 flex flex-col justify-end">
<h1
class="prose-2xl font-bold self-center my-4"
data-testid="nc-survey-form__heading"
style="word-break: break-all">
<h1 class="prose-2xl font-bold self-center my-4" data-testid="nc-survey-form__heading" style="word-break: break-all">
{{ sharedFormView.heading }}
</h1>
@ -309,7 +306,10 @@ onMounted(() => {
@update:edit-enabled="editEnabled[index] = $event"
/>
<div class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1" style="word-break: break-all">
<div
class="flex flex-col gap-2 text-slate-500 dark:text-slate-300 text-[0.75rem] my-2 px-1"
style="word-break: break-all"
>
<div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500">
{{ error.$message }}
</div>
@ -353,7 +353,7 @@ onMounted(() => {
:mouse-enter-delay="0.25"
:mouse-leave-delay="0"
>
<!-- Ok button for question -->
<!-- Ok button for question -->
<button
class="bg-opacity-100 scaling-btn flex items-center gap-1"
data-testid="nc-survey-form__btn-next"

27
packages/nocodb/src/db/sql-mgr/v2/ProjectMgrv2.ts

@ -1,21 +1,24 @@
import { MetaService } from '../../../meta/meta.service'
import SqlMgrv2 from './SqlMgrv2'
import SqlMgrv2Trans from './SqlMgrv2Trans'
import SqlMgrv2 from './SqlMgrv2';
import SqlMgrv2Trans from './SqlMgrv2Trans';
import type { MetaService } from '../../../meta/meta.service';
// import type NcMetaIO from '../../../meta/NcMetaIO';
import type Base from '../../../models/Base'
import type Base from '../../../models/Base';
export default class ProjectMgrv2 {
private static sqlMgrMap: {
[key: string]: SqlMgrv2;
} = {}
} = {};
public static getSqlMgr(project: { id: string }, ncMeta: MetaService = null): SqlMgrv2 {
if (ncMeta) return new SqlMgrv2(project, ncMeta)
public static getSqlMgr(
project: { id: string },
ncMeta: MetaService = null,
): SqlMgrv2 {
if (ncMeta) return new SqlMgrv2(project, ncMeta);
if (!this.sqlMgrMap[project.id]) {
this.sqlMgrMap[project.id] = new SqlMgrv2(project)
this.sqlMgrMap[project.id] = new SqlMgrv2(project);
}
return this.sqlMgrMap[project.id]
return this.sqlMgrMap[project.id];
}
public static async getSqlMgrTrans(
@ -24,8 +27,8 @@ export default class ProjectMgrv2 {
ncMeta: any,
base: Base,
): Promise<SqlMgrv2Trans> {
const sqlMgr = new SqlMgrv2Trans(project, ncMeta, base)
await sqlMgr.startTransaction(base)
return sqlMgr
const sqlMgr = new SqlMgrv2Trans(project, ncMeta, base);
await sqlMgr.startTransaction(base);
return sqlMgr;
}
}

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

@ -16,7 +16,6 @@ import getTableNameAlias, { getColumnNameAlias } from '../helpers/getTableName';
import mapDefaultDisplayValue from '../helpers/mapDefaultDisplayValue';
import {
Audit,
Base,
Column,
Model,
ModelRoleVisibility,

5
packages/nocodb/src/services/users/users.service.ts

@ -51,7 +51,10 @@ export class UsersService {
email: string;
lastname: any;
}) {
return this.metaService.metaInsert2(null, null, MetaTable.USERS, { ...param, email: param.email?.toLowerCase() });
return this.metaService.metaInsert2(null, null, MetaTable.USERS, {
...param,
email: param.email?.toLowerCase(),
});
}
async registerNewUserIfAllowed({

Loading…
Cancel
Save