debian-mirror-gitlab/app/assets/javascripts/import_projects/index.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-07-07 11:18:12 +05:30
import Vue from 'vue';
import { mapActions } from 'vuex';
import Translate from '../vue_shared/translate';
import ImportProjectsTable from './components/import_projects_table.vue';
import { parseBoolean } from '../lib/utils/common_utils';
import createStore from './store';
Vue.use(Translate);
export default function mountImportProjectsTable(mountElement) {
if (!mountElement) return undefined;
const {
reposPath,
provider,
providerTitle,
canSelectNamespace,
jobsPath,
importPath,
ciCdOnly,
} = mountElement.dataset;
const store = createStore();
return new Vue({
el: mountElement,
store,
created() {
this.setInitialData({
reposPath,
provider,
jobsPath,
importPath,
defaultTargetNamespace: gon.current_username,
ciCdOnly: parseBoolean(ciCdOnly),
canSelectNamespace: parseBoolean(canSelectNamespace),
});
},
methods: {
2019-12-21 20:55:43 +05:30
...mapActions(['setInitialData', 'setFilter']),
2019-07-07 11:18:12 +05:30
},
render(createElement) {
return createElement(ImportProjectsTable, { props: { providerTitle } });
},
});
}