-
Notifications
You must be signed in to change notification settings - Fork 11
message system #372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
message system #372
Conversation
1ccddcf to
cdfc219
Compare
cdfc219 to
cd9807f
Compare
1d45ee9 to
caa6965
Compare
caa6965 to
a6669b6
Compare
10b5ab6 to
0d0028a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements a Django-style message system to replace the previous modal-based error handling. The new system stores messages in the session and displays them at the top of pages after redirects, following the Post-Redirect-Get (PRG) pattern.
Key changes:
- Added a new message system with five severity levels (debug, info, success, warning, error) using an enum-based API
- Refactored error handling in
groups.phpto use the new message system instead of modal popups - Updated the
redirect()method to default to the current page when no destination is provided
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
resources/lib/UnityHTTPD.php |
Adds UnityHTTPDMessageLevel enum and message storage/retrieval methods; updates redirect() signature to accept optional destination |
resources/templates/header.php |
Displays session messages at top of page and removes old modal message elements |
webroot/panel/groups.php |
Replaces $modalErrors array with new message system calls; adds redirects after error conditions |
webroot/js/modal.js |
Removes message parameter from openModal() function signature |
webroot/css/modal.css |
Removes modal message styling; minor formatting change |
webroot/css/messages.css |
New file with styling for message banners with different severity levels |
resources/lib/utils.php |
Adds pathJoin() utility function for URL path concatenation |
resources/init.php |
Initializes $_SESSION["messages"] array if not present |
test/phpunit-bootstrap.php |
Adds assertMessageExists() test helper function |
test/functional/PIMemberRequestTest.php |
Updates test to check for messages using new helper instead of checking $_SESSION["MODAL_ERRORS"] |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Replaces the
$modalErrorsfunctionality fromgroups.phpwith a general-purpose message system. Messages are stored in the$_SESSIONso that they aren't lost on redirect. Terminology stolen from Django and style stolen from coldfrontFuture work:
pathJoinutil#327