-
Notifications
You must be signed in to change notification settings - Fork 977
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
update lifecycle component to accept strings + commas #4919
Changes from 3 commits
24312b3
487b158
c44b3e8
ee1212f
a651fec
dcfd679
a587301
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -8,6 +8,8 @@ meta: | |||
api_name: dbt Semantic Layer APIs | ||||
--- | ||||
|
||||
### test <Lifecycle status="team,enterprise"/> | ||||
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.
Suggested change
|
||||
|
||||
import CreateModel from '/snippets/_sl-create-semanticmodel.md'; | ||||
import DefineMetrics from '/snippets/_sl-define-metrics.md'; | ||||
import ConfigMetric from '/snippets/_sl-configure-metricflow.md'; | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,8 +22,10 @@ export default function Lifecycle(props) { | |
if (!props.status || (Array.isArray(props.status) && props.status.length === 0)) { | ||
return null; | ||
} | ||
// Check if props.status is an array or a single value | ||
const statuses = Array.isArray(props.status) ? props.status : [props.status]; | ||
// Check if props.status is an array or a single value amd to handle strings separated by commas | ||
const statuses = typeof props.status ==='string' | ||
?props.status.split(',').map(s => s.trim()) | ||
: Array.isArray(props.status) ? props.status : [props.status]; | ||
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. Now that we're always passing in a string, there's a couple adjustments we can make: You're on the right track with using For example, passing in I then recommend moving this line above the Let me know if you have any questions! 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. ok awesome! thank you so much @JKarlavige ! i made those changes. one thing i kept though was
because if i didn't add a status, the header would display a dash: 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. Nice catch, was able to recreate when passing an empty string into the status prop: Added the component to a few headers to double-check the build one more time, if the build passes i'll get this merged! |
||
|
||
return ( | ||
<> | ||
|
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.
tessting to see if build comes out right. will remove