Sept 23 fixes (#9074)

* Discover challenges

* Fixed hero loading

* Moved add task button

* Fixed bailey showing

* Added logs for bad sub data

* Fixed blurb editing

* Added confirmation for deleteing message

* Reset invite modals on invite

* fixed group member sorting

* Fixed chat time styles

* Fixed hover on liked

* Fixed like count

* Added reverse

* Fixed editing party

* Added leader conditions

* Added search

* Added loading

* Reset members when leaving party

* Rounded pending

* Fixed overflow on collecting quests

* Added to invite friends

* Hid summary from party

* Fixed button styles

* Fixed button class

* Removed okay button

* Fixed renav for profile modal

* Added subscription back to menu

* Fixed static link

* Added daily due setting

* Added local auth adding

* Fixed centering of text

* Removed message locally

* Added count for new message

* Added style fix for profile pet

* Fixed achievement popovers

* Fixed white boxes

* Added plain color backgrounds

* fixed challenge mutability

* Fixed challenge editing

* Added notation for large numbers

* Add color text to guild sizes

* Removed membership filters from discover challenges

* Added invites to group

* Cmd + enter send message

* Made leader clickable

* Updated group validation

* Added cancelling autocomplete

* Added mention icon

* Added removing member

* Removed extra string
This commit is contained in:
Keith Holliday
2017-09-25 13:02:12 -05:00
committed by GitHub
parent 4759764e61
commit a317b351be
29 changed files with 495 additions and 184 deletions

View File

@@ -130,6 +130,7 @@
</style>
<script>
import clone from 'lodash/clone';
import bModal from 'bootstrap-vue/lib/components/modal';
import bDropdown from 'bootstrap-vue/lib/components/dropdown';
import bDropdownItem from 'bootstrap-vue/lib/components/dropdown-item';
@@ -139,7 +140,7 @@ import { TAVERN_ID, MIN_SHORTNAME_SIZE_FOR_CHALLENGES, MAX_SUMMARY_SIZE_FOR_CHAL
import { mapState } from 'client/libs/store';
export default {
props: ['challenge', 'groupId', 'cloning'],
props: ['groupId', 'cloning'],
components: {
bModal,
bDropdown,
@@ -186,19 +187,19 @@ export default {
},
{
label: 'mental_health',
key: 'mental_health ',
key: 'mental_health',
},
{
label: 'getting_organized',
key: 'getting_organized ',
key: 'getting_organized',
},
{
label: 'self_improvement',
key: 'self_improvement ',
key: 'self_improvement',
},
{
label: 'spirituality',
key: 'spirituality ',
key: 'spirituality',
},
{
label: 'time_management',
@@ -250,7 +251,6 @@ export default {
_id: TAVERN_ID,
});
this.resetWorkingChallenge();
this.setUpWorkingChallenge();
},
watch: {
@@ -321,9 +321,14 @@ export default {
return false;
}
},
challenge () {
return this.$store.state.challengeOptions.workingChallenge;
},
},
methods: {
setUpWorkingChallenge () {
this.resetWorkingChallenge();
if (!this.challenge) return;
this.workingChallenge = Object.assign({}, this.workingChallenge, this.challenge);
@@ -357,6 +362,8 @@ export default {
shortName: '',
todos: [],
};
this.$store.state.workingChallenge = {};
},
async createChallenge () {
// @TODO: improve error handling, add it to updateChallenge, make errors translatable. Suggestion: `<% fieldName %> is required` where possible, where `fieldName` is inserted as the translatable string that's used for the field header.
@@ -385,9 +392,11 @@ export default {
name: catName,
});
});
this.workingChallenge.categories = serverCategories;
let challenge = await this.$store.dispatch('challenges:createChallenge', {challenge: this.workingChallenge});
let challengeDetails = clone(this.workingChallenge);
challengeDetails.categories = serverCategories;
let challenge = await this.$store.dispatch('challenges:createChallenge', {challenge: challengeDetails});
// @TODO: When to remove from guild instead?
this.user.balance -= this.workingChallenge.prize / 4;
@@ -403,18 +412,21 @@ export default {
let categoryKeys = this.workingChallenge.categories;
let serverCategories = [];
categoryKeys.forEach(key => {
let catName = this.categoriesHashByKey[key];
let newKey = key.trim();
let catName = this.categoriesHashByKey[newKey];
serverCategories.push({
slug: key,
slug: newKey,
name: catName,
});
});
this.workingChallenge.categories = serverCategories;
let challengeDetails = clone(this.workingChallenge);
challengeDetails.categories = serverCategories;
this.$emit('updatedChallenge', {
challenge: this.workingChallenge,
challenge: challengeDetails,
});
this.$store.dispatch('challenges:updateChallenge', {challenge: this.workingChallenge});
this.$store.dispatch('challenges:updateChallenge', {challenge: challengeDetails});
this.resetWorkingChallenge();
this.$root.$emit('hide::modal', 'challenge-modal');
},