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 2020/04/12 14:56:48 UTC

[incubator-streampipes] branch dev updated: Pipeline editor: Clear pipeline element filter when element type is changed

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


The following commit(s) were added to refs/heads/dev by this push:
     new 7434684  Pipeline editor: Clear pipeline element filter when element type is changed
7434684 is described below

commit 743468497a30811a3d3eeb0ab4848f0fa66de7e7
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Sun Apr 12 16:57:41 2020 +0200

    Pipeline editor: Clear pipeline element filter when element type is changed
---
 .../pipeline-element-icon-stand.component.ts       |  3 ++-
 .../pipeline-element-icon-stand.controller.ts      | 10 ++++++---
 .../pipeline-element-icon-stand.tmpl.html          |  4 ++--
 ui/src/app/editor/editor.controller.ts             | 24 ++++++++++++++--------
 ui/src/app/editor/editor.html                      |  4 +++-
 5 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.component.ts b/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.component.ts
index 59033bb..02195cf 100644
--- a/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.component.ts
+++ b/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.component.ts
@@ -24,7 +24,8 @@ export let PipelineElementIconStandComponent = {
     template: require('./pipeline-element-icon-stand.tmpl.html'),
     bindings: {
        currentElements: "=",
-       activeType: "="
+       activeType: "=",
+       elementFilter: "="
     },
     controller: PipelineElementIconStandController,
     controllerAs: 'ctrl'
diff --git a/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.controller.ts b/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.controller.ts
index 1b58d3f..1b6a709 100644
--- a/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.controller.ts
+++ b/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.controller.ts
@@ -18,19 +18,23 @@
 
 import * as angular from 'angular';
 
+import {RestApi} from "../../../services/rest-api.service";
+import {EditorDialogManager} from "../../services/editor-dialog-manager.service";
+
 export class PipelineElementIconStandController {
 
-    RestApi: any;
+    RestApi: RestApi;
     availableOptions: any;
     selectedOptions: any;
     options: any;
     activeType: any;
     currentElementName: any;
-    EditorDialogManager: any;
+    EditorDialogManager: EditorDialogManager;
     currentElements: any;
     $scope: any;
+    elementFilter: string;
 
-    constructor($scope, $rootScope, RestApi, EditorDialogManager) {
+    constructor($scope, $rootScope, RestApi: RestApi, EditorDialogManager: EditorDialogManager) {
         this.RestApi = RestApi;
         this.availableOptions = [];
         this.selectedOptions = [];
diff --git a/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.tmpl.html b/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.tmpl.html
index 3353410..f6d076e 100644
--- a/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.tmpl.html
+++ b/ui/src/app/editor/components/pipeline-element-icon-stand/pipeline-element-icon-stand.tmpl.html
@@ -22,7 +22,7 @@
         <div layout-align="start center" layout="row">
             <div layout="row" style="margin-right: 5px">
                 <md-icon md-svg-icon="action:ic_search_24px" class="sp-accent"></md-icon>
-                <input type="text" ng-model="ctrl.elName" placeholder="Find Element"
+                <input type="text" ng-model="ctrl.elementFilter" placeholder="Find Element"
                        style="background-color:#f6f6f6;border: none;border-bottom: solid 2px rgb(27, 20, 100);">&nbsp;
             </div>
             <div layout="row">
@@ -68,7 +68,7 @@
     <!-- selectFilter:ctrl.selectedOptions | -->
     <span id="{{ element.name }}" ng-mouseover="ctrl.updateMouseOver(element.name)"
           ng-mouseleave="ctrl.updateMouseOver('')"
-          ng-repeat="element in ctrl.currentElements |  selectFilter:ctrl.selectedOptions | elementNameFilter:ctrl.elName | orderBy: 'name'"
+          ng-repeat="element in ctrl.currentElements |  selectFilter:ctrl.selectedOptions | elementNameFilter:ctrl.elementFilter | orderBy: 'name'"
           my-data-bind class="draggable-icon tt"
           ng-class="element.type">
         <span id="container" style="position:relative;display:block;width:80px;height:80px;">
diff --git a/ui/src/app/editor/editor.controller.ts b/ui/src/app/editor/editor.controller.ts
index 320efa0..22b3713 100644
--- a/ui/src/app/editor/editor.controller.ts
+++ b/ui/src/app/editor/editor.controller.ts
@@ -18,15 +18,19 @@
 
 import * as angular from 'angular';
 import {AuthStatusService} from "../services/auth-status.service";
+import {RestApi} from "../services/rest-api.service";
+import {ShepherdService} from "../services/tour/shepherd.service";
+import {JsplumbBridge} from "../services/jsplumb-bridge.service";
+import {EditorDialogManager} from "./services/editor-dialog-manager.service";
 
 export class EditorCtrl {
 
     $rootScope: any;
-    RestApi: any;
+    RestApi: RestApi;
     $stateParams: any;
     $window: any;
-    JsplumbBridge: any;
-    EditorDialogManager: any;
+    JsplumbBridge: JsplumbBridge;
+    EditorDialogManager: EditorDialogManager;
     AuthStatusService: AuthStatusService;
     currentElements: any;
     allElements: any;
@@ -37,8 +41,9 @@ export class EditorCtrl {
     activeType: any;
     tabs: any;
     currentlyFocusedElement: any;
-    ShepherdService: any;
+    ShepherdService: ShepherdService;
     isTutorialOpen: boolean = false;
+    elementFilter: string;
 
     requiredStreamForTutorialAppId: any = "org.apache.streampipes.sources.simulator.flowrate1";
     requiredProcessorForTutorialAppId: any = "org.apache.streampipes.processors.filters.jvm.numericalfilter";
@@ -46,13 +51,13 @@ export class EditorCtrl {
     missingElementsForTutorial: any = [];
 
     constructor($rootScope,
-                RestApi,
+                RestApi: RestApi,
                 $stateParams,
                 $window,
-                JsplumbBridge,
-                EditorDialogManager,
-                AuthStatusService,
-                ShepherdService) {
+                JsplumbBridge: JsplumbBridge,
+                EditorDialogManager: EditorDialogManager,
+                AuthStatusService: AuthStatusService,
+                ShepherdService: ShepherdService) {
 
         this.$rootScope = $rootScope;
         this.RestApi = RestApi;
@@ -195,6 +200,7 @@ export class EditorCtrl {
 
     loadCurrentElements(type) {
         this.currentElements = this.allElements[type];
+        this.elementFilter = "";
         this.activeType = type;
         this.ShepherdService.trigger("select-" +type);
     }
diff --git a/ui/src/app/editor/editor.html b/ui/src/app/editor/editor.html
index 8a85a20..6dfaf1b 100644
--- a/ui/src/app/editor/editor.html
+++ b/ui/src/app/editor/editor.html
@@ -62,7 +62,9 @@
         <div id="shepherd-test" ng-show="!ctrl.minimizedEditorStand"
              style="background-color:#f6f6f6;padding:0px;border-bottom:1px solid #ffffff">
             <pipeline-element-icon-stand active-type="ctrl.activeType"
-                                         current-elements="ctrl.currentElements"></pipeline-element-icon-stand>
+                                         current-elements="ctrl.currentElements"
+                                         element-filter="ctrl.elementFilter">
+            </pipeline-element-icon-stand>
         </div>
     </div>
     <pipeline-assembly raw-pipeline-model="ctrl.rawPipelineModel" all-elements="ctrl.allElements"