Browse Source

chore(nc-gui): lint

pull/5903/head
Wing-Kam Wong 2 years ago
parent
commit
503061d7dd
  1. 2
      packages/nc-gui/components/dashboard/TreeView.vue
  2. 4
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  3. 4
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue
  4. 11
      packages/nc-gui/components/smartsheet/Form.vue
  5. 2
      packages/nc-gui/components/smartsheet/Grid.vue
  6. 10
      packages/nc-gui/pages/[projectType]/form/[viewId]/index/index.vue
  7. 12
      packages/nc-gui/pages/[projectType]/form/[viewId]/index/survey.vue
  8. 2
      packages/nc-gui/pages/index/index/index.vue

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]

4
packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue

@ -1,12 +1,10 @@
<script lang="ts" setup>
import { Form, Modal, message } from 'ant-design-vue'
import type { SelectHandler } from 'ant-design-vue/es/vc-select/Select'
import type { ProjectCreateForm } from '#imports'
import type { DefaultConnection, ProjectCreateForm, SQLiteConnection } from '#imports'
import {
CertTypes,
ClientType,
DefaultConnection,
SQLiteConnection,
SSLUsage,
clientTypes as _clientTypes,
computed,

4
packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue

@ -2,12 +2,10 @@
import type { BaseType } from 'nocodb-sdk'
import { Form, Modal, message } from 'ant-design-vue'
import type { SelectHandler } from 'ant-design-vue/es/vc-select/Select'
import type { ProjectCreateForm } from '#imports'
import type { DefaultConnection, ProjectCreateForm, SQLiteConnection } from '#imports'
import {
CertTypes,
ClientType,
DefaultConnection,
SQLiteConnection,
SSLUsage,
clientTypes,
computed,

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

@ -741,7 +741,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

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"

2
packages/nc-gui/pages/index/index/index.vue

@ -247,7 +247,7 @@ const copyProjectMeta = async () => {
<a-table-column key="title" :title="$t('general.title')" data-index="title">
<template #default="{ text, record }">
<div class="flex items-center">
<div @click.stop class="w-2">
<div class="w-2" @click.stop>
<a-menu class="!border-0 !m-0 !p-0" trigger-sub-menu-action="click">
<template v-if="isUIAllowed('projectTheme') || isUIAllowed('projectTheme', true, record.roles)">
<a-sub-menu key="theme" popup-class-name="custom-color">

Loading…
Cancel
Save