-
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-3776 - Item Table Component #50
Conversation
…/item-table-component
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.
The update makes sense to me. There are some minor comments but I know this will go through another iteration.
Some things that stick out that we have talked about:
- Use the the "text" variant for the button that looks like a link for now. I think we may need to reword it and isolate it to better appear as a button. This is for the "contact a librarian" button.
- Right now,
Button
s styled as link do have the underlined as hover and it is expected.
Something I noticed after we chatted:
- the mobile view has many horizontal lines that I will talk to @bigfishdesign13 about. It makes the mobile view confusing (to me at least)
A few things that need to be added that can be another ticket/PR:
- the "View all X items > " link when there are more than 3 items in a search result
- the eResource links that should appear as "Available Online" (https://www.nypl.org/research/research-catalog/search?q=national%20geographic)
src/components/RCLink/RCLink.tsx
Outdated
@@ -8,6 +11,8 @@ interface RCLinkProps { | |||
children: ReactNode | |||
className?: string | |||
color?: string | |||
type?: LinkTypes | |||
disabled?: boolean |
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.
<RCLink | ||
href={item.aeonUrl} | ||
type="buttonSecondary" | ||
disabled={!item.isAvailable} |
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.
These should be isDisabled
.
it("renders the correct text when item is available, has an aeon url, and has a location endpoint", async () => { | ||
const item = new Item(itemPhysicallyRequestable, parentBib) | ||
render(<ItemAvailability item={item} />) | ||
screen.getByText(/Available by appointment/) |
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.
These would break if they're not in the document, but for completeness I think it should have the expect(...).toBeInDocument()
wrapper.
const item = new Item(itemUnavailable, parentBib) | ||
render(<ItemAvailability item={item} />) | ||
screen.getByText(/Not available/) | ||
screen.getByText(/- Please/) |
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.
The above comment applies to all of these.
src/components/RCLink/RCLink.tsx
Outdated
import { Link as DSLink } from "@nypl/design-system-react-components" | ||
import { | ||
Link as DSLink, | ||
type LinkTypes, |
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.
@EdwinGuzman take a closer look.
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.
It was pointed out that LinkProps
needs to be exported.
{" - Please "} | ||
<Button | ||
id="contact-librarian" | ||
buttonType="link" |
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.
Try buttonType="text"
.
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.
Does this still need to be addressed?
@@ -29,12 +46,19 @@ const SearchResult = ({ bib }: SearchResultProps) => { | |||
<RCLink href={`${PATHS.BIB}/${bib.id}`}>{bib.title}</RCLink> | |||
</CardHeading> | |||
<CardContent> | |||
<Box sx={{ p: { display: "inline", marginRight: "s" } }}> | |||
<Box sx={{ p: { display: "inline", marginRight: "s" } }} mb="m"> | |||
{bib.materialType && <Text>{bib.materialType}</Text>} |
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.
Taking a better/closer look, I think these should be spans.
@EdwinGuzman Those lines are there to provide delineation between table rows. But yes, that treatment isn't working well here. Perhaps we could tie that style to the |
…rch-catalog into SCC-3776/item-table-component
| Variable | Type | Value Example | Description | | ||
| ---------------------------------------- | ------ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `NYPL_HEADER_URL` | string | "https://ds-header.nypl.org" | The base URL of the NYPL environment-specific header and footer scripts. | | ||
| `NEXT_PUBLIC_CLOSED_LOCATIONS` | string | "all;Library of the Performing Arts" | A semicolon-delimited list of strings. Include quotes around the string. All locations beginning with any string in this list will be removed from the list of request options in the `ElectronicDelivery`, `HoldRequest`, and `ItemTableRow` components. Currently used physical locations: `Schwarzman;Science;Library for the Performing Arts;Schomburg`. To close all locations, add `all`. This will also remove EDD as a request option, the 'Request' buttons, and also disable the hold request/edd forms. If `all` is not present, EDD and 'Request' buttons will still be available. | |
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.
What does NEXT_PUBLIC
indicate?
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.
That prefix allows env variables to be used on the client side.
__test__/fixtures/itemFixtures.ts
Outdated
@@ -16,6 +18,7 @@ export const itemPhysicallyRequestable = { | |||
prefLabel: "book, limited circ, MaRLI", | |||
}, | |||
], | |||
dueDate: ["September 3rd"], |
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'm not sure it makes a difference to the code, but I'm pretty sure this would be formatted YYYY-MM-DD
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.
The update looks good but there are a few things to cover before moving on.
- There are general spacing issues that I think will be picked up during VQA. I think now is a good time to share the Vercel Preview link in the Jira ticket with Apoorva and Clare for their VQA and accessibilty review.
- The electronic resource link seems better because the link text is actual text and not the URL. Do verify that this is what we want (also note there could be some space above the "Available Online" text):
- The "Not available - Please contact a librarian for assistance" text is not displaying. There also seems to be more spacing between elements and it could be slightly reduced. It also appears that the buttons that should be disabled are not. The right side is from this PR and the search term is "National Geographic":
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.
Approving knowing there's stylistic updates todo later.
Ticket Link
This PR adds the ItemTableData model and the following components:
ItemTable
RequestButtons
ItemAvailability (formerly InformationLinks)
It also includes tests and some small miscellaneous changes to Item model, SearchResultsBib model, and one renaming change (pascal-casing the itemFilterData class).
NB:
There are some further optimizations to be made, but I will not let these hold up the PR. I added comments where relevant.