mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
feat(invites): provide link to inviting user in party notif
Also changes basic links sitewide to purple-300
This commit is contained in:
@@ -50,10 +50,7 @@ h3.markdown {
|
||||
}
|
||||
|
||||
a {
|
||||
color: $blue-10;
|
||||
|
||||
&:hover, &:active, &:focus {
|
||||
color: $blue-10;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,12 +26,11 @@ a:not([href]), a:not([href]):hover {
|
||||
|
||||
a, a:not([href]):not([tabindex]) {
|
||||
cursor: pointer;
|
||||
|
||||
&.standard-link {
|
||||
color: $blue-10;
|
||||
color: $purple-300;
|
||||
|
||||
&:hover, &:active, &:focus {
|
||||
text-decoration: underline;
|
||||
color: $purple-300;
|
||||
}
|
||||
|
||||
&[disabled="disabled"] {
|
||||
@@ -39,7 +38,6 @@ a, a:not([href]):not([tabindex]) {
|
||||
text-decoration: none;
|
||||
cursor: default;
|
||||
}
|
||||
}
|
||||
|
||||
&.small-link {
|
||||
font-size: 12px;
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
v-if="user"
|
||||
>
|
||||
<a
|
||||
href=""
|
||||
target="_blank"
|
||||
@click.prevent="openBugReportModal()"
|
||||
>
|
||||
@@ -479,10 +480,6 @@ footer {
|
||||
color: $purple-300;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a:not([href]):not([class]):hover { // needed to make "report a bug"'s hover state correct
|
||||
color: $purple-300;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
column-gap: 1.5rem;
|
||||
display: grid;
|
||||
@@ -682,11 +679,6 @@ h3 {
|
||||
|
||||
footer {
|
||||
padding: 24px 16px;
|
||||
a:not([href]):not([class]):hover { // needed to make "report a bug"'s hover state correct
|
||||
color: $purple-300;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
column-gap: 1.5rem;
|
||||
display: grid;
|
||||
grid-template-areas:
|
||||
@@ -726,10 +718,6 @@ h3 {
|
||||
@media (max-width: 1024px) and (min-width: 768px) {
|
||||
footer {
|
||||
padding: 24px 24px;
|
||||
a:not([href]):not([class]):hover { // needed to make "report a bug"'s hover state correct
|
||||
color: $purple-300;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.desktop {
|
||||
|
||||
@@ -346,6 +346,7 @@
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href=""
|
||||
target="_blank"
|
||||
@click.prevent="openBugReportModal()"
|
||||
>
|
||||
@@ -521,21 +522,6 @@
|
||||
margin-left: .5em;
|
||||
}
|
||||
|
||||
// formats the report a bug link to match the others
|
||||
a:not([href]) {
|
||||
&:not([role=button]) {
|
||||
color: #007bff;
|
||||
text-decoration: none;
|
||||
}
|
||||
}
|
||||
|
||||
a:not([href]):hover {
|
||||
&:not([role=button]) {
|
||||
color: #0056b3;
|
||||
text-decoration: underline;
|
||||
}
|
||||
}
|
||||
|
||||
.tier1-icon, .tier2-icon {
|
||||
width: 11px;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,14 @@
|
||||
:notification="notification"
|
||||
>
|
||||
<div slot="content">
|
||||
<div v-html="$t('invitedToParty', {party: notification.data.name})"></div>
|
||||
<div
|
||||
v-html="$t('invitedToPartyBy', {
|
||||
userId: notification.data.inviter,
|
||||
userName: invitingUser.auth ? invitingUser.auth.local.username : null,
|
||||
party: notification.data.name,
|
||||
})"
|
||||
>
|
||||
</div>
|
||||
<div class="notifications-buttons">
|
||||
<div
|
||||
class="btn btn-small btn-success"
|
||||
@@ -32,10 +39,31 @@ export default {
|
||||
components: {
|
||||
BaseNotification,
|
||||
},
|
||||
props: ['notification', 'canRemove'],
|
||||
props: {
|
||||
notification: {
|
||||
type: Object,
|
||||
default (data) {
|
||||
return data;
|
||||
},
|
||||
},
|
||||
canRemove: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
invitingUser: {},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({ user: 'user.data' }),
|
||||
},
|
||||
async mounted () {
|
||||
this.invitingUser = await this.$store.dispatch('members:fetchMember', {
|
||||
memberId: this.notification.data.inviter,
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
async accept () {
|
||||
const group = this.notification.data;
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
{{ $t('notifications') }}
|
||||
</h4>
|
||||
<a
|
||||
class="small-link standard-link"
|
||||
class="small-link"
|
||||
:disabled="notificationsCount === 0"
|
||||
@click="dismissAll"
|
||||
>{{ $t('dismissAll') }}</a>
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
</button>
|
||||
<a
|
||||
v-once
|
||||
class="standard-link"
|
||||
@click="close()"
|
||||
>{{ $t('neverMind') }}</a>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import axios from 'axios';
|
||||
|
||||
// import omit from 'lodash/omit';
|
||||
// import findIndex from 'lodash/findIndex';
|
||||
|
||||
const apiv4Prefix = '/api/v4';
|
||||
|
||||
export async function getGroupMembers (store, payload) {
|
||||
@@ -117,38 +114,3 @@ export async function getPurchaseHistory (store, payload) {
|
||||
const response = await axios.get(`${apiv4Prefix}/members/${payload.memberId}/purchase-history`);
|
||||
return response.data.data;
|
||||
}
|
||||
|
||||
// export async function selectMember (uid) {
|
||||
// let memberIsReady = _checkIfMemberIsReady(members[uid]);
|
||||
//
|
||||
// if (memberIsReady) {
|
||||
// _prepareMember(members[uid], self);
|
||||
// return
|
||||
// } else {
|
||||
// fetchMember(uid)
|
||||
// .then(function (response) {
|
||||
// var member = response.data.data;
|
||||
// addToMembersList(member); // lazy load for later
|
||||
// _prepareMember(member, self);
|
||||
// deferred.resolve();
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
// function addToMembersList (member) {
|
||||
// if (member._id) {
|
||||
// members[member._id] = member;
|
||||
// }
|
||||
// }
|
||||
|
||||
// function _checkIfMemberIsReady (member) {
|
||||
// return member && member.items && member.items.weapon;
|
||||
// }
|
||||
//
|
||||
// function _prepareMember(member, self) {
|
||||
// self.selectedMember = members[member._id];
|
||||
// }
|
||||
//
|
||||
// $rootScope.$on('userUpdated', function(event, user){
|
||||
// addToMembersList(user);
|
||||
// })
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
"invite": "Invite",
|
||||
"leave": "Leave",
|
||||
"invitedToParty": "You were invited to join the Party <span class=\"notification-bold\"><%- party %></span>",
|
||||
"invitedToPartyBy": "<a href=\"/profile/<%- userId %>\" target=\"_blank\">@<%- userName %></a> has invited you to join the Party <span class=\"notification-bold\"><%- party %></span>",
|
||||
"invitedToPrivateGuild": "You were invited to join the private Guild <span class=\"notification-bold\"><%- guild %></span>",
|
||||
"invitedToPublicGuild": "You were invited to join the Guild <span class=\"notification-bold-blue\"><%- guild %></span>",
|
||||
"invitationAcceptedHeader": "Your Invitation has been Accepted",
|
||||
|
||||
Reference in New Issue
Block a user