debian-mirror-gitlab/app/assets/javascripts/environments/mixins/canary_callout_mixin.js

27 lines
965 B
JavaScript
Raw Normal View History

2020-05-24 23:13:21 +05:30
import { parseBoolean } from '~/lib/utils/common_utils';
2019-07-07 11:18:12 +05:30
export default {
2020-05-24 23:13:21 +05:30
data() {
const data = document.querySelector(this.$options.el).dataset;
return {
canaryDeploymentFeatureId: data.environmentsDataCanaryDeploymentFeatureId,
showCanaryDeploymentCallout: parseBoolean(data.environmentsDataShowCanaryDeploymentCallout),
userCalloutsPath: data.environmentsDataUserCalloutsPath,
lockPromotionSvgPath: data.environmentsDataLockPromotionSvgPath,
helpCanaryDeploymentsPath: data.environmentsDataHelpCanaryDeploymentsPath,
};
},
2019-07-07 11:18:12 +05:30
computed: {
2020-05-24 23:13:21 +05:30
canaryCalloutProps() {
return {
canaryDeploymentFeatureId: this.canaryDeploymentFeatureId,
showCanaryDeploymentCallout: this.showCanaryDeploymentCallout,
userCalloutsPath: this.userCalloutsPath,
lockPromotionSvgPath: this.lockPromotionSvgPath,
helpCanaryDeploymentsPath: this.helpCanaryDeploymentsPath,
};
},
2019-07-07 11:18:12 +05:30
},
};