Skip to content
Snippets Groups Projects

Add deployment approval UI MVC

Merged Andrew Fontaine requested to merge afontaine/deployment-approval into master
All threads resolved!
16 files
+ 556
10
Compare changes
  • Side-by-side
  • Inline
Files
16
  • 9e5aa83a
    Add deployment approval UI MVC · 9e5aa83a
    Andrew Fontaine authored
    Sets up the ability for users to approve and reject deployments from
    within the environments page.
    
    Current information shown is how many approvals are needed and how many
    are done, as well as who has approved and when.
    
    A rejection short cuts to killing the deployment.
    
    This is currently only in the new environment UI, as the old one is
    going away.
    
    Changelog: added
@@ -102,6 +102,9 @@ export default {
@@ -102,6 +102,9 @@ export default {
refPath() {
refPath() {
return this.ref?.refPath;
return this.ref?.refPath;
},
},
 
needsApproval() {
 
return this.deployment.pendingApprovalCount > 0;
 
},
},
},
methods: {
methods: {
toggleCollapse() {
toggleCollapse() {
@@ -116,6 +119,7 @@ export default {
@@ -116,6 +119,7 @@ export default {
showDetails: __('Show details'),
showDetails: __('Show details'),
hideDetails: __('Hide details'),
hideDetails: __('Hide details'),
triggerer: s__('Deployment|Triggerer'),
triggerer: s__('Deployment|Triggerer'),
 
needsApproval: s__('Deployment|Needs Approval'),
job: __('Job'),
job: __('Job'),
api: __('API'),
api: __('API'),
branch: __('Branch'),
branch: __('Branch'),
@@ -153,6 +157,9 @@ export default {
@@ -153,6 +157,9 @@ export default {
<div :class="$options.headerDetailsClasses">
<div :class="$options.headerDetailsClasses">
<div :class="$options.deploymentStatusClasses">
<div :class="$options.deploymentStatusClasses">
<deployment-status-badge v-if="status" :status="status" />
<deployment-status-badge v-if="status" :status="status" />
 
<gl-badge v-if="needsApproval" variant="warning">
 
{{ $options.i18n.needsApproval }}
 
</gl-badge>
<gl-badge v-if="latest" variant="info">{{ $options.i18n.latestBadge }}</gl-badge>
<gl-badge v-if="latest" variant="info">{{ $options.i18n.latestBadge }}</gl-badge>
</div>
</div>
<div class="gl-display-flex gl-align-items-center gl-gap-x-5">
<div class="gl-display-flex gl-align-items-center gl-gap-x-5">
@@ -199,6 +206,7 @@ export default {
@@ -199,6 +206,7 @@ export default {
</gl-button>
</gl-button>
</div>
</div>
<commit v-if="commit" :commit="commit" class="gl-mt-3" />
<commit v-if="commit" :commit="commit" class="gl-mt-3" />
 
<div class="gl-mt-3"><slot name="approval" /></div>
<gl-collapse :visible="visible">
<gl-collapse :visible="visible">
<div
<div
class="gl-display-flex gl-md-align-items-center gl-mt-5 gl-flex-direction-column gl-md-flex-direction-row gl-pr-4 gl-md-pr-0"
class="gl-display-flex gl-md-align-items-center gl-mt-5 gl-flex-direction-column gl-md-flex-direction-row gl-pr-4 gl-md-pr-0"
Loading