π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix: kanban failing tests
DarkPhoenix2704dff489ed14c3
diff --git a/packages/nc-gui/composables/useKanbanViewStore.ts b/packages/nc-gui/composables/useKanbanViewStore.tsindex 388a4a74ae..e176e3c01e 100644--- a/packages/nc-gui/composables/useKanbanViewStore.ts+++ b/packages/nc-gui/composables/useKanbanViewStore.ts@@ -55,7 +55,7 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(const { updateViewMeta } = viewStore- const { views } = storeToRefs(viewStore)+ const { setMeta } = useMetas()// save history of stack changes for undo/redoconst moveHistory = ref<{ op: 'added' | 'removed'; pk: string; stack: string; index: number }[]>([])@@ -586,13 +586,14 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState((o) => o.title !== stackTitle,)const cdf = groupingFieldColumn.value.cdf ? groupingFieldColumn.value.cdf.replace(/^'/, '').replace(/'$/, '') : null- await api.dbTableColumn.update(groupingFieldColumn.value.id!, {+ const newMeta = await api.dbTableColumn.update(groupingFieldColumn.value.id!, {...groupingFieldColumn.value,colOptions: {options: newOptions,},cdf: cdf === stackTitle ? null : cdf,} as any)+ await setMeta(newMeta)const splicedOps = [...groupingFieldColOptions.value].splice(stackIdx, 1)// update kanban stack metadiff --git a/packages/nocodb/src/services/kanbans.service.ts b/packages/nocodb/src/services/kanbans.service.tsindex ce160edb15..2f8660c82b 100644--- a/packages/nocodb/src/services/kanbans.service.ts+++ b/packages/nocodb/src/services/kanbans.service.ts@@ -271,6 +271,11 @@ export class KanbansService {newStackMeta.push(uncategorizedStack);// Process each column option, preserving existing order when possible+ let currentMaxOrder = Math.max(+ ...existingStacks.map((s) => s.order || 0),+ 0,+ );+for (const option of colOptions.options) {const existingStack = existingStacks.find((stack) => stack.id === option.id,@@ -285,13 +290,10 @@ export class KanbansService {});} else {// Add new stack for new option - assign next available order- const maxOrder = Math.max(- ...existingStacks.map((s) => s.order || 0),- 0,- );+ currentMaxOrder += 1; // Increment for each new itemnewStackMeta.push({...option,- order: maxOrder + 1, // Assign next order for new items+ order: currentMaxOrder,collapsed: false,});}