Skip to content

Commit eab6885

Browse files
AzmiTouilJihed525
authored andcommitted
fix: Fix CTA of notification setup automatic action - MEED-9256 - Meeds-io/meeds#3385 (#1903)
This PR will fix CTA of notification setup automatic action (cherry picked from commit 4e59948)
1 parent cf1944b commit eab6885

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

portlets/src/main/resources/locale/portlet/Challenges_en.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,7 @@ gamification.event.display.doItNow=Do it now!
562562
gamification.event.display.goThere=Go there
563563
gamification.event.display.yourProfile=Your Profile
564564
gamification.event.display.connectWithOthers=Connect with others
565+
gamification.event.display.profileNotificationSettingAdded=Update Settings
565566
gamification.event.display.joinSpaces=Join spaces
566567
gamification.event.display.browseActivities=Browse Activities
567568
gamification.event.display.connectAccount=Connect Account

portlets/src/main/webapp/vue-app/connector-events-extensions/components/profile/ProfileEvent.vue

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,54 @@ export default {
4747
default: false
4848
}
4949
},
50+
data() {
51+
return {
52+
eventTypes: {
53+
NOTIFICATION_SETTING: ['addUserProfileNotificationSetting'],
54+
RELATIONSHIP: ['receiveRelationshipRequest', 'sendRelationshipRequest'],
55+
},
56+
};
57+
},
5058
computed: {
51-
isProfileEvent() {
52-
return !['receiveRelationshipRequest', 'sendRelationshipRequest'].includes(this.trigger);
59+
eventType() {
60+
if (this.eventTypes.NOTIFICATION_SETTING.includes(this.trigger)) {
61+
return 'NOTIFICATION_SETTING';
62+
}
63+
if (this.eventTypes.RELATIONSHIP.includes(this.trigger)) {
64+
return 'RELATIONSHIP';
65+
}
66+
return 'PROFILE';
5367
},
5468
profileLink() {
5569
return `${eXo.env.portal.context}/${eXo.env.portal.portalName}/profile/${eXo.env.portal.userName}`;
5670
},
5771
peopleLink() {
5872
return `${eXo.env.portal.context}/${eXo.env.portal.portalName}/people`;
5973
},
74+
userNotificationSettingLink() {
75+
return `${eXo.env.portal.context}/${eXo.env.portal.portalName}/settings#notifications`;
76+
},
77+
eventConfig() {
78+
return {
79+
NOTIFICATION_SETTING: {
80+
button: this.$t('gamification.event.display.profileNotificationSettingAdded'),
81+
link: this.userNotificationSettingLink
82+
},
83+
RELATIONSHIP: {
84+
button: this.$t('gamification.event.display.connectWithOthers'),
85+
link: this.peopleLink
86+
},
87+
PROFILE: {
88+
button: this.$t('gamification.event.display.yourProfile'),
89+
link: this.profileLink
90+
}
91+
};
92+
},
6093
buttonLabel() {
61-
return this.isProfileEvent ? this.$t('gamification.event.display.yourProfile') : this.$t('gamification.event.display.connectWithOthers');
94+
return this.eventConfig[this.eventType].button;
6295
},
6396
buttonLink() {
64-
return this.isProfileEvent ? this.profileLink : this.peopleLink;
97+
return this.eventConfig[this.eventType].link;
6598
}
6699
}
67100
};

0 commit comments

Comments
 (0)