debian-mirror-gitlab/app/assets/javascripts/groups/create_edit_form.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
755 B
JavaScript
Raw Normal View History

2022-07-23 23:45:48 +05:30
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);
},
});
});
};