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

Web/add dataset drawer #2672

Merged
merged 10 commits into from
Nov 29, 2023
Prev Previous commit
Next Next commit
update drawer formatting/revert chips to row
Signed-off-by: sharpd <[email protected]>
  • Loading branch information
sharpd committed Oct 30, 2023
commit 15de5d706f67aeb0edbb115649052779e1432b64
2 changes: 1 addition & 1 deletion web/src/components/datasets/DatasetDetailPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const DatasetDetailPage: FunctionComponent<IProps> = (props) => {
label={tag}
size='small'
style={{
display: 'inline',
display: 'row',
marginRight: index < tags.length - 1 ? theme.spacing(1) : 0,
}}
/>
Expand Down
40 changes: 23 additions & 17 deletions web/src/components/datasets/DatasetInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import * as Redux from 'redux'
import {
Accordion,
Box,
Card,
CardContent,
Divider,
Table,
TableBody,
Expand Down Expand Up @@ -85,7 +87,7 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = (props) => {
const i18next = require('i18next')

const [open, setOpen] = useState(false)
const [selectedKey, setSelectedKey] = useState()
const [selectedKey, setSelectedKey] = useState<string | undefined>(undefined)
const theme = createTheme(useTheme())

useEffect(() => {
Expand All @@ -102,7 +104,7 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = (props) => {
)

const tagData = useSelector((state: IState) => state.tags.tags)
const handleOpen = (key: any) => {
const handleOpen = (key: string) => {
setOpen(true)
setSelectedKey(key)
}
Expand Down Expand Up @@ -166,24 +168,30 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = (props) => {
PaperProps={{
sx: {
width: 400,
backgroundColor: theme.palette.common.black,
backgroundColor: theme.palette.background.paper,
border: `2px dashed ${theme.palette.secondary.main}`,
p: 1,
},
}}
>
<MqText heading bottomMargin>
{selectedKey}
</MqText>
<Card>
<CardContent sx={{ backgroundColor: theme.palette.background.paper }}>
<MqText heading bottomMargin>
{selectedKey}
</MqText>
</CardContent>
</Card>
<Divider />
<MqText bottomMargin>{selectedFieldDesc}</MqText>
<Accordion>
<Card>
<CardContent sx={{ backgroundColor: theme.palette.background.paper }}>
<MqText bottomMargin>{selectedFieldDesc}</MqText>
</CardContent>
</Card>
<Accordion elevation={0}>
<AccordionSummary
expandIcon={<ExpandMoreIcon />}
aria-controls='panel1a-content'
id='panel1a-header'
sx={{
backgroundColor: theme.palette.common.black,
backgroundColor: theme.palette.background.paper,
}}
>
<MqText bold bottomMargin>
Expand All @@ -192,14 +200,12 @@ const DatasetInfo: FunctionComponent<DatasetInfoProps> = (props) => {
</AccordionSummary>
<AccordionDetails
sx={{
backgroundColor: theme.palette.common.black,
backgroundColor: theme.palette.background.paper,
}}
>
{selectedFieldTags.length > 0 ? (
<>{formatColumnTags(selectedFieldTags, tagData)}</>
) : (
'No Tags'
)}
{selectedFieldTags.length > 0
? formatColumnTags(selectedFieldTags, tagData)
: 'No Tags'}
</AccordionDetails>
</Accordion>
</Drawer>
Expand Down
Loading