2017-08-17 22:00:37 +05:30
|
|
|
import Vue from 'vue';
|
2020-05-24 23:13:21 +05:30
|
|
|
import canaryCalloutMixin from './mixins/canary_callout_mixin';
|
2018-03-17 18:26:18 +05:30
|
|
|
import environmentsComponent from './components/environments_app.vue';
|
2019-02-15 15:39:39 +05:30
|
|
|
import { parseBoolean } from '../lib/utils/common_utils';
|
2018-03-17 18:26:18 +05:30
|
|
|
import Translate from '../vue_shared/translate';
|
|
|
|
|
|
|
|
Vue.use(Translate);
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
export default () =>
|
|
|
|
new Vue({
|
|
|
|
el: '#environments-list-view',
|
|
|
|
components: {
|
|
|
|
environmentsComponent,
|
|
|
|
},
|
2019-07-07 11:18:12 +05:30
|
|
|
mixins: [canaryCalloutMixin],
|
2018-12-13 13:39:08 +05:30
|
|
|
data() {
|
|
|
|
const environmentsData = document.querySelector(this.$options.el).dataset;
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
return {
|
|
|
|
endpoint: environmentsData.environmentsDataEndpoint,
|
|
|
|
newEnvironmentPath: environmentsData.newEnvironmentPath,
|
|
|
|
helpPagePath: environmentsData.helpPagePath,
|
2019-09-30 21:07:59 +05:30
|
|
|
deployBoardsHelpPath: environmentsData.deployBoardsHelpPath,
|
2019-02-15 15:39:39 +05:30
|
|
|
canCreateEnvironment: parseBoolean(environmentsData.canCreateEnvironment),
|
|
|
|
canReadEnvironment: parseBoolean(environmentsData.canReadEnvironment),
|
2018-12-13 13:39:08 +05:30
|
|
|
};
|
|
|
|
},
|
|
|
|
render(createElement) {
|
|
|
|
return createElement('environments-component', {
|
|
|
|
props: {
|
|
|
|
endpoint: this.endpoint,
|
|
|
|
newEnvironmentPath: this.newEnvironmentPath,
|
|
|
|
helpPagePath: this.helpPagePath,
|
2019-09-30 21:07:59 +05:30
|
|
|
deployBoardsHelpPath: this.deployBoardsHelpPath,
|
2018-12-13 13:39:08 +05:30
|
|
|
canCreateEnvironment: this.canCreateEnvironment,
|
|
|
|
canReadEnvironment: this.canReadEnvironment,
|
2019-07-07 11:18:12 +05:30
|
|
|
...this.canaryCalloutProps,
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|