2017-04-27 10:06:17 -04:00
|
|
|
import Vue from 'vue';
|
2019-03-14 06:19:12 -04:00
|
|
|
import canaryCalloutMixin from 'ee_else_ce/environments/mixins/canary_callout_mixin';
|
2017-11-23 07:04:03 -05:00
|
|
|
import environmentsComponent from './components/environments_app.vue';
|
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';
|
|
|
|
|
|
|
|
Vue.use(Translate);
|
2016-10-14 08:14:18 -04:00
|
|
|
|
2018-10-10 02:18:49 -04:00
|
|
|
export default () =>
|
|
|
|
new Vue({
|
|
|
|
el: '#environments-list-view',
|
|
|
|
components: {
|
|
|
|
environmentsComponent,
|
|
|
|
},
|
2019-03-14 06:19:12 -04:00
|
|
|
mixins: [canaryCalloutMixin],
|
2018-10-10 02:18:49 -04:00
|
|
|
data() {
|
|
|
|
const environmentsData = document.querySelector(this.$options.el).dataset;
|
2017-11-23 07:04:03 -05:00
|
|
|
|
2018-10-10 02:18:49 -04:00
|
|
|
return {
|
|
|
|
endpoint: environmentsData.environmentsDataEndpoint,
|
|
|
|
newEnvironmentPath: environmentsData.newEnvironmentPath,
|
|
|
|
helpPagePath: environmentsData.helpPagePath,
|
|
|
|
cssContainerClass: environmentsData.cssClass,
|
2018-11-21 10:13:04 -05:00
|
|
|
canCreateEnvironment: parseBoolean(environmentsData.canCreateEnvironment),
|
|
|
|
canReadEnvironment: parseBoolean(environmentsData.canReadEnvironment),
|
2018-10-10 02:18:49 -04: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,
|
2019-03-14 06:19:12 -04:00
|
|
|
...this.canaryCalloutProps,
|
2018-10-10 02:18:49 -04:00
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|