@Input() permFilter: string;
// Limit copy locations to those owned at or above this org unit.
- @Input() contextOrgId: number;
+ private _contextOrgId: number;
+ @Input() set contextOrgId(value: number) {
+ this._contextOrgId = value;
+ this.ngOnInit();
+ }
@Input() orgUnitLabelField = 'shortname';
}
setFilterOrgs(): Promise<number[]> {
- const org = this.contextOrgId || this.auth.user().ws_ou();
+ const org = this._contextOrgId || this.auth.user().ws_ou();
const contextOrgIds = this.org.ancestors(org, true);
if (!this.permFilter) {
</div>
<div class="col-sm-2">
<eg-item-location-select
- permFilter="ADMIN_ACQ_DISTRIB_FORMULA"
+ permFilter="ADMIN_ACQ_DISTRIB_FORMULA" [contextOrgId]="entry.owning_lib()"
[ngModel]="entry.location()" name="location-{{idx}}"
(ngModelChange)="entry.location($event)"
(valueChange)="myForm.form.markAsDirty()">