Browse Source

Merge pull request #9987 from nocodb/chore/lint

chore: lint
pull/9993/head
Ramesh Mane 5 days ago committed by GitHub
parent
commit
c869db43e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      packages/nc-gui/components/cell/attachment/IconView.vue
  2. 17
      packages/nc-gui/components/cell/attachment/index.vue
  3. 2
      packages/nc-gui/components/dashboard/settings/base/index.vue
  4. 2
      packages/nc-gui/components/extensions/Extension/Header.vue
  5. 2
      packages/nc-gui/components/extensions/Market.vue
  6. 4
      packages/nc-gui/components/extensions/Market/ExtensionsTab.vue
  7. 2
      packages/nc-gui/components/feed/View.vue
  8. 6
      packages/nc-gui/components/nc/Tooltip.vue
  9. 2
      packages/nc-gui/components/smartsheet/calendar/DayView/DateTimeField.vue
  10. 2
      packages/nc-gui/components/smartsheet/calendar/MonthView.vue
  11. 15
      packages/nc-gui/components/smartsheet/calendar/WeekView/DateTimeField.vue
  12. 2
      packages/nc-gui/components/smartsheet/grid/Table.vue
  13. 2
      packages/nc-gui/components/smartsheet/toolbar/Calendar/Range.vue
  14. 6
      packages/nc-gui/composables/useAttachmentIcon.ts
  15. 14
      packages/nc-gui/composables/useExtensions.ts
  16. 48
      packages/nc-gui/composables/useViewGroupBy.ts
  17. 2
      packages/nc-gui/nuxt.config.ts
  18. 2
      packages/nocodb/src/db/BaseModelSqlv2.ts
  19. 2
      packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts
  20. 1
      packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts

2
packages/nc-gui/components/cell/attachment/IconView.vue

@ -1,11 +1,9 @@
<script setup lang="ts"> <script setup lang="ts">
const props = defineProps<{ const props = defineProps<{
item: any item: any
}>() }>()
const icon = useAttachmentIcon(() => props.item.title, props.item.mimetype) const icon = useAttachmentIcon(() => props.item.title, props.item.mimetype)
</script> </script>
<template> <template>

17
packages/nc-gui/components/cell/attachment/index.vue

