Browse Source

fix(gui-v2): lint

pull/3051/head
Wing-Kam Wong 2 years ago
parent
commit
b1c4effefb
  1. 1
      packages/nc-gui-v2/components.d.ts
  2. 2
      packages/nc-gui-v2/components/dlg/TableRename.vue
  3. 12
      packages/nc-gui-v2/composables/useViewData.ts
  4. 2
      packages/nc-gui-v2/composables/useViews.ts
  5. 2
      packages/nc-gui-v2/package.json
  6. 2
      packages/nc-gui-v2/pages/index/index.vue
  7. 1
      packages/nc-gui-v2/utils/index.ts

1
packages/nc-gui-v2/components.d.ts vendored

@ -47,6 +47,7 @@ declare module '@vue/runtime-core' {
ARow: typeof import('ant-design-vue/es')['Row']
ASelect: typeof import('ant-design-vue/es')['Select']
ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
ASkeleton: typeof import('ant-design-vue/es')['Skeleton']
ASkeletonImage: typeof import('ant-design-vue/es')['SkeletonImage']
ASpin: typeof import('ant-design-vue/es')['Spin']
ASubMenu: typeof import('ant-design-vue/es')['SubMenu']

2
packages/nc-gui-v2/components/dlg/TableRename.vue

@ -3,7 +3,7 @@ import { watchEffect } from '@vue/runtime-core'
import { Form, notification } from 'ant-design-vue'
import type { TableType } from 'nocodb-sdk'
import { useProject, useTabs } from '#imports'
import { extractSdkResponseErrorMsg, validateTableName } from '~/utils/errorUtils'
import { extractSdkResponseErrorMsg, validateTableName } from '~/utils'
import { useNuxtApp } from '#app'
interface Props {

12
packages/nc-gui-v2/composables/useViewData.ts

@ -1,4 +1,4 @@
import type { Api, FormType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk'
import type { Api, FormType, ColumnType, GalleryType, PaginatedType, TableType, ViewType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue'
import { notification } from 'ant-design-vue'
import { useNuxtApp } from '#app'
@ -33,7 +33,7 @@ export function useViewData(
const formattedData = ref<Row[]>([])
const paginationData = ref<PaginatedType>({ page: 1, pageSize: 25 })
const aggCommentCount = ref<Record<string, number>>({})
const aggCommentCount = ref<Record<string, number>[]>([])
const galleryData = ref<GalleryType | undefined>(undefined)
const formColumnData = ref<FormType | undefined>(undefined)
const formViewData = ref<FormType | undefined>(undefined)
@ -43,10 +43,10 @@ export function useViewData(
const selectedAllRecords = computed({
get() {
return formattedData.value.every((row) => row.rowMeta.selected)
return formattedData.value.every((row: Record<string, any>) => row.rowMeta.selected)
},
set(selected) {
formattedData.value.forEach((row) => (row.rowMeta.selected = selected))
formattedData.value.forEach((row: Record<string, any>) => (row.rowMeta.selected = selected))
},
})
@ -88,7 +88,7 @@ export function useViewData(
for (const row of formattedData.value) {
const id = extractPkFromRow(row.row, meta?.value?.columns as ColumnType[])
row.rowMeta.commentCount = aggCommentCount.value?.find((c) => c.row_id === id)?.count || 0
row.rowMeta.commentCount = aggCommentCount.value?.find((c: Record<string, any>) => c.row_id === id)?.count || 0
}
}
@ -261,7 +261,7 @@ export function useViewData(
let row = formattedData.value.length
while (row--) {
try {
const { row: rowObj, rowMeta } = formattedData.value[row]
const { row: rowObj, rowMeta } = formattedData.value[row] as Record<string, any>
if (!rowMeta.selected) {
continue
}

2
packages/nc-gui-v2/composables/useViews.ts

@ -12,7 +12,7 @@ export function useViews(meta: MaybeRef<TableType | undefined>) {
if (_meta && _meta.id) {
const response = (await $api.dbView.list(_meta.id)).list
if (response) {
views = response.sort((a, b) => a.order! - b.order!)
// views = response.sort((a, b) => a.order! - b.order!)
}
}
}

2
packages/nc-gui-v2/package.json

@ -26,9 +26,9 @@
"socket.io-client": "^4.5.1",
"sortablejs": "^1.15.0",
"unique-names-generator": "^4.7.1",
"vue-dompurify-html": "^3.0.0",
"url": "^0.11.0",
"util": "^0.12.4",
"vue-dompurify-html": "^3.0.0",
"vue-i18n": "^9.1.10",
"vue-toastification": "^2.0.0-rc.5",
"vuedraggable": "^4.1.0",

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

@ -42,7 +42,7 @@ const deleteProject = (project: ProjectType) => {
async onOk() {
try {
$e('c:project:delete')
await $api.project.delete(project.id as string)
await api.project.delete(project.id as string)
return projects.value?.splice(projects.value.indexOf(project), 1)
} catch (e: any) {
return notification.error({

1
packages/nc-gui-v2/utils/index.ts

@ -16,3 +16,4 @@ export * from './validation'
export * from './viewUtils'
export * from './currencyUtils'
export * from './dataUtils'
export * from './userUtils'

Loading…
Cancel
Save