blob: 8ca0e6077e972d7cf019fc139a54d0af644d5c81 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import Vue from 'vue';
import { parseRailsFormFields } from '~/lib/utils/forms';
import { parseBoolean } from '~/lib/utils/common_utils';
import GroupNameAndPath from './components/group_name_and_path.vue';
export const initGroupNameAndPath = () => {
const elements = document.querySelectorAll('.js-group-name-and-path');
if (!elements.length) {
return;
}
elements.forEach((element) => {
const fields = parseRailsFormFields(element);
const { basePath, mattermostEnabled } = element.dataset;
return new Vue({
el: element,
provide: {
fields,
basePath,
mattermostEnabled: parseBoolean(mattermostEnabled),
},
render(h) {
return h(GroupNameAndPath);
},
});
});
};
|