Added broken task event

This commit is contained in:
thehollidayinn
2017-11-03 10:24:00 -06:00
parent 3cf7b2c96c
commit 2e5f5714e4
2 changed files with 19 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
<template lang='pug'>
b-modal#broken-task-modal(title="Broken Challenge", size='sm', :hide-footer="true", v-if='brokenChallengeTask && brokenChallengeTask.challenge')
.modal-body
b-modal#broken-task-modal(title="Broken Challenge", size='sm', :hide-footer="true")
.modal-body(v-if='brokenChallengeTask && brokenChallengeTask.challenge')
div(v-if='brokenChallengeTask.challenge.broken === "TASK_DELETED" || brokenChallengeTask.challenge.broken === "CHALLENGE_TASK_NOT_FOUND"')
h2 {{ $t('brokenTask') }}
div
@@ -41,10 +41,19 @@ export default {
components: {
bModal,
},
computed: {
brokenChallengeTask () {
return this.$store.state.brokenChallengeTask;
},
data () {
return {
brokenChallengeTask: {},
};
},
created () {
this.$root.$on('handle-broken-task', (task) => {
this.brokenChallengeTask = Object.assign({}, task);
this.$root.$emit('show::modal', 'broken-task-modal');
});
},
removed () {
this.$root.$remove('handle-broken-task');
},
methods: {
...mapActions({

View File

@@ -17,8 +17,8 @@
.d-flex.justify-content-between
h3.task-title(:class="{ 'has-notes': task.notes }", v-markdown="task.text")
menu-dropdown.task-dropdown(
v-if="isUser && !isRunningYesterdailies",
:right="task.type === 'reward'",
v-if="isUser && !isRunningYesterdailies",
:right="task.type === 'reward'",
ref="taskDropdown"
)
div(slot="dropdown-toggle", draggable=false)
@@ -42,7 +42,7 @@
span.text {{ $t('delete') }}
.task-notes.small-text(
v-markdown="task.notes",
v-markdown="task.notes",
:class="{'has-checklist': task.notes && hasChecklist}",
)
.checklist(v-if="canViewchecklist")
@@ -749,8 +749,7 @@ export default {
},
handleBrokenTask (task) {
if (this.$store.state.isRunningYesterdailies) return;
this.$store.state.brokenChallengeTask = task;
this.$root.$emit('show::modal', 'broken-task-modal');
this.$root.$emit('handle-broken-task', task);
},
},
};