Browse Source

fix(nc-gui): lint errors (#7857)

pull/7858/head
Ramesh Mane 9 months ago committed by GitHub
parent
commit
2899d957ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 9
      packages/nc-gui/components/dashboard/TreeView/ProjectNode.vue
  2. 2
      packages/nc-gui/components/dashboard/settings/data-sources/EditBase.vue
  3. 4
      packages/nc-gui/components/monaco/Editor.vue
  4. 6
      packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
  5. 4
      packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
  6. 8
      packages/nc-gui/components/smartsheet/calendar/MonthView.vue
  7. 6
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue
  8. 4
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue

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

@ -523,7 +523,12 @@ const projectDelete = () => {
</NcMenuItem> </NcMenuItem>
<!-- ERD View --> <!-- ERD View -->
<NcMenuItem v-if="base?.sources?.[0]?.enabled" key="erd" data-testid="nc-sidebar-base-relations" @click="openErdView(base?.sources?.[0]!)"> <NcMenuItem
v-if="base?.sources?.[0]?.enabled"
key="erd"
data-testid="nc-sidebar-base-relations"
@click="openErdView(base?.sources?.[0]!)"
>
<div v-e="['c:base:erd']" class="flex gap-2 items-center"> <div v-e="['c:base:erd']" class="flex gap-2 items-center">
<GeneralIcon icon="erd" /> <GeneralIcon icon="erd" />
{{ $t('title.relations') }} {{ $t('title.relations') }}
@ -584,9 +589,9 @@ const projectDelete = () => {
</NcDropdown> </NcDropdown>
<NcButton <NcButton
:disabled="!base?.sources?.[0]?.enabled"
v-if="isUIAllowed('tableCreate', { roles: baseRole })" v-if="isUIAllowed('tableCreate', { roles: baseRole })"
v-e="['c:base:create-table']" v-e="['c:base:create-table']"
:disabled="!base?.sources?.[0]?.enabled"
class="nc-sidebar-node-btn" class="nc-sidebar-node-btn"
size="xxsmall" size="xxsmall"
type="text" type="text"

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

@ -224,7 +224,7 @@ const editBase = async () => {
// todo: refactor and remove this duplicate path in config // todo: refactor and remove this duplicate path in config
if (config.client === ClientType.SQLITE && config.connection?.connection?.filename) { if (config.client === ClientType.SQLITE && config.connection?.connection?.filename) {
config.connection.filename = config.connection.connection.filename; config.connection.filename = config.connection.connection.filename
} }
await api.source.update(base.value?.id, props.sourceId, { await api.source.update(base.value?.id, props.sourceId, {

4
packages/nc-gui/components/monaco/Editor.vue

@ -23,12 +23,12 @@ const props = withDefaults(defineProps<Props>(), {
autoFocus: true, autoFocus: true,
}) })
const emits = defineEmits(['update:modelValue'])
const { modelValue } = toRefs(props) const { modelValue } = toRefs(props)
const { hideMinimap, lang, validate, disableDeepCompare, readOnly, autoFocus } = props const { hideMinimap, lang, validate, disableDeepCompare, readOnly, autoFocus } = props
const emits = defineEmits(['update:modelValue'])
const vModel = computed<string>({ const vModel = computed<string>({
get: () => { get: () => {
if (typeof modelValue.value === 'object') { if (typeof modelValue.value === 'object') {

6
packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue

@ -4,7 +4,7 @@ import type { ColumnType } from 'nocodb-sdk'
import { type Row, computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports' import { type Row, computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports'
import { isRowEmpty } from '~/utils' import { isRowEmpty } from '~/utils'
const emit = defineEmits(['expand-record', 'new-record']) const emit = defineEmits(['expandRecord', 'newRecord'])
const meta = inject(MetaInj, ref()) const meta = inject(MetaInj, ref())
@ -192,7 +192,7 @@ const newRecord = () => {
[calendarRange.value[0].fk_from_col!.title!]: selectedDate.value.format('YYYY-MM-DD HH:mm:ssZ'), [calendarRange.value[0].fk_from_col!.title!]: selectedDate.value.format('YYYY-MM-DD HH:mm:ssZ'),
}, },
} }
emit('new-record', record) emit('newRecord', record)
} }
</script> </script>
@ -221,7 +221,7 @@ const newRecord = () => {
:resize="false" :resize="false"
color="blue" color="blue"
size="small" size="small"
@click="emit('expand-record', record)" @click="emit('expandRecord', record)"
> >
<template v-if="!isRowEmpty(record, displayField)"> <template v-if="!isRowEmpty(record, displayField)">
<LazySmartsheetCalendarCell <LazySmartsheetCalendarCell

4
packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue

@ -4,7 +4,7 @@ import type { ColumnType } from 'nocodb-sdk'
import { type Row, computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports' import { type Row, computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports'
import { generateRandomNumber, isRowEmpty } from '~/utils' import { generateRandomNumber, isRowEmpty } from '~/utils'
const emit = defineEmits(['expandRecord', 'new-record']) const emit = defineEmits(['expandRecord', 'newRecord'])
const { const {
// activeCalendarView, // activeCalendarView,
@ -847,7 +847,7 @@ const newRecord = (hour: dayjs.Dayjs) => {
[calendarRange.value[0].fk_from_col!.title!]: hour.format('YYYY-MM-DD HH:mm:ssZ'), [calendarRange.value[0].fk_from_col!.title!]: hour.format('YYYY-MM-DD HH:mm:ssZ'),
}, },
} }
emit('new-record', record) emit('newRecord', record)
} }
</script> </script>

8
packages/nc-gui/components/smartsheet/calendar/MonthView.vue

@ -4,7 +4,7 @@ import type { ColumnType } from 'nocodb-sdk'
import { type Row, computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports' import { type Row, computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports'
import { generateRandomNumber, isRowEmpty } from '~/utils' import { generateRandomNumber, isRowEmpty } from '~/utils'
const emit = defineEmits(['new-record', 'expandRecord']) const emit = defineEmits(['newRecord', 'expandRecord'])
const { const {
selectedDate, selectedDate,
@ -635,7 +635,7 @@ const addRecord = (date: dayjs.Dayjs) => {
[fromCol.title!]: date.format('YYYY-MM-DD HH:mm:ssZ'), [fromCol.title!]: date.format('YYYY-MM-DD HH:mm:ssZ'),
}, },
} }
emit('new-record', newRecord) emit('newRecord', newRecord)
} }
</script> </script>
@ -710,7 +710,7 @@ const addRecord = (date: dayjs.Dayjs) => {
[range.fk_from_col!.title!]: dayjs(day).format('YYYY-MM-DD HH:mm:ssZ'), [range.fk_from_col!.title!]: dayjs(day).format('YYYY-MM-DD HH:mm:ssZ'),
}, },
} }
emit('new-record', record) emit('newRecord', record)
} }
" "
> >
@ -738,7 +738,7 @@ const addRecord = (date: dayjs.Dayjs) => {
[calendarRange[0].fk_from_col!.title!]: (day).format('YYYY-MM-DD HH:mm:ssZ'), [calendarRange[0].fk_from_col!.title!]: (day).format('YYYY-MM-DD HH:mm:ssZ'),
}, },
} }
emit('new-record', record) emit('newRecord', record)
} }
" "
> >

