diff options
author | Phil Hughes <me@iamphill.com> | 2017-05-22 08:59:37 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-05-22 08:59:37 +0100 |
commit | 7a21e26f4b1243a48e6e31f2b9af6e525ae8ca30 (patch) | |
tree | 15f730d427826f884aa5f84827da6810255cd080 /app/assets/javascripts/issue_show/components/app.vue | |
parent | 4f0849f2fd1427b21bd6a043223f49d0c77fa3a3 (diff) | |
parent | 3c3b17a5a4b4f85f3f81f918a7e0c3a57f469eb7 (diff) | |
download | gitlab-ce-7a21e26f4b1243a48e6e31f2b9af6e525ae8ca30.tar.gz |
Merge branch 'issue-edit-inline' into issue-edit-inline-description-template
[ci skip]
Diffstat (limited to 'app/assets/javascripts/issue_show/components/app.vue')
-rw-r--r-- | app/assets/javascripts/issue_show/components/app.vue | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/app/assets/javascripts/issue_show/components/app.vue b/app/assets/javascripts/issue_show/components/app.vue index 9cd454e9f73..d9bfc29130f 100644 --- a/app/assets/javascripts/issue_show/components/app.vue +++ b/app/assets/javascripts/issue_show/components/app.vue @@ -8,6 +8,7 @@ import Store from '../stores'; import titleComponent from './title.vue'; import descriptionComponent from './description.vue'; import formComponent from './form.vue'; +import '../../lib/utils/url_utility'; export default { props: { @@ -15,6 +16,10 @@ export default { required: true, type: String, }, + canMove: { + required: true, + type: Boolean, + }, canUpdate: { required: true, type: Boolean, @@ -66,6 +71,10 @@ export default { type: String, required: true, }, + projectsAutocompleteUrl: { + type: String, + required: true, + }, }, data() { const store = new Store({ @@ -92,23 +101,27 @@ export default { }, methods: { openForm() { - this.showForm = true; - this.store.formState = { - title: this.state.titleText, - confidential: this.isConfidential, - description: this.state.descriptionText, - }; + if (!this.showForm) { + this.showForm = true; + this.store.formState = { + title: this.state.titleText, + confidential: this.isConfidential, + description: this.state.descriptionText, + move_to_project_id: 0, + }; + } }, closeForm() { this.showForm = false; }, updateIssuable() { this.service.updateIssuable(this.store.formState) - .then((res) => { - const data = res.json(); - - if (data.confidential !== this.isConfidential) { - location.reload(); + .then(res => res.json()) + .then((data) => { + if (location.pathname !== data.path) { + gl.utils.visitUrl(data.path); + } else if (data.confidential !== this.isConfidential) { + gl.utils.visitUrl(location.pathname); } eventHub.$emit('close.form'); @@ -177,12 +190,15 @@ export default { <form-component v-if="canUpdate && showForm" :form-state="formState" + :can-move="canMove" :can-destroy="canDestroy" :issuable-templates="issuableTemplates" :markdown-docs="markdownDocs" :markdown-preview-url="markdownPreviewUrl" :project-path="projectPath" - :project-namespace="projectNamespace" /> + :project-namespace="projectNamespace" + :projects-autocomplete-url="projectsAutocompleteUrl" + /> <div v-else> <title-component :issuable-ref="issuableRef" |