Skip to content

Commit

Permalink
[#1879] Inject DisplayRecommendedPipe to NaryMappingProperty (#1981)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
muyangye authored Oct 2, 2023
1 parent 5132886 commit 9e5fdc3
Showing 1 changed file with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -31,7 +32,7 @@ export class StaticMappingNaryComponent
{
@Output() inputEmitter: EventEmitter<boolean> = new EventEmitter<boolean>();

constructor() {
constructor(private displayRecommendedPipe: DisplayRecommendedPipe) {
super();
}

Expand All @@ -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,
Expand Down Expand Up @@ -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);
});
Expand Down

0 comments on commit 9e5fdc3

Please sign in to comment.