mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
Oct 9 fixes (#9174)
* Prevented purchasing of locked quest * Fixed category filters for challenges * Added armoire equipment directly to user * Halfed the time notifications display * Added quest accept/reject to party page
This commit is contained in:
parent
5dd168eee4
commit
7e1ae6a571
6 changed files with 53 additions and 11 deletions
|
|
@ -91,6 +91,10 @@
|
|||
p {{acceptedCount}} / {{group.memberCount}}
|
||||
.col-4
|
||||
button.btn.btn-secondary(@click="openQuestDetails()") {{ $t('details') }}
|
||||
.row.quest-active-section.quest-invite(v-if='user.party.quest && user.party.quest.RSVPNeeded')
|
||||
span {{ $t('wouldYouParticipate') }}
|
||||
button.btn.btn-primary.accept(@click='questAccept(group._id)') {{$t('accept')}}
|
||||
button.btn.btn-primary.reject(@click='questReject(group._id)') {{$t('reject')}}
|
||||
.row.quest-active-section(v-if='isParty && !onPendingQuest && onActiveQuest')
|
||||
.col-12.text-center
|
||||
.quest-boss(:class="'quest_' + questData.key")
|
||||
|
|
@ -378,6 +382,37 @@
|
|||
}
|
||||
}
|
||||
|
||||
.quest-invite {
|
||||
background-color: #2995cd;
|
||||
color: #fff;
|
||||
padding: 1em;
|
||||
|
||||
span {
|
||||
margin-top: .3em;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.accept, .reject {
|
||||
padding: .2em 1em;
|
||||
font-size: 12px;
|
||||
height: 24px;
|
||||
border-radius: 2px;
|
||||
box-shadow: 0 2px 2px 0 rgba(26, 24, 29, 0.16), 0 1px 4px 0 rgba(26, 24, 29, 0.12);
|
||||
}
|
||||
|
||||
.accept {
|
||||
background-color: #24cc8f;
|
||||
margin-left: 4em;
|
||||
margin-right: .5em;
|
||||
}
|
||||
|
||||
.reject {
|
||||
border-radius: 2px;
|
||||
background-color: #f74e52;
|
||||
}
|
||||
}
|
||||
|
||||
.section-header {
|
||||
border-top: 1px solid #e1e0e3;
|
||||
margin-top: 1em;
|
||||
|
|
@ -859,14 +894,13 @@ export default {
|
|||
let quest = await this.$store.dispatch('quests:sendAction', {groupId: this.group._id, action: 'quests/leave'});
|
||||
this.group.quest = quest;
|
||||
},
|
||||
async questAccept () {
|
||||
let quest = await this.$store.dispatch('quests:sendAction', {groupId: this.group._id, action: 'quests/accept'});
|
||||
this.group.quest = quest;
|
||||
async questAccept (partyId) {
|
||||
let quest = await this.$store.dispatch('quests:sendAction', {groupId: partyId, action: 'quests/accept'});
|
||||
this.user.party.quest = quest;
|
||||
},
|
||||
// @TODO: Move to notificaitons component?
|
||||
async questReject () {
|
||||
let quest = await this.$store.dispatch('quests:sendAction', {groupId: this.group._id, action: 'quests/reject'});
|
||||
this.group.quest = quest;
|
||||
async questReject (partyId) {
|
||||
let quest = await this.$store.dispatch('quests:sendAction', {groupId: partyId, action: 'quests/reject'});
|
||||
this.user.party.quest = quest;
|
||||
},
|
||||
showGroupGems () {
|
||||
this.$root.$emit('show::modal', 'group-gems-modal');
|
||||
|
|
|
|||
|
|
@ -471,6 +471,8 @@ export default {
|
|||
}
|
||||
},
|
||||
selectItem (item) {
|
||||
if (item.locked) return;
|
||||
|
||||
this.selectedItemToBuy = item;
|
||||
|
||||
if (this.$store.state.recentlyPurchased[item.key]) {
|
||||
|
|
|
|||
|
|
@ -126,8 +126,8 @@ export default {
|
|||
// @TODO the notifications always close even if timeout is false
|
||||
let timeout = this.notification.hasOwnProperty('timeout') ? this.notification.timeout : true;
|
||||
if (timeout) {
|
||||
let delay = this.notification.delay || 1000;
|
||||
delay += this.$store.state.notificationStore.length * 1000;
|
||||
let delay = this.notification.delay || 500;
|
||||
delay += this.$store.state.notificationStore.length * 500;
|
||||
setTimeout(() => {
|
||||
this.show = false;
|
||||
}, delay);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ export default {
|
|||
}
|
||||
|
||||
if (filters.categories && filters.categories.length > 0) {
|
||||
let intersectingCats = intersection(filters.categories, challenge.categories);
|
||||
let challengeCategories = challenge.categories.map(chal => chal.slug);
|
||||
let intersectingCats = intersection(filters.categories, challengeCategories);
|
||||
hasCategories = intersectingCats.length > 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -87,6 +87,10 @@ export async function genericPurchase (store, params) {
|
|||
|
||||
const isExperience = item.type === 'experience';
|
||||
|
||||
if (item.type === 'gear') {
|
||||
store.state.user.data.items.gear.owned[item.dropKey] = true;
|
||||
}
|
||||
|
||||
// @TODO: We might need to abstract notifications to library rather than mixin
|
||||
store.state.notificationStore.push({
|
||||
title: '',
|
||||
|
|
|
|||
|
|
@ -396,5 +396,6 @@
|
|||
"groupGemsDesc": "Guild Gems can be spent to make Challenges! In the future, you will be able to add more Guild Gems.",
|
||||
"groupTaskBoard": "Task Board",
|
||||
"groupInformation": "Group Information",
|
||||
"groupBilling": "Group Billing"
|
||||
"groupBilling": "Group Billing",
|
||||
"wouldYouParticipate": "Would you like to participate?"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue