return changeSelection[disValue] === true;
}
+ copyChangePermitted(copy: IdlObject, field: string,
+ value: any) : boolean {
+ switch(field){
+ case 'status': {
+ return this.statusEditable([copy]) &&
+ !this.volcopy.copyStatIsMagic(value);
+ }
+ case 'alert_message': {
+ return false;
+ }
+ default: {
+ return true;
+ }
+ }
+ }
+
applyCopyValue(field: string, value?: any, changeSelection?: BatchChangeSelection) {
if (value === undefined) {
value = this.values[field];
!this.copyWantsChange(copy, field, changeSelection)) {
return;
}
+
+ // prevent certain changes from going through
+ if(!this.copyChangePermitted(copy, field, value)){
+ return;
+ }
copy[field](value);
copy.ischanged(true);
return def ? def.label : '';
}
- // Returns false if any items are in magic statuses
- statusEditable(): boolean {
- const copies = this.context.copyList();
- for (let idx = 0; idx < copies.length; idx++) {
- if (this.volcopy.copyStatIsMagic(copies[idx].status())) {
- return false;
- }
- }
+ // Returns false if status is in magic statuses
+ statusEditable(c?: IdlObject[]): boolean {
+ if(c === undefined || !c.length)
+ c = this.context.copyList();
+ for (let idx = 0; idx < c.length; idx++) {
+ if (this.volcopy.copyStatIsMagic(c[idx].status())) {
+ return false;
+ }
+ }
return true;
}