HH - Cache Available Permissible Values [#171868635] #2271
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.
Only add permissible values where
is_available
is true to theRequestStore
cache. Fixes a regression from SPARCRequest 3.5 where disabled values appear in the protocol form.Pivotal Tracker: https://www.pivotaltracker.com/story/show/171868635
Context
At OHSU, we have customized SPARCRequest by creating new permissible values and setting others unavailable. For example, in the
study_type
category, the values "Clinical Trials," "Basic Science," and "Translational Science" are unavailable. The result in 3.5.0 is this (note that we also customized the title through the locale file):In SPARCRequest 3.6, all of the unavailable permissible values are present in the protocol form.
This seems to be related to the introduction of caching in the
PermissibleValue
model. The change in this pull request caches only the available permissible values, and with this change only the available permissible values are present in the protocol form.