refactor: DRY maint page layout wrapper#46
Open
somethingwithproof wants to merge 1 commit intoCacti:developfrom
Open
refactor: DRY maint page layout wrapper#46somethingwithproof wants to merge 1 commit intoCacti:developfrom
somethingwithproof wants to merge 1 commit intoCacti:developfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Extracts repeated top_header()/bottom_footer() wrapping into a shared maint_render_with_layout() helper in a new ui_helpers.php file, and routes the edit and default actions through it.
Changes:
- New
ui_helpers.phpwithmaint_render_with_layout()helper maint.phprouteseditand default actions through the new helper- New standalone test verifying wrapper call ordering and routing
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ui_helpers.php | New shared layout wrapper function |
| maint.php | Include helper and use it for edit/default actions |
| tests/test_layout_wrapper.php | Regression test for wrapper behavior and routing |
You can also share your feedback on Copilot code review. Take the survey.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
maint_render_with_layout()helper for page layout wrapperseditand default action rendering inmaint.phpthrough the helpertop_header()/bottom_footer()wrapper logicTests
php -l maint.phpphp -l ui_helpers.phpphp -l tests/test_layout_wrapper.phpphp tests/test_layout_wrapper.phpCloses #45