Commit e3929359 authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Phil Hughes

Removes EE differences from environmnet_item

Creares a mixin & moves the EE template
differences into CE
parent 1b53409f
......@@ -4,6 +4,7 @@ import _ from 'underscore';
import { GlTooltipDirective } from '@gitlab/ui';
import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link.vue';
import Icon from '~/vue_shared/components/icon.vue';
import environmentItemMixin from 'ee_else_ce/environments/mixins/environment_item_mixin';
import ActionsComponent from './environment_actions.vue';
import ExternalUrlComponent from './environment_external_url.vue';
import StopComponent from './environment_stop.vue';
......@@ -34,10 +35,10 @@ export default {
TerminalButtonComponent,
MonitoringButtonComponent,
},
directives: {
GlTooltip: GlTooltipDirective,
},
mixins: [environmentItemMixin],
props: {
model: {
......@@ -440,19 +441,12 @@ export default {
folderIconName() {
return this.model.isOpen ? 'chevron-down' : 'chevron-right';
},
deployIconName() {
return this.model.isDeployBoardVisible ? 'chevron-down' : 'chevron-right';
},
},
methods: {
onClickFolder() {
eventHub.$emit('toggleFolder', this.model);
},
toggleDeployBoard() {
eventHub.$emit('toggleDeployBoard', this.model);
},
},
};
</script>
......@@ -475,7 +469,7 @@ export default {
{{ s__('Environments|Environment') }}
</div>
<span v-if="model.hasDeployBoard" class="deploy-board-icon" @click="toggleDeployBoard">
<span v-if="shouldRenderDeployBoard" class="deploy-board-icon" @click="toggleDeployBoard">
<icon :name="deployIconName" />
</span>
......@@ -485,6 +479,7 @@ export default {
{{ s__('Environments|protected') }}
</span>
</span>
<span v-else class="folder-name" role="button" @click="onClickFolder">
<icon :name="folderIconName" class="folder-icon" />
......
export default {
computed: {
deployIconName() {
return '';
},
shouldRenderDeployBoard() {
return false;
},
},
methods: {
toggleDeployBoard() {},
},
};
---
title: Removes EE differences for environment_item.vue
merge_request:
author:
type: other
import eventHub from '~/environments/event_hub';
export default {
computed: {
deployIconName() {
return this.model.isDeployBoardVisible ? 'chevron-down' : 'chevron-right';
},
shouldRenderDeployBoard() {
return this.model.hasDeployBoard;
},
},
methods: {
toggleDeployBoard() {
eventHub.$emit('toggleDeployBoard', this.model);
},
},
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment