diff --git a/packages/nocodb/tests/sync/sync.js b/packages/nocodb/tests/sync/sync.js index 8b1e5c2ad6..756fb06375 100644 --- a/packages/nocodb/tests/sync/sync.js +++ b/packages/nocodb/tests/sync/sync.js @@ -484,6 +484,39 @@ async function nocoSetPrimary(aTblSchema) { } } +async function nc_hideColumn(tblName, viewName, columnName) { + + // retrieve table schema + let ncTbl = await nc_getTableSchema(tblName) + // retrieve view ID + let viewId = ncTbl.views.find(x => x.title === viewName).id; + // retrieve view Info + let viewDetails = await api.dbView.gridColumnsList(viewId); + + for(i =0; i x.title === columnName[i]); + // retrieve view column ID + let viewColumnId = viewDetails.find(x => x.fk_column_id === ncColumn.id).id + // hide + syncLog(`NC API: dbViewColumn.update ${viewId}, ${ncColumn.id}`) + let retVal = await api.dbViewColumn.update(viewId, viewColumnId, { show: false }) + } +} + +async function nocoReconfigureFields(aTblSchema) { + for (let idx = 0; idx < aTblSchema.length; idx++) { + let hiddenColumns = ["record_id"] + + // extract other columns hidden in this view + let hiddenColumnID = aTblSchema[idx].meaningfulColumnOrder.filter(x => x.visibility===false) + for(let i=0; i