debian-mirror-gitlab/app/assets/javascripts/groups/members/index.js

33 lines
761 B
JavaScript
Raw Normal View History

2020-11-24 15:15:51 +05:30
import Vue from 'vue';
import Vuex from 'vuex';
2021-01-03 14:25:43 +05:30
import { GlToast } from '@gitlab/ui';
import { parseDataAttributes } from 'ee_else_ce/groups/members/utils';
2020-11-24 15:15:51 +05:30
import App from './components/app.vue';
import membersModule from '~/vuex_shared/modules/members';
2021-01-29 00:20:46 +05:30
export const initGroupMembersApp = (el, tableFields, tableAttrs, requestFormatter) => {
2020-11-24 15:15:51 +05:30
if (!el) {
return () => {};
}
Vue.use(Vuex);
2021-01-03 14:25:43 +05:30
Vue.use(GlToast);
2020-11-24 15:15:51 +05:30
const store = new Vuex.Store({
...membersModule({
2021-01-03 14:25:43 +05:30
...parseDataAttributes(el),
2020-11-24 15:15:51 +05:30
currentUserId: gon.current_user_id || null,
2021-01-03 14:25:43 +05:30
tableFields,
2021-01-29 00:20:46 +05:30
tableAttrs,
2021-01-03 14:25:43 +05:30
requestFormatter,
2020-11-24 15:15:51 +05:30
}),
});
return new Vue({
el,
components: { App },
store,
render: createElement => createElement('app'),
});
};