Skip to content

feat: only offer IAB/IESG members for bofreq responsible leadership - #4276

Merged
rjsparks merged 8 commits into
ietf-tools:mainfrom
painless-security:jennifer/dont-demand-a-rock
Jul 26, 2022
Merged

feat: only offer IAB/IESG members for bofreq responsible leadership#4276
rjsparks merged 8 commits into
ietf-tools:mainfrom
painless-security:jennifer/dont-demand-a-rock

Conversation

@jennifer-richards

@jennifer-richards jennifer-richards commented Jul 26, 2022

Copy link
Copy Markdown
Member

This filters the options available when selecting "responsible leaders" for a bofreq. Previously, the standard SearchablePersonsField was used to select one or more Person objects to be assigned. The form validation then rejected any choices that were neither IAB members nor Area Directors.

Fixing was not straightforward because the SearchablePersonsField dynamically searches the Person table using an ajax endpoint. This endpoint does not permit filtering using Django's queryset tools. To work around this, I've extended the SearchableField classes 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:

  • rename the data-ajax--url attribute on search2 input elements (the select2 library overrides its javascript configuration with this attribute, so this avoids confusion)
  • sort SearchablePersonsField prefetch options so they appear in a sensible order in the pulldown
  • pass prefetch options to the javascript side as an array instead of a dict (needed to support the sorting)

Fixes #3711.

@codecov

codecov Bot commented Jul 26, 2022

Copy link
Copy Markdown

Codecov Report

Merging #4276 (5353a14) into main (fe1f51a) will increase coverage by 0.01%.
The diff coverage is 98.36%.

@@            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     
Impacted Files Coverage Δ
ietf/doc/urls.py 100.00% <ø> (ø)
ietf/utils/markdown.py 100.00% <ø> (ø)
ietf/doc/views_draft.py 91.90% <93.75%> (-0.09%) ⬇️
ietf/doc/views_ballot.py 91.86% <100.00%> (+0.10%) ⬆️
ietf/doc/views_bofreq.py 99.14% <100.00%> (+0.01%) ⬆️
ietf/doc/views_doc.py 90.53% <100.00%> (+0.04%) ⬆️
ietf/doc/views_status_change.py 93.36% <100.00%> (+0.20%) ⬆️
ietf/person/fields.py 86.90% <100.00%> (+0.65%) ⬆️
ietf/utils/fields.py 91.52% <100.00%> (+0.34%) ⬆️
ietf/utils/text.py 85.97% <100.00%> (+0.26%) ⬆️
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de4f1fe...5353a14. Read the comment docs.

@rjsparks
rjsparks merged commit 608b8e1 into ietf-tools:main Jul 26, 2022
@MsThang3677

This comment was marked as spam.

@ietf-tools ietf-tools locked as resolved and limited conversation to collaborators Jul 26, 2022
@jennifer-richards
jennifer-richards deleted the jennifer/dont-demand-a-rock branch August 2, 2022 21:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Editing Leadership for Bof Requests is a game of bring-me-a-rock

3 participants