Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: PR review fixes β€” remove console.error, fix as any casts, add CE stub

DarkPhoenix270467e050689f53
diff --git a/packages/nc-gui/components/shared-view/Outline.vue b/packages/nc-gui/components/shared-view/Outline.vue
index 64d9816820..a691152ba5 100644
--- a/packages/nc-gui/components/shared-view/Outline.vue
+++ b/packages/nc-gui/components/shared-view/Outline.vue
@@ -28,7 +28,6 @@ if (signedIn.value) {
try {
await loadProject()
} catch (e: any) {
- console.error(e)
message.error(await extractSdkResponseErrorMsg(e))
}
}
diff --git a/packages/nc-gui/components/smartsheet/outline/composables/useCanvasOutline.ts b/packages/nc-gui/components/smartsheet/outline/composables/useCanvasOutline.ts
index 1aee81d1f7..addd3c5460 100644
--- a/packages/nc-gui/components/smartsheet/outline/composables/useCanvasOutline.ts
+++ b/packages/nc-gui/components/smartsheet/outline/composables/useCanvasOutline.ts
@@ -1,6 +1,5 @@
import type { ColumnType, FormulaType, GridColumnType, LinkToAnotherRecordType, TableType } from 'nocodb-sdk'
import { PermissionEntity, PermissionKey, UITypes, isLTAR, isSystemColumn, isVirtualCol } from 'nocodb-sdk'
-import { stringifyFilterOrSortArr } from '~/utils/dataUtils'
import { SpriteLoader } from '../../grid/canvas/loaders/SpriteLoader'
import { getSingleMultiselectColOptions, getUserColOptions, parseCellWidth } from '../../grid/canvas/utils/cell'
import type { OutlineActiveCell, OutlineCanvasElement } from './types'
@@ -19,6 +18,7 @@ import { useCanvasRender } from './useCanvasRender'
import { useColumnResize } from './useColumnResize'
import { useOutlineDataFetch } from './useDataFetch'
import { useOutlineCellRenderer } from './useOutlineCellRenderer'
+import { stringifyFilterOrSortArr } from '~/utils/dataUtils'
import type { OutlineViewRow } from '~/composables/useOutlineViewStore'
export function useCanvasOutline({
@@ -188,16 +188,14 @@ export function useCanvasOutline({
: stringifyFilterOrSortArr([
...(nestedFilters.value ?? [])
.filter((f) => !f.id)
- .map((f) => ((f as any).fk_level_id ? f : { ...f, fk_level_id: fallbackLevelId })),
+ .map((f) => (f.fk_level_id ? f : { ...f, fk_level_id: fallbackLevelId })),
...searchFilters,
])
const sortArrJson = isUIAllowed('sortSync')
? undefined
: stringifyFilterOrSortArr(
- (sorts.value ?? [])
- .filter((s) => !s.id)
- .map((s) => ((s as any).fk_level_id ? s : { ...s, fk_level_id: fallbackLevelId })),
+ (sorts.value ?? []).filter((s) => !s.id).map((s) => (s.fk_level_id ? s : { ...s, fk_level_id: fallbackLevelId })),
)
return { filterArrJson, sortArrJson }
diff --git a/packages/nc-gui/components/smartsheet/outline/composables/useDataFetch.ts b/packages/nc-gui/components/smartsheet/outline/composables/useDataFetch.ts
index 6f3d5fed8c..4069d8cd02 100644
--- a/packages/nc-gui/components/smartsheet/outline/composables/useDataFetch.ts
+++ b/packages/nc-gui/components/smartsheet/outline/composables/useDataFetch.ts
@@ -64,7 +64,7 @@ export function useOutlineDataFetch({
totalRows.value = result.totalRows
levelCounts.value = result.counts
} catch (e) {
- console.error('Error fetching outline view count:', e)
+ // silently ignore β€” count will remain at previous value
}
}
@@ -100,7 +100,7 @@ export function useOutlineDataFetch({
chunkStates.value[chunkId + 1] = 'loaded'
}
} catch (e) {
- console.error(`Error fetching outline chunk ${chunkId}:`, e)
+ // reset chunk state so it can be retried
chunkStates.value[chunkId] = undefined
if (isInitialLoad) {
chunkStates.value[chunkId + 1] = undefined
@@ -136,7 +136,7 @@ export function useOutlineDataFetch({
group.forEach((id) => (chunkStates.value[id] = 'loaded'))
} catch (e) {
- console.error(`Error fetching outline chunks ${startChunk}-${endChunk}:`, e)
+ // reset chunk states so they can be retried
group.forEach((id) => (chunkStates.value[id] = undefined))
}
}
diff --git a/packages/nc-gui/components/smartsheet/outline/index.vue b/packages/nc-gui/components/smartsheet/outline/index.vue
index fa7f927907..9bb5a4ffca 100644
--- a/packages/nc-gui/components/smartsheet/outline/index.vue
+++ b/packages/nc-gui/components/smartsheet/outline/index.vue
@@ -326,8 +326,7 @@ async function saveRowProperty(cell: NonNullable<typeof activeCell.value>, rowOb
triggerRefreshCanvas()
}
} catch (e: any) {
- console.error('Failed to save cell:', e)
- message.error(e.message || 'Failed to save')
+ message.error(await extractSdkResponseErrorMsg(e))
}
}
diff --git a/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue b/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
index e99c8b8337..a45b02d6e4 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/ColumnFilter.vue
@@ -664,7 +664,7 @@ watch(
const visibleFilters = computed(() =>
filters.value.filter((filter) => {
if (filter.status === 'delete') return false
- if (levelId.value && !nested.value) return (filter as any).fk_level_id === levelId.value
+ if (levelId.value && !nested.value) return filter.fk_level_id === levelId.value
return true
}),
)
diff --git a/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue b/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
index 08e6a1b371..299f53c5f8 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/FieldsMenu.vue
@@ -361,7 +361,7 @@ const visibleFields = computed(
// For outline view with levels, only include selected level's fields
if (isOutline.value && isOutlineConfigured.value && outlineViewStore?.selectedLevelId.value) {
- if ((field as any).fk_level_id !== outlineViewStore.selectedLevelId.value) {
+ if (field.fk_level_id !== outlineViewStore.selectedLevelId.value) {
return false
}
}
diff --git a/packages/nc-gui/components/smartsheet/toolbar/Outline/SetLevels.vue b/packages/nc-gui/components/smartsheet/toolbar/Outline/SetLevels.vue
index 77635bc06b..fa7d56ce06 100644
--- a/packages/nc-gui/components/smartsheet/toolbar/Outline/SetLevels.vue
+++ b/packages/nc-gui/components/smartsheet/toolbar/Outline/SetLevels.vue
@@ -123,7 +123,7 @@ async function save() {
eventBus.emit(SmartsheetStoreEvents.SORT_RELOAD)
eventBus.emit(SmartsheetStoreEvents.FILTER_RELOAD)
} catch (e) {
- console.error('Error saving level configuration:', e)
+ message.error(await extractSdkResponseErrorMsg(e))
}
}
diff --git a/packages/nc-gui/composables/useOutlineViewStore.ts b/packages/nc-gui/composables/useOutlineViewStore.ts
index 1e6ee4de17..b5052e54a3 100644
--- a/packages/nc-gui/composables/useOutlineViewStore.ts
+++ b/packages/nc-gui/composables/useOutlineViewStore.ts
@@ -88,7 +88,6 @@ const [useProvideOutlineViewStore, useOutlineViewStore] = useInjectionState(
levels: config.levels,
})
} catch (e) {
- console.error('Error saving level configuration:', e)
throw e
}
}
@@ -100,7 +99,6 @@ const [useProvideOutlineViewStore, useOutlineViewStore] = useInjectionState(
try {
await _updateViewMeta(viewId.value, ViewTypes.OUTLINE, updates)
} catch (e) {
- console.error('Error updating outline view meta:', e)
throw e
}
}
diff --git a/packages/nc-gui/composables/useViewColumns.ts b/packages/nc-gui/composables/useViewColumns.ts
index 72f1b53ac3..60eaa2976f 100644
--- a/packages/nc-gui/composables/useViewColumns.ts
+++ b/packages/nc-gui/composables/useViewColumns.ts
@@ -132,7 +132,7 @@ const [useProvideViewColumns, useViewColumns] = useInjectionState(
try {
await _getMeta(meta.value!.base_id!, level.fk_model_id)
} catch (e) {
- console.error(`Failed to load meta for level table ${level.fk_model_id}:`, e)
+ // silently ignore β€” level table meta may not be accessible
}
}
}
diff --git a/packages/nc-gui/lib/types.ts b/packages/nc-gui/lib/types.ts
index 4afd0a4a1c..68f64017f4 100644
--- a/packages/nc-gui/lib/types.ts
+++ b/packages/nc-gui/lib/types.ts
@@ -78,6 +78,7 @@ interface Field {
underline: boolean | number
title: string
fk_column_id?: string
+ fk_level_id?: string
system?: boolean
isViewEssentialField?: boolean
initialShow?: boolean
diff --git a/packages/nocodb/src/models/OutlineViewColumn.ts b/packages/nocodb/src/models/OutlineViewColumn.ts
index 7eb144279e..13c8cad1b1 100644
--- a/packages/nocodb/src/models/OutlineViewColumn.ts
+++ b/packages/nocodb/src/models/OutlineViewColumn.ts
@@ -20,4 +20,8 @@ export default class OutlineViewColumn {
static async update(..._args) {
return null;
}
+
+ static async getNextOrderForLevel(..._args): Promise<number> {
+ return 1;
+ }
}