Add ability for guest overage confirmation to return a promise
What does this MR do and why?
On the Manage
-> Members
page, clicking on a role for any member shows the role details drawer. Changing the role in the drawer and saving it will run a guest overage check. If an overage will happen, a warning modal is shown to the user:
Role details drawer | Overage warning modal |
---|---|
![]() |
![]() |
Previously, the overage check component required a callback method for when the overage check is confirmed. To make the component easier to use, this MR adds the ability for it to return a promise as well.
How to set up and validate locally
- Enable the
show_role_details_in_drawer
feature flag:
echo "Feature.enable(:show_role_details_in_drawer)" | rails c
- The guest overage feature is still under development. To force the modal to show, apply this patch:
Index: ee/app/assets/javascripts/members/components/table/drawer/guest_overage_confirmation.vue
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/ee/app/assets/javascripts/members/components/table/drawer/guest_overage_confirmation.vue b/ee/app/assets/javascripts/members/components/table/drawer/guest_overage_confirmation.vue
--- a/ee/app/assets/javascripts/members/components/table/drawer/guest_overage_confirmation.vue (revision 3eb977ffcdaf12e05caa9f63c3e7cd9fa8f62caf)
+++ b/ee/app/assets/javascripts/members/components/table/drawer/guest_overage_confirmation.vue (date 1720435073165)
@@ -74,7 +74,7 @@
// modal. Otherwise, act as if the overage warning was accepted and emit the confirm event.
checkOverage() {
return new Promise((resolve, reject) => {
- if (this.shouldSkipConfirmationCheck) {
+ if (!this.shouldSkipConfirmationCheck) {
this.emitConfirm();
resolve(true);
return;
@@ -97,7 +97,7 @@
const { willIncreaseOverage, seatsInSubscription, newBillableUserCount } =
response?.data?.group?.gitlabSubscriptionsPreviewBillableUserChange || {};
// If the overage won't increase or if there's no subscription data, don't show the modal.
- if (!willIncreaseOverage || isNil(seatsInSubscription) || isNil(newBillableUserCount)) {
+ if (willIncreaseOverage || isNil(seatsInSubscription) || isNil(newBillableUserCount)) {
this.emitConfirm();
resolve(true);
return;
- Follow this video walkthrough (with audio commentary) for validation steps:
Related to #464104