2017-04-05 21:13:06 -04:00
|
|
|
import Vue from 'vue';
|
2017-05-12 05:11:15 -04:00
|
|
|
import eventHub from './event_hub';
|
2017-05-10 07:29:33 -04:00
|
|
|
import issuableApp from './components/app.vue';
|
2017-04-05 21:13:06 -04:00
|
|
|
import '../vue_shared/vue_resource_interceptor';
|
|
|
|
|
2017-05-12 05:11:15 -04:00
|
|
|
document.addEventListener('DOMContentLoaded', () => {
|
2017-05-15 09:51:40 -04:00
|
|
|
const initialDataEl = document.getElementById('js-issuable-app-initial-data');
|
|
|
|
const initialData = JSON.parse(initialDataEl.innerHTML.replace(/"/g, '"'));
|
2017-05-18 08:24:34 -04:00
|
|
|
|
2017-05-12 05:11:15 -04:00
|
|
|
$('.issuable-edit').on('click', (e) => {
|
|
|
|
e.preventDefault();
|
2017-04-05 21:13:06 -04:00
|
|
|
|
2017-05-12 05:11:15 -04:00
|
|
|
eventHub.$emit('open.form');
|
|
|
|
});
|
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el: document.getElementById('js-issuable-app'),
|
|
|
|
components: {
|
|
|
|
issuableApp,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2017-05-24 07:25:53 -04:00
|
|
|
...initialData,
|
2017-05-12 05:11:15 -04:00
|
|
|
};
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('issuable-app', {
|
|
|
|
props: {
|
|
|
|
canUpdate: this.canUpdate,
|
2017-05-12 06:58:48 -04:00
|
|
|
canDestroy: this.canDestroy,
|
2017-05-17 08:01:24 -04:00
|
|
|
canMove: this.canMove,
|
2017-05-12 05:11:15 -04:00
|
|
|
endpoint: this.endpoint,
|
|
|
|
issuableRef: this.issuableRef,
|
2017-05-24 07:25:53 -04:00
|
|
|
initialTitleHtml: this.initialTitleHtml,
|
|
|
|
initialTitleText: this.initialTitleText,
|
2017-05-12 05:11:15 -04:00
|
|
|
initialDescriptionHtml: this.initialDescriptionHtml,
|
|
|
|
initialDescriptionText: this.initialDescriptionText,
|
2017-05-15 09:51:40 -04:00
|
|
|
issuableTemplates: this.issuableTemplates,
|
2017-05-15 12:00:16 -04:00
|
|
|
isConfidential: this.isConfidential,
|
2017-05-12 10:52:45 -04:00
|
|
|
markdownPreviewUrl: this.markdownPreviewUrl,
|
2017-05-15 07:28:42 -04:00
|
|
|
markdownDocs: this.markdownDocs,
|
2017-05-16 11:18:52 -04:00
|
|
|
projectPath: this.projectPath,
|
|
|
|
projectNamespace: this.projectNamespace,
|
2017-05-17 08:01:24 -04:00
|
|
|
projectsAutocompleteUrl: this.projectsAutocompleteUrl,
|
2017-06-02 12:17:54 -04:00
|
|
|
updatedAt: this.updatedAt,
|
|
|
|
updatedByName: this.updatedByName,
|
|
|
|
updatedByPath: this.updatedByPath,
|
2017-06-20 05:56:18 -04:00
|
|
|
initialTaskStatus: this.initialTaskStatus,
|
2017-05-12 05:11:15 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
});
|