|
|
|
@ -57,7 +57,9 @@ export class RuleChainSelectComponent implements ControlValueAccessor, OnInit { |
|
|
|
|
|
|
|
ruleChains$: Observable<Array<RuleChain>>; |
|
|
|
|
|
|
|
ruleChainId: string | null; |
|
|
|
ruleChain: RuleChain; |
|
|
|
|
|
|
|
selected: any; |
|
|
|
|
|
|
|
private propagateChange = (v: any) => { }; |
|
|
|
|
|
|
|
@ -76,6 +78,10 @@ export class RuleChainSelectComponent implements ControlValueAccessor, OnInit { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
public compareWith(object1: any, object2: any) { |
|
|
|
return object1 && object2 && object1.id.id === object2.id.id; |
|
|
|
} |
|
|
|
|
|
|
|
registerOnChange(fn: any): void { |
|
|
|
this.propagateChange = fn; |
|
|
|
} |
|
|
|
@ -90,16 +96,21 @@ export class RuleChainSelectComponent implements ControlValueAccessor, OnInit { |
|
|
|
|
|
|
|
writeValue(value: string | null): void { |
|
|
|
if (isDefinedAndNotNull(value)) { |
|
|
|
this.ruleChainId = value; |
|
|
|
this.ruleChainService.getRuleChain(value) |
|
|
|
.subscribe(ruleChain => this.ruleChain = ruleChain); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
getname() { |
|
|
|
return this.ruleChain?.name; |
|
|
|
} |
|
|
|
|
|
|
|
ruleChainIdChanged() { |
|
|
|
this.updateView(); |
|
|
|
} |
|
|
|
|
|
|
|
private updateView() { |
|
|
|
this.propagateChange(this.ruleChainId); |
|
|
|
this.propagateChange(this.ruleChain.id.id); |
|
|
|
} |
|
|
|
|
|
|
|
private getRuleChains(pageLink: PageLink): Observable<PageData<RuleChain>> { |
|
|
|
|