diff --git a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html index 4cdaed942d..fbef717692 100644 --- a/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html +++ b/ui-ngx/src/app/modules/home/pages/rulechain/rulechain-page.component.html @@ -30,7 +30,7 @@ fxLayout="column"> - + + settings_ethernet + {{ruleChain?.name}} + + {{ruleChain.name}} diff --git a/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.scss b/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.scss index c538da5725..6221000d64 100644 --- a/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.scss +++ b/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.scss @@ -22,5 +22,18 @@ height: 48px; min-height: 100%; pointer-events: all; + + &-trigger { + &-text { + max-width: 190px; + text-overflow: ellipsis; + overflow: hidden; + } + &-icon { + display: flex; + width: 36px; + justify-content: center; + } + } } } diff --git a/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.ts b/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.ts index 003d85b751..a4c2dbcc7b 100644 --- a/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.ts +++ b/ui-ngx/src/app/shared/components/rule-chain/rule-chain-select.component.ts @@ -57,7 +57,9 @@ export class RuleChainSelectComponent implements ControlValueAccessor, OnInit { ruleChains$: Observable>; - 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> {