Browse Source

chore: lint

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5274/head
Pranav C 2 years ago
parent
commit
dbce6f0952
  1. 4
      packages/nc-gui/components/cell/DateTimePicker.vue
  2. 2
      packages/nc-gui/components/cell/MultiSelect.vue
  3. 2
      packages/nc-gui/components/cell/TimePicker.vue
  4. 12
      packages/nc-gui/components/dashboard/TreeView.vue
  5. 2
      packages/nc-gui/components/dashboard/settings/AuditTab.vue
  6. 2
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  7. 2
      packages/nc-gui/components/dashboard/settings/Metadata.vue
  8. 3
      packages/nc-gui/components/dashboard/settings/Misc.vue
  9. 2
      packages/nc-gui/components/dashboard/settings/UIAcl.vue
  10. 2
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  11. 2
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue
  12. 3
      packages/nc-gui/components/dlg/AirtableImport.vue
  13. 2
      packages/nc-gui/components/dlg/QuickImport.vue
  14. 3
      packages/nc-gui/components/dlg/TableRename.vue
  15. 2
      packages/nc-gui/components/smartsheet/Cell.vue
  16. 2
      packages/nc-gui/components/smartsheet/header/CellIcon.ts
  17. 2
      packages/nc-gui/components/smartsheet/sidebar/index.vue
  18. 3
      packages/nc-gui/composables/useKanbanViewStore.ts
  19. 2
      packages/nc-gui/composables/useMultiSelect/index.ts
  20. 2
      packages/nc-gui/composables/useSharedFormViewStore.ts
  21. 2
      packages/nc-gui/composables/useSharedView.ts
  22. 2
      packages/nc-gui/composables/useTable.ts
  23. 2
      packages/nc-gui/composables/useTabs.ts
  24. 2
      packages/nc-gui/nuxt.config.ts
  25. 3
      packages/nc-gui/pages/[projectType]/[projectId]/index.vue
  26. 2
      packages/nc-gui/pages/[projectType]/[projectId]/index/index/index.vue
  27. 6
      packages/nc-gui/pages/index/index/[projectId].vue
  28. 4
      packages/nc-gui/store/project.ts

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

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { storeToRefs } from 'pinia'
import { import {
ActiveCellInj, ActiveCellInj,
ColumnInj, ColumnInj,
@ -13,7 +14,6 @@ import {
useSelectedCellKeyupListener, useSelectedCellKeyupListener,
watch, watch,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
interface Props { interface Props {
modelValue?: string | null modelValue?: string | null
@ -24,7 +24,7 @@ const { modelValue, isPk } = defineProps<Props>()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const { isMysql } = (useProject()) const { isMysql } = useProject()
const { showNull } = useGlobal() const { showNull } = useGlobal()

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

@ -68,7 +68,7 @@ const { getMeta } = useMetas()
const { hasRole } = useRoles() const { hasRole } = useRoles()
const { isPg, isMysql } = (useProject()) const { isPg, isMysql } = useProject()
// a variable to keep newly created options value // a variable to keep newly created options value
// temporary until it's add the option to column meta // temporary until it's add the option to column meta

2
packages/nc-gui/components/cell/TimePicker.vue

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { ActiveCellInj, ReadonlyInj, inject, onClickOutside, useProject, useSelectedCellKeyupListener, watch } from '#imports'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { ActiveCellInj, ReadonlyInj, inject, onClickOutside, useProject, useSelectedCellKeyupListener, watch } from '#imports'
interface Props { interface Props {
modelValue?: string | null | undefined modelValue?: string | null | undefined

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

@ -5,8 +5,8 @@ import { Dropdown, Tooltip, message } from 'ant-design-vue'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import Sortable from 'sortablejs' import Sortable from 'sortablejs'
import GithubButton from 'vue-github-button' import GithubButton from 'vue-github-button'
import type { VNodeRef } from '#imports'
import { Icon } from '@iconify/vue' import { Icon } from '@iconify/vue'
import type { VNodeRef } from '#imports'
import { import {
ClientType, ClientType,
Empty, Empty,
@ -713,8 +713,8 @@ const setIcon = async (icon: string, table: TableType) => {
<MdiPlus /> <MdiPlus />
<span class="text-gray-500 group-hover:(text-primary/100) flex-1 nc-add-new-table">{{ <span class="text-gray-500 group-hover:(text-primary/100) flex-1 nc-add-new-table">{{
$t('tooltip.addTable') $t('tooltip.addTable')
}}</span> }}</span>
<a-dropdown <a-dropdown
v-if="!isSharedBase" v-if="!isSharedBase"
@ -808,8 +808,7 @@ const setIcon = async (icon: string, table: TableType) => {
overlay-class-name="nc-dropdown-import-menu" overlay-class-name="nc-dropdown-import-menu"
@click.stop @click.stop
> >
<MdiDotsVertical <MdiDotsVertical class="transition-opacity opacity-0 group-hover:opacity-100 nc-import-menu outline-0" />
class="transition-opacity opacity-0 group-hover:opacity-100 nc-import-menu outline-0" />
<template #overlay> <template #overlay>
<a-menu class="!py-0 rounded text-sm"> <a-menu class="!py-0 rounded text-sm">
@ -910,8 +909,7 @@ const setIcon = async (icon: string, table: TableType) => {
> >
<div class="flex items-center" @click.stop> <div class="flex items-center" @click.stop>
<component :is="isUIAllowed('tableIconCustomisation') ? Tooltip : 'div'"> <component :is="isUIAllowed('tableIconCustomisation') ? Tooltip : 'div'">
<span v-if="table.meta?.icon" :key="table.meta?.icon" <span v-if="table.meta?.icon" :key="table.meta?.icon" class="nc-table-icon flex items-center">
class="nc-table-icon flex items-center">
<Icon <Icon
:key="table.meta?.icon" :key="table.meta?.icon"
:data-testid="`nc-icon-${table.meta?.icon}`" :data-testid="`nc-icon-${table.meta?.icon}`"

2
packages/nc-gui/components/dashboard/settings/AuditTab.vue

@ -1,8 +1,8 @@
<script setup lang="ts"> <script setup lang="ts">
import { Tooltip as ATooltip, Empty } from 'ant-design-vue' import { Tooltip as ATooltip, Empty } from 'ant-design-vue'
import type { AuditType } from 'nocodb-sdk' import type { AuditType } from 'nocodb-sdk'
import { h, onMounted, timeAgo, useGlobal, useI18n, useNuxtApp, useProject } from '#imports'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { h, onMounted, timeAgo, useGlobal, useI18n, useNuxtApp, useProject } from '#imports'
const { $api } = useNuxtApp() const { $api } = useNuxtApp()

2
packages/nc-gui/components/dashboard/settings/DataSources.vue

@ -23,7 +23,7 @@ const vReload = useVModel(props, 'reload', emits)
const { $api, $e } = useNuxtApp() const { $api, $e } = useNuxtApp()
const projectStore = useProject() const projectStore = useProject()
const { loadProject } = projectStore const { loadProject } = projectStore
const { project } = projectStore const { project } = projectStore
let sources = $ref<BaseType[]>([]) let sources = $ref<BaseType[]>([])

2
packages/nc-gui/components/dashboard/settings/Metadata.vue

@ -10,7 +10,7 @@ const emit = defineEmits(['baseSynced'])
const { $api } = useNuxtApp() const { $api } = useNuxtApp()
const projectStore = useProject() const projectStore = useProject()
const { loadTables } = projectStore const { loadTables } = projectStore
const { project } = projectStore const { project } = projectStore
const { t } = useI18n() const { t } = useI18n()

3
packages/nc-gui/components/dashboard/settings/Misc.vue

@ -4,9 +4,8 @@ import { useGlobal, useProject, watch } from '#imports'
const { includeM2M, showNull } = useGlobal() const { includeM2M, showNull } = useGlobal()
const projectStore = useProject() const projectStore = useProject()
const { updateProject, loadTables,hasEmptyOrNullFilters } = projectStore const { updateProject, loadTables, hasEmptyOrNullFilters } = projectStore
const { project, projectMeta } = projectStore const { project, projectMeta } = projectStore
watch(includeM2M, async () => await loadTables()) watch(includeM2M, async () => await loadTables())

2
packages/nc-gui/components/dashboard/settings/UIAcl.vue

@ -1,4 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { storeToRefs } from 'pinia'
import { import {
Empty, Empty,
computed, computed,
@ -11,7 +12,6 @@ import {
useNuxtApp, useNuxtApp,
useProject, useProject,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
const props = defineProps<{ const props = defineProps<{
baseId: string baseId: string

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

@ -34,7 +34,7 @@ const emit = defineEmits(['baseCreated'])
const { appInfo } = useGlobal() const { appInfo } = useGlobal()
const projectStore = useProject() const projectStore = useProject()
const { loadProject } = projectStore const { loadProject } = projectStore
const { project } = projectStore const { project } = projectStore
const useForm = Form.useForm const useForm = Form.useForm

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

@ -32,7 +32,7 @@ const props = defineProps<{
const emit = defineEmits(['baseUpdated']) const emit = defineEmits(['baseUpdated'])
const projectStore = useProject() const projectStore = useProject()
const { loadProject } = projectStore const { loadProject } = projectStore
const { project } = projectStore const { project } = projectStore
const useForm = Form.useForm const useForm = Form.useForm

3
packages/nc-gui/components/dlg/AirtableImport.vue

@ -31,9 +31,8 @@ const baseURL = appInfo.ncSiteUrl
const { $state } = useNuxtApp() const { $state } = useNuxtApp()
const projectStore = useProject() const projectStore = useProject()
const { loadProject } = projectStore const { loadProject } = projectStore
const { project } = projectStore const { project } = projectStore
const showGoToDashboardButton = ref(false) const showGoToDashboardButton = ref(false)

2
packages/nc-gui/components/dlg/QuickImport.vue

@ -2,6 +2,7 @@
import type { TableType } from 'nocodb-sdk' import type { TableType } from 'nocodb-sdk'
import type { UploadChangeParam, UploadFile } from 'ant-design-vue' import type { UploadChangeParam, UploadFile } from 'ant-design-vue'
import { Upload } from 'ant-design-vue' import { Upload } from 'ant-design-vue'
import { storeToRefs } from 'pinia'
import { import {
CSVTemplateAdapter, CSVTemplateAdapter,
ExcelTemplateAdapter, ExcelTemplateAdapter,
@ -22,7 +23,6 @@ import {
useProject, useProject,
useVModel, useVModel,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
import type { importFileList, streamImportFileList } from '~/lib' import type { importFileList, streamImportFileList } from '~/lib'
interface Props { interface Props {

3
packages/nc-gui/components/dlg/TableRename.vue

@ -38,9 +38,8 @@ const dialogShow = useVModel(props, 'modelValue', emit)
const { updateTab } = useTabs() const { updateTab } = useTabs()
const projectStore = useProject() const projectStore = useProject()
const { loadTables, isMysql, isMssql, isPg } = projectStore const { loadTables, isMysql, isMssql, isPg } = projectStore
const { project } = projectStore const { project } = projectStore
const inputEl = $ref<ComponentPublicInstance>() const inputEl = $ref<ComponentPublicInstance>()

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

@ -1,6 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ColumnType } from 'nocodb-sdk' import type { ColumnType } from 'nocodb-sdk'
import { isSystemColumn } from 'nocodb-sdk' import { isSystemColumn } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import { import {
ActiveCellInj, ActiveCellInj,
ColumnInj, ColumnInj,
@ -45,7 +46,6 @@ import {
useSmartsheetRowStoreOrThrow, useSmartsheetRowStoreOrThrow,
useVModel, useVModel,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
import { NavigateDir } from '~/lib' import { NavigateDir } from '~/lib'
interface Props { interface Props {

2
packages/nc-gui/components/smartsheet/header/CellIcon.ts

@ -1,5 +1,6 @@
import type { ColumnType } from 'nocodb-sdk' import type { ColumnType } from 'nocodb-sdk'
import type { PropType } from '@vue/runtime-core' import type { PropType } from '@vue/runtime-core'
import { storeToRefs } from 'pinia'
import { import {
ColumnInj, ColumnInj,
computed, computed,
@ -33,7 +34,6 @@ import {
toRef, toRef,
useProject, useProject,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
import FilePhoneIcon from '~icons/mdi/file-phone' import FilePhoneIcon from '~icons/mdi/file-phone'
import KeyIcon from '~icons/mdi/key-variant' import KeyIcon from '~icons/mdi/key-variant'
import JSONIcon from '~icons/mdi/code-json' import JSONIcon from '~icons/mdi/code-json'

2
packages/nc-gui/components/smartsheet/sidebar/index.vue

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import type { ViewType, ViewTypes } from 'nocodb-sdk' import type { ViewType, ViewTypes } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import { import {
ActiveViewInj, ActiveViewInj,
MetaInj, MetaInj,
@ -16,7 +17,6 @@ import {
useViews, useViews,
watch, watch,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
const meta = inject(MetaInj, ref()) const meta = inject(MetaInj, ref())

3
packages/nc-gui/composables/useKanbanViewStore.ts

@ -41,7 +41,7 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(
const { api } = useApi() const { api } = useApi()
const { project,sqlUis } = storeToRefs(useProject()) const { project, sqlUis } = storeToRefs(useProject())
const { $e, $api } = useNuxtApp() const { $e, $api } = useNuxtApp()
@ -57,7 +57,6 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(
const { search } = useFieldQuery() const { search } = useFieldQuery()
const sqlUi = ref( const sqlUi = ref(
(meta.value as TableType)?.base_id ? sqlUis.value[(meta.value as TableType).base_id!] : Object.values(sqlUis.value)[0], (meta.value as TableType)?.base_id ? sqlUis.value[(meta.value as TableType).base_id!] : Object.values(sqlUis.value)[0],
) )

2
packages/nc-gui/composables/useMultiSelect/index.ts

@ -53,7 +53,7 @@ export function useMultiSelect(
const { appInfo } = useGlobal() const { appInfo } = useGlobal()
const { isMysql } = storeToRefs( useProject) const { isMysql } = storeToRefs(useProject)
let clipboardContext = $ref<{ value: any; uidt: UITypes } | null>(null) let clipboardContext = $ref<{ value: any; uidt: UITypes } | null>(null)

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

@ -44,7 +44,7 @@ const [useProvideSharedFormStore, useSharedFormStore] = useInjectionState((share
const { metas, setMeta } = useMetas() const { metas, setMeta } = useMetas()
const { project } = storeToRefs( useProject) const { project } = storeToRefs(useProject)
const { t } = useI18n() const { t } = useI18n()

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

@ -1,7 +1,7 @@
import type { ExportTypes, FilterType, KanbanType, PaginatedType, RequestParams, SortType, TableType, ViewType } from 'nocodb-sdk' import type { ExportTypes, FilterType, KanbanType, PaginatedType, RequestParams, SortType, TableType, ViewType } from 'nocodb-sdk'
import { UITypes } from 'nocodb-sdk' import { UITypes } from 'nocodb-sdk'
import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { computed, useGlobal, useMetas, useNuxtApp, useState } from '#imports'
export function useSharedView() { export function useSharedView() {
const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([]) const nestedFilters = ref<(FilterType & { status?: 'update' | 'delete' | 'create'; parentId?: string })[]>([])

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

@ -1,5 +1,6 @@
import type { LinkToAnotherRecordType, TableType } from 'nocodb-sdk' import type { LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { UITypes, isSystemColumn } from 'nocodb-sdk' import { UITypes, isSystemColumn } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import { import {
Modal, Modal,
SYSTEM_COLUMNS, SYSTEM_COLUMNS,
@ -14,7 +15,6 @@ import {
useTabs, useTabs,
watch, watch,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
import { TabType } from '~/lib' import { TabType } from '~/lib'
export function useTable(onTableCreate?: (tableMeta: TableType) => void, baseId?: string) { export function useTable(onTableCreate?: (tableMeta: TableType) => void, baseId?: string) {

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

@ -1,6 +1,6 @@
import type { WritableComputedRef } from '@vue/reactivity' import type { WritableComputedRef } from '@vue/reactivity'
import { computed, createSharedComposable, navigateTo, ref, useProject, useRouter, watch } from '#imports'
import { storeToRefs } from 'pinia' import { storeToRefs } from 'pinia'
import { computed, createSharedComposable, navigateTo, ref, useProject, useRouter, watch } from '#imports'
import type { TabItem } from '~/lib' import type { TabItem } from '~/lib'
import { TabType } from '~/lib' import { TabType } from '~/lib'

2
packages/nc-gui/nuxt.config.ts

@ -12,7 +12,7 @@ import PurgeIcons from 'vite-plugin-purge-icons'
// https://v3.nuxtjs.org/api/configuration/nuxt.config // https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({ export default defineNuxtConfig({
modules: ['@vueuse/nuxt', 'nuxt-windicss', '@nuxt/image-edge', '@pinia/nuxt',], modules: ['@vueuse/nuxt', 'nuxt-windicss', '@nuxt/image-edge', '@pinia/nuxt'],
ssr: false, ssr: false,

3
packages/nc-gui/pages/[projectType]/[projectId]/index.vue

@ -47,11 +47,10 @@ const router = useRouter()
const { appInfo, token, signOut, signedIn, user, currentVersion } = useGlobal() const { appInfo, token, signOut, signedIn, user, currentVersion } = useGlobal()
const projectStore = useProject() const projectStore = useProject()
const { loadProjectMetaInfo, saveTheme, loadProject, reset } = projectStore const { loadProjectMetaInfo, saveTheme, loadProject, reset } = projectStore
const {project, isSharedBase, projectMetaInfo } = storeToRefs(projectStore) const { project, isSharedBase, projectMetaInfo } = storeToRefs(projectStore)
const { clearTabs, addTab } = useTabs() const { clearTabs, addTab } = useTabs()

2
packages/nc-gui/pages/[projectType]/[projectId]/index/index/index.vue

@ -1,6 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { UploadChangeParam, UploadFile } from 'ant-design-vue' import type { UploadChangeParam, UploadFile } from 'ant-design-vue'
import type { BaseType } from 'nocodb-sdk' import type { BaseType } from 'nocodb-sdk'
import { storeToRefs } from 'pinia'
import { import {
message, message,
ref, ref,
@ -13,7 +14,6 @@ import {
useUIPermission, useUIPermission,
watch, watch,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
const dropZone = ref<HTMLDivElement>() const dropZone = ref<HTMLDivElement>()

6
packages/nc-gui/pages/index/index/[projectId].vue

@ -3,6 +3,7 @@ import type { Form } from 'ant-design-vue'
import type { ProjectType } from 'nocodb-sdk' import type { ProjectType } from 'nocodb-sdk'
import type { VNodeRef } from '@vue/runtime-core' import type { VNodeRef } from '@vue/runtime-core'
import type { RuleObject } from 'ant-design-vue/es/form' import type { RuleObject } from 'ant-design-vue/es/form'
import { storeToRefs } from 'pinia'
import { import {
extractSdkResponseErrorMsg, extractSdkResponseErrorMsg,
message, message,
@ -13,14 +14,13 @@ import {
useProject, useProject,
useRoute, useRoute,
} from '#imports' } from '#imports'
import { storeToRefs } from 'pinia'
const route = useRoute() const route = useRoute()
const projectStore = useProject() const projectStore = useProject()
const { loadProject, updateProject } = projectStore const { loadProject, updateProject } = projectStore
const {project, isLoading } = storeToRefs(projectStore) const { project, isLoading } = storeToRefs(projectStore)
const nameValidationRules = [ const nameValidationRules = [
{ {

4
packages/nc-gui/store/project.ts

@ -1,6 +1,7 @@
import type { BaseType, OracleUi, ProjectType, TableType } from 'nocodb-sdk' import type { BaseType, OracleUi, ProjectType, TableType } from 'nocodb-sdk'
import { SqlUiFactory } from 'nocodb-sdk' import { SqlUiFactory } from 'nocodb-sdk'
import { isString } from '@vueuse/core' import { isString } from '@vueuse/core'
import { defineStore } from 'pinia'
import { import {
ClientType, ClientType,
computed, computed,
@ -14,7 +15,6 @@ import {
useTheme, useTheme,
} from '#imports' } from '#imports'
import type { ProjectMetaInfo, ThemeConfig } from '~/lib' import type { ProjectMetaInfo, ThemeConfig } from '~/lib'
import { defineStore } from 'pinia'
export const useProject = defineStore('projectStore', () => { export const useProject = defineStore('projectStore', () => {
const { $e } = useNuxtApp() const { $e } = useNuxtApp()
@ -68,7 +68,7 @@ export const useProject = defineStore('projectStore', () => {
temp[base.id] = SqlUiFactory.create({ client: base.type }) as Exclude< temp[base.id] = SqlUiFactory.create({ client: base.type }) as Exclude<
ReturnType<typeof SqlUiFactory['create']>, ReturnType<typeof SqlUiFactory['create']>,
typeof OracleUi typeof OracleUi
> >
} }
} }
return temp return temp

Loading…
Cancel
Save