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,
|
2020-07-28 23:09:34 +05:30
|
|
|
disabled,
|
2020-06-23 00:09:42 +05:30
|
|
|
} = el.dataset;
|
2020-07-28 23:09:34 +05:30
|
|
|
|
2020-03-13 15:44:24 +05:30
|
|
|
const activated = parseBoolean(activatedStr);
|
2020-07-28 23:09:34 +05:30
|
|
|
const isDisabled = parseBoolean(disabled);
|
2020-03-13 15:44:24 +05:30
|
|
|
|
|
|
|
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,
|
2020-07-28 23:09:34 +05:30
|
|
|
isDisabled,
|
2020-03-13 15:44:24 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|