debian-mirror-gitlab/app/assets/javascripts/alerts_service_settings/index.js

36 lines
736 B
JavaScript
Raw Normal View History

2020-03-13 15:44:24 +05:30
import Vue from 'vue';
import { parseBoolean } from '~/lib/utils/common_utils';
import AlertsServiceForm from './components/alerts_service_form.vue';
export default el => {
if (!el) {
return null;
}
2020-06-23 00:09:42 +05:30
const {
activated: activatedStr,
alertsSetupUrl,
alertsUsageUrl,
formPath,
authorizationKey,
url,
} = el.dataset;
2020-03-13 15:44:24 +05:30
const activated = parseBoolean(activatedStr);
return new Vue({
el,
render(createElement) {
return createElement(AlertsServiceForm, {
props: {
2020-06-23 00:09:42 +05:30
alertsSetupUrl,
alertsUsageUrl,
2020-03-13 15:44:24 +05:30
initialActivated: activated,
formPath,
initialAuthorizationKey: authorizationKey,
url,
},
});
},
});
};