|
|
@ -32,6 +32,7 @@ import ncModelsOrderUpgrader from './jobs/ncModelsOrderUpgrader'; |
|
|
|
import ncParentModelTitleUpgrader from './jobs/ncParentModelTitleUpgrader'; |
|
|
|
import ncParentModelTitleUpgrader from './jobs/ncParentModelTitleUpgrader'; |
|
|
|
import ncRemoveDuplicatedRelationRows from './jobs/ncRemoveDuplicatedRelationRows'; |
|
|
|
import ncRemoveDuplicatedRelationRows from './jobs/ncRemoveDuplicatedRelationRows'; |
|
|
|
import xcMetaDiffSync from './handlers/xcMetaDiffSync'; |
|
|
|
import xcMetaDiffSync from './handlers/xcMetaDiffSync'; |
|
|
|
|
|
|
|
import UITypes from '../../sqlUi/UITypes'; |
|
|
|
|
|
|
|
|
|
|
|
const log = debug('nc:api:base'); |
|
|
|
const log = debug('nc:api:base'); |
|
|
|
|
|
|
|
|
|
|
@ -755,11 +756,12 @@ export default abstract class BaseApiBuilder<T extends Noco> |
|
|
|
const columns = |
|
|
|
const columns = |
|
|
|
changeObj.columns |
|
|
|
changeObj.columns |
|
|
|
.filter(c => c.altered !== 4) |
|
|
|
.filter(c => c.altered !== 4) |
|
|
|
.map(({ altered: _al, ...rest }) => ({ |
|
|
|
.map(({ altered: _al, ...rest }) => |
|
|
|
...rest, |
|
|
|
this.mergeUiColAndDbColMetas( |
|
|
|
// find and overwrite column property from db
|
|
|
|
rest, |
|
|
|
...(columnsFromDb?.find(c => c.cn === rest.cn) || {}) |
|
|
|
columnsFromDb?.find(c => c.cn === rest.cn) |
|
|
|
})) || (await this.getColumnList(tn)); |
|
|
|
) |
|
|
|
|
|
|
|
) || (await this.getColumnList(tn)); |
|
|
|
|
|
|
|
|
|
|
|
/* Get all relations */ |
|
|
|
/* Get all relations */ |
|
|
|
const relations = await this.relationsSyncAndGet(); |
|
|
|
const relations = await this.relationsSyncAndGet(); |
|
|
@ -1201,6 +1203,22 @@ export default abstract class BaseApiBuilder<T extends Noco> |
|
|
|
await NcHelp.executeOperations(aclOper, this.connectionConfig.client); |
|
|
|
await NcHelp.executeOperations(aclOper, this.connectionConfig.client); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected mergeUiColAndDbColMetas(uiCol, dbCol) { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
...(uiCol || {}), |
|
|
|
|
|
|
|
...(dbCol || {}), |
|
|
|
|
|
|
|
// persist x props for single/multi select
|
|
|
|
|
|
|
|
...(uiCol?.uidt === UITypes.SingleSelect || |
|
|
|
|
|
|
|
uiCol?.uidt === UITypes.MultiSelect |
|
|
|
|
|
|
|
? { |
|
|
|
|
|
|
|
dtx: uiCol.dtx, |
|
|
|
|
|
|
|
dtxp: uiCol.dtxp, |
|
|
|
|
|
|
|
dtxs: uiCol.dtxs |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
: {}) |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public async onViewUpdate( |
|
|
|
public async onViewUpdate( |
|
|
|
viewName: string, |
|
|
|
viewName: string, |
|
|
|
beforeMetaUpdate?: (args: any) => Promise<void> |
|
|
|
beforeMetaUpdate?: (args: any) => Promise<void> |
|
|
|