Browse Source

fix(nc-gui): lint issues

pull/6547/head
WK Wong 1 year ago
parent
commit
8f09668d0f
  1. 15
      packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue
  2. 21
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  3. 9
      packages/nc-gui/components/dashboard/TreeView/ViewsList.vue
  4. 2
      packages/nc-gui/components/dashboard/TreeView/index.vue
  5. 2
      packages/nc-gui/components/dlg/ViewCreate.vue
  6. 2
      packages/nc-gui/components/smartsheet/Topbar.vue
  7. 2
      packages/nc-gui/components/smartsheet/details/Fields.vue
  8. 2
      packages/nc-gui/composables/useViewData.ts
  9. 2
      packages/nc-gui/pages/signin.vue

15
packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue

@ -1,12 +1,23 @@
<script lang="ts" setup>
import GithubButton from 'vue-github-button'
import {
computed,
message,
navigateTo,
onMounted,
ref,
storeToRefs,
useCopy,
useGlobal,
useSidebarStore,
useUsers,
watch,
} from '#imports'
const { user, signOut, token, appInfo } = useGlobal()
// So watcher in users store is triggered
useUsers()
const { clearWorkspaces } = useWorkspace()
const { leftSidebarState } = storeToRefs(useSidebarStore())
const { copy } = useCopy(true)

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

@ -10,10 +10,27 @@ import {
ProjectInj,
ProjectRoleInj,
ToggleDialogInj,
TreeViewInj,
computed,
extractSdkResponseErrorMsg,
h,
inject,
navigateTo,
openLink,
ref,
resolveComponent,
storeToRefs,
useBase,
useBases,
useCopy,
useDialog,
useGlobal,
useI18n,
useRoles,
useRouter,
useTablesStore,
useTabs,
useToggle,
} from '#imports'
import type { NcProject } from '#imports'
import { useNuxtApp } from '#app'
@ -27,10 +44,10 @@ const indicator = h(LoadingOutlined, {
})
const router = useRouter()
const route = router.currentRoute
const { isSharedBase } = storeToRefs(useBase())
const { projectUrl } = useBase()
const { setMenuContext, openRenameTableDialog, duplicateTable, contextMenuTarget } = inject(TreeViewInj)!
@ -41,9 +58,11 @@ const basesStore = useBases()
const { isMobileMode } = useGlobal()
const { loadProject, loadProjects, createProject: _createProject, updateProject, getProjectMetaInfo } = basesStore
const { bases } = storeToRefs(basesStore)
const { loadProjectTables } = useTablesStore()
const { activeTable } = storeToRefs(useTablesStore())
const { appInfo, navigateToProject } = useGlobal()

9
packages/nc-gui/components/dashboard/TreeView/ViewsList.vue

@ -5,7 +5,6 @@ import type { SortableEvent } from 'sortablejs'
import Sortable from 'sortablejs'
import type { Menu as AntMenu } from 'ant-design-vue'
import {
isDefaultBase as _isDefaultBase,
extractSdkResponseErrorMsg,
message,
onMounted,
@ -36,14 +35,8 @@ const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { isMobileMode } = useGlobal()
const { $e } = useNuxtApp()
const { t } = useI18n()
const isDefaultBase = computed(() => {
const source = base.value?.sources?.find((b) => b.id === table.value.source_id)
if (!source) return false
return _isDefaultBase(source)
})
const { t } = useI18n()
const { viewsByTable, activeView, recentViews } = storeToRefs(useViewsStore())

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

@ -68,7 +68,7 @@ const setMenuContext = (type: 'base' | 'source' | 'table' | 'main' | 'layout', v
contextMenuTarget.value = value
}
function openRenameTableDialog(table: TableType, rightClick = false) {
function openRenameTableDialog(table: TableType, _ = false) {
if (!table || !table.source_id) return
$e('c:table:rename')

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

@ -2,7 +2,7 @@
import type { ComponentPublicInstance } from '@vue/runtime-core'
import type { Form as AntForm, SelectProps } from 'ant-design-vue'
import { capitalize } from '@vue/runtime-core'
import type { FormType, GalleryType, GridType, KanbanType, MapType, TableType, ViewType } from 'nocodb-sdk'
import type { FormType, GalleryType, GridType, KanbanType, MapType, TableType } from 'nocodb-sdk'
import { UITypes, ViewTypes } from 'nocodb-sdk'
import { computed, message, nextTick, onBeforeMount, reactive, ref, useApi, useI18n, useVModel, watch } from '#imports'

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

@ -10,8 +10,6 @@ const isPublic = inject(IsPublicInj, ref(false))
const { isViewsLoading } = storeToRefs(useViewsStore())
const { isLeftSidebarOpen } = storeToRefs(useSidebarStore())
const { isMobileMode } = storeToRefs(useConfigStore())
const { appInfo } = useGlobal()

2
packages/nc-gui/components/smartsheet/details/Fields.vue

@ -43,8 +43,6 @@ const moveOps = ref<moveOp[]>([])
const visibilityOps = ref<fieldsVisibilityOps[]>([])
const selectedView = inject(ActiveViewInj)
const { fields: viewFields, toggleFieldVisibility, loadViewColumns } = useViewColumns(view, meta as Ref<TableType | undefined>)
const loading = ref(false)

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

@ -77,7 +77,7 @@ export function useViewData(
const { sharedView, fetchSharedViewData, paginationData: sharedPaginationData } = useSharedView()
const { $api, $e } = useNuxtApp()
const { $api } = useNuxtApp()
const { sorts, nestedFilters } = useSmartsheetStoreOrThrow()

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

@ -26,8 +26,6 @@ const { t } = useI18n()
useSidebar('nc-left-sidebar', { hasSidebar: false })
const { clearWorkspaces } = useWorkspace()
const formValidator = ref()
const form = reactive({

Loading…
Cancel
Save