"Needs approval" badge shown for finished deployments
Summary
The "Needs approval" badge is incorrectly displayed for finished deployments on Environments and Environments folder pages.
Steps to reproduce
- Navigate to a project with protected environments requiring approval
- Go to the Environments or Environments folder page
- Observe that finished deployments still show the "Needs approval" badge
What is the current bug behavior?
The "Needs approval" badge remains visible for deployments that have already finished, incorrectly suggesting that these deployments still require approval.
What is the expected correct behavior?
The "Needs approval" badge should only be shown for deployments that actually require approval, and should be hidden for deployments that have already finished.
Relevant logs and/or screenshots
Implementation guide
- Update
needsApprovalcomputed inenvironments/components/deployment.vueto check for finished state. UseisFinishedutil fromdeployments/utilsto check finished state. Don't render approval badge for finished deployments.
needsApproval() {
return (
!this.isFinished({ status: this.deployment.status }) &&
this.deployment.pendingApprovalCount > 0
);
},
- Note:
isFinishedmethod expects uppercased status - Update the related spec
Related to https://gitlab.com/gitlab-com/account-management/commercial/arcesium/-/issues/38 (internal)
Edited by 🤖 GitLab Bot 🤖
