Commit d408a892 authored by Kushal Pandya's avatar Kushal Pandya

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

Move environments_app_mixin out of ee folder

See merge request gitlab-org/gitlab!29987
parents ae3c210a 351225fd
<script> <script>
import { GlDeprecatedButton } from '@gitlab/ui'; import { GlDeprecatedButton } from '@gitlab/ui';
import envrionmentsAppMixin from 'ee_else_ce/environments/mixins/environments_app_mixin';
import Flash from '~/flash'; import Flash from '~/flash';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import emptyState from './empty_state.vue'; import emptyState from './empty_state.vue';
...@@ -22,13 +21,18 @@ export default { ...@@ -22,13 +21,18 @@ export default {
DeleteEnvironmentModal, DeleteEnvironmentModal,
}, },
mixins: [CIPaginationMixin, environmentsMixin, envrionmentsAppMixin], mixins: [CIPaginationMixin, environmentsMixin],
props: { props: {
endpoint: { endpoint: {
type: String, type: String,
required: true, required: true,
}, },
canaryDeploymentFeatureId: {
type: String,
required: false,
default: '',
},
canCreateEnvironment: { canCreateEnvironment: {
type: Boolean, type: Boolean,
required: true, required: true,
...@@ -41,6 +45,11 @@ export default { ...@@ -41,6 +45,11 @@ export default {
type: String, type: String,
required: true, required: true,
}, },
helpCanaryDeploymentsPath: {
type: String,
required: false,
default: '',
},
helpPagePath: { helpPagePath: {
type: String, type: String,
required: true, required: true,
...@@ -50,17 +59,37 @@ export default { ...@@ -50,17 +59,37 @@ export default {
required: false, required: false,
default: '', default: '',
}, },
lockPromotionSvgPath: {
type: String,
required: false,
default: '',
},
showCanaryDeploymentCallout: {
type: Boolean,
required: false,
default: false,
},
userCalloutsPath: {
type: String,
required: false,
default: '',
},
}, },
created() { created() {
eventHub.$on('toggleFolder', this.toggleFolder); eventHub.$on('toggleFolder', this.toggleFolder);
eventHub.$on('toggleDeployBoard', this.toggleDeployBoard);
}, },
beforeDestroy() { beforeDestroy() {
eventHub.$off('toggleFolder'); eventHub.$off('toggleFolder');
eventHub.$off('toggleDeployBoard');
}, },
methods: { methods: {
toggleDeployBoard(model) {
this.store.toggleDeployBoard(model.id);
},
toggleFolder(folder) { toggleFolder(folder) {
this.store.toggleFolder(folder); this.store.toggleFolder(folder);
......
export default {
props: {
canaryDeploymentFeatureId: {
type: String,
required: false,
default: '',
},
showCanaryDeploymentCallout: {
type: Boolean,
required: false,
default: false,
},
userCalloutsPath: {
type: String,
required: false,
default: '',
},
lockPromotionSvgPath: {
type: String,
required: false,
default: '',
},
helpCanaryDeploymentsPath: {
type: String,
required: false,
default: '',
},
},
metods: {
toggleDeployBoard() {},
},
};
...@@ -132,6 +132,17 @@ export default class EnvironmentsStore { ...@@ -132,6 +132,17 @@ export default class EnvironmentsStore {
return count; return count;
} }
/**
* Toggles deploy board visibility for the provided environment ID.
* Currently only works on EE.
*
* @param {Object} environment
* @return {Array}
*/
toggleDeployBoard() {
return this.state.environments;
}
/** /**
* Toggles folder open property for the given folder. * Toggles folder open property for the given folder.
* *
......
import eventHub from '~/environments/event_hub';
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,
},
},
created() {
eventHub.$on('toggleDeployBoard', this.toggleDeployBoard);
},
beforeDestroy() {
eventHub.$off('toggleDeployBoard');
},
methods: {
/**
* Toggles the visibility of the deploy boards of the clicked environment.
* @param {Object} model
*/
toggleDeployBoard(model) {
this.store.toggleDeployBoard(model.id);
},
},
};
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