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

Scc 4334/replace owning institution #405

Merged
merged 11 commits into from
Dec 4, 2024

Conversation

charmingduchess
Copy link
Contributor

@charmingduchess charmingduchess commented Nov 25, 2024

Ticket:

This PR does the following:

  • Add owning institution to the bib details for partner records only
  • modify BibDetails.prototype.buildStandardDetail to accommodate owner and extent instance variables, instead of only being able to build details straight from the bib. This pattern could be extended to the subject heading and other details, but maybe for later work.

How has this been tested?

  • Verifying a partner record shows up with owning institution. Can test with pb2608686
  • Verify NYPL record does not show up with owning institution

Accessibility concerns or updates

Checklist:

  • I updated the CHANGELOG with the appropriate information and JIRA ticket number (if applicable).
  • I have added relevant accessibility documentation for this pull request.
  • All new and existing tests passed.

Copy link

vercel bot commented Nov 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
research-catalog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 3, 2024 4:14pm

@@ -43,6 +45,17 @@ export default class BibDetails {
this.bottomDetails = this.buildBottomDetails()
}

buildOwner(): string[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, why does this have to be an array if it always returns one element?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I was trying to keep the details as standard as possible. The subject heading urls are nested arrays, and the intention was to have all the values for the bib details be string arrays.

@charmingduchess charmingduchess changed the base branch from main to dec-24-release December 2, 2024 17:04
@@ -124,17 +140,10 @@ export default class BibDetails {
detail = this.buildInternalLinkedDetail(fieldMapping)
else if (fieldMapping.field === "subjectLiteral")
detail = this.subjectHeadings
else if (fieldMapping.field === "extent") detail = this.extent
else if (fieldMapping.field === "owner")
detail = this.bib.owner && {
Copy link
Contributor

@dgcohen dgcohen Dec 2, 2024

Choose a reason for hiding this comment

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

Where are the owner and extent attributes accessed now that this has been removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made them properties on the bib model, so buildStandardDetail can build them. The original way this was working required the label to be defined in two different places. This way, the label stays in the bottomDetails method, and the value can be referenced from buildStandardDetail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me know if you want me to explain! It's a little tricky but I'm hoping this streamlines things a little.

@charmingduchess
Copy link
Contributor Author

@dgcohen I added 2 more commits to try and use the same pattern more, as well as renaming a method.

Copy link
Member

@EdwinGuzman EdwinGuzman left a comment

Choose a reason for hiding this comment

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

I can't say I understand the business req/logic but the code looks right. Why did you have to change the return type from an object to an array of data? It seems like a general update.

Comment on lines -35 to -36
// This was the only way to get this test to pass. waitFor was not in fact waiting, even with same timeout.
setTimeout(() => {
Copy link
Member

Choose a reason for hiding this comment

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

How did this change now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure. it was not passing, so I changed it to waitFor, and the test started passing.

@charmingduchess
Copy link
Contributor Author

@EdwinGuzman The methods that I updated had been returning a label and a value. I wanted to DRY out the logic that was adding the label, especially because the labels were hardcoded in some cases. I updated the property methods (ie extent, subjectLiteral, and other values that are transformed) to only return the value, and let buildStandardDetail add the label.

@charmingduchess charmingduchess merged commit 33cc6b2 into dec-24-release Dec 4, 2024
3 checks passed
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