2020-02-15 16:08:49 -05:00
|
|
|
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-03 08:08:21 -04:00
|
|
|
const {
|
|
|
|
activated: activatedStr,
|
|
|
|
alertsSetupUrl,
|
|
|
|
alertsUsageUrl,
|
|
|
|
formPath,
|
|
|
|
authorizationKey,
|
|
|
|
url,
|
2020-06-26 11:08:45 -04:00
|
|
|
disabled,
|
2020-06-03 08:08:21 -04:00
|
|
|
} = el.dataset;
|
2020-06-26 11:08:45 -04:00
|
|
|
|
2020-02-15 16:08:49 -05:00
|
|
|
const activated = parseBoolean(activatedStr);
|
2020-06-26 11:08:45 -04:00
|
|
|
const isDisabled = parseBoolean(disabled);
|
2020-02-15 16:08:49 -05:00
|
|
|
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
render(createElement) {
|
|
|
|
return createElement(AlertsServiceForm, {
|
|
|
|
props: {
|
2020-06-03 08:08:21 -04:00
|
|
|
alertsSetupUrl,
|
|
|
|
alertsUsageUrl,
|
2020-02-15 16:08:49 -05:00
|
|
|
initialActivated: activated,
|
|
|
|
formPath,
|
|
|
|
initialAuthorizationKey: authorizationKey,
|
|
|
|
url,
|
2020-06-26 11:08:45 -04:00
|
|
|
isDisabled,
|
2020-02-15 16:08:49 -05:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|