Skip to content

Commit

Permalink
Merge pull request #221 from DependencyTrack/port-Fix-tags-with-speci…
Browse files Browse the repository at this point in the history
…al-characters
  • Loading branch information
nscuro authored Jan 27, 2025
2 parents 2080c63 + f60fd51 commit 2152274
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 @@ -24,6 +24,8 @@ import TaggedPoliciesListModal from '@/views/portfolio/tags/TaggedPoliciesListMo
import TaggedProjectListModal from '@/views/portfolio/tags/TaggedProjectListModal.vue';
import TaggedVulnerabilityListModal from '@/views/portfolio/tags/TaggedVulnerabilityListModal.vue';
import i18n from '@/i18n';
import MurmurHash2 from 'imurmurhash';
export default {
mixins: [bootstrapTableMixin, permissionsMixin, routerMixin],
components: {
Expand Down Expand Up @@ -229,7 +231,7 @@ export default {
},
buttonsOrder: ['btnDeleteSelected', 'refresh', 'columns'],
clickToSelect: true,
uniqueId: 'name',
uniqueId: 'nameHash',
search: true,
showColumns: true,
showRefresh: true,
Expand All @@ -246,6 +248,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 2152274

Please sign in to comment.