6
packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue

@ -5,7 +5,7 @@ import type { Row } from '~/lib'
import { computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports' import { computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports'
import { generateRandomNumber, isRowEmpty } from '~/utils' import { generateRandomNumber, isRowEmpty } from '~/utils'
const emits = defineEmits(['expandRecord']) const emits = defineEmits(['expandRecord', 'newRecord'])
const { selectedDateRange, formattedData, formattedSideBarData, calendarRange, selectedDate, displayField, updateRowProperty } = const { selectedDateRange, formattedData, formattedSideBarData, calendarRange, selectedDate, displayField, updateRowProperty } =
useCalendarViewStoreOrThrow() useCalendarViewStoreOrThrow()
@ -529,7 +529,7 @@ const addRecord = (date: dayjs.Dayjs) => {
[fromCol.title!]: date.format('YYYY-MM-DD HH:mm:ssZ'), [fromCol.title!]: date.format('YYYY-MM-DD HH:mm:ssZ'),
}, },
} }
emits('new-record', newRecord) emits('newRecord', newRecord)
} }
</script> </script>
@ -586,7 +586,7 @@ const addRecord = (date: dayjs.Dayjs) => {
:resize="!!record.rowMeta.range?.fk_to_col && isUIAllowed('dataEdit')" :resize="!!record.rowMeta.range?.fk_to_col && isUIAllowed('dataEdit')"
:selected="dragRecord?.rowMeta?.id === record.rowMeta.id" :selected="dragRecord?.rowMeta?.id === record.rowMeta.id"
color="blue" color="blue"
@dblclick.stop="emits('expand-record', record)" @dblclick.stop="emits('expandRecord', record)"
@resize-start="onResizeStart" @resize-start="onResizeStart"
> >
<template v-if="!isRowEmpty(record, displayField)"> <template v-if="!isRowEmpty(record, displayField)">

4
packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue

@ -5,7 +5,7 @@ import type { Row } from '~/lib'
import { computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports' import { computed, isPrimary, ref, useViewColumnsOrThrow } from '#imports'
import { generateRandomNumber, isRowEmpty } from '~/utils' import { generateRandomNumber, isRowEmpty } from '~/utils'
const emits = defineEmits(['expandRecord']) const emits = defineEmits(['expandRecord', 'newRecord'])
const { const {
selectedDateRange, selectedDateRange,
@ -733,7 +733,7 @@ const addRecord = (date: dayjs.Dayjs) => {
[fromCol.title!]: date.format('YYYY-MM-DD HH:mm:ssZ'), [fromCol.title!]: date.format('YYYY-MM-DD HH:mm:ssZ'),
}, },
} }
emits('new-record', newRecord) emits('newRecord', newRecord)
} }
</script> </script>

Loading…
Cancel
Save