|
|
@ -113,7 +113,7 @@ export class AtImportProcessor { |
|
|
|
await sMapEM.init(); |
|
|
|
await sMapEM.init(); |
|
|
|
const userRole = syncDB.user.roles |
|
|
|
const userRole = syncDB.user.roles |
|
|
|
.split(',') |
|
|
|
.split(',') |
|
|
|
.reduce((rolesObj, role) => ({ [role]: true, ...rolesObj }), {}); |
|
|
|
.reduce((rolesObj, role) => ({ [role]: true, ...rolesObj })); |
|
|
|
|
|
|
|
|
|
|
|
const sMap = { |
|
|
|
const sMap = { |
|
|
|
// static mapping records between aTblId && ncId
|
|
|
|
// static mapping records between aTblId && ncId
|
|
|
@ -666,7 +666,12 @@ export class AtImportProcessor { |
|
|
|
const view = { list: [] }; |
|
|
|
const view = { list: [] }; |
|
|
|
view['list'] = await this.viewsService.viewList({ |
|
|
|
view['list'] = await this.viewsService.viewList({ |
|
|
|
tableId: table.id, |
|
|
|
tableId: table.id, |
|
|
|
user: { roles: userRole }, |
|
|
|
user: { |
|
|
|
|
|
|
|
roles: userRole, |
|
|
|
|
|
|
|
project_roles: { |
|
|
|
|
|
|
|
owner: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'dbView.list'); |
|
|
|
recordPerfStats(_perfStart, 'dbView.list'); |
|
|
|
|
|
|
|
|
|
|
@ -745,7 +750,7 @@ export class AtImportProcessor { |
|
|
|
const srcTbl: any = |
|
|
|
const srcTbl: any = |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
tableId: srcTableId, |
|
|
|
tableId: srcTableId, |
|
|
|
user: syncDB.user, |
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
|
|
@ -829,7 +834,7 @@ export class AtImportProcessor { |
|
|
|
const childTblSchema: any = |
|
|
|
const childTblSchema: any = |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
tableId: ncLinkMappingTable[x].nc.childId, |
|
|
|
tableId: ncLinkMappingTable[x].nc.childId, |
|
|
|
user: syncDB.user, |
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
|
|
@ -837,7 +842,7 @@ export class AtImportProcessor { |
|
|
|
const parentTblSchema: any = |
|
|
|
const parentTblSchema: any = |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
tableId: ncLinkMappingTable[x].nc.parentId, |
|
|
|
tableId: ncLinkMappingTable[x].nc.parentId, |
|
|
|
user: syncDB.user, |
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
|
|
@ -1734,7 +1739,12 @@ export class AtImportProcessor { |
|
|
|
const viewList = { list: [] }; |
|
|
|
const viewList = { list: [] }; |
|
|
|
viewList['list'] = await this.viewsService.viewList({ |
|
|
|
viewList['list'] = await this.viewsService.viewList({ |
|
|
|
tableId: tblId, |
|
|
|
tableId: tblId, |
|
|
|
user: { roles: userRole }, |
|
|
|
user: { |
|
|
|
|
|
|
|
roles: userRole, |
|
|
|
|
|
|
|
project_roles: { |
|
|
|
|
|
|
|
owner: true, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
} as any, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'dbView.list'); |
|
|
|
recordPerfStats(_perfStart, 'dbView.list'); |
|
|
|
|
|
|
|
|
|
|
@ -1854,7 +1864,7 @@ export class AtImportProcessor { |
|
|
|
const _perfStart = recordPerfStart(); |
|
|
|
const _perfStart = recordPerfStart(); |
|
|
|
const ncTbl: any = await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
const ncTbl: any = await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
tableId: tblId, |
|
|
|
tableId: tblId, |
|
|
|
user: syncDB.user, |
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
|
|
@ -2328,7 +2338,7 @@ export class AtImportProcessor { |
|
|
|
ncTblList['list'] = await this.tablesService.getAccessibleTables({ |
|
|
|
ncTblList['list'] = await this.tablesService.getAccessibleTables({ |
|
|
|
projectId: ncCreatedProjectSchema.id, |
|
|
|
projectId: ncCreatedProjectSchema.id, |
|
|
|
baseId: syncDB.baseId, |
|
|
|
baseId: syncDB.baseId, |
|
|
|
roles: userRole, |
|
|
|
roles: { ...userRole, owner: true }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'base.tableList'); |
|
|
|
recordPerfStats(_perfStart, 'base.tableList'); |
|
|
|
|
|
|
|
|
|
|
@ -2348,7 +2358,7 @@ export class AtImportProcessor { |
|
|
|
const ncTbl: any = |
|
|
|
const ncTbl: any = |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
tableId: ncTblList.list[i].id, |
|
|
|
tableId: ncTblList.list[i].id, |
|
|
|
user: syncDB.user, |
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
recordPerfStats(_perfStart, 'dbTable.read'); |
|
|
|
|
|
|
|
|
|
|
@ -2383,7 +2393,7 @@ export class AtImportProcessor { |
|
|
|
const ncTbl: any = |
|
|
|
const ncTbl: any = |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
await this.tablesService.getTableWithAccessibleViews({ |
|
|
|
tableId: ncTblList.list[i].id, |
|
|
|
tableId: ncTblList.list[i].id, |
|
|
|
user: syncDB.user, |
|
|
|
user: { ...syncDB.user, project_roles: { owner: true } }, |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
rtc.data.nestedLinks += await importLTARData({ |
|
|
|
rtc.data.nestedLinks += await importLTARData({ |
|
|
|