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

Community Spotlight Members Round 2 #3751

Merged
merged 22 commits into from
Jul 31, 2023
Merged

Conversation

JKarlavige
Copy link
Collaborator

@JKarlavige JKarlavige commented Jul 14, 2023

Asana

What are you changing in this pull request and why?

This adds the latest addition of Community Spotlight Members. Adjustments to the communitySpotlightCard and communitySpotlightList components were made to support showing a Previously on the spotlight header for older spotlight members.

Previews

https://deploy-preview-3751--docs-getdbt-com.netlify.app/community/spotlight
https://deploy-preview-3751--docs-getdbt-com.netlify.app/community/spotlight/josh-devlin

@netlify
Copy link

netlify bot commented Jul 14, 2023

Deploy Preview for docs-getdbt-com ready!

Name Link
🔨 Latest commit 84b4355
🔍 Latest deploy log https://app.netlify.com/sites/docs-getdbt-com/deploys/64c81b103c02fa0007e8628f
😎 Deploy Preview https://deploy-preview-3751--docs-getdbt-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions github-actions bot added content Improvements or additions to content size: large This change will more than a week to address and might require more than one person labels Jul 14, 2023
@JKarlavige JKarlavige marked this pull request as ready for review July 17, 2023 15:56
@JKarlavige JKarlavige requested a review from a team as a code owner July 17, 2023 15:56
@JKarlavige JKarlavige requested review from a team, breezyfasano, lfracalossiFA and amada-ech and removed request for a team July 17, 2023 17:04
Copy link
Contributor

@lfracalossiFA lfracalossiFA left a comment

Choose a reason for hiding this comment

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

lgtm!

@@ -100,7 +100,7 @@ function CommunitySpotlightCard({ frontMatter, isSpotlightMember = false }) {
</div>
)}
{description && !isSpotlightMember && (
<p className={styles.spotlightMemberDescription}>{truncateText(description)}</p>
<p className={styles.spotlightMemberDescription} dangerouslySetInnerHTML={{__html: truncateText(description)}} />
Copy link
Contributor

Choose a reason for hiding this comment

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

Ruh-roh, dangerouslySetInnerHtml! 😆 I'm sure it's fine, but just for my own curiosity: what's this change for?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is to support html links within the description field on the cards within the spotlight index page. Doing the same for the description on individual spotlight member pages.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah gotcha, thanks!

// This date determines where the 'Previously on the Spotlight" text will show.
// Any spotlight members with a 'dateCreated' field before this date
// will be under the 'Previously..' header.
const currentSpotlightDate = new Date('2023-06-01')
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this need to be updated manually whenever we do a new spotlight?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah since we're using the dateCreated field we're using this to know where to show the Previously header

@lfracalossiFA
Copy link
Contributor

No required changes; just a couple of clarifying questions.

// Otherwise href, title, rel values all counted as text.
if(hasLinks) {
const linkText = str.match(/(?<=<a ).*(?=<\/a>)/g)
if(linkText?.length && linkText[0]?.length) {
Copy link
Member

Choose a reason for hiding this comment

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

this is neat!! i hate regex but i love regex!

@breezyfasano breezyfasano self-requested a review July 19, 2023 15:47
Copy link
Member

@breezyfasano breezyfasano left a comment

Choose a reason for hiding this comment

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

lgtm!! very clean!

@github-actions github-actions bot added the guides Knowledge best suited for Guides label Jul 31, 2023
@github-actions github-actions bot removed the guides Knowledge best suited for Guides label Jul 31, 2023
@JKarlavige JKarlavige merged commit 8c96f48 into current Jul 31, 2023
10 checks passed
@JKarlavige JKarlavige deleted the community-spotlight-round-2 branch July 31, 2023 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content size: large This change will more than a week to address and might require more than one person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants