Skip to content

Commit

Permalink
fix(ui): More concise "labels as array" handling
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-mulier-p authored and loicmathieu committed Jul 13, 2023
1 parent ae74c1b commit 44ecc27
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ui/src/components/layout/Labels.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
// if we align both of them this can be removed
mounted() {
if (Array.isArray(this.labels)) {
const labelMap = {};
this.labels.forEach(label => labelMap[label.key] = label.value)
this.labelMap = labelMap;
this.labelMap = Object.fromEntries(this.labels.map(label => [label.key, label.value]))
} else {
this.labelMap = this.labels;
}
Expand Down

0 comments on commit 44ecc27

Please sign in to comment.