Skip to content

Commit

Permalink
fix cheklist editing + misc fixes to tasks modal
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed Aug 24, 2017
1 parent ae589c9 commit 999303a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions website/client/components/tasks/taskModal.vue
Expand Up @@ -5,7 +5,7 @@
)
b-modal#task-modal(
size="sm",
@hidden="$emit('cancel')",
@hidden="onClose()",
)
.task-modal-header(
slot="modal-header",
Expand All @@ -31,7 +31,7 @@
label(v-once) {{ $t('checklist') }}
br
.inline-edit-input-group.checklist-group.input-group(v-for="(item, $index) in task.checklist")
input.inline-edit-input.checklist-item.form-control(type="text", :value="item.text")
input.inline-edit-input.checklist-item.form-control(type="text", v-model="item.text")
span.input-group-btn(@click="removeChecklistItem($index)")
.svg-icon.destroy-icon(v-html="icons.destroy")
input.inline-edit-input.checklist-item.form-control(type="text", :placeholder="$t('newChecklistItem')", @keydown.enter="addChecklistItem($event)", v-model="newChecklistItem")
Expand Down Expand Up @@ -551,9 +551,13 @@ export default {
this.$root.$emit('hide::modal', 'task-modal');
},
cancel () {
this.showTagsSelect = false;
this.$root.$emit('hide::modal', 'task-modal');
},
onClose () {
this.showTagsSelect = false;
this.newChecklistItem = '';
this.$emit('cancel');
},
updateRequiresApproval (newValue) {
let truthy = true;
if (!newValue) truthy = false; // This return undefined instad of false
Expand Down
2 changes: 2 additions & 0 deletions website/client/store/actions/tasks.js
Expand Up @@ -113,6 +113,8 @@ export async function save (store, editedTask) {

sanitizeChecklist(editedTask);

console.log(JSON.parse(JSON.stringify(editedTask), null, 4))
console.log(JSON.parse(JSON.stringify(originalTask), null, 4))
if (originalTask) Object.assign(originalTask, editedTask);

const taskDataToSend = omit(editedTask, ['history']);
Expand Down

0 comments on commit 999303a

Please sign in to comment.