diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-24 21:09:46 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-24 21:09:46 +0300 |
commit | aca82d5ba49a8d2cf7ca30ac4ee6dcbd62b47cff (patch) | |
tree | 3ce0eff868aab025bc85c37d921582217f4c69f9 /app/assets/javascripts/environments | |
parent | 8a840df2e433bc39d033b20e64402fa3f56445d3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/environments')
4 files changed, 42 insertions, 27 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.vue b/app/assets/javascripts/environments/components/environment_item.vue index 335c668474e..fa3d217f148 100644 --- a/app/assets/javascripts/environments/components/environment_item.vue +++ b/app/assets/javascripts/environments/components/environment_item.vue @@ -9,7 +9,6 @@ import UserAvatarLink from '~/vue_shared/components/user_avatar/user_avatar_link import CommitComponent from '~/vue_shared/components/commit.vue'; import Icon from '~/vue_shared/components/icon.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 ActionsComponent from './environment_actions.vue'; import ExternalUrlComponent from './environment_external_url.vue'; @@ -44,7 +43,7 @@ export default { directives: { GlTooltip: GlTooltipDirective, }, - mixins: [environmentItemMixin, timeagoMixin], + mixins: [timeagoMixin], props: { canReadEnvironment: { @@ -65,6 +64,9 @@ export default { }, computed: { + deployIconName() { + return this.model.isDeployBoardVisible ? 'chevron-down' : 'chevron-right'; + }, /** * Verifies if `last_deployment` key exists in the current Environment. * This key is required to render most of the html - this method works has @@ -210,6 +212,10 @@ export default { })); }, + shouldRenderDeployBoard() { + return this.model.hasDeployBoard; + }, + /** * Builds the string used in the user image alt attribute. * @@ -501,6 +507,9 @@ export default { }, methods: { + toggleDeployBoard() { + eventHub.$emit('toggleDeployBoard', this.model); + }, onClickFolder() { eventHub.$emit('toggleFolder', this.model); }, diff --git a/app/assets/javascripts/environments/components/environments_table.vue b/app/assets/javascripts/environments/components/environments_table.vue index 89e40faa23e..380e16c7b71 100644 --- a/app/assets/javascripts/environments/components/environments_table.vue +++ b/app/assets/javascripts/environments/components/environments_table.vue @@ -4,7 +4,6 @@ */ import { GlLoadingIcon } from '@gitlab/ui'; import { flow, reverse, sortBy } from 'lodash/fp'; -import environmentTableMixin from 'ee_else_ce/environments/mixins/environments_table_mixin'; import { s__ } from '~/locale'; import EnvironmentItem from './environment_item.vue'; @@ -16,7 +15,6 @@ export default { CanaryDeploymentCallout: () => import('ee_component/environments/components/canary_deployment_callout.vue'), }, - mixins: [environmentTableMixin], props: { environments: { type: Array, @@ -33,6 +31,31 @@ export default { required: false, default: false, }, + canaryDeploymentFeatureId: { + type: String, + required: false, + default: '', + }, + helpCanaryDeploymentsPath: { + type: String, + required: false, + default: '', + }, + lockPromotionSvgPath: { + type: String, + required: false, + default: '', + }, + showCanaryDeploymentCallout: { + type: Boolean, + required: false, + default: false, + }, + userCalloutsPath: { + type: String, + required: false, + default: '', + }, }, computed: { sortedEnvironments() { @@ -79,9 +102,15 @@ export default { folderUrl(model) { return `${window.location.pathname}/folders/${model.folderName}`; }, + shouldRenderDeployBoard(model) { + return model.hasDeployBoard && model.isDeployBoardVisible; + }, shouldRenderFolderContent(env) { return env.isFolder && env.isOpen && env.children && env.children.length > 0; }, + shouldShowCanaryCallout(env) { + return env.showCanaryCallout && this.showCanaryDeploymentCallout; + }, sortEnvironments(environments) { /* * The sorting algorithm should sort in the following priorities: diff --git a/app/assets/javascripts/environments/mixins/environment_item_mixin.js b/app/assets/javascripts/environments/mixins/environment_item_mixin.js deleted file mode 100644 index 2dfed36ec99..00000000000 --- a/app/assets/javascripts/environments/mixins/environment_item_mixin.js +++ /dev/null @@ -1,13 +0,0 @@ -export default { - computed: { - deployIconName() { - return ''; - }, - shouldRenderDeployBoard() { - return false; - }, - }, - methods: { - toggleDeployBoard() {}, - }, -}; diff --git a/app/assets/javascripts/environments/mixins/environments_table_mixin.js b/app/assets/javascripts/environments/mixins/environments_table_mixin.js deleted file mode 100644 index 208f1a7373d..00000000000 --- a/app/assets/javascripts/environments/mixins/environments_table_mixin.js +++ /dev/null @@ -1,10 +0,0 @@ -export default { - methods: { - shouldShowCanaryCallout() { - return false; - }, - shouldRenderDeployBoard() { - return false; - }, - }, -}; |