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">
const props = defineProps<{
item: any
}>()
const icon = useAttachmentIcon(() => props.item.title, props.item.mimetype)
</script>
<template>

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

@ -52,7 +52,6 @@ const {
visibleItems,
onDrop,
isLoading,
FileIcon,
selectedFile,
isReadonly,
storedFiles,
@ -317,11 +316,7 @@ defineExpose({
</div>
</div>
</div>
<div
v-else
ref="attachmentCellRef"
class="nc-attachment-cell relative group color-transition"
>
<div v-else ref="attachmentCellRef" class="nc-attachment-cell relative group color-transition">
<LazyCellAttachmentCarousel v-if="selectedFile" />
<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"
: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,
paddingBottom: !rowHeight || rowHeight === 1 ? '4px !important' : undefined,
}"
@ -401,11 +398,7 @@ defineExpose({
:srcs="getPossibleAttachmentSrc(item, attachmentSize)"
@click="() => onFileClick(item)"
/>
<div
v-else
class="nc-attachment h-full w-full flex items-center justify-center"
@click="onFileClick(item)"
>
<div 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" />
</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 { isFeatureEnabled } = useBetaFeatureToggle()
const router = useRouter()
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 { 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)

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

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

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

@ -4,12 +4,12 @@ interface Props {
isOpen: boolean
}
const { $e } = useNuxtApp()
const props = withDefaults(defineProps<Props>(), {})
const emits = defineEmits(['update:searchQuery', 'update:isOpen'])
const { $e } = useNuxtApp()
const searchQuery = useVModel(props, 'searchQuery', 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 FeedChangelog from './Changelog/index.vue'
import FeedYoutube from './Youtube/index.vue'
import FeedTwitter from './Twitter.vue'
// import FeedTwitter from './Twitter.vue'
// import FeedRoadmap from './Roadmap.vue'
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 attrs = useAttrs()
const allAttrs = useAttrs()
const isKeyPressed = ref(false)
@ -125,8 +125,8 @@ watchDebounced(
)
const divStyles = computed(() => ({
style: attrs.style as CSSProperties,
class: attrs.class as string,
style: allAttrs.style as CSSProperties,
class: allAttrs.class as string,
}))
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
const sortedFormattedData = [...formattedData.value]
.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) {
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) }}
</span>
</template>
<template v-for="(field, id) in fields" :key="field.id">
<template v-for="field in fields" :key="field.id">
<LazySmartsheetPlainCell
v-if="!isRowEmpty(record, field!)"
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) => {
// Get the hour component for start and end times
const startHour = startDate.hour()
@ -155,13 +163,6 @@ const calculateNewDates = useMemoize(
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 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()
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
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) => {
_calendar_ranges.value = _calendar_ranges.value.filter((_, i) => i !== id)
await saveCalendarRanges()
}
*/
const isDisabled = computed(() => {
return (

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

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

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

@ -1,5 +1,5 @@
import { ExtensionsEvents } from '#imports'
import { useStorage } from '@vueuse/core'
import { ExtensionsEvents } from '#imports'
const extensionsState = createGlobalState(() => {
const baseExtensions = ref<Record<string, any>>({})
@ -46,10 +46,10 @@ export interface ExtensionManifest {
}
export interface IKvStore<T extends Record<string, any>> {
get<K extends keyof T>(key: K): T[K] | null;
set<K extends keyof T>(key: K, value: T[K]): Promise<void>;
delete<K extends keyof T>(key: K): Promise<void>;
serialize(): Record<string, T[keyof T]>;
get<K extends keyof T>(key: K): T[K] | null
set<K extends keyof T>(key: K, value: T[K]): Promise<void>
delete<K extends keyof T>(key: K): Promise<void>
serialize(): Record<string, T[keyof T]>
}
abstract class ExtensionType {
@ -206,7 +206,7 @@ export const useExtensions = createSharedComposable(() => {
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(
(ext: any) => ext.id !== extensionId,
@ -234,7 +234,7 @@ export const useExtensions = createSharedComposable(() => {
})
if (newExtension) {
const duplicatedExtension = new Extension(newExtension);
const duplicatedExtension = new Extension(newExtension)
baseExtensions.value[base.value.id].extensions.push(duplicatedExtension)
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)
}
if (appInfo.value.ee) {
if (appInfo.value.ee && group?.children?.length) {
const aggregationAliasMapper = new AliasMapper()
const aggregation = Object.values(gridViewCols.value)
@ -408,28 +408,32 @@ const [useProvideViewGroupBy, useViewGroupBy] = useInjectionState(
}
})
const aggResponse = !isPublic
? await api.dbDataTableBulkAggregate.dbDataTableBulkAggregate(
meta.value!.id,
{
viewId: view.value!.id,
aggregation,
},
aggregationParams,
)
: await fetchBulkAggregatedData(
{
aggregation,
},
aggregationParams,
)
let aggResponse = {}
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 (aggregation.length) {
aggResponse = !isPublic
? await api.dbDataTableBulkAggregate.dbDataTableBulkAggregate(
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) {

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

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

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

@ -1475,7 +1475,7 @@ class BaseModelSqlv2 {
) {
try {
if (!bulkFilterList?.length) {
return NcError.badRequest('bulkFilterList is required');
return {};
}
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 userRoles = {
owner: 'owner',
@ -1899,6 +1900,7 @@ export class AtImportProcessor {
recordPerfStats(_perfStart, 'auth.baseUserAdd');
}
};
*/
const updateNcTblSchema = (tblSchema) => {
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[] = [];
let offset = 0;
// eslint-disable-next-line no-constant-condition
while (true) {
const batchComments = await Comment.listByModel(context, model.id, {
limit: READ_BATCH_SIZE + 1,

Loading…
Cancel
Save