Browse Source

chore: lint

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

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

@ -8,6 +8,7 @@ import {
ActiveCellInj, ActiveCellInj,
CellClickHookInj, CellClickHookInj,
ColumnInj, ColumnInj,
EditModeInj,
IsKanbanInj, IsKanbanInj,
ReadonlyInj, ReadonlyInj,
RowHeightInj, RowHeightInj,
@ -27,7 +28,6 @@ import {
useRoles, useRoles,
useSelectedCellKeyupListener, useSelectedCellKeyupListener,
watch, watch,
EditModeInj
} from '#imports' } from '#imports'
import MdiCloseCircle from '~icons/mdi/close-circle' 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 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({ const vModel = computed({
get: () => { get: () => {

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

@ -8,6 +8,7 @@ import {
ActiveCellInj, ActiveCellInj,
CellClickHookInj, CellClickHookInj,
ColumnInj, ColumnInj,
EditModeInj,
IsFormInj, IsFormInj,
IsKanbanInj, IsKanbanInj,
ReadonlyInj, ReadonlyInj,
@ -23,7 +24,6 @@ import {
useRoles, useRoles,
useSelectedCellKeyupListener, useSelectedCellKeyupListener,
watch, watch,
EditModeInj
} from '#imports' } from '#imports'
interface Props { interface Props {
@ -96,7 +96,7 @@ const isOptionMissing = computed(() => {
const hasEditRoles = computed(() => hasRole('owner', true) || hasRole('creator', true) || hasRole('editor', true)) 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({ const vModel = computed({
get: () => tempSelectedOptState.value ?? modelValue, get: () => tempSelectedOptState.value ?? modelValue,

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

@ -535,7 +535,7 @@ watch(view, (nextView) => {
<a-textarea <a-textarea
v-model:value="formViewData.heading" v-model:value="formViewData.heading"
class="w-full !font-bold !text-4xl !border-0 !border-b-1 !border-dashed !rounded-none !border-gray-400" 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" size="large"
hide-details hide-details
placeholder="Form Title" placeholder="Form Title"
@ -554,7 +554,7 @@ watch(view, (nextView) => {
<a-textarea <a-textarea
v-model:value="formViewData.subheading" v-model:value="formViewData.subheading"
class="w-full !border-0 !border-b-1 !border-dashed !rounded-none !border-gray-400" 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" size="large"
hide-details hide-details
:placeholder="$t('msg.info.formDesc')" :placeholder="$t('msg.info.formDesc')"
@ -743,7 +743,9 @@ watch(view, (nextView) => {
</LazySmartsheetDivDataCell> </LazySmartsheetDivDataCell>
</a-form-item> </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> </div>
</template> </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%; max-width: 100%;
word-break: break-all; word-break: break-all;
white-space: pre-line; 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) { async function reloadViewDataHandler(shouldShowLoading: boolean | void) {
// save any unsaved data before reload // save any unsaved data before reload
await saveOrUpdateRecords(); await saveOrUpdateRecords()
// set value if spinner should be hidden // set value if spinner should be hidden
showLoading.value = !!shouldShowLoading showLoading.value = !!shouldShowLoading

6
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"> <div class="flex flex-row">
<a-form-item> <a-form-item>
<a-checkbox v-model:checked="vModel.virtual" :disabled="appInfo.isCloud" name="virtual" <a-checkbox v-model:checked="vModel.virtual" :disabled="appInfo.isCloud" name="virtual" @change="onDataTypeChange"
@change="onDataTypeChange"
>Virtual Relation >Virtual Relation
</a-checkbox </a-checkbox>
>
</a-form-item> </a-form-item>
</div> </div>
</div> </div>

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

@ -291,7 +291,7 @@ const [useProvideColumnCreateStore, useColumnCreateStore] = createInjectionState
isMssql, isMssql,
isPg, isPg,
isMysql, 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)" 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"> <template v-if="sharedFormView">
<h1 <h1 class="prose-2xl font-bold self-center my-4" style="word-break: break-all">
class="prose-2xl font-bold self-center my-4"
style="word-break: break-all"
>
{{ sharedFormView.heading }} {{ sharedFormView.heading }}
</h1> </h1>
@ -189,7 +186,10 @@ const onDecode = async (scannedCodeValue: string) => {
</a-button> </a-button>
</LazySmartsheetDivDataCell> </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"> <div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500">
{{ error.$message }} {{ error.$message }}
</div> </div>

10
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" 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"> <div class="px-4 md:px-0 flex flex-col justify-end">
<h1 <h1 class="prose-2xl font-bold self-center my-4" data-testid="nc-survey-form__heading" style="word-break: break-all">
class="prose-2xl font-bold self-center my-4"
data-testid="nc-survey-form__heading"
style="word-break: break-all">
{{ sharedFormView.heading }} {{ sharedFormView.heading }}
</h1> </h1>
@ -309,7 +306,10 @@ onMounted(() => {
@update:edit-enabled="editEnabled[index] = $event" @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"> <div v-for="error of v$.localState[field.title]?.$errors" :key="error" class="text-red-500">
{{ error.$message }} {{ error.$message }}
</div> </div>

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

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

@ -51,7 +51,10 @@ export class UsersService {
email: string; email: string;
lastname: any; 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({ async registerNewUserIfAllowed({

Loading…
Cancel
Save