π₯ π₯ π₯ A Free & Self-hostable Airtable Alternative
TypeScript airtableairtable-alternativeautomatic-apihacktoberfestlow-codeno-codeno-code-databaseno-code-platformpostgresqlrest-apirestful-apispreadsheetsqliteswagger
fix: NRecordSelector baseId missing
Ramesh Mane81ae43a804d4
diff --git a/packages/nc-gui/components/n/RecordPicker/Records.vue b/packages/nc-gui/components/n/RecordPicker/Records.vueindex 67cba2eaec..42e0c06a58 100644--- a/packages/nc-gui/components/n/RecordPicker/Records.vue+++ b/packages/nc-gui/components/n/RecordPicker/Records.vue@@ -24,7 +24,7 @@ const emits = defineEmits<{const { meta, viewMeta, where, records, fields: propsFields } = toRefs(props)-const pv = computed(() => (meta.value.columns ?? []).find((c) => c.pv))+const pv = computed(() => (meta.value?.columns ?? []).find((c) => c.pv))useProvideSmartsheetLtarHelpers(meta)const { isMobileMode } = useGlobal()@@ -36,10 +36,10 @@ const _fields = computedInject(FieldsInj, (_fields) => {!isSystemColumn(col) && !isPrimary(col) && !isLinksOrLTAR(col) && !isCreatedOrLastModifiedTimeCol(col)if (propsFields.value?.length) {- return (meta.value.columns ?? []).filter((col) => propsFields.value.includes(col.title!) && conditionToCheck(col))+ return (meta.value?.columns ?? []).filter((col) => propsFields.value.includes(col.title!) && conditionToCheck(col))}- return (meta.value.columns ?? [])+ return (meta.value?.columns ?? []).filter((col) => conditionToCheck(col)).sort((a, b) => {return (a.meta?.defaultViewColOrder ?? Infinity) - (b.meta?.defaultViewColOrder ?? Infinity)diff --git a/packages/nc-gui/components/n/RecordPicker/index.vue b/packages/nc-gui/components/n/RecordPicker/index.vueindex fd79e4277a..8dc6238f82 100644--- a/packages/nc-gui/components/n/RecordPicker/index.vue+++ b/packages/nc-gui/components/n/RecordPicker/index.vue@@ -5,6 +5,7 @@ import { ViewTypes, getFirstNonPersonalView } from 'nocodb-sdk'const props = withDefaults(defineProps<{label: string+ baseId?: stringtableId: stringviewId?: stringmodelValue: Row@@ -26,6 +27,8 @@ const emits = defineEmits<{const { internalApi } = useApi()+const { activeProjectId } = storeToRefs(useBases())+const searchQuery = ref('')const debouncedSearch = refDebounced(searchQuery, 200)@@ -93,31 +96,42 @@ const isLoading = ref(false)const loadMetas = async () => {if (!props.tableId) return+isLoading.value = true- tableMeta.value = (await getMeta(tableMeta.value?.base_id, props.tableId))!+ try {+ const effectiveBaseId = props.baseId || activeProjectId.value+ if (!effectiveBaseId) {+ console.error('[NRecordPicker] baseId is required but was not provided')+ return+ }- // Helper function to find views for this table- const findViews = () => {- if (!tableMeta.value?.base_id) return []- const key = `${tableMeta.value.base_id}:${props.tableId}`- return viewsByTable.value.get(key) || []- }+ tableMeta.value = (await getMeta(effectiveBaseId!, props.tableId))!- if (props.viewId) {- viewMeta.value = findViews().find((v) => v.id === props.viewId)+ // Helper function to find views for this table+ const findViews = () => {+ const key = `${effectiveBaseId}:${props.tableId}`+ return viewsByTable.value.get(key) || []+ }- if (!viewMeta.value) {- await loadViews({ tableId: props.tableId, force: true })+ if (props.viewId) {viewMeta.value = findViews().find((v) => v.id === props.viewId)++ if (!viewMeta.value) {+ await loadViews({ tableId: props.tableId, force: true })+ viewMeta.value = findViews().find((v) => v.id === props.viewId)+ }+ } else {+ await loadViews({ tableId: props.tableId, force: true })+ viewMeta.value = getFirstNonPersonalView(findViews(), {+ includeViewType: ViewTypes.GRID,+ })}- } else {- await loadViews({ tableId: props.tableId, force: true })- viewMeta.value = getFirstNonPersonalView(findViews(), {- includeViewType: ViewTypes.GRID,- })+ } catch (e) {+ console.error(e)+ } finally {+ isLoading.value = false}- isLoading.value = false}onMounted(async () => {@@ -226,7 +240,7 @@ whenever(isOpen, () => {</div></div><NRecordPickerRecords- v-if="!isLoading"+ v-if="!isLoading && tableMeta"ref="recordsRef":view-meta="viewMeta":data="records"