Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
protected setup(routeData: PaneRouteData) {
if (!routeData.objectId) {
return;
}
const oid = Ro.ObjectIdWrapper.fromObjectId(routeData.objectId, this.configService.config.keySeparator);
if (oid.domainType !== this.lastOid) {
this.lastOid = oid.domainType;
this.parent.clear();
this.customComponentService.getCustomComponent(this.lastOid, ViewType.Object).then((c: Type) => {
const childComponent = this.componentFactoryResolver.resolveComponentFactory(c);
this.parent.createComponent(childComponent);
});
}
}
constructor(
private readonly context: ContextService,
private readonly config: CustomComponentConfigService) {
this.customComponentCaches = [];
this.customComponentCaches[ViewType.Object] = new CustomComponentCache(context, ObjectComponent);
this.customComponentCaches[ViewType.List] = new CustomComponentCache(context, ListComponent);
this.customComponentCaches[ViewType.Error] = new CustomComponentCache(context, ErrorComponent);
config.configureCustomObjects(this.customComponentCaches[ViewType.Object]);
config.configureCustomLists(this.customComponentCaches[ViewType.List]);
config.configureCustomErrors(this);
}
private render() {
switch (this.lastPaneRouteData.location) {
case ViewType.Home:
return this.ciceroRendererService.renderHome(this.lastPaneRouteData);
case ViewType.Object:
return this.ciceroRendererService.renderObject(this.lastPaneRouteData);
case ViewType.List:
return this.ciceroRendererService.renderList(this.lastPaneRouteData);
default:
return this.ciceroRendererService.renderError('unknown render error');
}
}
constructor(
private readonly context: ContextService,
private readonly config: CustomComponentConfigService) {
this.customComponentCaches = [];
this.customComponentCaches[ViewType.Object] = new CustomComponentCache(context, ObjectComponent);
this.customComponentCaches[ViewType.List] = new CustomComponentCache(context, ListComponent);
this.customComponentCaches[ViewType.Error] = new CustomComponentCache(context, ErrorComponent);
config.configureCustomObjects(this.customComponentCaches[ViewType.Object]);
config.configureCustomLists(this.customComponentCaches[ViewType.List]);
config.configureCustomErrors(this);
}
component: HomeComponent,
canActivate: [AuthService],
data: { pane: 1, paneType: 'single' },
children: [
{ path: 'home', component: HomeComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'object', component: DynamicObjectComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'list', component: DynamicListComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'attachment', component: AttachmentComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'recent', component: RecentComponent, data: { pane: 2, paneType: 'split' } }
]
},
{
path: 'gemini/object',
component: DynamicObjectComponent,
canActivate: [AuthService],
data: { pane: 1, paneType: 'single', dynamicType: ViewType.Object },
children: [
{ path: 'home', component: HomeComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'object', component: DynamicObjectComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'list', component: DynamicListComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'attachment', component: AttachmentComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'recent', component: RecentComponent, data: { pane: 2, paneType: 'split' } }
]
},
{
path: 'gemini/list',
component: DynamicListComponent,
canActivate: [AuthService],
data: { pane: 1, paneType: 'single' },
children: [
{ path: 'home', component: HomeComponent, data: { pane: 2, paneType: 'split' } },
{ path: 'object', component: DynamicObjectComponent, data: { pane: 2, paneType: 'split' } },