2017-04-27 14:06:17 +00:00
|
|
|
import Vue from 'vue';
|
2017-11-23 12:04:03 +00:00
|
|
|
import environmentsComponent from './components/environments_app.vue';
|
2018-11-21 15:13:04 +00:00
|
|
|
import { parseBoolean } from '../lib/utils/common_utils';
|
2017-11-23 12:04:03 +00:00
|
|
|
import Translate from '../vue_shared/translate';
|
|
|
|
|
|
|
|
Vue.use(Translate);
|
2016-10-14 12:14:18 +00:00
|
|
|
|
2018-10-10 06:18:49 +00:00
|
|
|
export default () =>
|
|
|
|
new Vue({
|
|
|
|
el: '#environments-list-view',
|
|
|
|
components: {
|
|
|
|
environmentsComponent,
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
const environmentsData = document.querySelector(this.$options.el).dataset;
|
2017-11-23 12:04:03 +00:00
|
|
|
|
2018-10-10 06:18:49 +00:00
|
|
|
return {
|
|
|
|
endpoint: environmentsData.environmentsDataEndpoint,
|
|
|
|
newEnvironmentPath: environmentsData.newEnvironmentPath,
|
|
|
|
helpPagePath: environmentsData.helpPagePath,
|
|
|
|
cssContainerClass: environmentsData.cssClass,
|
2018-11-21 15:13:04 +00:00
|
|
|
canCreateEnvironment: parseBoolean(environmentsData.canCreateEnvironment),
|
|
|
|
canReadEnvironment: parseBoolean(environmentsData.canReadEnvironment),
|
2018-10-10 06:18:49 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('environments-component', {
|
|
|
|
props: {
|
|
|
|
endpoint: this.endpoint,
|
|
|
|
newEnvironmentPath: this.newEnvironmentPath,
|
|
|
|
helpPagePath: this.helpPagePath,
|
|
|
|
cssContainerClass: this.cssContainerClass,
|
|
|
|
canCreateEnvironment: this.canCreateEnvironment,
|
|
|
|
canReadEnvironment: this.canReadEnvironment,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|