debian-mirror-gitlab/app/assets/javascripts/projects/settings_service_desk/index.js

44 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-07-28 23:09:34 +05:30
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import ServiceDeskRoot from './components/service_desk_root.vue';
export default () => {
const serviceDeskRootElement = document.querySelector('.js-service-desk-setting-root');
if (serviceDeskRootElement) {
// eslint-disable-next-line no-new
new Vue({
el: serviceDeskRootElement,
components: {
ServiceDeskRoot,
},
data() {
const { dataset } = serviceDeskRootElement;
return {
initialIsEnabled: parseBoolean(dataset.enabled),
endpoint: dataset.endpoint,
incomingEmail: dataset.incomingEmail,
2021-01-29 00:20:46 +05:30
customEmail: dataset.customEmail,
2020-07-28 23:09:34 +05:30
selectedTemplate: dataset.selectedTemplate,
outgoingName: dataset.outgoingName,
projectKey: dataset.projectKey,
templates: JSON.parse(dataset.templates),
};
},
render(createElement) {
return createElement('service-desk-root', {
props: {
initialIsEnabled: this.initialIsEnabled,
endpoint: this.endpoint,
2021-01-29 00:20:46 +05:30
incomingEmail: this.incomingEmail,
customEmail: this.customEmail,
2020-07-28 23:09:34 +05:30
selectedTemplate: this.selectedTemplate,
outgoingName: this.outgoingName,
projectKey: this.projectKey,
templates: this.templates,
},
});
},
});
}
};