Browse Source

chore(nc-gui): lint error and warnings

Signed-off-by: mertmit <mertmit99@gmail.com>
pull/6315/head
mertmit 1 year ago
parent
commit
85aaabe2cc
  1. 2
      packages/nc-gui/components/cell/attachment/Carousel.vue
  2. 3
      packages/nc-gui/components/cell/attachment/utils.ts
  3. 2
      packages/nc-gui/components/dashboard/Sidebar/Header.vue
  4. 2
      packages/nc-gui/components/dashboard/Sidebar/TopSection/Header.vue
  5. 5
      packages/nc-gui/components/dashboard/TreeView/BaseOptions.vue
  6. 4
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  7. 39
      packages/nc-gui/components/dashboard/settings/data-sources/CreateBase.vue
  8. 37
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue
  9. 1
      packages/nc-gui/components/dlg/AirtableImport.vue
  10. 4
      packages/nc-gui/components/dlg/ProjectDelete.vue
  11. 3
      packages/nc-gui/components/dlg/TableCreate.vue
  12. 3
      packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue
  13. 2
      packages/nc-gui/components/dlg/share-and-collaborate/View.vue
  14. 2
      packages/nc-gui/components/general/DeleteModal.vue
  15. 2
      packages/nc-gui/components/general/UserIcon.vue
  16. 2
      packages/nc-gui/components/project/AccessSettings.vue
  17. 6
      packages/nc-gui/components/project/InviteProjectCollabSection.vue
  18. 2
      packages/nc-gui/components/project/View.vue
  19. 1
      packages/nc-gui/components/smartsheet/Gallery.vue
  20. 4
      packages/nc-gui/components/smartsheet/Pagination.vue
  21. 2
      packages/nc-gui/components/smartsheet/Toolbar.vue
  22. 6
      packages/nc-gui/components/smartsheet/Topbar.vue
  23. 6
      packages/nc-gui/components/smartsheet/toolbar/ColumnFilterMenu.vue
  24. 2
      packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
  25. 2
      packages/nc-gui/components/smartsheet/toolbar/SortListMenu.vue
  26. 3
      packages/nc-gui/components/tabs/Smartsheet.vue
  27. 1
      packages/nc-gui/components/workspace/CollaboratorsList.vue
  28. 2
      packages/nc-gui/components/workspace/CreateProjectDlg.vue
  29. 4
      packages/nc-gui/components/workspace/ProjectList.vue
  30. 2
      packages/nc-gui/components/workspace/View.vue
  31. 4
      packages/nc-gui/pages/index/[typeOrId]/[projectId]/index/index.vue
  32. 2
      packages/nc-gui/pages/index/[typeOrId]/[projectId]/index/index/[viewId]/[[viewTitle]]/[...slugs].vue
  33. 7
      packages/nc-gui/utils/iconUtils.ts

2
packages/nc-gui/components/cell/attachment/Carousel.vue

@ -1,7 +1,7 @@
<script lang="ts" setup>
import { onKeyDown } from '@vueuse/core'
import { useAttachmentCell } from './utils'
import { computed, iconMap, isImage, onClickOutside, ref, useAttachment, useEventListener } from '#imports'
import { computed, iconMap, isImage, ref, useAttachment, useEventListener } from '#imports'
const { selectedImage, visibleItems, downloadFile } = useAttachmentCell()!

3
packages/nc-gui/components/cell/attachment/utils.ts

