feat: only offer IAB/IESG members for bofreq responsible leadership - #4276
Merged
rjsparks merged 8 commits intoJul 26, 2022
Merged
Conversation
Using "data-ajax--url" shadows explicit configuration in our select2.js wrapper. Use "data-select2-ajax-url" to avoid this. Also add ability to omit the ajax setup entirely by returning None from ajax_url().
Codecov Report
@@ Coverage Diff @@
## main #4276 +/- ##
==========================================
+ Coverage 88.40% 88.41% +0.01%
==========================================
Files 294 294
Lines 39197 39214 +17
==========================================
+ Hits 34652 34671 +19
+ Misses 4545 4543 -2
Continue to review full report at Codecov.
|
rjsparks
approved these changes
Jul 26, 2022
This comment was marked as spam.
This comment was marked as spam.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This filters the options available when selecting "responsible leaders" for a bofreq. Previously, the standard
SearchablePersonsFieldwas used to select one or morePersonobjects to be assigned. The form validation then rejected any choices that were neither IAB members nor Area Directors.Fixing was not straightforward because the
SearchablePersonsFielddynamically searches thePersontable using an ajax endpoint. This endpoint does not permit filtering using Django's queryset tools. To work around this, I've extended theSearchableFieldclasses to support disabling ajax lookups. The fields already supported priming the options with "prefetch" data; this becomes the sole data source when ajax lookups are disabled. For the "responsible leaders" field, the area directors / IAB members are passed in as prefetch data. This does not add a large amount of data to the page - there are currently fewer than 30 options.This pull request also adds the option to configure the "minSearchLength" for the fields - the minimum number of characters to enter before displaying matches. This retains its default of 2, but is set to 0 for the "responsible leaders" field. When the field is focused, the options are shown like a typical pull-down so that the user need not guess names to see what options are available.
Other changes include:
data-ajax--urlattribute on search2 input elements (the select2 library overrides its javascript configuration with this attribute, so this avoids confusion)SearchablePersonsFieldprefetch options so they appear in a sensible order in the pulldownFixes #3711.