From 9e5fdc3cdb12e291c1c240dbaaa09841853a075f Mon Sep 17 00:00:00 2001 From: Leaf Date: Mon, 2 Oct 2023 01:12:06 -0700 Subject: [PATCH] [#1879] Inject DisplayRecommendedPipe to NaryMappingProperty (#1981) * implement new round processor * add English locale, icon, and documentation * fix checkstyle * support different rounding modes * add rounding mode in documentation * fix time display * let NaryMapping selection account for property scope --- .../static-mapping-nary.component.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/ui/src/app/core-ui/static-properties/static-mapping-nary/static-mapping-nary.component.ts b/ui/src/app/core-ui/static-properties/static-mapping-nary/static-mapping-nary.component.ts index 42b6208d97..98e9c80447 100644 --- a/ui/src/app/core-ui/static-properties/static-mapping-nary/static-mapping-nary.component.ts +++ b/ui/src/app/core-ui/static-properties/static-mapping-nary/static-mapping-nary.component.ts @@ -19,6 +19,7 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { StaticMappingComponent } from '../static-mapping/static-mapping'; import { MappingPropertyNary } from '@streampipes/platform-services'; +import { DisplayRecommendedPipe } from '../filter/display-recommended.pipe'; @Component({ selector: 'sp-app-static-mapping-nary', @@ -31,7 +32,7 @@ export class StaticMappingNaryComponent { @Output() inputEmitter: EventEmitter = new EventEmitter(); - constructor() { + constructor(private displayRecommendedPipe: DisplayRecommendedPipe) { super(); } @@ -40,7 +41,12 @@ export class StaticMappingNaryComponent if (!this.staticProperty.selectedProperties) { this.selectNone(); } else { - this.availableProperties.forEach(ep => { + let recommendedProperties = this.displayRecommendedPipe.transform( + this.availableProperties, + this.staticProperty.propertyScope, + this.displayRecommended, + ); + recommendedProperties.forEach(ep => { if ( this.staticProperty.selectedProperties.indexOf( ep.propertySelector, @@ -85,7 +91,12 @@ export class StaticMappingNaryComponent selectAll() { this.selectNone(); - this.availableProperties.forEach(ep => { + let recommendedProperties = this.displayRecommendedPipe.transform( + this.availableProperties, + this.staticProperty.propertyScope, + this.displayRecommended, + ); + recommendedProperties.forEach(ep => { ep['checked'] = true; this.addProperty(ep); });