debian-mirror-gitlab/app/assets/javascripts/environments/folder/environments_folder_bundle.js

36 lines
1.1 KiB
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Vue from 'vue';
2018-03-17 18:26:18 +05:30
import environmentsFolderApp from './environments_folder_view.vue';
import { convertPermissionToBoolean } from '../../lib/utils/common_utils';
import Translate from '../../vue_shared/translate';
Vue.use(Translate);
2017-08-17 22:00:37 +05:30
2018-03-27 19:54:05 +05:30
export default () => new Vue({
2017-08-17 22:00:37 +05:30
el: '#environments-folder-list-view',
components: {
2018-03-17 18:26:18 +05:30
environmentsFolderApp,
},
data() {
const environmentsData = document.querySelector(this.$options.el).dataset;
return {
endpoint: environmentsData.endpoint,
folderName: environmentsData.folderName,
cssContainerClass: environmentsData.cssClass,
canCreateDeployment: convertPermissionToBoolean(environmentsData.canCreateDeployment),
canReadEnvironment: convertPermissionToBoolean(environmentsData.canReadEnvironment),
};
},
render(createElement) {
return createElement('environments-folder-app', {
props: {
endpoint: this.endpoint,
folderName: this.folderName,
cssContainerClass: this.cssContainerClass,
canCreateDeployment: this.canCreateDeployment,
canReadEnvironment: this.canReadEnvironment,
},
});
2017-08-17 22:00:37 +05:30
},
2018-03-27 19:54:05 +05:30
});