-
Notifications
You must be signed in to change notification settings - Fork 14
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
Streamline defining and usage of preferences #1072
base: master
Are you sure you want to change the base?
Conversation
1af196f
to
ba2468d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1072 +/- ##
==========================================
- Coverage 81.08% 80.95% -0.14%
==========================================
Files 141 137 -4
Lines 5087 5066 -21
==========================================
- Hits 4125 4101 -24
- Misses 962 965 +3 ☔ View full report in Codecov by Sentry. |
preferences_choices = {} | ||
for namespace, cls in Preferences.NAMESPACES.items(): | ||
preferences_choices[namespace] = { | ||
name: field.choices for name, field in cls.FIELDS.items() if field.choices is not None |
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.
You're assuming all preferences forever will be "select from dropdown".
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.
Nope, I'm just saying that if they do have choices, you can add them in the PreferenceField directly and they will become available in the rendering context, to be used however the developer sees fit
5d67a80
to
aa7fad4
Compare
d1b4423
to
cdd8160
Compare
271d34c
to
3f747a4
Compare
Quality Gate passedIssues Measures |
Preference
class: