-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Subject tag changes #10138
Open
jimchamp
wants to merge
15
commits into
internetarchive:master
Choose a base branch
from
jimchamp:subject-tag-changes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Subject tag changes #10138
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Removes `work` tag type, and adds four distinct subject types. Adds `body` input to the "add tag" form. Fixes bug where incorrect subject page link is rendered on tag page. Replace subject page "Edit" button with "Tag" button, when no associated tag is found. If there is a tag, a link to the tag page is included beneath the tag description. Update the Tag.create method to take a `tag` dictionary, and to return the newly created tag.
Creates handler for paths like `/tag/{tag_type}/add`, and new templates for adding and editing specific tag types. The generic "Add Tag" form template has been updated to show and hide the appropriate form elements whenever the selected tag type is changed. Additionally, existing tag form templates have been updated to take a `page` object (instead of one parameter for each property a `Tag` may have). The subject page "Tag" link has been updated to point to `/tag/{tag_type}/add`, where `tag_type` is one of our four subject types. Patron's who follow the link will be served the form for adding subject tags (instead of the generalized add tag form, available at `/tag/add`).
The subject page handler now makes a call to fetch related tags after the subject has been returned from Solr. Data fetched from the `/subjects` `json` endpoint are no longer decorated with tag data.
Adds new `validate_subject_tag` and `create_tag` functions. Updates existing `create_subject_tag` function to take a dictionary. Updates existing handlers to use the correct tag validation and creation methods.
Form would fail to submit when `collection` type was chosen and all fields filled. The issue was the required subject tag body, which is only required for subject tags. Inputs specific to a tag sub-type are now removed if that tag type is not selected.
- Sanitize tag description in tag view - Update subject key derivation in tag view - Reduce number of DB calls required to decorate a subject page with tags - Tag edit `GET` handler returns edit form specific to the existing tag's type - Use correct sub-type validations on tag edit - Remove `utils.unflatten` call when creating tag - `utils.unflatten` is made specifically for processing the book edit form
jimchamp
force-pushed
the
subject-tag-changes
branch
from
December 9, 2024 18:44
e52b1fe
to
1c17c70
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #10138 +/- ##
==========================================
+ Coverage 17.12% 17.33% +0.20%
==========================================
Files 89 90 +1
Lines 4752 4822 +70
Branches 831 855 +24
==========================================
+ Hits 814 836 +22
- Misses 3428 3461 +33
- Partials 510 525 +15 ☔ View full report in Codecov by Sentry. |
jimchamp
force-pushed
the
subject-tag-changes
branch
from
December 9, 2024 18:54
01aaaf0
to
7f45814
Compare
jimchamp
force-pushed
the
subject-tag-changes
branch
4 times, most recently
from
December 9, 2024 19:58
53a99e9
to
7e861fd
Compare
jimchamp
force-pushed
the
subject-tag-changes
branch
from
December 9, 2024 21:34
fe8c8a4
to
12fca88
Compare
jimchamp
force-pushed
the
subject-tag-changes
branch
from
December 9, 2024 21:55
c6dc94f
to
0d81650
Compare
for more information, see https://pre-commit.ci
jimchamp
added
the
Needs: Submitter Input
Waiting on input from the creator of the issue/pr [managed]
label
Dec 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Supplants #9843
General Changes
collection
subject
,person
,place
,time
body
propertyTag
modelTag.find()
updated to return multiple valuestag_type
no longer a required parameterTag.create()
updated to take adict
representation of a Tagdict
validations are expected to occur beforecreate
is calledTag.create()
now returns the newly createdTag
object (instead of a key)Tag
page templatesGeneral Tag view -
/templates/type/tag/view.html
subject_key
Tag.body
to the page (if the tag is a subject tag)Type-specific edit page and form controls -
/templates/type/tag/{tag_type}
/templates/type/tag/subject
/templates/type/tag/collection
edit.html
- Form used for editing an existing tag or creating a new tagedit_form_inputs
- Contains form inputs appropriate for the tag typeGeneric "Add Tag" form
edit_form_inputs
templatesSubject page
Tag
views of subject tags with a similar nameaddtag.py
unflatten
calls on patron input have been removedunflatten
is used specifically for book edit form dataMissing from this PR
body
is not automatically generatedsanitize
andformat
calls/tags/OL123T/{tag_type}/{tag_label}
)ReadableUrlProcessor
Technical
Testing
Screenshot
Stakeholders