Skip to content

Conversation

@niko-exo
Copy link

@niko-exo niko-exo commented Jan 2, 2026

ref: https://app.clickup.com/t/86b7yxuzh

86b7yxuzh - fix: close modal on succesful approval

Changelog

  • Unit test close modal behavior.
  • Add mocks.
  • Missing import of lodash.
  • Close modal after executing process request service call.

Link

86b7yxuzh - Sponsor users - Show Level - Access Request Approval - Modal should be closed after a successful approval

Evidence

2025-12-31_14-35-51.mp4

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed sponsor user request popup to ensure the processing completes before closing the dialog.

✏️ Tip: You can customize this high-level summary in your review settings.

fetchResponseHandler,
fetchErrorHandler
} from "openstack-uicore-foundation/lib/utils/actions";
import * as _ from "lodash";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niko-exo why do we need this ?

Copy link

@smarcet smarcet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@niko-exo please review comments

@smarcet
Copy link

smarcet commented Jan 19, 2026

LGTM

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Lodash imports are migrated from default to namespace syntax across three action files. A new test suite with comprehensive mock data is added for the ProcessRequestPopup component. The component's save handler is made asynchronous to await sponsor user request processing before closing the dialog.

Changes

Cohort / File(s) Summary
Lodash Import Migration
src/actions/company-actions.js, src/actions/sponsor-actions.js
Changed lodash import style from default (import _ from "lodash") to namespace (import * as _ from "lodash"). No runtime behavior changes.
Lodash Import Addition
src/actions/sponsorship-actions.js
Added namespace lodash import (import * as _ from "lodash"). Note: File may already contain a default lodash import, creating redundancy.
ProcessRequestPopup Component Logic
src/pages/sponsors/sponsor-users-list-page/components/process-request-popup.js
Made handleProcess async to await processSponsorUserRequest completion before invoking handleClose, ensuring popup closes only after request processing completes.
ProcessRequestPopup Test Infrastructure
src/pages/sponsors/sponsor-users-list-page/components/__tests__/process-request-popup.test.js, src/pages/sponsors/sponsor-users-list-page/components/__tests__/userGroups.mock.json
Added unit test file mocking sponsor user actions and lodash debounce, rendering component with sample request and Redux state, and verifying both processSponsorUserRequest invocation and onClose callback. Comprehensive mock JSON fixture with 15 paginated user records containing varied sponsorships, access rights, and group memberships.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

Poem

🐰 With namespace imports neat and clean,
The lodash utilities are seen!
Tests now guard the popup's flow,
Async handlers steal the show—
Mock data flows like gentle streams,
Making sponsors' user dreams!

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@smarcet smarcet merged commit fdc84ce into master Jan 19, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants