Skip to content

Commit 6d5093f

Browse files
sofyenneexo-swf
authored andcommitted
feat: Add the ability to open activity/people search results in a new tab - MEED-9241 - Meeds-io/MIPs#193 (#4895)
1 parent 10d6a9d commit 6d5093f

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

webapp/src/main/webapp/vue-apps/search-activity/components/SearchActivityCard.vue

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
flat
55
class="pa-0"
66
:aria-label="$t('search.access.to.result', {0 :excerptText || activityTitle})"
7-
@click="openActivity">
7+
:href="link">
88
<v-list class="pa-0" :class="hover && 'light-grey-background-color no-border-radius' || ''">
99
<v-list-item>
1010
<v-list-item-icon class="me-2">
@@ -15,16 +15,17 @@
1515

1616
<v-list-item-content>
1717
<v-list-item-title class="d-flex flex-row full-width align-center">
18-
<p
18+
<h1
1919
class="flex-grow-1 title pt-1 mb-0 ps-0 my-auto align-center text-start text-truncate"
20-
v-sanitized-html="activityTitle"></p>
20+
:aria-label="activityTitleText"
21+
v-sanitized-html="activityTitle"></h1>
2122
<div v-show="hover || isMobile" class="ml-2 pt-1">
2223
<span class="d-inline-flex align-center justify-center">
2324
<v-btn
2425
icon
2526
small
2627
class="me-2"
27-
@click.stop="openActivityCommentDrawer">
28+
@click.stop.prevent="openActivityCommentDrawer">
2829
<v-icon class="icon-default-color" size="16">
2930
fas fa-comment
3031
</v-icon>
@@ -33,7 +34,7 @@
3334
icon
3435
small
3536
class="me-2"
36-
@click.stop="openKudosForm">
37+
@click.stop.prevent="openKudosForm">
3738
<v-icon class="icon-default-color" size="16">
3839
fas fa-award
3940
</v-icon>
@@ -188,6 +189,9 @@ export default {
188189
activityTitle() {
189190
return this.excerptHtml || this.$t('search.activity.no.title.label');
190191
},
192+
activityTitleText() {
193+
return $('<div />').html(this.activityTitle).text();
194+
},
191195
isMobile() {
192196
return this.$vuetify?.breakpoint?.smAndDown;
193197
},
@@ -233,11 +237,6 @@ export default {
233237
this.$root.activityBaseLink = this.activityBaseLink;
234238
},
235239
methods: {
236-
openActivity() {
237-
if (this.link) {
238-
window.location.href = this.link;
239-
}
240-
},
241240
refreshActivityTypes() {
242241
const extensions = extensionRegistry.loadExtensions(this.extensionApp, this.activityTypeExtensionName);
243242
let changed = false;

webapp/src/main/webapp/vue-apps/search-people/components/SearchPeopleCard.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<template>
22
<v-hover v-slot="{ hover }">
33
<v-card
4-
@click="openUserProfile()"
54
class="border-box-sizing fill-height"
65
width="350"
76
:height="80"
87
:min-height="80"
98
:max-height="80"
109
:elevation="hover && 3 || 0"
10+
:href="userProfileUrl"
1111
outlined
1212
flat
1313
rounded>
@@ -42,16 +42,16 @@ export default {
4242
isMobile() {
4343
return this.$vuetify.breakpoint.mobile;
4444
},
45+
userProfileUrl() {
46+
if (this.result?.username) {
47+
return `${eXo.env.portal.context}/${eXo.env.portal.metaPortalName}/profile/${this.result.username}`;
48+
} else {
49+
return '#';
50+
}
51+
}
4552
},
4653
created() {
4754
this.profileActionExtensions = extensionRegistry.loadExtensions('profile-extension', 'action') || [];
4855
},
49-
methods: {
50-
openUserProfile() {
51-
if (this.result?.username) {
52-
window.location.href = `${eXo.env.portal.context}/${eXo.env.portal.metaPortalName}/profile/${this.result.username}`;
53-
}
54-
}
55-
}
5656
};
5757
</script>

webapp/src/main/webapp/vue-apps/search/components/SearchResultCardGroup.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535

3636
<v-list-item-content>
3737
<v-list-item-title class="d-flex flex-row full-width align-center pt-2">
38-
<p
39-
class="flex-grow-1 title pt-1 mb-0 ps-0 my-auto align-center text-start text-truncate"
40-
v-sanitized-html="connectorName">
41-
</p>
38+
<h1
39+
class="flex-grow-1 title pt-1 mb-0 ps-0 my-auto align-center text-start text-truncate">
40+
{{ connectorName }}
41+
</h1>
4242
</v-list-item-title>
4343

4444
<card-carousel class="d-flex">

0 commit comments

Comments
 (0)