Skip to content

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

fix: airtable import missing description

Ramesh Mane5725f4d52614
diff --git a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts
index af3b9ff638..a4442909cb 100644
--- a/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts
+++ b/packages/nocodb/src/modules/jobs/jobs/at-import/at-import.processor.ts
@@ -562,6 +562,11 @@ export class AtImportProcessor {
// check for duplicate and populate a unique name if already exist
table.table_name = uniqueTableNameGen(sanitizedName);
+ // add description to table
+ if (tblSchema[i].description) {
+ table.description = tblSchema[i].description;
+ }
+
table.columns = [];
const source = await Source.get(context, syncDB.sourceId);
@@ -1735,9 +1740,12 @@ export class AtImportProcessor {
// create view
await getViewData(galleryViews[i].id);
- const viewName = aTblSchema[idx].views.find(
+ const aView = aTblSchema[idx].views.find(
(x) => x.id === galleryViews[i].id,
- )?.name;
+ );
+
+ const viewName = aView?.name;
+ const viewDescription = aView?.description;
logBasic(
`:: [${configuredViews + i + 1}/${rtc.view.total}] Gallery : ${
@@ -1751,6 +1759,7 @@ export class AtImportProcessor {
tableId: tblId,
gallery: {
title: viewName,
+ description: viewDescription,
},
user: syncDB.user,
req,
@@ -1778,9 +1787,11 @@ export class AtImportProcessor {
// create view
const vData = await getViewData(formViews[i].id);
- const viewName = aTblSchema[idx].views.find(
+ const aView = aTblSchema[idx].views.find(
(x) => x.id === formViews[i].id,
- )?.name;
+ );
+ const viewName = aView?.name;
+ const viewDescription = aView?.description;
logBasic(
`:: [${configuredViews + i + 1}/${rtc.view.total}] Form : ${
@@ -1807,6 +1818,7 @@ export class AtImportProcessor {
const formData = {
title: viewName,
heading: viewName,
+ description: viewDescription,
subheading: desc,
success_msg: msg,
submit_another_form: refreshMode.includes('REFRESH_BUTTON'),
@@ -1866,9 +1878,12 @@ export class AtImportProcessor {
const vData = await getViewData(gridViews[i].id);
// retrieve view name & associated NC-ID
- const viewName = aTblSchema[idx].views.find(
+ const aView = aTblSchema[idx].views.find(
(x) => x.id === gridViews[i].id,
- )?.name;
+ );
+ const viewName = aView?.name;
+ const viewDescription = aView?.description;
+
const _perfStart = recordPerfStart();
// const viewList: any = await api.dbView.list(tblId);
const viewList = { list: [] };
@@ -1901,6 +1916,7 @@ export class AtImportProcessor {
tableId: tblId,
grid: {
title: viewName,
+ description: viewDescription,
},
req,
},
diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json
index a911cadf01..6d851a551d 100644
--- a/packages/nocodb/src/schema/swagger.json
+++ b/packages/nocodb/src/schema/swagger.json
@@ -28457,6 +28457,11 @@
"calendar_range": {
"description": "Calendar Range or Null",
"$ref": "#/components/schemas/CalendarRangeOrNull"
+ },
+ "description": {
+ "$ref": "#/components/schemas/TextOrNull",
+ "description": "Description of the view.",
+ "example": "This is a grid view."
}
},
"required": [