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

module WHCode should allow for persisting tab selection as queryString #4175

Open
1 task done
dataders opened this issue Oct 3, 2023 · 0 comments
Open
1 task done
Labels
content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear

Comments

@dataders
Copy link
Contributor

dataders commented Oct 3, 2023

Contributions

  • I have read the contribution docs, and understand what's expected of me.

Link to the page on docs.getdbt.com requiring updates

nice-to-have feature idea.

While reviewing #4174's edits to Python models: supported data platforms tab section, I thought to edit the warehouse tabs at the bottom to allow for a querystring (see Docusaurus: Tabs: ##Query String
).

However, TIL these are not Docusaurs tabs but something different

My immediate use case is so that I can deterministically send someone directly to the BigQuery tab. More broadly, it'd be nice to have querystrings that would pre-select datawarehouses for a given tutorial, and that the querystring might persist between pages?

What part(s) of the page would you like to see updated?

import React from 'react';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
function WHCode({children}) {
let tabValuesArr = []
let value
const tabItems = children.map((child, index) => {
if (child.props.warehouse == undefined || child.props.warehouse == '') {
throw "Expected warehouse prop to be defined for each child of WHCode component";
}
tabValuesArr.push({ label: child.props.warehouse, value: child.props.warehouse })
value = child.props.warehouse
return (
<TabItem key={index} value={value}>
{child}
</TabItem>
);
})
return (
<Tabs
defaultValue={tabValuesArr[0].value}
values={tabValuesArr}>
{tabItems}
</Tabs>
);
}
export default WHCode;

Additional information

No response

@dataders dataders added content Improvements or additions to content improvement Use this when an area of the docs needs improvement as it's currently unclear labels Oct 3, 2023
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 improvement Use this when an area of the docs needs improvement as it's currently unclear
Projects
None yet
Development

No branches or pull requests

1 participant