mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
New client group fixes (#8965)
* Fixed gem styles * Fixed party challenge logic * Fixed category sending * Filtered habitrpg * Fixed updating group * Added new empty state badge * Added information to create group * Fixed large icons * Fixed name collision
This commit is contained in:
@@ -1,13 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="70" height="76" viewBox="0 0 70 76">
|
||||
<defs>
|
||||
<path id="a" d="M35 0L0 15.235C0 45.705 4.255 62.941 35 76c30.745-13.059 35-30.294 35-60.765L35 0z"/>
|
||||
</defs>
|
||||
<g fill-rule="evenodd">
|
||||
<g>
|
||||
<use fill="#C3C0C7" xlink:href="#a"/>
|
||||
<path stroke="#F9F9F9" stroke-width="10" d="M35 5.453L5.02 18.503c.182 14.831 1.675 23.961 5.417 31.396C14.674 58.32 22.197 64.81 35 70.545 47.803 64.81 55.326 58.32 59.563 49.9c3.742-7.435 5.235-16.565 5.418-31.395l-2.445-1.065L38.473 6.965l-4.442-1.934.969.422z"/>
|
||||
<path stroke="#C3C0C7" stroke-width="6" d="M35 3.272L3.007 17.198c.111 15.9 1.621 25.609 5.643 33.6C13.205 59.848 21.31 66.734 35 72.733c13.691-6 21.795-12.885 26.35-21.935 4.022-7.991 5.532-17.7 5.643-33.6l-3.66-1.593L39.272 5.131l-4.85-2.111.579.252z"/>
|
||||
</g>
|
||||
<path fill="#F9F9F9" d="M27 40.667V44h16v-3.333C43 37.557 37.668 36 35 36c-2.666 0-8 1.556-8 4.667zM35.006 26A4.005 4.005 0 0 0 31 30c0 2.208 1.795 4 4.006 4A3.993 3.993 0 0 0 39 30c0-2.207-1.781-4-3.994-4"/>
|
||||
</g>
|
||||
</svg>
|
||||
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 34 38"><title>Empty_Large</title><path d="M19,35.26C7,29.71,4.67,22.8,4.51,9.23L19,2.74,33.49,9.23C33.33,22.8,31,29.71,19,35.26Z" transform="translate(-2)" fill="#c3c0c7"/><path d="M19,5.48l12,5.36c-0.31,11.64-2.58,17-12,21.65-9.38-4.61-11.65-10-12-21.65L19,5.48M19,0L2,7.62C2,22.85,4.07,31.47,19,38,33.93,31.47,36,22.85,36,7.62L19,0h0Z" transform="translate(-2)" fill="#f9f9f9"/><path d="M19,3.29L33,9.56C32.8,23.2,30.34,29.43,19,34.71,7.68,29.43,5.21,23.19,5,9.55L19,3.29M19,0L2,7.62C2,22.85,4.07,31.47,19,38,33.93,31.47,36,22.85,36,7.62L19,0h0Z" transform="translate(-2)" fill="#c3c0c7"/><path d="M19,13a2.14,2.14,0,1,0,2.14,2.14h0A2.14,2.14,0,0,0,19,13m0,5.72c-1.67,0-5,.83-5,2.5V23H24V21.22c0-1.67-3.33-2.5-5-2.5" transform="translate(-2)" fill="#f9f9f9"/></svg>
|
||||
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 853 B |
@@ -97,7 +97,7 @@ export default {
|
||||
},
|
||||
async mounted () {
|
||||
this.groupIdForChallenges = this.groupId;
|
||||
if (this.user.party._id) this.groupIdForChallenges = this.user.party._id;
|
||||
if (this.groupId === 'party' && this.user.party._id) this.groupIdForChallenges = this.user.party._id;
|
||||
this.challenges = await this.$store.dispatch('challenges:getGroupChallenges', {groupId: this.groupIdForChallenges});
|
||||
},
|
||||
data () {
|
||||
|
||||
@@ -47,12 +47,12 @@
|
||||
label
|
||||
strong(v-once) {{$t('description')}}*
|
||||
div.description-count {{charactersRemaining}} {{ $t('charactersRemaining') }}
|
||||
b-form-input(type="text", textarea :placeholder="creatingParty ? $t('partyDescriptionPlaceHolder') : $t('guildDescriptionPlaceHolder')", v-model="workingGuild.description")
|
||||
textarea.form-control(:placeholder="creatingParty ? $t('partyDescriptionPlaceHolder') : $t('guildDescriptionPlaceHolder')", v-model="workingGuild.description")
|
||||
|
||||
.form-group(v-if='workingGuild.id && !creatingParty')
|
||||
.form-group(v-if='!creatingParty')
|
||||
label
|
||||
strong(v-once) {{$t('guildInformation')}}*
|
||||
b-form-input(type="text", textarea, :placeholder="$t('guildInformationPlaceHolder')", v-model="workingGuild.guildInformation")
|
||||
textarea.form-control(:placeholder="$t('guildInformationPlaceHolder')", v-model="workingGuild.guildInformation")
|
||||
|
||||
.form-group(v-if='creatingParty && !workingGuild.id')
|
||||
span
|
||||
@@ -89,17 +89,21 @@
|
||||
button(@click.prevent='addMemberToInvite()') Add
|
||||
|
||||
.form-group.text-center
|
||||
div.item-with-icon(v-if='!creatingParty')
|
||||
div.item-with-icon(v-if='!creatingParty && !workingGuild.id')
|
||||
.svg-icon(v-html="icons.gem")
|
||||
span.count 4
|
||||
button.btn.btn-primary.btn-md(v-if='!workingGuild.id', :disabled='!workingGuild.name || !workingGuild.description') {{ creatingParty ? $t('createParty') : $t('createGuild') }}
|
||||
button.btn.btn-primary.btn-md(v-if='workingGuild.id', :disabled='!workingGuild.name || !workingGuild.description') {{ creatingParty ? $t('updateParty') : $t('updateGuild') }}
|
||||
.gem-description(v-once, v-if='!creatingParty') {{ $t('guildGemCostInfo') }}
|
||||
.gem-description(v-once, v-if='!creatingParty && !workingGuild.id') {{ $t('guildGemCostInfo') }}
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import '~client/assets/scss/colors.scss';
|
||||
|
||||
.svg-icon {
|
||||
width: 16px;
|
||||
}
|
||||
|
||||
textarea {
|
||||
height: 150px;
|
||||
}
|
||||
@@ -279,6 +283,8 @@ export default {
|
||||
this.workingGuild.type = editingGroup.type;
|
||||
this.workingGuild.privacy = editingGroup.privacy;
|
||||
if (editingGroup.description) this.workingGuild.description = editingGroup.description;
|
||||
if (editingGroup.information) this.workingGuild.information = editingGroup.information;
|
||||
if (editingGroup.summary) this.workingGuild.summary = editingGroup.summary;
|
||||
if (editingGroup._id) this.workingGuild.id = editingGroup._id;
|
||||
if (editingGroup.leader._id) this.workingGuild.newLeader = editingGroup.leader._id;
|
||||
if (editingGroup._id) this.getMembers();
|
||||
@@ -353,10 +359,21 @@ export default {
|
||||
};
|
||||
}
|
||||
|
||||
let newgroup;
|
||||
let categoryKeys = this.workingGuild.categories;
|
||||
let serverCategories = [];
|
||||
categoryKeys.forEach(key => {
|
||||
let catName = this.categoriesHashByKey[key];
|
||||
serverCategories.push({
|
||||
slug: key,
|
||||
name: catName,
|
||||
});
|
||||
});
|
||||
this.workingGuild.categories = serverCategories;
|
||||
|
||||
let newgroup;
|
||||
if (this.workingGuild.id) {
|
||||
await this.$store.dispatch('guilds:update', {group: this.workingGuild});
|
||||
this.$root.$emit('updatedGroup', this.workingGuild);
|
||||
// @TODO: this doesn't work because of the async resource
|
||||
// if (updatedGroup.type === 'party') this.$store.state.party = {data: updatedGroup};
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<template lang="pug">
|
||||
.row(v-if="group")
|
||||
group-form-modal
|
||||
invite-modal(:group='this.group')
|
||||
start-quest-modal(:group='this.group')
|
||||
.col-8.standard-page
|
||||
@@ -113,19 +112,19 @@
|
||||
.toggle-down(@click="sections.description = !sections.description", v-if="!sections.description")
|
||||
.svg-icon(v-html="icons.downIcon")
|
||||
.section(v-if="sections.description")
|
||||
p(v-once) {{ group.description }}
|
||||
p {{ group.description }}
|
||||
|
||||
.section-header
|
||||
.row
|
||||
.col-10
|
||||
h3(v-once) {{ $t('guildInformation') }}
|
||||
h3 {{ $t('guildInformation') }}
|
||||
.col-2
|
||||
.toggle-up(@click="sections.information = !sections.information", v-if="sections.information")
|
||||
.svg-icon(v-html="icons.upIcon")
|
||||
.toggle-down(@click="sections.information = !sections.information", v-if="!sections.information")
|
||||
.svg-icon(v-html="icons.downIcon")
|
||||
.section(v-if="sections.information")
|
||||
p(v-once) {{ group.information }}
|
||||
p {{ group.information }}
|
||||
|
||||
.section-header.challenge
|
||||
.row
|
||||
@@ -365,6 +364,7 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import extend from 'lodash/extend';
|
||||
import groupUtilities from 'client/mixins/groupsUtilities';
|
||||
import styleHelper from 'client/mixins/styleHelper';
|
||||
import { mapState } from 'client/libs/store';
|
||||
@@ -523,10 +523,13 @@ export default {
|
||||
// Check Desktop notifs
|
||||
// Mark Chat seen
|
||||
// Load invites
|
||||
// Load group tasks for group plan
|
||||
// Load approvals for group plan
|
||||
}
|
||||
this.fetchGuild();
|
||||
|
||||
this.$root.$on('updatedGroup', group => {
|
||||
let updatedGroup = extend(this.group, group);
|
||||
this.$set(this.group, updatedGroup);
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
// call again the method if the route changes (when this route is already active)
|
||||
|
||||
@@ -19,7 +19,7 @@ router-link.card-link(:to="{ name: 'guild', params: { groupId: guild._id } }")
|
||||
button.btn.btn-success(v-if='!isMember' @click='join()', v-once) {{ $t('join') }}
|
||||
div.item-with-icon.gem-bank(v-if='displayGemBank')
|
||||
.svg-icon.gem(v-html="icons.gem")
|
||||
span.count {{ guild.balance }}
|
||||
span.count {{ guild.balance * 4 }}
|
||||
div.guild-bank(v-if='displayGemBank', v-once) {{$t('guildBank')}}
|
||||
.row
|
||||
.col-md-12
|
||||
|
||||
@@ -28,7 +28,7 @@ export default {
|
||||
let isLeader = true;
|
||||
let correctSize = true;
|
||||
|
||||
if (group._id === this.$store.state.constants.TAVERN_ID) return false;
|
||||
if (group._id === this.$store.state.constants.TAVERN_ID || group._id === 'habitrpg') return false;
|
||||
|
||||
if (search) {
|
||||
passedSearch = group.name.toLowerCase().indexOf(search.toLowerCase()) >= 0;
|
||||
|
||||
Reference in New Issue
Block a user