Commit 314f1e1d authored by peterhegman's avatar peterhegman

Fix console error caused by missing mount element

"Allow access to the following IP addresses" and
"Restrict membership by email domain" fields are only shown on the
root group. This was causing console errors on the subgroups because
the mount element was missing.
parent 02423421
...@@ -2,7 +2,11 @@ import Vue from 'vue'; ...@@ -2,7 +2,11 @@ import Vue from 'vue';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import CommaSeparatedListTokenSelector from '../components/comma_separated_list_token_selector.vue'; import CommaSeparatedListTokenSelector from '../components/comma_separated_list_token_selector.vue';
export default (el, props = {}, qaSelector, customValidator) => { export default (selector, props = {}, qaSelector, customValidator) => {
const el = document.querySelector(selector);
if (!el) return;
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el, el,
...@@ -10,9 +14,7 @@ export default (el, props = {}, qaSelector, customValidator) => { ...@@ -10,9 +14,7 @@ export default (el, props = {}, qaSelector, customValidator) => {
CommaSeparatedListTokenSelector, CommaSeparatedListTokenSelector,
}, },
data() { data() {
const { hiddenInputId, labelId, regexValidator, disallowedValues } = document.querySelector( const { hiddenInputId, labelId, regexValidator, disallowedValues } = el.dataset;
this.$options.el,
).dataset;
return { return {
hiddenInputId, hiddenInputId,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment