-
Notifications
You must be signed in to change notification settings - Fork 0
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
Scc 4334/replace owning institution #405
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -43,6 +45,17 @@ export default class BibDetails { | |||
this.bottomDetails = this.buildBottomDetails() | |||
} | |||
|
|||
buildOwner(): string[] { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@@ -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 && { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@dgcohen I added 2 more commits to try and use the same pattern more, as well as renaming a method. |
There was a problem hiding this 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.
// This was the only way to get this test to pass. waitFor was not in fact waiting, even with same timeout. | ||
setTimeout(() => { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
@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 |
Ticket:
This PR does the following:
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?
pb2608686
Accessibility concerns or updates
Checklist: