-
Notifications
You must be signed in to change notification settings - Fork 989
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
add links to lifecycle pill #6845
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8360490
update lifecycle component
mirnawong1 51e1ee5
centralize links
mirnawong1 5a49ff2
Merge branch 'current' into clickable-lifecycle
mirnawong1 9dd11c2
Merge branch 'current' into clickable-lifecycle
mirnawong1 3efc2bf
Update introduction.md
mirnawong1 ef7ab42
Merge branch 'current' into clickable-lifecycle
mirnawong1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ function slugify(text) { | |
.replace(/[\u0300-\u036f]/g, '') // remove diacritics | ||
.replace(/\s+/g, '-') // replace spaces with - | ||
.replace(/[^\w\-]+/g, '') // remove all non-word chars | ||
.replace(/\-\-+/g, '-') // replace multipl - with a single - | ||
.replace(/\-\-+/g, '-') // replace multiple - with a single - | ||
.replace(/^-+/, '') // trim - from the start | ||
.replace(/-+$/, ''); // trim - from the end | ||
} | ||
|
@@ -39,43 +39,46 @@ function Expandable({ children, alt_header = null, lifecycle }) { | |
popup.classList.add('copy-popup'); | ||
popup.innerText = 'Link copied!'; | ||
|
||
// Add close button ('x') | ||
const closeButton = document.createElement('span'); | ||
closeButton.classList.add('close-button'); | ||
closeButton.innerHTML = ' ×'; // '×' symbol for 'x' | ||
closeButton.addEventListener('click', () => { | ||
if (document.body.contains(popup)) { | ||
document.body.removeChild(popup); | ||
} | ||
}); | ||
popup.appendChild(closeButton); | ||
// Add close button ('x') | ||
const closeButton = document.createElement('span'); | ||
closeButton.classList.add('close-button'); | ||
closeButton.innerHTML = ' ×'; // '×' symbol for 'x' | ||
closeButton.addEventListener('click', () => { | ||
if (document.body.contains(popup)) { | ||
document.body.removeChild(popup); | ||
} | ||
}); | ||
popup.appendChild(closeButton); | ||
|
||
document.body.appendChild(popup); | ||
document.body.appendChild(popup); | ||
|
||
setTimeout(() => { | ||
if (document.body.contains(popup)) { | ||
document.body.removeChild(popup); | ||
} | ||
}, 3000); | ||
}; | ||
setTimeout(() => { | ||
if (document.body.contains(popup)) { | ||
document.body.removeChild(popup); | ||
} | ||
}, 3000); | ||
}; | ||
|
||
useEffect(() => { | ||
if (window.location.hash === `#${anchorId}`) { | ||
setOn(true); | ||
const element = document.getElementById(anchorId); | ||
if (element) { | ||
element.scrollIntoView({ behavior: 'smooth' }); | ||
useEffect(() => { | ||
if (window.location.hash === `#${anchorId}`) { | ||
setOn(true); | ||
const element = document.getElementById(anchorId); | ||
if (element) { | ||
element.scrollIntoView({ behavior: 'smooth' }); | ||
} | ||
} | ||
} | ||
}, [anchorId]); | ||
}, [anchorId]); | ||
|
||
return ( | ||
<div id={anchorId} className={`${styles.expandableContainer} `}> | ||
<div id={anchorId} className={`${styles.expandableContainer}`}> | ||
<div className={styles.header} onClick={handleToggleClick}> | ||
<span className={`${styles.toggle} ${isOn ? styles.toggleDown : styles.toggleRight}`}></span> | ||
| ||
<span className={styles.headerText}> | ||
{alt_header}<Lifecycle status={lifecycle} /> | ||
{alt_header} | ||
<span onClick={(e) => e.stopPropagation()}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this stops the copy link propagation so that users can click the pill for the link or click on the icon to copy the url |
||
<Lifecycle status={lifecycle} /> | ||
</span> | ||
</span> | ||
<span onClick={handleCopyClick} className={styles.copyIcon}></span> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
const PRODUCT_LIFECYCLE_URL = 'https://docs.getdbt.com/docs/dbt-versions/product-lifecycles'; | ||
const PLAN_URL = 'https://www.getdbt.com/pricing'; | ||
|
||
export const STATUS_URLS = { | ||
enterprise: PLAN_URL, | ||
team: PLAN_URL, | ||
developer: 'https://www.getdbt.com/signup', | ||
beta: PRODUCT_LIFECYCLE_URL, | ||
preview: PRODUCT_LIFECYCLE_URL, | ||
ga: PRODUCT_LIFECYCLE_URL, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
will have to remove these test lifecycle pills before pr is merged