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-417 - Study Place additional room info #123

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

mdyoung3
Copy link
Contributor

@mdyoung3 mdyoung3 commented Mar 15, 2024

READY FOR REVIEW

Summary

Review By (Date)

  • March 18

Urgency

  • How critical is this PR?

Steps to Test

  1. Do this
  2. Then this
  3. Then this

Affected Projects or Products

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

Associated Issues and/or People

  • JIRA ticket
  • 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)

See Also

Copy link

vercel bot commented Mar 15, 2024

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

Name Status Preview Updated (UTC)
su-library ✅ Ready (Inspect) Visit Preview Mar 16, 2024 1:02am

src/components/node/sul-study-place/card.tsx Outdated Show resolved Hide resolved
src/components/node/sul-study-place/card.tsx Outdated Show resolved Hide resolved
@@ -42,21 +48,30 @@ const StudyPlaceFeatures = ({branchHours, branchTitle, branchUrl, capacity, cont

<div className="card-body items-start rs-px-3 rs-pb-3 rs-pt-7 md:rs-pt-3 w-full">
<div className="leading-display text-18 pt-0 font-normal ">
<h2 id={headingId} className="type-3 rs-mb-1">{type}</h2>
<h2 id={headingId} className="type-3 rs-mb-1">{roomDonorName} {type}</h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

need to trim if the donor name is empty.

Copy link
Contributor Author

@mdyoung3 mdyoung3 Mar 15, 2024

Choose a reason for hiding this comment

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

@pookmish How about [roomDonorName, type].join(" ") instead? That way it ignores the space if room is null.

Copy link
Contributor

Choose a reason for hiding this comment

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

You'd have to filter it if you do that. [roomDonorName, type].filter(item => !!item).join(" ")

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm. Not a fan of that. I could trim it this way: {(node.sulStudyRoomDonorName || '').trim()} {node.sulStudyType.name}

Copy link
Contributor

Choose a reason for hiding this comment

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

You still have the space between. You're trimming the wrong thing. Something like this would work:

{node.sulStudyRoomDonorName ? `${node.sulStudyRoomDonorName} ${node.sulStudyType.name}` : node.sulStudyType.name}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pookmish Okay. Sorry. I went back to the join version. Just seems a bit easier for me to know what's going on.

It's interesting that the space never seemed to appear in the UI. I could only see it in console.log(). Which I admit I probably should have ran it through sooner.

Copy link
Contributor

Choose a reason for hiding this comment

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

Honestly, it might not even make any difference. But I feel it's good practice.

Copy link
Contributor Author

@mdyoung3 mdyoung3 Mar 16, 2024

Choose a reason for hiding this comment

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

I also experienced a weird build issues. Both on my local and with the build on this PR. I finally had to switch to another ticket out of frustration. When I came back, it stopped being an issue. Been trying to replicate it. Hope fully it's just one of those on-off things.

Copy link
Contributor

Choose a reason for hiding this comment

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

interesting, Using the .filter produces this dom markup: <h2 class="type-3 rs-mb-1">Group study room</h2>
While just printing the two values next to eachother produces this dom: <h2 class="type-3 rs-mb-1"> <!-- -->Group study room</h2>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The filter way seems cleaner.

remove console.log
@pookmish pookmish merged commit 02f2066 into release-1.1.0 Mar 19, 2024
3 checks passed
@pookmish pookmish deleted the SUL23-417-card-title branch March 19, 2024 03:42
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