[Frontend] Multiple blocking merge request approval rules
Frontend Issue for: https://gitlab.com/gitlab-org/gitlab-ee/issues/1979
Please refer to the description of the parent issue for up-to-date information.
This issue was created to track Frontend weight independently of Backend.
Some details
- Settings form
- MR new / edit form
- MR Widget
Basic initial wireframe here (not final): : https://gitlab.com/gitlab-org/gitlab-ee/uploads/d0d81219351363f0aaf01a498d7e6150/approvals.png
Iteration Plan
-
Move MR approval settings. Same behavior, just moved to it's own settings section and refactored into Vue. Here's the design, except we'll keep the existing behavior instead of the blue box:
-
Update MR approval section in MR widget. Here's the design:
-
FE for "Multiple blocking merge request approval rules". This is the full implementation (see designs).
FE/BE Plan
Here's a rough draft of the things the FE will need from an API.
(Warning: This if just a rough draft. The routes and property names may not be accurate.)
#############
# 1. Routes #
#############
https://docs.google.com/spreadsheets/d/1LoosFEFsWPmZhB5f6MnGq0fxp1zCoqyGOOG0uFmd2MA/edit?usp=sharing
##############
# 2. Schemas #
##############
These schemas are referenced by other schemas and the routes above.
Please see the routes above for context.
ProjectApprovalRuleSettings {
id: Id,
name: String, # Name of the approval rule
users: [User],
groups: [Groups],
approvalsRequired: Integer, # Number of required approvals for this rule
}
ProjectApprovalRule {
id: Id,
name: String, # Name of the approval rule
approvers: [User], # List of elligible approvers for this rule
approvalsRequired: Integer, # Number of required approvals for this rule
}
MergeRequestApprovalRuleAttributes {
id: Id, # ID of the ProjectApprovalRule
approvalsRequired: Integer, # Required count that was set in this MR
}
MergeRequestApprovalRule {
id: Id,
name: String, # Name given to the approval rule
approvers: [User], # List of eligible approvers for this rule
approvalsRequired: Integer, # Number of required approvals for this rule
approvedBy: [User], # List of users that have approved and match this rule
}
MergeRequestApprovalSummary {
approvalsLeft: Integer, # The number of approvals left
approvalRulesLeft: [String], # The names of the approval rules that are not yet fully approved
approvedBy: [User], # The approvers of this MR
suggestedApprovers: [User],
}
MergeRequestApprovalRule {
[MergeRequestApprovalRule] # Array of all rules
}
MergeRequest {
..., # Existing MR properties
approvalRulesAttributes: [MergeRequestApprovalRuleAttributes] # Array of rule ID and overridden counts
}
Notes:
- We'll want the
POST
andDELETE
ofproject/merge_request/{id}/approvals
to also accept the?type=full
parameter.
TODO
-
Update approval promotion text _promote_mr_features.html.haml
Edited by Paul Slaughter