@ -1,5 +1,4 @@
import type { AttachmentType } from 'nocodb-sdk'
import { readonly } from '@vue/reactivity'
import RenameFile from './RenameFile.vue'
import {
ColumnInj,
@ -34,7 +33,7 @@ export const [useProvideAttachmentCell, useAttachmentCell] = useInjectionState(
(updateModelValue: (data: string | Record<string, any>[]) => void) => {
const isReadonly = inject(ReadonlyInj, ref(false))
const isLockedMode = inject(IsLockedInj, ref(false))
// const isLockedMode = inject(IsLockedInj, ref(false))
const isPublic = inject(IsPublicInj, ref(false))

2
packages/nc-gui/components/dashboard/Sidebar/Header.vue

@ -1,10 +1,8 @@
<script setup lang="ts">
const workspaceStore = useWorkspace()
const projectStore = useProject()
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { isSharedBase } = storeToRefs(projectStore)
const { activeWorkspace, isWorkspaceLoading } = storeToRefs(workspaceStore)
</script>

2
packages/nc-gui/components/dashboard/Sidebar/TopSection/Header.vue

@ -1 +1 @@
<template></template>
<template><span /></template>

5
packages/nc-gui/components/dashboard/TreeView/BaseOptions.vue

@ -115,10 +115,9 @@ function openQuickImportDialog(type: string) {
</a-menu-item>
</a-sub-menu>
<a-menu-divider v-if="false" class="my-0" />
<!-- Connect to new datasource -->
<!-- <a-sub-menu>
<!-- <a-menu-divider v-if="false" class="my-0" />
<a-sub-menu>
<template #title>
<div class="nc-project-menu-item group">
<GeneralIcon icon="datasource" class="group-hover:text-black" />

4
packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue

@ -472,8 +472,6 @@ const DlgProjectDuplicateOnOk = async (jobData: { id: string; project_id: string
</div>
</a-menu-item>
<a-menu-divider v-if="false" />
<!-- ERD View -->
<a-menu-item key="erd" @click="openProjectErdView(project)">
<div class="nc-project-menu-item group">
@ -513,8 +511,6 @@ const DlgProjectDuplicateOnOk = async (jobData: { id: string; project_id: string
<a-menu-divider />
</template>
<a-menu-divider v-if="false" />
<a-menu-item v-if="isUIAllowed('projectDelete', false, projectRole)" @click="isProjectDeleteDialogVisible = true">
<div class="nc-project-menu-item group text-red-500">
<GeneralIcon icon="delete" />

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

@ -1,5 +1,5 @@
<script lang="ts" setup>
import { Form, Modal, message } from 'ant-design-vue'
import { Form, message } from 'ant-design-vue'
import type { SelectHandler } from 'ant-design-vue/es/vc-select/Select'
import type { DefaultConnection, ProjectCreateForm, SQLiteConnection } from '#imports'
import {
@ -423,43 +423,6 @@ watch(
<a-input v-model:value="(formState.dataSource.connection as SQLiteConnection).connection.filename" />
</a-form-item>
<template v-else-if="formState.dataSource.client === ClientType.SNOWFLAKE && false">
<!-- Account -->
<a-form-item label="Account" v-bind="validateInfos['dataSource.connection.account']">
<a-input v-model:value="formState.dataSource.connection.account" class="nc-extdb-account" />
</a-form-item>
<!-- Username -->
<a-form-item :label="$t('labels.username')" v-bind="validateInfos['dataSource.connection.username']">
<a-input v-model:value="formState.dataSource.connection.username" class="nc-extdb-host-user" />
</a-form-item>
<!-- Password -->
<a-form-item :label="$t('labels.password')" v-bind="validateInfos['dataSource.connection.password']">
<a-input-password v-model:value="formState.dataSource.connection.password" class="nc-extdb-host-password" />
</a-form-item>
<!-- Warehouse -->
<a-form-item label="Warehouse" v-bind="validateInfos['dataSource.connection.warehouse']">
<a-input v-model:value="formState.dataSource.connection.warehouse" />
</a-form-item>
<!-- Database -->
<a-form-item :label="$t('labels.database')" v-bind="validateInfos['dataSource.connection.database']">
<!-- Database : create if not exists -->
<a-input
v-model:value="formState.dataSource.connection.database"
:placeholder="$t('labels.dbCreateIfNotExists')"
class="nc-extdb-host-database"
/>
</a-form-item>
<!-- Schema name -->
<a-form-item :label="$t('labels.schemaName')" v-bind="validateInfos['dataSource.connection.schema']">
<a-input v-model:value="formState.dataSource.connection.schema" />
</a-form-item>
</template>
<template v-else>
<!-- Host Address -->
<a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']">

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

@ -380,43 +380,6 @@ onMounted(async () => {
<a-input v-model:value="(formState.dataSource.connection as SQLiteConnection).connection.filename" />
</a-form-item>
<template v-else-if="formState.dataSource.client === ClientType.SNOWFLAKE && false">
<!-- Account -->
<a-form-item label="Account" v-bind="validateInfos['dataSource.connection.account']">
<a-input v-model:value="formState.dataSource.connection.account" class="nc-extdb-account" />
</a-form-item>
<!-- Username -->
<a-form-item :label="$t('labels.username')" v-bind="validateInfos['dataSource.connection.username']">
<a-input v-model:value="formState.dataSource.connection.username" class="nc-extdb-host-user" />
</a-form-item>
<!-- Password -->
<a-form-item :label="$t('labels.password')" v-bind="validateInfos['dataSource.connection.password']">
<a-input-password v-model:value="formState.dataSource.connection.password" class="nc-extdb-host-password" />
</a-form-item>
<!-- Warehouse -->
<a-form-item label="Warehouse" v-bind="validateInfos['dataSource.connection.warehouse']">
<a-input v-model:value="formState.dataSource.connection.warehouse" />
</a-form-item>
<!-- Database -->
<a-form-item :label="$t('labels.database')" v-bind="validateInfos['dataSource.connection.database']">
<!-- Database : create if not exists -->
<a-input
v-model:value="formState.dataSource.connection.database"
:placeholder="$t('labels.dbCreateIfNotExists')"
class="nc-extdb-host-database"
/>
</a-form-item>
<!-- Schema name -->
<a-form-item :label="$t('labels.schemaName')" v-bind="validateInfos['dataSource.connection.schema']">
<a-input v-model:value="formState.dataSource.connection.schema" />
</a-form-item>
</template>
<template v-else>
<!-- Host Address -->
<a-form-item :label="$t('labels.hostAddress')" v-bind="validateInfos['dataSource.connection.host']">

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

@ -12,7 +12,6 @@ import {
onMounted,
ref,
storeToRefs,
useGlobal,
useNuxtApp,
useProject,
watch,

4
packages/nc-gui/components/dlg/ProjectDelete.vue

@ -1,6 +1,4 @@
<script lang="ts" setup>
import { navigateTo } from '#app'
const props = defineProps<{
visible: boolean
projectId: string
@ -22,8 +20,6 @@ const project = computed(() => projects.value.get(props.projectId))
const isLoading = ref(false)
const { projectsList } = storeToRefs(projectsStore)
const onDelete = async () => {
if (!project.value) return

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

@ -3,7 +3,6 @@ import {
Form,
TabType,
computed,
iconMap,
nextTick,
onMounted,
ref,
@ -153,6 +152,7 @@ onMounted(() => {
:placeholder="$t('msg.info.enterTableName')"
/>
</a-form-item>
<!--
<div v-if="false" class="flex justify-end items-center">
<div
class="pointer flex flex-row items-center gap-x-1 cursor-pointer"
@ -164,6 +164,7 @@ onMounted(() => {
<component :is="iconMap.plusCircle" v-else class="text-gray-500" />
</div>
</div>
-->
<div class="nc-table-advanced-options" :class="{ active: isAdvanceOptVisible }">
<!-- hint="Table name as saved in database" -->
<!-- <div v-if="!project.prefix" class="mb-2">{{ $t('msg.info.tableNameInDb') }}</div>

3
packages/nc-gui/components/dlg/share-and-collaborate/SharePage.vue

@ -2,8 +2,7 @@
import type { ColumnType, KanbanType, ViewType } from 'nocodb-sdk'
import { ViewTypes } from 'nocodb-sdk'
import tinycolor from 'tinycolor2'
import { useTablesStore } from '~/store/tables'
import { useMetas } from '~/composables/useMetas'
import { useMetas } from '#imports'
const { view: _view, $api } = useSmartsheetStoreOrThrow()
const { $e } = useNuxtApp()

2
packages/nc-gui/components/dlg/share-and-collaborate/View.vue

@ -6,8 +6,6 @@ import { useViewsStore } from '~/store/views'
const { isViewToolbar } = defineProps<{
isViewToolbar?: boolean
}>()
const router = useRouter()
const route = router.currentRoute
const { copy } = useCopy()
const { dashboardUrl } = useDashboard()

2
packages/nc-gui/components/general/DeleteModal.vue

@ -52,10 +52,12 @@ onKeyStroke('Enter', () => {
<slot name="entity-preview"></slot>
<!--
<div v-if="false" class="flex flex-row items-center py-2 px-3 border-1 border-gray-100 rounded-lg text-gray-700">
<GeneralIcon icon="warning" class="text-orange-500"></GeneralIcon>
<div class="pl-2.5 text-gray-500">This action cannot be undone</div>
</div>
-->
<div class="flex flex-row gap-x-2 mt-2.5 pt-2.5 justify-end">
<NcButton type="secondary" @click="visible = false">

2
packages/nc-gui/components/general/UserIcon.vue

@ -1,6 +1,4 @@
<script lang="ts" setup>
import type { UserType } from 'nocodb-sdk'
const props = defineProps<{
hideLabel?: boolean
size?: 'small' | 'medium'

2
packages/nc-gui/components/project/AccessSettings.vue

@ -111,8 +111,6 @@ watchDebounced(
},
)
const modal = ref(true)
const reloadCollabs = async () => {
currentPage.value = 0
collaborators.value = []

6
packages/nc-gui/components/project/InviteProjectCollabSection.vue

@ -1,6 +1,6 @@
<script lang="ts" setup>
import { ProjectRoles, WorkspaceUserRoles } from 'nocodb-sdk'
import { extractSdkResponseErrorMsg, useDashboard, useManageUsers, useProject, useWorkspace } from '#imports'
import { ProjectRoles } from 'nocodb-sdk'
import { extractSdkResponseErrorMsg, useDashboard, useManageUsers } from '#imports'
const emit = defineEmits(['invited'])
@ -9,8 +9,6 @@ const inviteData = reactive({
roles: ProjectRoles.VIEWER,
})
const projectStore = useProject()
const { dashboardUrl } = useDashboard()
const { inviteUser } = useManageUsers()

2
packages/nc-gui/components/project/View.vue

@ -115,6 +115,7 @@ watch(
</template>
<DashboardSettingsDataSources v-model:state="baseSettingsState" />
</a-tab-pane>
<!--
<a-tab-pane v-if="false && isUIAllowed('acl')" key="ui-acl">
<template #tab>
<div class="tab-title" data-testid="proj-view-tab__ui-acl">
@ -124,6 +125,7 @@ watch(
</template>
<DashboardSettingsUIAclTabs class="mt-6" />
</a-tab-pane>
-->
</a-tabs>
</div>
</div>

1
packages/nc-gui/components/smartsheet/Gallery.vue

@ -17,7 +17,6 @@ import {
computed,
createEventHook,
extractPkFromRow,
iconMap,
inject,
isImage,
isLTAR,

4
packages/nc-gui/components/smartsheet/Pagination.vue

@ -28,12 +28,8 @@ const fixedSize = toRef(props, 'fixedSize')
const extraStyle = toRef(props, 'extraStyle')
const isPublic = inject(IsPublicInj, ref(false))
const isGroupBy = inject(IsGroupByInj, ref(false))
const { isLeftSidebarOpen, isRightSidebarOpen } = storeToRefs(useSidebarStore())
const { isPaginationLoading } = storeToRefs(useViewsStore())
const count = computed(() => vPaginationData.value?.totalRows ?? Infinity)

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

@ -1,7 +1,7 @@
<script setup lang="ts">
import { IsPublicInj, inject, ref, useSharedView, useSmartsheetStoreOrThrow, useUIPermission, useViewsStore } from '#imports'
const { isGrid, isForm, isGallery, isKanban, isMap } = useSmartsheetStoreOrThrow()
const { isGrid, isGallery, isKanban, isMap } = useSmartsheetStoreOrThrow()
const isPublic = inject(IsPublicInj, ref(false))

6
packages/nc-gui/components/smartsheet/Topbar.vue

@ -1,5 +1,5 @@
<script setup lang="ts">
import { IsPublicInj, inject, ref, useSharedView, useSmartsheetStoreOrThrow, useUIPermission, useViewsStore } from '#imports'
import { IsPublicInj, inject, ref, useSmartsheetStoreOrThrow, useViewsStore } from '#imports'
const { isGrid, isForm, isGallery, isKanban, isMap } = useSmartsheetStoreOrThrow()
@ -12,10 +12,6 @@ const { isViewsLoading } = storeToRefs(useViewsStore())
const { isMobileMode } = useGlobal()
const { isUIAllowed } = useUIPermission()
const { allowCSVDownload } = useSharedView()
const isSharedBase = computed(() => route.value.params.typeOrId === 'base')
</script>

6
packages/nc-gui/components/smartsheet/toolbar/ColumnFilterMenu.vue

@ -3,13 +3,11 @@ import type ColumnFilter from './ColumnFilter.vue'
import {
ActiveViewInj,
IsLockedInj,
IsPublicInj,
computed,
inject,
ref,
useGlobal,
useMenuCloseOnEsc,
useNuxtApp,
useSmartsheetStoreOrThrow,
useViewFilters,
watch,
@ -21,14 +19,12 @@ const isLocked = inject(IsLockedInj, ref(false))
const activeView = inject(ActiveViewInj, ref())
const isPublic = inject(IsPublicInj, ref(false))
// const isPublic = inject(IsPublicInj, ref(false))
const { filterAutoSave, isMobileMode } = useGlobal()
const filterComp = ref<typeof ColumnFilter>()
const { $e } = useNuxtApp()
const { nestedFilters } = useSmartsheetStoreOrThrow()
// todo: avoid duplicate api call by keeping a filter store

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

@ -350,7 +350,7 @@ useMenuCloseOnEsc(open)
No fields found
</div>
<Draggable v-model="fields" item-key="id" @change="onMove($event)">
<template #item="{ element: field, index: index }">
<template #item="{ element: field }">
<div
v-if="
filteredFieldList

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

@ -30,8 +30,6 @@ const { sorts, saveOrUpdate, loadSorts, addSort: _addSort, deleteSort } = useVie
const { showSystemFields, metaColumnById } = useViewColumns(view, meta)
const removeIcon = ref<HTMLElement>()
const showCreateSort = ref(false)
const { isMobileMode } = useGlobal()

3
packages/nc-gui/components/tabs/Smartsheet.vue

@ -54,9 +54,6 @@ const { isGallery, isGrid, isForm, isKanban, isLocked, isMap } = useProvideSmart
useSqlEditor()
const { openedProject } = storeToRefs(useProjects())
const { activeTable } = storeToRefs(useTablesStore())
const reloadEventHook = createEventHook<void | boolean>()
const reloadViewMetaEventHook = createEventHook<void | boolean>()

1
packages/nc-gui/components/workspace/CollaboratorsList.vue

@ -1,6 +1,5 @@
<script lang="ts" setup>
import { OrderedWorkspaceRoles, RoleColors, RoleLabels, WorkspaceUserRoles } from 'nocodb-sdk'
import { Empty } from 'ant-design-vue'
import { storeToRefs, stringToColour, timeAgo, useWorkspace } from '#imports'
const { user } = useGlobal()

2
packages/nc-gui/components/workspace/CreateProjectDlg.vue

@ -15,7 +15,7 @@ const emit = defineEmits(['update:modelValue'])
const dialogShow = useVModel(props, 'modelValue', emit)
const projectsStore = useProjects()
const { loadProjects, createProject: _createProject } = projectsStore
const { createProject: _createProject } = projectsStore
const { navigateToProject } = useGlobal()

4
packages/nc-gui/components/workspace/ProjectList.vue

@ -139,10 +139,12 @@ const workspaceMoveProjectOnSuccess = async (workspaceId: string) => {
})
}
/*
const moveProject = (project: ProjectType) => {
selectedProjectToMove.value = project
isMoveDlgOpen.value = true
}
*/
const isDuplicateDlgOpen = ref(false)
const selectedProjectToDuplicate = ref()
@ -360,6 +362,7 @@ const setIcon = async (icon: string, project: ProjectType) => {
{{ $t('general.duplicate') }} {{ $t('objects.project') }}
</div>
</a-menu-item>
<!--
<a-menu-item
v-if="false && isUIAllowed('moveProject', true, [record.workspace_role, record.project_role].join())"
@click="moveProject(record)"
@ -369,6 +372,7 @@ const setIcon = async (icon: string, project: ProjectType) => {
{{ $t('general.move') }} {{ $t('objects.project') }}
</div>
</a-menu-item>
-->
<a-menu-item
v-if="isUIAllowed('projectDelete', true, [record.workspace_role, record.project_role].join())"
@click="deleteProject(record)"

2
packages/nc-gui/components/workspace/View.vue

@ -10,8 +10,6 @@ const workspaceStore = useWorkspace()
const { isWorkspaceOwnerOrCreator, isWorkspaceOwner, activeWorkspace, workspaces } = storeToRefs(workspaceStore)
const { loadCollaborators } = workspaceStore
const { appInfo } = useGlobal()
const tab = computed({
get() {
return route.value.query?.tab ?? 'collaborators'

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

@ -9,10 +9,6 @@ useProjectsShortcuts()
provide(TabMetaInj, activeTab)
useSidebar('nc-left-sidebar')
const router = useRouter()
const route = router.currentRoute
</script>
<template>

2
packages/nc-gui/pages/index/[typeOrId]/[projectId]/index/index/[viewId]/[[viewTitle]]/[...slugs].vue

@ -1 +1 @@
<template></template>
<template><span /></template>

7
packages/nc-gui/utils/iconUtils.ts

@ -32,25 +32,19 @@ import MaterialSymbolsWarningOutlineRounded from '~icons/material-symbols/warnin
import MaterialSymbolsDragIndicator from '~icons/ri/draggable'
import NcSearch from '~icons/nc-icons/search'
import NcCreditCard from '~icons/nc-icons/credit-card'
import NcLayers from '~icons/nc-icons/layers'
import NcUsers from '~icons/nc-icons/users'
import NcCheck from '~icons/nc-icons/check'
import PlusSquare from '~icons/nc-icons/plus-square'
import PhLayout from '~icons/ph/layout'
import Copy from '~icons/material-symbols/content-copy-outline'
import Delete from '~icons/material-symbols/delete-outline-rounded'
import CiFilter from '~icons/mdi/filter-outline'
import Plus from '~icons/material-symbols/add-rounded'
import Minus from '~icons/material-symbols/remove-rounded'
import Code from '~icons/material-symbols/code-rounded'
import Palette from '~icons/material-symbols/palette-outline'
import Erd from '~icons/material-symbols/account-tree-outline-rounded'
import MsSync from '~icons/material-symbols/sync-rounded'
import MdiRefresh from '~icons/mdi/refresh'
import ApiSnippet from '~icons/material-symbols/settings-ethernet-rounded'
import MdiSettings from '~icons/mdi/cog-outline'
import Phishing from '~icons/material-symbols/phishing-outline-rounded'
import MdiAccountGroup from '~icons/mdi/account-group'
import MdiDotsVertical from '~icons/mdi/dots-vertical'
@ -70,7 +64,6 @@ import NcIconsRowHeightExtraTall from '~icons/nc-icons/row-height-extra-tall'
import MsInfo from '~icons/material-symbols/info-outline-rounded'
import PhSparkleFill from '~icons/ph/sparkle-fill'
import NcArticle from '~icons/nc-icons/article'
import MsDatabase from '~icons/mdi/database-outline'
import MdiDatabaseSearch from '~icons/mdi/database-search'
import MdiMagicStaff from '~icons/mdi/magic-staff'

Loading…
Cancel
Save