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