harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
36 stars 30 forks source link

Prevent multiple resubmits of result selection in legal-doc add flow; fix #1964 #1967

Closed lizadaly closed 1 year ago

lizadaly commented 1 year ago

I anticipated that multiple clicks could happen here but was relying on the presence or absence of the disabled attribute on the clickable element, in an earlier UI where non-selected results remained on-screen but greyed out. Later we decided to hide all non-selected results so I removed the disabled attribute, but that left this check orphaned.

This updates the check to more directly reflect whether a search result has been clicked.

(I'll add test coverage for this as part of #1966)

codecov-commenter commented 1 year ago

Codecov Report

Merging #1967 (5440e6e) into develop (08bce7b) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #1967   +/-   ##
========================================
  Coverage    76.92%   76.92%           
========================================
  Files           60       60           
  Lines         6839     6839           
========================================
  Hits          5261     5261           
  Misses        1578     1578           
Impacted Files Coverage Δ
web/main/views.py 72.04% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.