feat(invites): provide link to inviting user in party notif

Also changes basic links sitewide to purple-300
This commit is contained in:
SabreCat
2023-02-15 16:54:46 -06:00
parent ab706abed5
commit 9ec1917e6d
9 changed files with 43 additions and 84 deletions

View File

@@ -50,10 +50,7 @@ h3.markdown {
} }
a { a {
color: $blue-10;
&:hover, &:active, &:focus { &:hover, &:active, &:focus {
color: $blue-10;
text-decoration: underline; text-decoration: underline;
} }
} }

View File

@@ -26,12 +26,11 @@ a:not([href]), a:not([href]):hover {
a, a:not([href]):not([tabindex]) { a, a:not([href]):not([tabindex]) {
cursor: pointer; cursor: pointer;
color: $purple-300;
&.standard-link {
color: $blue-10;
&:hover, &:active, &:focus { &:hover, &:active, &:focus {
text-decoration: underline; text-decoration: underline;
color: $purple-300;
} }
&[disabled="disabled"] { &[disabled="disabled"] {
@@ -39,7 +38,6 @@ a, a:not([href]):not([tabindex]) {
text-decoration: none; text-decoration: none;
cursor: default; cursor: default;
} }
}
&.small-link { &.small-link {
font-size: 12px; font-size: 12px;

View File

@@ -108,6 +108,7 @@
v-if="user" v-if="user"
> >
<a <a
href=""
target="_blank" target="_blank"
@click.prevent="openBugReportModal()" @click.prevent="openBugReportModal()"
> >
@@ -479,10 +480,6 @@ footer {
color: $purple-300; color: $purple-300;
text-decoration: underline; 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; column-gap: 1.5rem;
display: grid; display: grid;
@@ -682,11 +679,6 @@ h3 {
footer { footer {
padding: 24px 16px; 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; column-gap: 1.5rem;
display: grid; display: grid;
grid-template-areas: grid-template-areas:
@@ -726,10 +718,6 @@ h3 {
@media (max-width: 1024px) and (min-width: 768px) { @media (max-width: 1024px) and (min-width: 768px) {
footer { footer {
padding: 24px 24px; 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 { .desktop {

View File

@@ -346,6 +346,7 @@
</li> </li>
<li> <li>
<a <a
href=""
target="_blank" target="_blank"
@click.prevent="openBugReportModal()" @click.prevent="openBugReportModal()"
> >
@@ -521,21 +522,6 @@
margin-left: .5em; 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 { .tier1-icon, .tier2-icon {
width: 11px; width: 11px;
} }

View File

@@ -5,7 +5,14 @@
:notification="notification" :notification="notification"
> >
<div slot="content"> <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="notifications-buttons">
<div <div
class="btn btn-small btn-success" class="btn btn-small btn-success"
@@ -32,10 +39,31 @@ export default {
components: { components: {
BaseNotification, BaseNotification,
}, },
props: ['notification', 'canRemove'], props: {
notification: {
type: Object,
default (data) {
return data;
},
},
canRemove: {
type: Boolean,
default: true,
},
},
data () {
return {
invitingUser: {},
};
},
computed: { computed: {
...mapState({ user: 'user.data' }), ...mapState({ user: 'user.data' }),
}, },
async mounted () {
this.invitingUser = await this.$store.dispatch('members:fetchMember', {
memberId: this.notification.data.inviter,
});
},
methods: { methods: {
async accept () { async accept () {
const group = this.notification.data; const group = this.notification.data;

View File

@@ -39,7 +39,7 @@
{{ $t('notifications') }} {{ $t('notifications') }}
</h4> </h4>
<a <a
class="small-link standard-link" class="small-link"
:disabled="notificationsCount === 0" :disabled="notificationsCount === 0"
@click="dismissAll" @click="dismissAll"
>{{ $t('dismissAll') }}</a> >{{ $t('dismissAll') }}</a>

View File

@@ -31,7 +31,6 @@
</button> </button>
<a <a
v-once v-once
class="standard-link"
@click="close()" @click="close()"
>{{ $t('neverMind') }}</a> >{{ $t('neverMind') }}</a>
</div> </div>

View File

@@ -1,8 +1,5 @@
import axios from 'axios'; import axios from 'axios';
// import omit from 'lodash/omit';
// import findIndex from 'lodash/findIndex';
const apiv4Prefix = '/api/v4'; const apiv4Prefix = '/api/v4';
export async function getGroupMembers (store, payload) { 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`); const response = await axios.get(`${apiv4Prefix}/members/${payload.memberId}/purchase-history`);
return response.data.data; 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);
// })

View File

@@ -25,6 +25,7 @@
"invite": "Invite", "invite": "Invite",
"leave": "Leave", "leave": "Leave",
"invitedToParty": "You were invited to join the Party <span class=\"notification-bold\"><%- party %></span>", "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>", "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>", "invitedToPublicGuild": "You were invited to join the Guild <span class=\"notification-bold-blue\"><%- guild %></span>",
"invitationAcceptedHeader": "Your Invitation has been Accepted", "invitationAcceptedHeader": "Your Invitation has been Accepted",