Browse Source

Merge pull request #7836 from nocodb/nc-fix-lint

fix(nc-gui): lint
pull/7838/head
Anbarasu 9 months ago committed by GitHub
parent
commit
ee91eccf8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 6
      packages/nc-gui/components/smartsheet/calendar/DayView/DateField.vue
  2. 8
      packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
  3. 8
      packages/nc-gui/components/smartsheet/calendar/MonthView.vue
  4. 4
      packages/nc-gui/components/smartsheet/calendar/SideMenu.vue
  5. 15
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateField.vue
  6. 4
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue

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

8
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>
@ -909,7 +909,7 @@ const newRecord = (hour: dayjs.Dayjs) => {
}, },
} }
} }
emit('new-record', record) emit('newRecord', record)
} }
" "
> >
@ -946,7 +946,7 @@ const newRecord = (hour: dayjs.Dayjs) => {
}, },
} }
} }
emit('new-record', record) emit('newRecord', record)
} }
" "
> >

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)
} }
" "
> >

4
packages/nc-gui/components/smartsheet/calendar/SideMenu.vue

@ -8,7 +8,7 @@ const props = defineProps<{
visible: boolean visible: boolean
}>() }>()
const emit = defineEmits(['expand-record', 'newRecord']) const emit = defineEmits(['expandRecord', 'newRecord'])
const INFINITY_SCROLL_THRESHOLD = 100 const INFINITY_SCROLL_THRESHOLD = 100
@ -428,7 +428,7 @@ onUnmounted(() => {
" "
color="blue" color="blue"
data-testid="nc-sidebar-record-card" data-testid="nc-sidebar-record-card"
@click="emit('expand-record', record)" @click="emit('expandRecord', record)"
@dragstart="dragStart($event, record)" @dragstart="dragStart($event, record)"
@dragover.prevent @dragover.prevent
> >

15
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>
@ -565,28 +565,28 @@ const addRecord = (date: dayjs.Dayjs) => {
class="absolute nc-scrollbar-md overflow-y-auto mt-9 pointer-events-none inset-0" class="absolute nc-scrollbar-md overflow-y-auto mt-9 pointer-events-none inset-0"
data-testid="nc-calendar-week-record-container" data-testid="nc-calendar-week-record-container"
> >
<template v-for="(record, id) in calendarData" :key="id">
<div <div
v-for="(record, id) in calendarData" v-if="record.rowMeta.style?.display !== 'none'"
:key="id"
:data-testid="`nc-calendar-week-record-${record.row[displayField!.title!]}`" :data-testid="`nc-calendar-week-record-${record.row[displayField!.title!]}`"
:data-unique-id="record.rowMeta.id" :data-unique-id="record.rowMeta.id"
:style="{ :style="{
...record.rowMeta.style, ...record.rowMeta.style,
}" }"
class="absolute group draggable-record pointer-events-auto nc-calendar-week-record-card" class="absolute group draggable-record pointer-events-auto nc-calendar-week-record-card"
@mousedown.stop="dragStart($event, record)"
@mouseleave="hoverRecord = null" @mouseleave="hoverRecord = null"
@mouseover="hoverRecord = record.rowMeta.id" @mouseover="hoverRecord = record.rowMeta.id"
@mousedown.stop="dragStart($event, record)"
> >
<LazySmartsheetRow :row="record"> <LazySmartsheetRow :row="record">
<LazySmartsheetCalendarRecordCard <LazySmartsheetCalendarRecordCard
:hover="hoverRecord === record.rowMeta.id || record.rowMeta.id === dragRecord?.rowMeta?.id" :hover="hoverRecord === record.rowMeta.id || record.rowMeta.id === dragRecord?.rowMeta?.id"
:position="record.rowMeta.position" :position="record.rowMeta.position"
:record="record" :record="record"
:selected="dragRecord?.rowMeta?.id === record.rowMeta.id"
: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"
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)">
@ -611,6 +611,7 @@ const addRecord = (date: dayjs.Dayjs) => {
</LazySmartsheetCalendarRecordCard> </LazySmartsheetCalendarRecordCard>
</LazySmartsheetRow> </LazySmartsheetRow>
</div> </div>
</template>
</div> </div>
</div> </div>
</template> </template>

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