forked from MarquezProject/marquez
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lineage UI: Add a graph depth config option (MarquezProject#2525)
* stuff Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * Add headers Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * Fix zindex Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * Add minimum Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * hmm Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * retry Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * Update default depth Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * Add an entry to the Changlog Signed-off-by: John Lukenoff <johnlukenoff@asana.com> * Dont reformat everything Signed-off-by: John Lukenoff <johnlukenoff@asana.com> --------- Signed-off-by: John Lukenoff <johnlukenoff@asana.com> Signed-off-by: Xavier-Cliquennois <Xavier-Cliquennois@users.noreply.github.com>
- Loading branch information
1 parent
67b1135
commit e0839e1
Showing
10 changed files
with
139 additions
and
16 deletions.
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
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
70 changes: 70 additions & 0 deletions
70
web/src/components/lineage/components/depth-config/DepthConfig.tsx
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,70 @@ | ||
// Copyright 2018-2023 contributors to the Marquez project | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import * as Redux from 'redux' | ||
import { Box, Typography } from '@material-ui/core' | ||
import { Theme, WithStyles, createStyles, withStyles } from '@material-ui/core/styles' | ||
import { bindActionCreators } from 'redux' | ||
import { connect } from 'react-redux' | ||
import { setLineageGraphDepth } from '../../../../store/actionCreators' | ||
import React from 'react' | ||
import TextField from '@material-ui/core/TextField' | ||
|
||
const styles = (theme: Theme) => | ||
createStyles({ | ||
root: { | ||
position: 'absolute', | ||
display: 'flex', | ||
justifyContent: 'space-evenly', | ||
alignItems: 'center', | ||
right: 0, | ||
marginRight: '3rem', | ||
padding: '1rem', | ||
zIndex: theme.zIndex.appBar | ||
}, | ||
title: { | ||
textAlign: 'center' | ||
}, | ||
textField: { | ||
width: '4rem', | ||
marginLeft: '0.5rem' | ||
} | ||
}) | ||
|
||
interface DepthConfigProps extends WithStyles<typeof styles> { | ||
depth: number | ||
setDepth: (depth: number) => void | ||
} | ||
|
||
const DepthConfig: React.FC<DepthConfigProps> = ({ classes, setDepth, depth }) => { | ||
const i18next = require('i18next') | ||
const GRAPH_TITLE = i18next.t('lineage.graph_depth_title') | ||
return ( | ||
<Box className={classes.root}> | ||
<Typography>{GRAPH_TITLE}</Typography> | ||
<TextField | ||
type='number' | ||
value={depth} | ||
onChange={e => setDepth(isNaN(parseInt(e.target.value)) ? 0 : parseInt(e.target.value))} | ||
variant='outlined' | ||
size='small' | ||
aria-label={GRAPH_TITLE} | ||
className={classes.textField} | ||
inputProps={{ | ||
min: 0, | ||
max: 100 | ||
}} | ||
/> | ||
</Box> | ||
) | ||
} | ||
|
||
const mapDispatchToProps = (dispatch: Redux.Dispatch) => | ||
bindActionCreators( | ||
{ | ||
setDepth: setLineageGraphDepth | ||
}, | ||
dispatch | ||
) | ||
|
||
export default connect(null, mapDispatchToProps)(withStyles(styles)(DepthConfig)) |
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
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
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