Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make tagged project names clickable #923

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/views/administration/accessmanagement/SelectProjectModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import xssFilters from 'xss-filters';
import permissionsMixin from '../../../mixins/permissionsMixin';
import common from '../../../shared/common';
import { Switch as cSwitch } from '@coreui/vue';
import router from '@/router';

export default {
mixins: [permissionsMixin],
Expand All @@ -70,16 +71,20 @@ export default {
title: this.$t('message.project_name'),
field: 'name',
sortable: true,
formatter(value, row, index) {
let url = xssFilters.uriInUnQuotedAttr('../projects/' + row.uuid);
return `<a href="${url}">${xssFilters.inHTMLData(value)}</a>`;
formatter(value, row) {
// TODO: Close modal when link is clicked.
const href = router.resolve({
name: 'Project',
params: { uuid: row.uuid },
}).href;
return `<a href="${href}">${xssFilters.inHTMLData(value)}</a>`;
},
},
{
title: this.$t('message.version'),
field: 'version',
sortable: true,
formatter(value, row, index) {
formatter(value) {
return xssFilters.inHTMLData(common.valueWithDefault(value, ''));
},
},
Expand Down
10 changes: 8 additions & 2 deletions src/views/portfolio/tags/TaggedProjectListModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import xssFilters from 'xss-filters';
import permissionsMixin from '../../../mixins/permissionsMixin';
import common from '../../../shared/common';
import router from '@/router';

export default {
props: {
Expand Down Expand Up @@ -56,8 +57,13 @@ export default {
title: this.$t('message.name'),
field: 'name',
sortable: true,
formatter(value) {
return xssFilters.inHTMLData(common.valueWithDefault(value, ''));
formatter: (value, row) => {
// TODO: Close modal when link is clicked.
const href = router.resolve({
name: 'Project',
params: { uuid: row.uuid },
}).href;
return `<a href="${href}">${xssFilters.inHTMLData(value)}</a>`;
},
},
{
Expand Down
Loading