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.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/javascripts/webhooks/index.js b/app/assets/javascripts/webhooks/index.js
index 7d04978280b..6eb7cbea72c 100644
--- a/app/assets/javascripts/webhooks/index.js
+++ b/app/assets/javascripts/webhooks/index.js
@@ -1,5 +1,6 @@
import Vue from 'vue';
import FormUrlApp from './components/form_url_app.vue';
+import TestDropdown from './components/test_dropdown.vue';
export default () => {
const el = document.querySelector('.js-vue-webhook-form');
@@ -23,3 +24,22 @@ export default () => {
},
});
};
+
+const initHookTestDropdown = (el) => {
+ const { items, size } = el.dataset;
+
+ return new Vue({
+ el,
+ render(h) {
+ return h(TestDropdown, {
+ props: {
+ items: JSON.parse(items),
+ size,
+ },
+ });
+ },
+ });
+};
+
+export const initHookTestDropdowns = (selector = '.js-webhook-test-dropdown') =>
+ document.querySelectorAll(selector).forEach(initHookTestDropdown);