mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Hotfix/oct 24 fixes (#9261)
* Removed max height from text section * Added items to mystery sets * Group manager fixes * Fixed promo code apply
This commit is contained in:
committed by
Sabe Jones
parent
b445bc8261
commit
6bc70ca471
@@ -32,13 +32,20 @@ export default {
|
|||||||
user: 'user.data',
|
user: 'user.data',
|
||||||
groupPlans: 'groupPlans',
|
groupPlans: 'groupPlans',
|
||||||
}),
|
}),
|
||||||
isLeader () {
|
currentGroup () {
|
||||||
let groupFound = this.groupPlans.find(group => {
|
let groupFound = this.groupPlans.find(group => {
|
||||||
return group._id === this.groupId;
|
return group._id === this.groupId;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!groupFound) return false;
|
return groupFound;
|
||||||
return groupFound.leader === this.user._id;
|
},
|
||||||
|
isLeader () {
|
||||||
|
if (!this.currentGroup) return false;
|
||||||
|
return this.currentGroup.leader === this.user._id;
|
||||||
|
},
|
||||||
|
isManager () {
|
||||||
|
if (!this.currentGroup) return false;
|
||||||
|
return Boolean(this.currentGroup.managers[this.user._id]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -40,11 +40,11 @@ div
|
|||||||
span.dropdown-icon-item
|
span.dropdown-icon-item
|
||||||
.svg-icon.inline(v-html="icons.starIcon")
|
.svg-icon.inline(v-html="icons.starIcon")
|
||||||
span.text {{$t('promoteToLeader')}}
|
span.text {{$t('promoteToLeader')}}
|
||||||
b-dropdown-item(@click='addManager(member)', v-if='isLeader && groupIsSubscribed')
|
b-dropdown-item(@click='addManager(member._id)', v-if='isLeader && groupIsSubscribed')
|
||||||
span.dropdown-icon-item
|
span.dropdown-icon-item
|
||||||
.svg-icon.inline(v-html="icons.starIcon")
|
.svg-icon.inline(v-html="icons.starIcon")
|
||||||
span.text {{$t('addManager')}}
|
span.text {{$t('addManager')}}
|
||||||
b-dropdown-item(@click='removeManager(member)', v-if='isLeader && groupIsSubscribed')
|
b-dropdown-item(@click='removeManager(member._id)', v-if='isLeader && groupIsSubscribed')
|
||||||
span.dropdown-icon-item
|
span.dropdown-icon-item
|
||||||
.svg-icon.inline(v-html="icons.removeIcon")
|
.svg-icon.inline(v-html="icons.removeIcon")
|
||||||
span.text {{$t('removeManager2')}}
|
span.text {{$t('removeManager2')}}
|
||||||
|
|||||||
@@ -23,8 +23,10 @@
|
|||||||
<script>
|
<script>
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { mapState } from 'client/libs/store';
|
import { mapState } from 'client/libs/store';
|
||||||
|
import notifications from 'client/mixins/notifications';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
mixins: [notifications],
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
codes: {
|
codes: {
|
||||||
@@ -51,10 +53,12 @@ export default {
|
|||||||
// })
|
// })
|
||||||
},
|
},
|
||||||
async enterCoupon () {
|
async enterCoupon () {
|
||||||
let code = await axios.get(`/api/v3/coupons/enter/${this.couponCode}`);
|
let code = await axios.post(`/api/v3/coupons/enter/${this.couponCode}`);
|
||||||
if (!code) return;
|
if (!code) return;
|
||||||
// @TODO: what needs to be updated? User.sync();
|
|
||||||
// @TODO: mixin Notification.text(env.t('promoCodeApplied'));
|
this.$store.state.user.data = code.data.data;
|
||||||
|
|
||||||
|
this.text(this.$t('promoCodeApplied'));
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -19,7 +19,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.text {
|
.text {
|
||||||
max-height: 220px;
|
|
||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|||||||
@@ -83,7 +83,6 @@
|
|||||||
@click.prevent.stop="togglePinned(ctx.item)"
|
@click.prevent.stop="togglePinned(ctx.item)"
|
||||||
)
|
)
|
||||||
span.svg-icon.inline.icon-12.color(v-html="icons.pin")
|
span.svg-icon.inline.icon-12.color(v-html="icons.pin")
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
|
|||||||
@@ -219,6 +219,7 @@ module.exports = function getItemInfo (user, type, item, officialPinnedItems, la
|
|||||||
break;
|
break;
|
||||||
case 'mystery_set':
|
case 'mystery_set':
|
||||||
itemInfo = {
|
itemInfo = {
|
||||||
|
items: item.items,
|
||||||
key: item.key,
|
key: item.key,
|
||||||
text: item.text(language),
|
text: item.text(language),
|
||||||
value: 1,
|
value: 1,
|
||||||
|
|||||||
@@ -1287,7 +1287,7 @@ api.getGroupPlans = {
|
|||||||
.find({
|
.find({
|
||||||
_id: {$in: userGroups},
|
_id: {$in: userGroups},
|
||||||
})
|
})
|
||||||
.select('leaderOnly leader purchased name')
|
.select('leaderOnly leader purchased name managers')
|
||||||
.exec();
|
.exec();
|
||||||
|
|
||||||
let groupPlans = groups.filter(group => {
|
let groupPlans = groups.filter(group => {
|
||||||
|
|||||||
Reference in New Issue
Block a user