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 2021/05/17 20:03:13 UTC

[incubator-streampipes] branch dev updated: [hotfix] Avoid selection of internally managed adapters in installation overview

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 eedcf48  [hotfix] Avoid selection of internally managed adapters in installation overview
eedcf48 is described below

commit eedcf4889d03b71cd8e09c9306fc46c6dfa4754d
Author: Dominik Riemer <ri...@fzi.de>
AuthorDate: Mon May 17 22:03:00 2021 +0200

    [hotfix] Avoid selection of internally managed adapters in installation overview
---
 ui/src/app/add/add.component.ts                    | 22 +++++++++++++---------
 .../endpoint-item/endpoint-item.component.html     |  2 +-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/ui/src/app/add/add.component.ts b/ui/src/app/add/add.component.ts
index 38fca8d..7887dad 100644
--- a/ui/src/app/add/add.component.ts
+++ b/ui/src/app/add/add.component.ts
@@ -62,12 +62,14 @@ export class AddComponent implements OnInit {
     }
 
     toggleSelected(endpointItem) {
-        if (this.selectedEndpointItems.some(item => item === endpointItem.uri)) {
-            this.selectedEndpointItems.splice(this.selectedEndpointItems.indexOf(endpointItem.uri), 1);
-        } else {
-            this.selectedEndpointItems.push(endpointItem.uri);
+        if (endpointItem.editable) {
+            if (this.selectedEndpointItems.some(item => item === endpointItem.uri)) {
+                this.selectedEndpointItems.splice(this.selectedEndpointItems.indexOf(endpointItem.uri), 1);
+            } else {
+                this.selectedEndpointItems.push(endpointItem.uri);
+            }
+            endpointItem.selected = !endpointItem.selected;
         }
-        endpointItem.selected = !endpointItem.selected;
     }
 
     setSelectedTab(index: number) {
@@ -83,10 +85,12 @@ export class AddComponent implements OnInit {
     selectAll(selected) {
         this.selectedEndpointItems = [];
         this.endpointItems.forEach(item => {
-            if (item.type === this.selectedTab || this.selectedTab == 'all') {
-                item.selected = selected;
-                if (selected) {
-                    this.selectedEndpointItems.push(item.uri);
+            if (item.editable) {
+                if (item.type === this.selectedTab || this.selectedTab == 'all') {
+                    item.selected = selected;
+                    if (selected) {
+                        this.selectedEndpointItems.push(item.uri);
+                    }
                 }
             }
         });
diff --git a/ui/src/app/add/components/endpoint-item/endpoint-item.component.html b/ui/src/app/add/components/endpoint-item/endpoint-item.component.html
index 2689d12..dfa540e 100644
--- a/ui/src/app/add/components/endpoint-item/endpoint-item.component.html
+++ b/ui/src/app/add/components/endpoint-item/endpoint-item.component.html
@@ -17,7 +17,7 @@
   -->
 
 <div fxFlex="100" fxLayout="column" fxLayoutAlign="start start" class="pipeline-element-box"
-     style="padding:5px;margin-bottom:10px;background:{{getSelectedBackground()}}">
+     style="padding:5px;margin-bottom:10px;background:{{getSelectedBackground()}}" [ngStyle]="item.editable ? {opacity: 1} : {opacity: 0.5}">
     <div fxFlex fxLayout="row" style="width:100%;">
         <div style="margin-right:10px;margin-left:10px;margin-top:10px;">
             <div class="draggable-icon {{item.type}}">{{iconText(item.name)}}</div>