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

riemer pushed a commit to branch fix-label-deletion-asset-view
in repository https://gitbox.apache.org/repos/asf/streampipes.git

commit 6ff9b44d1740ce46cb406c6405c96d50d9665298
Author: Dominik Riemer <[email protected]>
AuthorDate: Wed Nov 26 13:24:50 2025 +0100

    fix: Properly handle deleted labels in asset view
---
 .../asset-details-labels/asset-details-labels.component.ts     | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts
 
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts
index cc011338df..e241244732 100644
--- 
a/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts
+++ 
b/ui/src/app/assets/components/asset-details/edit-asset/asset-details-panel/asset-details-basics/asset-details-labels/asset-details-labels.component.ts
@@ -78,10 +78,6 @@ export class AssetDetailsLabelsComponent implements OnInit, 
OnChanges {
                             label.color,
                         )),
             );
-            this.asset.labelIds =
-                this.asset.labelIds?.filter(id =>
-                    this.allLabels.find(l => l._id === id),
-                ) || [];
             this.refreshCurrentLabels();
             this.labelsAvailable = true;
             this.updateFilteredLabels();
@@ -95,6 +91,10 @@ export class AssetDetailsLabelsComponent implements OnInit, 
OnChanges {
 
     refreshCurrentLabels(): void {
         this.asset.labelIds ??= [];
+        this.asset.labelIds =
+            this.asset.labelIds?.filter(id =>
+                this.allLabels.find(l => l._id === id),
+            ) || [];
         this.labels =
             this.asset.labelIds?.map(id =>
                 this.allLabels.find(l => l._id === id),
@@ -102,7 +102,7 @@ export class AssetDetailsLabelsComponent implements OnInit, 
OnChanges {
     }
 
     ngOnChanges(changes: SimpleChanges) {
-        if (changes['asset']) {
+        if (changes['asset'] && this.labelsAvailable) {
             this.refreshCurrentLabels();
             this.updateFilteredLabels();
         }

Reply via email to