Browse Source

fix(nc-gui): lint issues

pull/6531/head
WK Wong 1 year ago
parent
commit
bc6e694c4a
  1. 6
      packages/nc-gui/components/smartsheet/grid/newFile.ts
  2. 5
      packages/nc-gui/composables/useViewFilters.ts
  3. 10
      packages/nc-gui/composables/useViewGroupBy.ts
  4. 13
      packages/nc-gui/pages/reset/[id].vue

6
packages/nc-gui/components/smartsheet/grid/newFile.ts

@ -1,4 +1,4 @@
import { JsonExpandInj, provide } from '#imports'; import { isJsonExpand } from './Table.vue'
import { isJsonExpand } from './Table.vue'; import { JsonExpandInj, provide } from '#imports'
provide(JsonExpandInj, isJsonExpand); provide(JsonExpandInj, isJsonExpand)

5
packages/nc-gui/composables/useViewFilters.ts

@ -1,7 +1,7 @@
import type { ColumnType, FilterType, LinkToAnotherRecordType, LookupType, ViewType } from 'nocodb-sdk' import type { ColumnType, FilterType, LinkToAnotherRecordType, LookupType, ViewType } from 'nocodb-sdk'
import type { ComputedRef, Ref } from 'vue' import type { ComputedRef, Ref } from 'vue'
import type { SelectProps } from 'ant-design-vue' import type { SelectProps } from 'ant-design-vue'
import { RelationTypes, UITypes, isSystemColumn } from 'nocodb-sdk' import { UITypes, isSystemColumn } from 'nocodb-sdk'
import { import {
ActiveViewInj, ActiveViewInj,
IsPublicInj, IsPublicInj,
@ -440,10 +440,9 @@ export function useViewFilters(
for (const col of meta.value?.columns || []) { for (const col of meta.value?.columns || []) {
if (col.uidt !== UITypes.Lookup) continue if (col.uidt !== UITypes.Lookup) continue
let nextCol = col let nextCol = col
let btLookup = true
// check all the relation of nested lookup columns is bt or not // check all the relation of nested lookup columns is bt or not
// include the column only if all only if all relations are bt // include the column only if all only if all relations are bt
while (btLookup && nextCol && nextCol.uidt === UITypes.Lookup) { while (nextCol && nextCol.uidt === UITypes.Lookup) {
const lookupRelation = (await getMeta(nextCol.fk_model_id))?.columns?.find( const lookupRelation = (await getMeta(nextCol.fk_model_id))?.columns?.find(
(c) => c.id === (nextCol.colOptions as LookupType).fk_relation_column_id, (c) => c.id === (nextCol.colOptions as LookupType).fk_relation_column_id,
) )

10
packages/nc-gui/composables/useViewGroupBy.ts

@ -164,7 +164,7 @@ export const useViewGroupBy = (view: Ref<ViewType | undefined>, where?: Computed
const groupby = groupBy.value[group.nestedIn.length] const groupby = groupBy.value[group.nestedIn.length]
const nestedWhere = calculateNestedWhere(group.nestedIn, where?.value) const nestedWhere = calculateNestedWhere(group.nestedIn, where?.value)
if (!groupby || !(groupby.column.title)) return if (!groupby || !groupby.column.title) return
if (isPublic.value && !sharedView.value?.uuid) { if (isPublic.value && !sharedView.value?.uuid) {
return return
@ -203,16 +203,16 @@ export const useViewGroupBy = (view: Ref<ViewType | undefined>, where?: Computed
} }
if (groupby.column.title && groupby.column.uidt) { if (groupby.column.title && groupby.column.uidt) {
acc.push({ acc.push({
key: valueToTitle(curr[(groupby.column.title)!], groupby.column), key: valueToTitle(curr[groupby.column.title!], groupby.column),
column: groupby.column, column: groupby.column,
count: +curr.count, count: +curr.count,
color: findKeyColor(curr[(groupby.column.title)!], groupby.column), color: findKeyColor(curr[groupby.column.title!], groupby.column),
nestedIn: [ nestedIn: [
...group!.nestedIn, ...group!.nestedIn,
{ {
title: groupby.column.title, title: groupby.column.title,
column_name: (groupby.column.title)!, column_name: groupby.column.title!,
key: valueToTitle(curr[(groupby.column.title)!], groupby.column), key: valueToTitle(curr[groupby.column.title!], groupby.column),
column_uidt: groupby.column.uidt, column_uidt: groupby.column.uidt,
}, },
], ],

13
packages/nc-gui/pages/reset/[id].vue

@ -8,7 +8,6 @@ import {
reactive, reactive,
ref, ref,
useApi, useApi,
useI18n,
useRoute, useRoute,
useRouter, useRouter,
} from '#imports' } from '#imports'
@ -27,8 +26,6 @@ const form = reactive({
newPassword: '', newPassword: '',
}) })
const { t } = useI18n()
const formValidator = ref() const formValidator = ref()
async function resetPassword() { async function resetPassword() {
@ -71,13 +68,11 @@ function resetError() {
<div class="self-center flex flex-col justify-center items-center text-center gap-2"> <div class="self-center flex flex-col justify-center items-center text-center gap-2">
<h1 class="prose-2xl font-bold my-4 w-full">{{ $t('title.resetPassword') }}</h1> <h1 class="prose-2xl font-bold my-4 w-full">{{ $t('title.resetPassword') }}</h1>
<template> <div class="prose-sm text-success flex items-center leading-8 gap-2">
<div class="prose-sm text-success flex items-center leading-8 gap-2"> {{ $t('msg.info.passwordRecovery.success') }} <ClaritySuccessLine />
{{ $t('msg.info.passwordRecovery.success') }} <ClaritySuccessLine /> </div>
</div>
<nuxt-link to="/signin">{{ $t('general.signIn') }}</nuxt-link> <nuxt-link to="/signin">{{ $t('general.signIn') }}</nuxt-link>
</template>
</div> </div>
<a-form ref="formValidator" layout="vertical" :model="form" no-style @finish="resetPassword"> <a-form ref="formValidator" layout="vertical" :model="form" no-style @finish="resetPassword">

Loading…
Cancel
Save