Sept 14 2017 (#9037)

* Added new message count

* Added route change for group plan

* Added fix for quest value of 0

* Fixed guild summary limit, guild and challenge height

* Added task sorting

* Added api buy armoire

* Fixed linting
This commit is contained in:
Keith Holliday
2017-09-14 14:53:27 -05:00
committed by GitHub
parent 5b1530b216
commit a5dfb499b3
12 changed files with 183 additions and 78 deletions

View File

@@ -9,7 +9,7 @@
:class="{active: activeFilter.label === filter.label}",
@click="activateFilter(type, filter)",
) {{ $t(filter.label) }}
.tasks-list(ref="taskList")
.tasks-list(ref="taskList", v-sortable='', @onsort='sorted')
task(
v-for="task in taskList",
:key="task.id", :task="task",
@@ -171,6 +171,7 @@ import rewardIcon from 'assets/svg/reward.svg';
import bModal from 'bootstrap-vue/lib/components/modal';
import shopItem from '../shops/shopItem';
import throttle from 'lodash/throttle';
import sortable from 'client/directives/sortable.directive';
export default {
components: {
@@ -178,6 +179,9 @@ export default {
bModal,
shopItem,
},
directives: {
sortable,
},
props: ['type', 'isUser', 'searchText', 'selectedTags', 'taskListOverride', 'group'], // @TODO: maybe we should store the group on state?
data () {
const types = Object.freeze({
@@ -268,6 +272,20 @@ export default {
},
methods: {
...mapActions({loadCompletedTodos: 'tasks:fetchCompletedTodos'}),
sorted (data) {
const sorting = this.taskList;
const taskIdToMove = this.taskList[data.oldIndex]._id;
if (sorting) {
const deleted = sorting.splice(data.oldIndex, 1);
sorting.splice(data.newIndex, 0, deleted[0]);
}
this.$store.dispatch('tasks:move', {
taskId: taskIdToMove,
position: data.newIndex,
});
},
editTask (task) {
this.$emit('editTask', task);
},