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

Merge staging into production, 14 Aug 2024 #1601

Open
wants to merge 200 commits into
base: production
Choose a base branch
from
Open

Conversation

lucasmarchd01
Copy link
Contributor

@lucasmarchd01 lucasmarchd01 commented Aug 14, 2024

To Test:

lucasmarchd01 and others added 30 commits June 5, 2024 14:41
adds blocks for title and scripts so that templates can put those parts in the header.
The title and scripts are no longer simply added to the body of the page, but are now actually contained by the header, where they should be.
Since the siglum and institution name now come from the institution, the source only needs
to have the shelfmark.

However, until all the data is properly migrated, the old title and siglum fields will remain.
This is a hacky, change-as-needed script that serves to migrate the source data from the old structure to the new, creating institutions and moving the shelfmark data to the new sources.

There is a whole bunch of sigla that get skipped (essentially all private collectors) until we figure out how they will be handled.

Don't look to closely, since there are lots of skeletons in this closet.
Allows sources to be added to an institution by using the autocomplete widget
Previously, the LoginView import in the URLs was taken from the views.user module, instead of directly from the django auth views, because this view was also imported into the user module. (aka, a transitive import). This changes it to import from the auth views directly.

I also ran a formatter on the imports in the user module, so that's why it looks like there are more changes than there actually are!
Previously there were several duplicated property definitions that varied only by checking whether the user was logged in. They also did the sorting in Python, rather than in the database.

This condenses all the definitions to a single one per property, and uses the expanding empty dict trick to determine whether `published=True` gets added to the filters. (Since without this, what is really desired is `published = True OR False` but without resorting to Q queries this was the simplest way to do it.)
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.2.1 to 2.2.2.
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.2.1...2.2.2)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
This commit completely reworks the fetching of data for the feast detail page.

Previously, this page took several seconds to load, and generated a large number of queries, due to the complexity of the information needing to be collated.

This was rewritten to instead use two custom SQL queries that are executed directly. This means that the number of queries generated by this segment of code is now no more than two.

There are a few 'interesting' things in this, which I've tried to note in comments.

In the process, this also fixes a number of other small bugs:

Fixes #1540
Fixes #1136
Fixes #596
This commit reworks the source display in the templates, primarily by calling a couple helper methods on the Source model to keep the referencing consistent. The 'short heading' method displays the Institution siglum and the shelfmark, while the 'heading' displays the full institution name and the shelfmark.

The edit and create templates were reworked for the new structure and source referencing. The source display will now show the institution and the shelfmark in separate columns.
This is to allow saving sources in the create / edit without triggering a validation error.
Buckle up, this one's a bit messy.

This commit disables the Feast Detail tests. It turns out, after much searching and Googling and digging, that the Django Test Suite always wraps the tests in a transaction, so that the test can be easily rolled back after each one is run, and thus present a database in a known state for each individual test.

However, with the switch to running a raw SQL query, the cursor in the Feast Detail View now runs outside of this transaction. Thus to the View, the database always looks empty, even if it's running inside of the test.

I tried fixtures, TransactionTestCase, overriding methods and hacking the TestCase to prevent this behaviour, but no dice.

So for now I've marked the Feast Detail tests as "skip" so that they still appear in the runs, but are skipped because they will always fail, as they're written.
It's better to use the named fields for the column content than to rely on the order of the tuple unpacking....
Still failing, but being worked on. Committing here to merge in latest changes.
# Conflicts:
#	django/cantusdb_project/main_app/templates/browse_chants.html
#	django/cantusdb_project/main_app/templates/chant_create.html
#	django/cantusdb_project/main_app/templates/chant_detail.html
#	django/cantusdb_project/main_app/templates/chant_edit.html
#	django/cantusdb_project/main_app/templates/melody_search.html
#	django/cantusdb_project/main_app/templates/source_detail.html
#	django/cantusdb_project/main_app/templates/source_edit.html
#	django/cantusdb_project/main_app/templates/user_source_list.html
Syncing the templates with the latest develop generated a number of merge conflicts. This commit fixes them.

Also it fixes the new block definitions in the base templates.

Fixes #1551
The numbers from a fresh database copy now match the numbers running on the production site, and the numbers
fetched in the browse Chants UI for the chants associated with a feast.
Adds a section that shows a list of sources that are attached to the institution at the bottom of the institution page. Also adds the ID as a link field to that source record.
This commit adds the ability to specify private collectors as a type of Institution.

The model constraints are set up so that you can either specify that an institution is a private collector (via a checkbox) OR they have a siglum. Both cannot be selected for the same record, but one of the two options must be selected for each record.

Institutions that do not have a siglum currently get the word "Private" prepended to the shelfmark.

All other fields are accessible for private collectors.

Alters the admin UI to make the distinction via the layout as well.
Puts the siglum at the front, so that the fact that it is ordered by siglum is clear.
ahankinson and others added 30 commits August 23, 2024 14:16
in response to e-mail feedback
Adds functionality for private collection and for migrated identifiers
- in source model
- on the source create and edit forms
- holding institution and shelfmark fields are now required
- fixes incorrect use of <small> tag on these fields
…eViewTest

- add holding institution required field
Create partial database backup for RISM
Create JSON endpoint for `Service` and `Genre` list and detail views
- Add sortable "city + institution" column
- Make source column = siglum + shelfmark
- Make default order siglum + shelfmark
Newer versions of faker are now typed and have identical functionality
in the ways we need it.
We use the same structure as in the views themselves.
Break up `test_views.py` so structure matches views directory
Revert "Break up `test_views.py` so structure matches views directory"
Adjust sortable columns for source list page (based on email feedback)
Add zoom links to link checker exclusions
Display chant.project on Chant Detail page where it exists
Make `shelfmark` a required field on source create and edit forms
We use the same structure as in the views themselves.
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.

3 participants