summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/webhooks/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/webhooks/index.js')
-rw-r--r--app/assets/javascripts/webhooks/index.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/webhooks/index.js b/app/assets/javascripts/webhooks/index.js
new file mode 100644
index 00000000000..1b2b33e44c1
--- /dev/null
+++ b/app/assets/javascripts/webhooks/index.js
@@ -0,0 +1,25 @@
+import Vue from 'vue';
+import FormUrlApp from './components/form_url_app.vue';
+
+export default () => {
+ const el = document.querySelector('.js-vue-webhook-form');
+
+ if (!el) {
+ return null;
+ }
+
+ const { url: initialUrl, urlVariables } = el.dataset;
+
+ return new Vue({
+ el,
+ name: 'WebhookFormRoot',
+ render(createElement) {
+ return createElement(FormUrlApp, {
+ props: {
+ initialUrl,
+ initialUrlVariables: urlVariables ? JSON.parse(urlVariables) : undefined,
+ },
+ });
+ },
+ });
+};