Commit 894ec095 authored by Mark Florian's avatar Mark Florian

Merge branch '212320-mixin-env-item' into 'master'

Moved environment_item_mixin out of ee folder

See merge request gitlab-org/gitlab!30058
parents ddc04584 ea86d8f4
...@@ -9,7 +9,6 @@ import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link ...@@ -9,7 +9,6 @@ import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link
import CommitComponent from '~/vue_shared/components/commit.vue'; import CommitComponent from '~/vue_shared/components/commit.vue';
import Icon from '~/vue_shared/components/icon.vue'; import Icon from '~/vue_shared/components/icon.vue';
import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate.vue';
import environmentItemMixin from 'ee_else_ce/environments/mixins/environment_item_mixin';
import eventHub from '../event_hub'; import eventHub from '../event_hub';
import ActionsComponent from './environment_actions.vue'; import ActionsComponent from './environment_actions.vue';
import ExternalUrlComponent from './environment_external_url.vue'; import ExternalUrlComponent from './environment_external_url.vue';
...@@ -44,7 +43,7 @@ export default { ...@@ -44,7 +43,7 @@ export default {
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
}, },
mixins: [environmentItemMixin, timeagoMixin], mixins: [timeagoMixin],
props: { props: {
canReadEnvironment: { canReadEnvironment: {
...@@ -65,6 +64,9 @@ export default { ...@@ -65,6 +64,9 @@ export default {
}, },
computed: { computed: {
deployIconName() {
return this.model.isDeployBoardVisible ? 'chevron-down' : 'chevron-right';
},
/** /**
* Verifies if `last_deployment` key exists in the current Environment. * Verifies if `last_deployment` key exists in the current Environment.
* This key is required to render most of the html - this method works has * This key is required to render most of the html - this method works has
...@@ -210,6 +212,10 @@ export default { ...@@ -210,6 +212,10 @@ export default {
})); }));
}, },
shouldRenderDeployBoard() {
return this.model.hasDeployBoard;
},
/** /**
* Builds the string used in the user image alt attribute. * Builds the string used in the user image alt attribute.
* *
...@@ -501,6 +507,9 @@ export default { ...@@ -501,6 +507,9 @@ export default {
}, },
methods: { methods: {
toggleDeployBoard() {
eventHub.$emit('toggleDeployBoard', this.model);
},
onClickFolder() { onClickFolder() {
eventHub.$emit('toggleFolder', this.model); eventHub.$emit('toggleFolder', this.model);
}, },
......
export default {
computed: {
deployIconName() {
return '';
},
shouldRenderDeployBoard() {
return false;
},
},
methods: {
toggleDeployBoard() {},
},
};
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