Skip to content

Commit 8377370

Browse files
committed
Fix Project View Details display wrong tags
Previously the DTO was only updated, when it contains no tags and the project has tags. Because of this, the tags in the Modal didn't update, when switching between projects. Signed-off-by: Torsten Mehnert <[email protected]>
1 parent 1c24842 commit 8377370

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/views/portfolio/projects/ProjectDetailsModal.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<b-modal id="projectDetailsModal" size="md" hide-header-close no-stacking :title="$t('message.project_details')">
2+
<b-modal id="projectDetailsModal" size="md" hide-header-close no-stacking :title="$t('message.project_details')" @show="initializeTags">
33
<b-tabs class="body-bg-color" style="border:0;padding:0">
44
<b-tab class="body-bg-color" style="border:0;padding:0" active>
55
<template v-slot:title><i class="fa fa-edit"></i> {{ $t('message.general') }}</template>
@@ -125,13 +125,13 @@
125125
}
126126
},
127127
beforeUpdate() {
128-
if (this.tags.length === 0 && this.project && this.project.tags) { // Prevents line from being executed when entering new tags
129-
this.project.tags.forEach((tag) => this.tags.push({text: tag.name}));
130-
}
131128
this.readOnlyProjectName = this.project.name;
132129
this.readOnlyProjectVersion = this.project.version;
133130
},
134131
methods: {
132+
initializeTags: function() {
133+
this.tags = (this.project.tags || []).map(tag => ({ text: tag.name }));
134+
},
135135
syncReadOnlyNameField: function(value) {
136136
this.readOnlyProjectName = value;
137137
},

0 commit comments

Comments
 (0)