@@ -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