gitlab-org--gitlab-foss/app/assets/javascripts/environments/folder/environments_folder_bundle.js

49 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-04-27 10:06:17 -04:00
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import createDefaultClient from '~/lib/graphql';
import { parseBoolean } from '../../lib/utils/common_utils';
2017-11-23 07:04:03 -05:00
import Translate from '../../vue_shared/translate';
import environmentsFolderApp from './environments_folder_view.vue';
2017-11-23 07:04:03 -05:00
Vue.use(Translate);
Vue.use(VueApollo);
2017-02-12 09:55:18 -05:00
const apolloProvider = new VueApollo({
defaultClient: createDefaultClient(),
});
export default () => {
const el = document.getElementById('environments-folder-list-view');
return new Vue({
el,
components: {
environmentsFolderApp,
},
apolloProvider,
provide: {
projectPath: el.dataset.projectPath,
},
data() {
const environmentsData = el.dataset;
2017-11-23 07:04:03 -05:00
return {
endpoint: environmentsData.environmentsDataEndpoint,
folderName: environmentsData.environmentsDataFolderName,
cssContainerClass: environmentsData.cssClass,
canReadEnvironment: parseBoolean(environmentsData.environmentsDataCanReadEnvironment),
};
},
render(createElement) {
return createElement('environments-folder-app', {
props: {
endpoint: this.endpoint,
folderName: this.folderName,
cssContainerClass: this.cssContainerClass,
canReadEnvironment: this.canReadEnvironment,
},
});
},
});
};