Skip to content

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

fix: Kanban if stacked by field has default value, add new record in uncategorized stack doesnt work

Ramesh Mane31f51e0c6302
diff --git a/packages/nc-gui/components/smartsheet/Kanban.vue b/packages/nc-gui/components/smartsheet/Kanban.vue
index d8e659e7f6..df0384e14f 100644
--- a/packages/nc-gui/components/smartsheet/Kanban.vue
+++ b/packages/nc-gui/components/smartsheet/Kanban.vue
@@ -473,6 +473,7 @@ const draggableCardFilter = (event: Event, target: HTMLElement) => {
return !!(
eventTarget &&
+ target &&
target.contains(eventTarget) &&
closestNotDraggable &&
(target.contains(closestNotDraggable) || closestNotDraggable === target)
@@ -1258,6 +1259,7 @@ const handleOpenNewRecordForm = (stackTitle?: string) => {
:meta="meta"
:load-row="!isPublic"
:view="view"
+ :allow-null-field-ids="groupingFieldColumn?.id ? [groupingFieldColumn.id] : []"
@cancel="removeRowFromUncategorizedStack"
/>
</Suspense>
@@ -1272,6 +1274,7 @@ const handleOpenNewRecordForm = (stackTitle?: string) => {
:expand-form="expandForm"
:row-id="route.query.rowId"
:view="view"
+ :allow-null-field-ids="groupingFieldColumn?.id ? [groupingFieldColumn.id] : []"
/>
</Suspense>
diff --git a/packages/nc-gui/components/smartsheet/expanded-form/index.vue b/packages/nc-gui/components/smartsheet/expanded-form/index.vue
index aac84c25ef..0d2f988e09 100644
--- a/packages/nc-gui/components/smartsheet/expanded-form/index.vue
+++ b/packages/nc-gui/components/smartsheet/expanded-form/index.vue
@@ -23,6 +23,7 @@ interface Props {
newRecordSubmitBtnText?: string
expandForm?: (row: Row) => void
maintainDefaultViewOrder?: boolean
+ allowNullFieldIds?: string[]
}
const props = defineProps<Props>()
@@ -99,7 +100,7 @@ const isLoading = ref(true)
const isSaving = ref(false)
-const expandedFormStore = useProvideExpandedFormStore(meta, row, maintainDefaultViewOrder, !!props.useMetaFields)
+const expandedFormStore = useProvideExpandedFormStore(meta, row, maintainDefaultViewOrder, !!props.useMetaFields, props.allowNullFieldIds)
const {
commentsDrawer,
diff --git a/packages/nc-gui/composables/useExpandedFormStore.ts b/packages/nc-gui/composables/useExpandedFormStore.ts
index 6bff1e4bc2..2e2abf87b7 100644
--- a/packages/nc-gui/composables/useExpandedFormStore.ts
+++ b/packages/nc-gui/composables/useExpandedFormStore.ts
@@ -23,7 +23,13 @@ import type { Ref } from 'vue'
import dayjs from 'dayjs'
const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState(
- (meta: Ref<TableType>, _row: Ref<Row>, maintainDefaultViewOrder: Ref<boolean>, useMetaFields: boolean) => {
+ (
+ meta: Ref<TableType>,
+ _row: Ref<Row>,
+ maintainDefaultViewOrder: Ref<boolean>,
+ useMetaFields: boolean,
+ allowNullFieldIds?: string[],
+ ) => {
const { $e, $state, $api, $ncSocket } = useNuxtApp()
const { t } = useI18n()
@@ -362,6 +368,7 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState(
getMeta,
row: row.value.row,
throwError: true,
+ allowNullFieldIds,
})
if (missingRequiredColumns.size) return
diff --git a/packages/nc-gui/utils/dataUtils.ts b/packages/nc-gui/utils/dataUtils.ts
index b4bc7969fd..065f51297e 100644
--- a/packages/nc-gui/utils/dataUtils.ts
+++ b/packages/nc-gui/utils/dataUtils.ts
@@ -82,6 +82,7 @@ export async function populateInsertObject({
ltarState,
throwError,
undo = false,
+ allowNullFieldIds = [],
}: {
meta: TableType
ltarState: Record<string, any>
@@ -89,6 +90,7 @@ export async function populateInsertObject({
row: Record<string, any>
throwError?: boolean
undo?: boolean
+ allowNullFieldIds?: string[]
}) {
const missingRequiredColumns = new Set()
const insertObj = await meta.columns?.reduce(async (_o: Promise<any>, col) => {
@@ -116,7 +118,7 @@ export async function populateInsertObject({
missingRequiredColumns.add(col.title)
}
- if ((!col.ai || undo) && row?.[col.title as string] !== null) {
+ if ((!col.ai || undo) && (row?.[col.title as string] !== null || allowNullFieldIds.includes(col.id as string))) {
o[col.title as string] = row?.[col.title as string]
}
diff --git a/packages/nocodb-sdk-v2/src/lib/Api.ts b/packages/nocodb-sdk-v2/src/lib/Api.ts
index adf3afa366..a834e34610 100644
--- a/packages/nocodb-sdk-v2/src/lib/Api.ts
+++ b/packages/nocodb-sdk-v2/src/lib/Api.ts
@@ -2679,7 +2679,7 @@ export class InternalApi<
*
* If `viewId` query parameter is also included, then the filters included here will be applied over the filtering configuration defined in the view.
*
- * Please remember to maintain the specified format, and do not include spaces between the different condition components
+ * Please remember to maintain the specified format, for further information on this please see [the documentation](https://nocodb.com/docs/product-docs/developer-resources/rest-apis#v3-where-query-parameter)
*/
where?: string;
/**
@@ -2912,7 +2912,7 @@ export class InternalApi<
*
* If `viewId` query parameter is also included, then the filters included here will be applied over the filtering configuration defined in the view.
*
- * Please remember to maintain the specified format, and do not include spaces between the different condition components
+ * Please remember to maintain the specified format, for further information on this please see [the documentation](https://nocodb.com/docs/product-docs/developer-resources/rest-apis#v3-where-query-parameter)
*/
where?: string;
},
@@ -2979,7 +2979,7 @@ export class InternalApi<
*
* You can also use other comparison operators like 'neq' (not equal), 'gt' (greater than), 'lt' (less than), and more, to create complex filtering rules.
*
- * Please remember to maintain the specified format, and do not include spaces between the different condition components
+ * Please remember to maintain the specified format, for further information on this please see [the documentation](https://nocodb.com/docs/product-docs/developer-resources/rest-apis#v3-where-query-parameter)
*/
where?: string;
/**