Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((object: Ro.DomainObjectRepresentation) => {
// only change the object property if the object has changed
if (isChanging || wasDirty) {
this.object = this.viewModelFactory.domainObjectViewModel(object, routeData, wasDirty);
}
if (modeChanging || isChanging || wasDirty) {
if (this.mode === InteractionMode.Edit ||
this.mode === InteractionMode.Form ||
this.mode === InteractionMode.Transient) {
this.createForm(this.object!); // will never be null
}
}
})
.catch((reject: ErrorWrapper) => {
}
return null;
};
const sav = selfAsValue();
this.value = sav ? sav.toString() : '';
this.reference = sav ? sav.toValueString() : '';
this.selectedChoice = sav ? new ChoiceViewModel(sav, '') : null;
this.colorService.toColorNumberFromType(this.domainObject.domainType())
.then(c => this.color = `${this.configService.config.objectColor}${c}`)
.catch((reject: ErrorWrapper) => this.error.handleError(reject));
this.resetMessage();
if (routeData.interactionMode === InteractionMode.Form) {
forEach(this.actions, a => this.wrapAction(a));
}
}
private readonly showDialog = () => this.actionRep.extensions().hasParams() && (this.routeData.interactionMode !== InteractionMode.Form);