Move PPCHOICES(2) out of UiConstants #1680
Merged
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.
Welcome to the next installment of "Killing UiConstants softly" (with @NickLaMuro): Part Deux, the default pagination epic!
Removes both
PPCHOICES
andPPCHOICES2
from theUiConstants
lib, and moves them into properly scoped places. ForPPCHOICES2
, this was relatively simple since it is only used in theMiqTaskController
.For
PPCHOICES
, though, it was not only used to populate the@pp_choices
variable in the controller, but also called from a view directly (not using the instance variable), so this either needed to be exposed in the view, or a helper method to expose this variable. I went with the latter to avoid the practice of polluting the global namespace, even in the view, but the way I did it might be controversial.Links
Steps for Testing/QA
PPCHOICES that was called in the view should only be called from the
/configuration/index
page, so you can confirm that works by heading to that page with this change applied. The page would break trying to populate the "Default Items Per Page" section if things didn't work properly.