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

40 lines
872 B
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 () => {
2021-03-11 19:13:27 +05:30
const el = document.querySelector('.js-service-desk-setting-root');
if (!el) {
return false;
2020-07-28 23:09:34 +05:30
}
2021-03-11 19:13:27 +05:30
const {
customEmail,
customEmailEnabled,
enabled,
endpoint,
incomingEmail,
outgoingName,
projectKey,
selectedTemplate,
templates,
} = el.dataset;
return new Vue({
el,
provide: {
customEmail,
customEmailEnabled: parseBoolean(customEmailEnabled),
endpoint,
initialIncomingEmail: incomingEmail,
initialIsEnabled: parseBoolean(enabled),
outgoingName,
projectKey,
selectedTemplate,
templates: JSON.parse(templates),
},
render: (createElement) => createElement(ServiceDeskRoot),
});
2020-07-28 23:09:34 +05:30
};