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/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new 818dcd9754 fix: Properly handle deleted labels in asset view (#3970)
818dcd9754 is described below
commit 818dcd9754f86d5e5fa68e833923aadb5610e8b6
Author: Dominik Riemer <[email protected]>
AuthorDate: Wed Nov 26 14:50:34 2025 +0100
fix: Properly handle deleted labels in asset view (#3970)
Co-authored-by: Jacqueline Höllig
<[email protected]>
---
.../asset-details-labels/asset-details-labels.component.ts | 11 +++++------
1 file changed, 5 insertions(+), 6 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..d803cb774e 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();
@@ -94,7 +90,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 +101,7 @@ export class AssetDetailsLabelsComponent implements OnInit,
OnChanges {
}
ngOnChanges(changes: SimpleChanges) {
- if (changes['asset']) {
+ if (changes['asset'] && this.labelsAvailable) {
this.refreshCurrentLabels();
this.updateFilteredLabels();
}