Skip to content

Conversation

@symroe
Copy link
Member

@symroe symroe commented Mar 30, 2022

Warning: I am BAD at JavaScript, so this might be a really bad way to do things.

Much manual testing required!

@symroe symroe requested a review from VirginiaDooley March 30, 2022 15:10
@VirginiaDooley
Copy link
Contributor

It seems like bulk.js is included even after submitting the bulk add form and redirecting to the add_review_form which causes an error in the console. I think every function in bulk.js relates to the bulk adding table and not the add/review form, so we might want to be more selective about when scripts are run.

Copy link
Contributor

@michaeljcollinsuk michaeljcollinsuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tested locally, after adding the candidate details to the bulk add form and then submitted, only the last person that I entered was being passed through to the next step. Not entirely sure what was causing this bug but my guess was something JS related.

{% include "bulk_add/sopns/_known-people.html" %}

<form method=POST id="bulk_add_form">
<form method=POST id="bulk_add_form" data-winner-count="{{ ballot.winner_count }}">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If winner_count is not set, this causes a 500 error


// Remove empty fieldsets
var always_show_extra = $("form#bulk_add_form")[0].dataset['winnerCount'] * 3;
var always_show_extra = $("form#bulk_add_form")[0].dataset.winnerCount * 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had chance to check this out locally to test, but I dont think this would fix the 500 error I mentioned in an old comment that happens when a ballot does not have winner_count set? I think that will need a change in the view.

There was also another bug that I came across when testing originally, that from memory, was that if I filled in multiple candidates using the new "add a row" button, and then submitting the form, only the last candidate that I entered was being created/shown for review. But as mentioned it was a while ago I tested it locally so will need to go through again when I have chance!

@symroe symroe force-pushed the master branch 2 times, most recently from 64904b0 to 44bf9f8 Compare April 8, 2024 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants