Skip to content

Commit

Permalink
Fix tags with special characters breaking the tags table
Browse files Browse the repository at this point in the history
Fixes #1081

Signed-off-by: nscuro <[email protected]>
  • Loading branch information
nscuro committed Nov 10, 2024
1 parent 0244383 commit f359ed3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/views/portfolio/tags/TagList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import TaggedNotificationRuleListModal from '@/views/portfolio/tags/TaggedNotifi
import TaggedPoliciesListModal from '@/views/portfolio/tags/TaggedPoliciesListModal.vue';
import TaggedProjectListModal from '@/views/portfolio/tags/TaggedProjectListModal.vue';
import i18n from '@/i18n';
import MurmurHash2 from 'imurmurhash';
export default {
mixins: [bootstrapTableMixin, permissionsMixin, routerMixin],
components: {
Expand Down Expand Up @@ -195,7 +197,7 @@ export default {
},
buttonsOrder: ['btnDeleteSelected', 'refresh', 'columns'],
clickToSelect: true,
uniqueId: 'name',
uniqueId: 'nameHash',
search: true,
showColumns: true,
showRefresh: true,
Expand All @@ -212,6 +214,11 @@ export default {
refresh: 'fa-refresh',
},
responseHandler: function (res, xhr) {
for (let tag of res) {
// Tag names with special characters can break table rendering.
// https://github.com/DependencyTrack/dependency-track/issues/4357
tag.nameHash = MurmurHash2(tag.name).result();
}
res.total = xhr.getResponseHeader('X-Total-Count');
return res;
},
Expand Down

0 comments on commit f359ed3

Please sign in to comment.