Skip to content
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

Create workflow to add chants to a source from a csv file. #1770

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

dchiller
Copy link
Contributor

@dchiller dchiller commented Feb 28, 2025

Closes #1259. The new page can be found at source/<source id>/add-chants.

The page provides a preview of a selected CSV file, and various validations are made and signaled to the user with alerts and tooltips:

image

Additional validation occurs on the back-end.

Along the way, refactored or fixed the following:

  1. The JSONResponseMixin that does content negotiation for a number of views had an error that caused it not to work nicely with ListViews that had more than one page. This fixes that error by making use of the object_list attribute, rather than the queryset passed to the ListView context.
  2. FeastListView and FeastDetailView were not previously using the JSONResponseMixin, but it was useful for the front-end mapping and validation of feasts for this feature, so I added it.
  3. Refactored the AddImageLinksView and the view for this PR into a new source_bulk_actions directory and added some typing to autocomplete views.
  4. Previously, on the ChantCreateForm, we were validating the uniqueness of the sequence and folio of a new chant regardless of whether the field-level validation of the form had succeeded. But this meant that a form submitted with an empty folio or sequence (an invalid form) would still attempt to validate that the folio-sequence combination was unique, and would error because there was no value for that field. Now, we only complete the validation of the combination if the field values are all valid.

Only conducts folio-sequence uniqueness validation on the `ChantCreateForm` if both the `folio` and the `c_sequence` fields are actually valid (ie. provided as required.
Adds the `/add-chants` endpoint to a source with a view that previews and validates a csv file containing chants to add to the source.

Adds appropriate tests.

Also, includes some minor changes not included in the refactoring introduced in 49fb742.
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.

We need to establish a workflow for creating chants given a CSV file
1 participant