Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return () => {
this.dirtyList.setDirty(parent.getOid());
this.setCurrentObjectsDirty();
clearCacheIfNecessary();
};
}
if (parent instanceof Ro.CollectionRepresentation) {
return () => {
const selfLink = parent.selfLink();
const oid = Ro.ObjectIdWrapper.fromLink(selfLink, this.keySeparator);
this.dirtyList.setDirty(oid);
this.setCurrentObjectsDirty();
clearCacheIfNecessary();
};
}
if (parent instanceof Ro.CollectionMember) {
return () => {
const memberParent = parent.parent;
if (memberParent instanceof Ro.DomainObjectRepresentation) {
this.dirtyList.setDirty(memberParent.getOid());
}
this.setCurrentObjectsDirty();
clearCacheIfNecessary();
};
}
if (parent instanceof Ro.ListRepresentation && parms) {
const ccaParm = find(action.parameters(), p => p.isCollectionContributed());
const ccaId = ccaParm ? ccaParm.id() : null;
const ccaValue = ccaId ? parms[ccaId] : null;
// this should always be true
constructor(
public readonly id: string,
propertyRep?: Ro.PropertyMember | Ro.CollectionMember,
mask?: MaskService
) {
if (propertyRep && mask) {
this.title = propertyRep.extensions().friendlyName();
if (propertyRep instanceof Ro.CollectionMember) {
const size = propertyRep.size();
this.formattedValue = Helpers.getCollectionDetails(size);
this.value = '';
this.type = 'scalar';
this.returnType = 'string';
}
if (propertyRep instanceof Ro.PropertyMember) {
const isPassword = propertyRep.extensions().dataType() === 'password';
const value = propertyRep.value();
this.returnType = propertyRep.extensions().returnType()!;
if (propertyRep.isScalar()) {
this.type = 'scalar';
Helpers.setScalarValueInView(this, propertyRep, value);