diff options
Diffstat (limited to 'app/assets/javascripts/work_items/components/work_item_title.vue')
-rw-r--r-- | app/assets/javascripts/work_items/components/work_item_title.vue | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/app/assets/javascripts/work_items/components/work_item_title.vue b/app/assets/javascripts/work_items/components/work_item_title.vue index 9b5803421dd..0be57e291f4 100644 --- a/app/assets/javascripts/work_items/components/work_item_title.vue +++ b/app/assets/javascripts/work_items/components/work_item_title.vue @@ -8,7 +8,7 @@ import { WORK_ITEM_TITLE_MAX_LENGTH, I18N_MAX_CHARS_IN_WORK_ITEM_TITLE_MESSAGE, } from '../constants'; -import { getUpdateWorkItemMutation } from './update_work_item'; +import updateWorkItemMutation from '../graphql/update_work_item.mutation.graphql'; import ItemTitle from './item_title.vue'; export default { @@ -32,16 +32,16 @@ export default { required: false, default: '', }, - workItemParentId: { - type: String, - required: false, - default: null, - }, canUpdate: { type: Boolean, required: false, default: false, }, + useH1: { + type: Boolean, + default: false, + required: false, + }, }, computed: { tracking() { @@ -63,24 +63,19 @@ export default { return; } - const input = { - id: this.workItemId, - title: updatedTitle, - }; - this.updateInProgress = true; try { this.track('updated_title'); - const { mutation, variables } = getUpdateWorkItemMutation({ - workItemParentId: this.workItemParentId, - input, - }); - const { data } = await this.$apollo.mutate({ - mutation, - variables, + mutation: updateWorkItemMutation, + variables: { + input: { + id: this.workItemId, + title: updatedTitle, + }, + }, }); const errors = data.workItemUpdate?.errors; @@ -101,5 +96,10 @@ export default { </script> <template> - <item-title :title="workItemTitle" :disabled="!canUpdate" @title-changed="updateTitle" /> + <item-title + :title="workItemTitle" + :disabled="!canUpdate" + :use-h1="useH1" + @title-changed="updateTitle" + /> </template> |