Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
focus(parms: QueryList) {
if (this.mode == null || this.mode === InteractionMode.View) {
return;
}
if (parms && parms.length > 0) {
some(parms.toArray(), p => p.focus());
}
}
return this.returnResult('', '', () => this.urlManager.setInteractionMode(InteractionMode.View));
}
private readonly cancelHandler = () => this.isFormOrTransient() ? () => this.urlManager.popUrlState(this.onPaneId) : () => this.urlManager.setInteractionMode(InteractionMode.View, this.onPaneId);
private reset(obj: Ro.DomainObjectRepresentation, routeData: PaneRouteData, resetting: boolean) {
this.domainObject = obj;
this.onPaneId = routeData.paneId;
this.routeData = routeData;
const iMode = this.domainObject.extensions().interactionMode();
this.isInEdit = routeData.interactionMode !== InteractionMode.View || iMode === 'form' || iMode === 'transient';
this.props = routeData.interactionMode !== InteractionMode.View ? this.contextService.getObjectCachedValues(this.domainObject.id(), routeData.paneId) : {};
const actions = values(this.domainObject.actionMembers()) as Ro.ActionMember[];
this.actions = map(actions, action => this.viewModelFactory.actionViewModel(action, this, this.routeData)).filter(avm => !avm.returnsScalar());
this.menuItems = Helpers.createMenuItems(this.actions);
this.properties = map(this.domainObject.propertyMembers(), (property, id) => this.viewModelFactory.propertyViewModel(property, id!, this.props[id!], this.onPaneId, this.propertyMap));
this.collections = map(this.domainObject.collectionMembers(), collection => this.viewModelFactory.collectionViewModel(collection, this.routeData, resetting));
this.unsaved = routeData.interactionMode === InteractionMode.Transient;
this.title = this.unsaved ? `Unsaved ${this.domainObject.extensions().friendlyName()}` : this.domainObject.title();
this.title = this.title + Helpers.dirtyMarker(this.contextService, this.configService, obj.getOid());
private handleError(err: Ro.ErrorMap, obj: Ro.DomainObjectRepresentation) {
if (err.containsError()) {
const propFriendlyName = (propId: string) => Ro.friendlyNameForProperty(obj, propId);
this.handleErrorResponse(err, propFriendlyName);
} else {
this.urlManager.setInteractionMode(InteractionMode.View);
}
}
}
private reset(obj: Ro.DomainObjectRepresentation, routeData: PaneRouteData, resetting: boolean) {
this.domainObject = obj;
this.onPaneId = routeData.paneId;
this.routeData = routeData;
const iMode = this.domainObject.extensions().interactionMode();
this.isInEdit = routeData.interactionMode !== InteractionMode.View || iMode === 'form' || iMode === 'transient';
this.props = routeData.interactionMode !== InteractionMode.View ? this.contextService.getObjectCachedValues(this.domainObject.id(), routeData.paneId) : {};
const actions = values(this.domainObject.actionMembers()) as Ro.ActionMember[];
this.actions = map(actions, action => this.viewModelFactory.actionViewModel(action, this, this.routeData)).filter(avm => !avm.returnsScalar());
this.menuItems = Helpers.createMenuItems(this.actions);
this.properties = map(this.domainObject.propertyMembers(), (property, id) => this.viewModelFactory.propertyViewModel(property, id!, this.props[id!], this.onPaneId, this.propertyMap));
this.collections = map(this.domainObject.collectionMembers(), collection => this.viewModelFactory.collectionViewModel(collection, this.routeData, resetting));
this.unsaved = routeData.interactionMode === InteractionMode.Transient;
this.title = this.unsaved ? `Unsaved ${this.domainObject.extensions().friendlyName()}` : this.domainObject.title();
this.title = this.title + Helpers.dirtyMarker(this.contextService, this.configService, obj.getOid());
this.friendlyName = this.domainObject.extensions().friendlyName();