Commit 94298f55 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '212320-mixin-environments_table_mixin' into 'master'

Move environments_table_mixin to core

See merge request gitlab-org/gitlab!29983
parents 19829d26 db1f9ca0
......@@ -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:
......
export default {
methods: {
shouldShowCanaryCallout() {
return false;
},
shouldRenderDeployBoard() {
return false;
},
},
};
export default {
props: {
canaryDeploymentFeatureId: {
type: String,
required: true,
},
showCanaryDeploymentCallout: {
type: Boolean,
required: true,
},
userCalloutsPath: {
type: String,
required: true,
},
lockPromotionSvgPath: {
type: String,
required: true,
},
helpCanaryDeploymentsPath: {
type: String,
required: true,
},
},
methods: {
shouldShowCanaryCallout(env) {
return env.showCanaryCallout && this.showCanaryDeploymentCallout;
},
shouldRenderDeployBoard(model) {
return model.hasDeployBoard && model.isDeployBoardVisible;
},
},
};
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