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

SUL23-438: Added location link to list of branches on the homepage #150

Merged
merged 5 commits into from
Jun 26, 2024

Conversation

imonroe
Copy link
Contributor

@imonroe imonroe commented Jun 21, 2024

READY FOR REVIEW

Summary

  • Added a map link to the homepage branches box.

Review By (Date)

  • When does this need to be reviewed by?

Criticality

  • How critical is this PR on a 1-10 scale? Also see Severity Assessment.
  • E.g., it affects one site, or every site and product?

Urgency

  • How urgent is this? (Normal, High)

Review Tasks

Setup tasks and/or behavior to test

  1. Check out this branch
  2. Navigate to the home page.
  3. Select a branch from the dropdown in the top area of the page.
  4. verify a map icon and link appears. Verify the link goes to a map to the chosen branch
  5. Select a different library branch. Verify the link now goes to the newly-selected branch map.

Site Configuration Sync

  • Is there a config:export in this PR that changes the config sync directory?

Front End Validation

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided? eg (unit, behat, or codeception)

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

  • JIRA ticket(s)
  • Other PRs
  • Any other contextual information that might be helpful (e.g., description of a bug that this PR fixes, new functionality that it adds, etc.)
  • Anyone who should be notified? (@mention them here)

Resources

Copy link

vercel bot commented Jun 21, 2024

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

Name Status Preview Updated (UTC)
su-library ✅ Ready (Inspect) Visit Preview Jun 26, 2024 4:09pm

@imonroe imonroe requested a review from pookmish June 21, 2024 17:56
@imonroe imonroe requested a review from jenbreese June 21, 2024 17:56
@imonroe
Copy link
Contributor Author

imonroe commented Jun 21, 2024

Preview branch on Vercel is here: https://su-library-7f8up786g-stanford-libraries.vercel.app/

suLibraryHours: library.suLibraryHours,
suLibraryContactImg: library.suLibraryContactImg as MediaImage,
suLibraryBanner: library.suLibraryBanner as MediaImage,
map: library.suLibraryMapLink?.url ?? undefined
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need the ?? undefined

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It threw a typescript error without it. Because of the Maybe I think.

Copy link
Contributor

@pookmish pookmish Jun 21, 2024

Choose a reason for hiding this comment

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

Yeah. If you use map?: Maybe<string> it should fix that.

@@ -80,6 +83,9 @@ const LibrariesTodayHours = ({libraries, ...props}: { libraries: HoursProps["lib
{library?.suLibraryHours &&
<TodayLibraryHours branchId={library.suLibraryHours}/>
}
{library?.map &&
<span className="float-right w-auto inline"><Link href={library?.map} aria-label="Link to map"><MapPinIcon title="Map" width={25} className="mr-5 inline"/>Location</Link></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like some sr-only descriptive text would be helpful here. like <span className="sr-only">{library.title}</span> Location

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 put this in the right place...

@@ -80,6 +84,9 @@ const LibrariesTodayHours = ({libraries, ...props}: { libraries: HoursProps["lib
{library?.suLibraryHours &&
<TodayLibraryHours branchId={library.suLibraryHours}/>
}
{library?.map &&
<span className="float-right w-auto inline"><span className="sr-only">{library.title} Location</span><Link href={library?.map} aria-label="Link to map"><MapPinIcon title="Map" width={25} className="mr-5 inline"/>Location</Link></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

the sr-only needs to be within the <Link> also you can remove the aria-label property.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok this is fixed.

@@ -80,6 +84,9 @@ const LibrariesTodayHours = ({libraries, ...props}: { libraries: HoursProps["lib
{library?.suLibraryHours &&
<TodayLibraryHours branchId={library.suLibraryHours}/>
}
{library?.map &&
<span className="float-right w-auto inline"><Link href={library?.map} ><span className="sr-only">{library.title} Location</span><MapPinIcon title="Map" width={25} className="mr-5 inline"/>Location</Link></span>
Copy link
Contributor

Choose a reason for hiding this comment

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

Now you have 2 "location" strings. either wrap the second in aria-hidden or remove the first one. Ensure there is a space though. Sometimes you have to use &nbps; to force a space at the end of tag.

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 removed the first one since the second is visible, and included the &nbps; for safety. Also got that git hook for prettier to do its thing correctly.

Copy link
Contributor

@pookmish pookmish left a comment

Choose a reason for hiding this comment

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

Thanks.

@pookmish pookmish merged commit 36d6f11 into 1.x Jun 26, 2024
2 of 4 checks passed
@pookmish pookmish deleted the SUL23-438 branch June 26, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants