Skip to content

Commit

Permalink
let NaryMapping selection account for property scope
Browse files Browse the repository at this point in the history
  • Loading branch information
muyangye committed Sep 30, 2023
1 parent 4e27123 commit 83d386c
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 83d386c

Please sign in to comment.