@ -52,7 +52,6 @@ const {
visibleItems, visibleItems,
onDrop, onDrop,
isLoading, isLoading,
FileIcon,
selectedFile, selectedFile,
isReadonly, isReadonly,
storedFiles, storedFiles,
@ -317,11 +316,7 @@ defineExpose({
</div> </div>
</div> </div>
</div> </div>
<div <div v-else ref="attachmentCellRef" class="nc-attachment-cell relative group color-transition">
v-else
ref="attachmentCellRef"
class="nc-attachment-cell relative group color-transition"
>
<LazyCellAttachmentCarousel v-if="selectedFile" /> <LazyCellAttachmentCarousel v-if="selectedFile" />
<template v-if="!isReadonly && !dragging && !!currentCellRef"> <template v-if="!isReadonly && !dragging && !!currentCellRef">
@ -377,7 +372,9 @@ defineExpose({
}" }"
class="nc-attachment-wrapper flex cursor-pointer w-full items-center flex-wrap gap-2 mt-0 items-start overflow-y-auto nc-scrollbar-thin" class="nc-attachment-wrapper flex cursor-pointer w-full items-center flex-wrap gap-2 mt-0 items-start overflow-y-auto nc-scrollbar-thin"
:style="{ :style="{
height: `max(${!rowHeight || rowHeight === 1 ? rowHeightInPx['1']: rowHeightInPx[`${rowHeight}`] - 17}px, ${isGrid ? 22 : 32}px)`, height: `max(${!rowHeight || rowHeight === 1 ? rowHeightInPx['1'] : rowHeightInPx[`${rowHeight}`] - 17}px, ${
isGrid ? 22 : 32
}px)`,
paddingTop: !rowHeight || rowHeight === 1 ? '4px !important' : undefined, paddingTop: !rowHeight || rowHeight === 1 ? '4px !important' : undefined,
paddingBottom: !rowHeight || rowHeight === 1 ? '4px !important' : undefined, paddingBottom: !rowHeight || rowHeight === 1 ? '4px !important' : undefined,
}" }"
@ -401,11 +398,7 @@ defineExpose({
:srcs="getPossibleAttachmentSrc(item, attachmentSize)" :srcs="getPossibleAttachmentSrc(item, attachmentSize)"
@click="() => onFileClick(item)" @click="() => onFileClick(item)"
/> />
<div <div v-else class="nc-attachment h-full w-full flex items-center justify-center" @click="onFileClick(item)">
v-else
class="nc-attachment h-full w-full flex items-center justify-center"
@click="onFileClick(item)"
>
<CellAttachmentIconView :item="item" class="max-h-full max-w-full" /> <CellAttachmentIconView :item="item" class="max-h-full max-w-full" />
</div> </div>
</div> </div>

2
packages/nc-gui/components/dashboard/settings/base/index.vue

@ -3,8 +3,6 @@ const { isUIAllowed } = useRoles()
const hasPermissionForSnapshots = computed(() => isUIAllowed('manageSnapshot')) const hasPermissionForSnapshots = computed(() => isUIAllowed('manageSnapshot'))
const { isFeatureEnabled } = useBetaFeatureToggle()
const router = useRouter() const router = useRouter()
const activeMenu = ref(isEeUI && hasPermissionForSnapshots.value ? 'snapshots' : 'visibility') const activeMenu = ref(isEeUI && hasPermissionForSnapshots.value ? 'snapshots' : 'visibility')

2
packages/nc-gui/components/extensions/Extension/Header.vue

@ -19,7 +19,7 @@ const { $e } = useNuxtApp()
const { eventBus, getExtensionAssetsUrl, duplicateExtension, showExtensionDetails } = useExtensions() const { eventBus, getExtensionAssetsUrl, duplicateExtension, showExtensionDetails } = useExtensions()
const { fullscreen, collapsed, extension, extensionManifest, activeError, showExpandBtn } = useExtensionHelperOrThrow() const { fullscreen, collapsed, extension, extensionManifest, activeError, showExpandBtn } = useExtensionHelperOrThrow()
const EXTENSION_ID = extension.value.extensionId; const EXTENSION_ID = extension.value.extensionId
const titleInput = ref<HTMLInputElement | null>(null) const titleInput = ref<HTMLInputElement | null>(null)

2
packages/nc-gui/components/extensions/Market.vue

@ -14,8 +14,6 @@ interface TabItem {
const props = defineProps<Prop>() const props = defineProps<Prop>()
const { $e } = useNuxtApp()
const emit = defineEmits(['update:modelValue']) const emit = defineEmits(['update:modelValue'])
const tabs = [ const tabs = [

4
packages/nc-gui/components/extensions/Market/ExtensionsTab.vue

@ -4,12 +4,12 @@ interface Props {
isOpen: boolean isOpen: boolean
} }
const { $e } = useNuxtApp()
const props = withDefaults(defineProps<Props>(), {}) const props = withDefaults(defineProps<Props>(), {})
const emits = defineEmits(['update:searchQuery', 'update:isOpen']) const emits = defineEmits(['update:searchQuery', 'update:isOpen'])
const { $e } = useNuxtApp()
const searchQuery = useVModel(props, 'searchQuery', emits) const searchQuery = useVModel(props, 'searchQuery', emits)
const isOpen = useVModel(props, 'isOpen', emits) const isOpen = useVModel(props, 'isOpen', emits)

2
packages/nc-gui/components/feed/View.vue

@ -2,7 +2,7 @@
import FeedRecents from './Recents/index.vue' import FeedRecents from './Recents/index.vue'
import FeedChangelog from './Changelog/index.vue' import FeedChangelog from './Changelog/index.vue'
import FeedYoutube from './Youtube/index.vue' import FeedYoutube from './Youtube/index.vue'
import FeedTwitter from './Twitter.vue' // import FeedTwitter from './Twitter.vue'
// import FeedRoadmap from './Roadmap.vue' // import FeedRoadmap from './Roadmap.vue'
const { activeTab } = useProductFeed() const { activeTab } = useProductFeed()

6
packages/nc-gui/components/nc/Tooltip.vue

@ -47,7 +47,7 @@ const isHovering = useElementHover(() => el.value)
const isOverlayHovering = useElementHover(() => element.value) const isOverlayHovering = useElementHover(() => element.value)
const attrs = useAttrs() const allAttrs = useAttrs()
const isKeyPressed = ref(false) const isKeyPressed = ref(false)
@ -125,8 +125,8 @@ watchDebounced(
) )
const divStyles = computed(() => ({ const divStyles = computed(() => ({
style: attrs.style as CSSProperties, style: allAttrs.style as CSSProperties,
class: attrs.class as string, class: allAttrs.class as string,
})) }))
const onClick = () => { const onClick = () => {

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

@ -274,7 +274,7 @@ const recordsAcrossAllRange = computed<{
// But not all fetched records are valid for the certain range, so we filter them out & sort them // But not all fetched records are valid for the certain range, so we filter them out & sort them
const sortedFormattedData = [...formattedData.value] const sortedFormattedData = [...formattedData.value]
.filter((record) => { .filter((record) => {
const fromDate = record.row[fromCol?.title] ? dayjs(record.row[fromCol?.title!]) : null const fromDate = fromCol?.title && record.row[fromCol.title] ? dayjs(record.row[fromCol.title]) : null
if (fromCol && endCol) { if (fromCol && endCol) {
const toDate = record.row[endCol.title!] ? dayjs(record.row[endCol.title!]) : null const toDate = record.row[endCol.title!] ? dayjs(record.row[endCol.title!]) : null

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

@ -930,7 +930,7 @@ const addRecord = (date: dayjs.Dayjs) => {
{{ dayjs(record.row[record.rowMeta.range?.fk_from_col!.title!]).format('h:mma').slice(0, -1) }} {{ dayjs(record.row[record.rowMeta.range?.fk_from_col!.title!]).format('h:mma').slice(0, -1) }}
</span> </span>
</template> </template>
<template v-for="(field, id) in fields" :key="field.id"> <template v-for="field in fields" :key="field.id">
<LazySmartsheetPlainCell <LazySmartsheetPlainCell
v-if="!isRowEmpty(record, field!)" v-if="!isRowEmpty(record, field!)"
v-model="record.row[field!.title!]" v-model="record.row[field!.title!]"

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

@ -92,6 +92,14 @@ onMounted(() => {
}) })
}) })
// Since it is a datetime Week view, we need to create a 2D array of dayjs objects to represent the hours in a day for each day in the week
const datesHours = computed(() => {
const start = dayjs(selectedDateRange.value.start).startOf('week')
return Array.from({ length: maxVisibleDays.value }, (_, i) =>
Array.from({ length: 24 }, (_, h) => start.add(i, 'day').hour(h).minute(0).second(0)),
)
})
const calculateHourIndices = (dayIndex: number, startDate: dayjs.Dayjs, endDate: dayjs.Dayjs) => { const calculateHourIndices = (dayIndex: number, startDate: dayjs.Dayjs, endDate: dayjs.Dayjs) => {
// Get the hour component for start and end times // Get the hour component for start and end times
const startHour = startDate.hour() const startHour = startDate.hour()
@ -155,13 +163,6 @@ const calculateNewDates = useMemoize(
return { startDate, endDate } return { startDate, endDate }
}, },
) )
// Since it is a datetime Week view, we need to create a 2D array of dayjs objects to represent the hours in a day for each day in the week
const datesHours = computed(() => {
const start = dayjs(selectedDateRange.value.start).startOf('week')
return Array.from({ length: maxVisibleDays.value }, (_, i) =>
Array.from({ length: 24 }, (_, h) => start.add(i, 'day').hour(h).minute(0).second(0)),
)
})
const getGridTime = (date: dayjs.Dayjs, round = false) => { const getGridTime = (date: dayjs.Dayjs, round = false) => {
const minutes = date.hour() * 60 + date.minute() const minutes = date.hour() * 60 + date.minute()

2
packages/nc-gui/components/smartsheet/grid/Table.vue

@ -1060,7 +1060,7 @@ const scrollWrapper = computed(() => scrollParent.value || gridWrapper.value)
const scrollLeft = ref() const scrollLeft = ref()
function scrollToCell(row?: number | null, col?: number | null, scrollBehaviour: ScrollBehavior = 'instant') { function scrollToCell(row?: number | null, col?: number | null, _scrollBehaviour: ScrollBehavior = 'instant') {
row = row ?? activeCell.row row = row ?? activeCell.row
col = col ?? activeCell.col col = col ?? activeCell.col

2
packages/nc-gui/components/smartsheet/toolbar/Calendar/Range.vue

@ -138,10 +138,12 @@ const saveCalendarRanges = async () => {
} }
} }
/*
const removeRange = async (id: number) => { const removeRange = async (id: number) => {
_calendar_ranges.value = _calendar_ranges.value.filter((_, i) => i !== id) _calendar_ranges.value = _calendar_ranges.value.filter((_, i) => i !== id)
await saveCalendarRanges() await saveCalendarRanges()
} }
*/
const isDisabled = computed(() => { const isDisabled = computed(() => {
return ( return (

6
packages/nc-gui/composables/useAttachmentIcon.ts

@ -1,5 +1,7 @@
export const useAttachmentIcon = (
export const useAttachmentIcon = (title: MaybeRefOrGetter<string | undefined>, mimetype: MaybeRefOrGetter<string | undefined>) => { title: MaybeRefOrGetter<string | undefined>,
mimetype: MaybeRefOrGetter<string | undefined>,
) => {
return computed<keyof typeof iconMap>(() => { return computed<keyof typeof iconMap>(() => {
if (isImage(toValue(title) || '', toValue(mimetype))) { if (isImage(toValue(title) || '', toValue(mimetype))) {
return 'image' return 'image'

14
packages/nc-gui/composables/useExtensions.ts

@ -1,5 +1,5 @@
import { ExtensionsEvents } from '#imports'
import { useStorage } from '@vueuse/core' import { useStorage } from '@vueuse/core'
import { ExtensionsEvents } from '#imports'
const extensionsState = createGlobalState(() => { const extensionsState = createGlobalState(() => {
const baseExtensions = ref<Record<string, any>>({}) const baseExtensions = ref<Record<string, any>>({})
@ -46,10 +46,10 @@ export interface ExtensionManifest {
} }
export interface IKvStore<T extends Record<string, any>> { export interface IKvStore<T extends Record<string, any>> {
get<K extends keyof T>(key: K): T[K] | null; get<K extends keyof T>(key: K): T[K] | null
set<K extends keyof T>(key: K, value: T[K]): Promise<void>; set<K extends keyof T>(key: K, value: T[K]): Promise<void>
delete<K extends keyof T>(key: K): Promise<void>; delete<K extends keyof T>(key: K): Promise<void>
serialize(): Record<string, T[keyof T]>; serialize(): Record<string, T[keyof T]>
} }
abstract class ExtensionType { abstract class ExtensionType {
@ -206,7 +206,7 @@ export const useExtensions = createSharedComposable(() => {
await $api.extensions.delete(extensionId) await $api.extensions.delete(extensionId)
const extensionToDelete = baseExtensions.value[base.value.id].extensions.find((e: any) => e.id === extensionId); const extensionToDelete = baseExtensions.value[base.value.id].extensions.find((e: any) => e.id === extensionId)
baseExtensions.value[base.value.id].extensions = baseExtensions.value[base.value.id].extensions.filter( baseExtensions.value[base.value.id].extensions = baseExtensions.value[base.value.id].extensions.filter(
(ext: any) => ext.id !== extensionId, (ext: any) => ext.id !== extensionId,
@ -234,7 +234,7 @@ export const useExtensions = createSharedComposable(() => {
}) })
if (newExtension) { if (newExtension) {
const duplicatedExtension = new Extension(newExtension); const duplicatedExtension = new Extension(newExtension)
baseExtensions.value[base.value.id].extensions.push(duplicatedExtension) baseExtensions.value[base.value.id].extensions.push(duplicatedExtension)
eventBus.emit(ExtensionsEvents.DUPLICATE, duplicatedExtension.id) eventBus.emit(ExtensionsEvents.DUPLICATE, duplicatedExtension.id)

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

@ -390,7 +390,7 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState(
group = await processGroupData(response, group) group = await processGroupData(response, group)
} }
if (appInfo.value.ee) { if (appInfo.value.ee && group?.children?.length) {
const aggregationAliasMapper = new AliasMapper() const aggregationAliasMapper = new AliasMapper()
const aggregation = Object.values(gridViewCols.value) const aggregation = Object.values(gridViewCols.value)
@ -408,28 +408,32 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState(
} }
}) })
const aggResponse = !isPublic let aggResponse = {}
? await api.dbDataTableBulkAggregate.dbDataTableBulkAggregate(
meta.value!.id,
{
viewId: view.value!.id,
aggregation,
},
aggregationParams,
)
: await fetchBulkAggregatedData(
{
aggregation,
},
aggregationParams,
)
await aggregationAliasMapper.process(aggResponse, (originalKey, value) => { if (aggregation.length) {
const child = (group?.children ?? []).find((c) => c.key.toString() === (originalKey as any).toString()) aggResponse = !isPublic
if (child) { ? await api.dbDataTableBulkAggregate.dbDataTableBulkAggregate(
Object.assign(child.aggregations, value) meta.value!.id,
} {
}) viewId: view.value!.id,
aggregation,
},
aggregationParams,
)
: await fetchBulkAggregatedData(
{
aggregation,
},
aggregationParams,
)
await aggregationAliasMapper.process(aggResponse, (originalKey, value) => {
const child = (group?.children ?? []).find((c) => c.key.toString() === (originalKey as any).toString())
if (child) {
Object.assign(child.aggregations, value)
}
})
}
} }
if (group?.children?.length && group.nestedIn.length === groupBy.value.length - 1) { if (group?.children?.length && group.nestedIn.length === groupBy.value.length - 1) {

2
packages/nc-gui/nuxt.config.ts

@ -255,7 +255,7 @@ export default defineNuxtConfig({
'xlsx', 'xlsx',
'youtube-vue3', 'youtube-vue3',
'vuedraggable', 'vuedraggable',
'jsbarcode' 'jsbarcode',
], ],
esbuildOptions: { esbuildOptions: {
define: { define: {

2
packages/nocodb/src/db/BaseModelSqlv2.ts

@ -1475,7 +1475,7 @@ class BaseModelSqlv2 {
) { ) {
try { try {
if (!bulkFilterList?.length) { if (!bulkFilterList?.length) {
return NcError.badRequest('bulkFilterList is required'); return {};
} }
const { where, aggregation } = this._getListArgs(args as any); const { where, aggregation } = this._getListArgs(args as any);

2
packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts

@ -1853,6 +1853,7 @@ export class AtImportProcessor {
} }
}; };
/* TODO: AT import user handling
const nocoAddUsers = async (aTblSchema) => { const nocoAddUsers = async (aTblSchema) => {
const userRoles = { const userRoles = {
owner: 'owner', owner: 'owner',
@ -1899,6 +1900,7 @@ export class AtImportProcessor {
recordPerfStats(_perfStart, 'auth.baseUserAdd'); recordPerfStats(_perfStart, 'auth.baseUserAdd');
} }
}; };
*/
const updateNcTblSchema = (tblSchema) => { const updateNcTblSchema = (tblSchema) => {
const tblId = tblSchema.id; const tblId = tblSchema.id;

1
packages/nocodb/src/modules/jobs/jobs/export-import/export.service.ts

@ -387,6 +387,7 @@ export class ExportService {
const comments: Comment[] = []; const comments: Comment[] = [];
let offset = 0; let offset = 0;
// eslint-disable-next-line no-constant-condition
while (true) { while (true) {
const batchComments = await Comment.listByModel(context, model.id, { const batchComments = await Comment.listByModel(context, model.id, {
limit: READ_BATCH_SIZE + 1, limit: READ_BATCH_SIZE + 1,

Loading…
Cancel
Save