2017-08-17 22:00:37 +05:30
|
|
|
import Vue from 'vue';
|
2017-09-10 17:25:29 +05:30
|
|
|
import eventHub from './event_hub';
|
|
|
|
import issuableApp from './components/app.vue';
|
2017-08-17 22:00:37 +05:30
|
|
|
import '../vue_shared/vue_resource_interceptor';
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
const initialDataEl = document.getElementById('js-issuable-app-initial-data');
|
|
|
|
const initialData = JSON.parse(initialDataEl.innerHTML.replace(/"/g, '"'));
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
$('.issuable-edit').on('click', (e) => {
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
eventHub.$emit('open.form');
|
2017-08-17 22:00:37 +05:30
|
|
|
});
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
return new Vue({
|
|
|
|
el: document.getElementById('js-issuable-app'),
|
|
|
|
components: {
|
|
|
|
issuableApp,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
...initialData,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('issuable-app', {
|
|
|
|
props: {
|
|
|
|
canUpdate: this.canUpdate,
|
|
|
|
canDestroy: this.canDestroy,
|
|
|
|
canMove: this.canMove,
|
|
|
|
endpoint: this.endpoint,
|
|
|
|
issuableRef: this.issuableRef,
|
|
|
|
initialTitleHtml: this.initialTitleHtml,
|
|
|
|
initialTitleText: this.initialTitleText,
|
|
|
|
initialDescriptionHtml: this.initialDescriptionHtml,
|
|
|
|
initialDescriptionText: this.initialDescriptionText,
|
|
|
|
issuableTemplates: this.issuableTemplates,
|
|
|
|
isConfidential: this.isConfidential,
|
|
|
|
markdownPreviewUrl: this.markdownPreviewUrl,
|
|
|
|
markdownDocs: this.markdownDocs,
|
|
|
|
projectPath: this.projectPath,
|
|
|
|
projectNamespace: this.projectNamespace,
|
|
|
|
projectsAutocompleteUrl: this.projectsAutocompleteUrl,
|
|
|
|
updatedAt: this.updatedAt,
|
|
|
|
updatedByName: this.updatedByName,
|
|
|
|
updatedByPath: this.updatedByPath,
|
|
|
|
initialTaskStatus: this.initialTaskStatus,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|