You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2020/10/03 06:57:09 UTC

[incubator-streampipes] branch STREAMPIPES-234 updated: Add delete functionality for label categories

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

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


The following commit(s) were added to refs/heads/STREAMPIPES-234 by this push:
     new 420c1c3  Add delete functionality for label categories
420c1c3 is described below

commit 420c1c3e90866c35dca8b9d72ca7c8ac3e639d8a
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Sat Oct 3 08:56:35 2020 +0200

    Add delete functionality for label categories
---
 .../components/configure-labels/configure-labels.component.html      | 4 +---
 .../labels/components/configure-labels/configure-labels.component.ts | 5 +++++
 .../labels/components/label-list-item/label-list-item.component.ts   | 2 +-
 3 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.html b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.html
index ac6b21c..fe76cba 100644
--- a/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.html
+++ b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.html
@@ -26,9 +26,7 @@
                 <mat-label>Category Name</mat-label>
                 <input matInput type="text" [(ngModel)]="selectedCategory.name">
             </mat-form-field>
-            <button mat-button mat-flat-button color="warn" (click)="addCategory()">
-                <mat-icon class="icon">delete</mat-icon>
-            </button>
+            <mat-icon  style="cursor: pointer;" matTooltip="Delete label category" (click)="deleteCategory()" class="icon">delete</mat-icon>
         </div>
         <div fxLayout="column" fxLayoutAlign="center stretch">
             <sp-label-list-item
diff --git a/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.ts b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.ts
index c4b0584..8025a67 100644
--- a/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.ts
+++ b/ui/src/app/core-ui/labels/components/configure-labels/configure-labels.component.ts
@@ -43,6 +43,11 @@ export class ConfigureLabelsComponent implements OnInit {
     this.editCategory = true;
   }
 
+  deleteCategory() {
+    this.categories = this.categories.filter(obj => obj !== this.selectedCategory);
+    this.endEditCategory();
+  }
+
   addLabel() {
     const label = new Label();
     label.name = '';
diff --git a/ui/src/app/core-ui/labels/components/label-list-item/label-list-item.component.ts b/ui/src/app/core-ui/labels/components/label-list-item/label-list-item.component.ts
index be5678b..3b2bfe9 100644
--- a/ui/src/app/core-ui/labels/components/label-list-item/label-list-item.component.ts
+++ b/ui/src/app/core-ui/labels/components/label-list-item/label-list-item.component.ts
@@ -8,7 +8,7 @@ import { Label } from '../../../../core-model/gen/streampipes-model';
 })
 export class LabelListItemComponent implements OnInit {
 
-  @Input
+  @Input()
   label: Label;
 
   @Output() removeLabel = new EventEmitter<Label>();