You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ri...@apache.org on 2022/01/19 19:58:43 UTC

[incubator-streampipes] 02/03: [hotfix] Show default properties if none match recommended filter

This is an automated email from the ASF dual-hosted git repository.

riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git

commit 99082e68a24ce8fc298c65b80e93474ab6d8c182
Author: Dominik Riemer <do...@gmail.com>
AuthorDate: Wed Jan 19 20:58:12 2022 +0100

    [hotfix] Show default properties if none match recommended filter
---
 .../filter/display-recommended.pipe.ts                  | 17 +++++++++--------
 .../static-mapping-unary.component.html                 |  1 -
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/ui/src/app/core-ui/static-properties/filter/display-recommended.pipe.ts b/ui/src/app/core-ui/static-properties/filter/display-recommended.pipe.ts
index 78695f3..3577b9e 100644
--- a/ui/src/app/core-ui/static-properties/filter/display-recommended.pipe.ts
+++ b/ui/src/app/core-ui/static-properties/filter/display-recommended.pipe.ts
@@ -16,17 +16,19 @@
  *
  */
 
-import {Pipe, PipeTransform} from "@angular/core";
-import {EventPropertyUnion} from "../../../core-model/gen/streampipes-model";
+import { Pipe, PipeTransform } from '@angular/core';
+import { EventPropertyUnion } from '../../../core-model/gen/streampipes-model';
 
 @Pipe({name: 'displayRecommendedPipe'})
 export class DisplayRecommendedPipe implements PipeTransform {
-  transform(properties: EventPropertyUnion[], propertyScope: string, displayRecommended: boolean): any {
-    var result = [];
+  transform(properties: EventPropertyUnion[],
+            propertyScope: string,
+            displayRecommended: boolean): any {
+    const result = [];
     if (!displayRecommended) {
       return properties;
     } else {
-      if (propertyScope === undefined || propertyScope === "NONE") {
+      if (propertyScope === undefined || propertyScope === 'NONE') {
         return properties;
       } else {
         properties.forEach(property => {
@@ -35,10 +37,9 @@ export class DisplayRecommendedPipe implements PipeTransform {
           }
         });
       }
-      return result;
+      return result.length > 0 ? result : properties;
     }
   }
 
 
-
-}
\ No newline at end of file
+}
diff --git a/ui/src/app/core-ui/static-properties/static-mapping-unary/static-mapping-unary.component.html b/ui/src/app/core-ui/static-properties/static-mapping-unary/static-mapping-unary.component.html
index 3b5e843..c91afe6 100644
--- a/ui/src/app/core-ui/static-properties/static-mapping-unary/static-mapping-unary.component.html
+++ b/ui/src/app/core-ui/static-properties/static-mapping-unary/static-mapping-unary.component.html
@@ -19,7 +19,6 @@
 <div [formGroup]="parentForm" id="formWrapper">
     <div fxFlex="100" fxLayout="row">
             <mat-form-field class="example-full-width" color="accent">
-                <!--<mat-form-field class="example-full-width">-->
                 <mat-select formControlName="{{fieldName}}" [placeholder]="staticProperty.label" [attr.data-cy]="fieldName">
                     <mat-option *ngFor="let property of availableProperties | displayRecommendedPipe: staticProperty.propertyScope: displayRecommended" [value]="property.propertySelector">
                         {{property.runtimeName}}