-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update workflow search UX (#245)
* feat: update workflow search UX Signed-off-by: csirius <[email protected]> * feat: update search UX and add outputs Signed-off-by: csirius <[email protected]> * fix: change the limit to unlimited Signed-off-by: csirius <[email protected]> * fix: unit test failure Signed-off-by: csirius <[email protected]>
- Loading branch information
Showing
14 changed files
with
539 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import * as React from 'react'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import classNames from 'classnames'; | ||
import { Link } from 'react-router-dom'; | ||
import { WorkflowExecutionPhase } from 'models/Execution/enums'; | ||
import { barChartColors } from 'components/common/constants'; | ||
import { useCommonStyles } from 'components/common/styles'; | ||
|
||
const useStyles = makeStyles(() => ({ | ||
barContainer: { | ||
display: 'block' | ||
}, | ||
barItem: { | ||
display: 'inline-block', | ||
marginRight: 2, | ||
borderRadius: 2, | ||
width: 10, | ||
height: 12, | ||
backgroundColor: barChartColors.default | ||
}, | ||
successBarItem: { | ||
backgroundColor: barChartColors.success | ||
}, | ||
failedBarItem: { | ||
backgroundColor: barChartColors.failure | ||
} | ||
})); | ||
|
||
interface ProjectStatusBarProps { | ||
items: WorkflowExecutionPhase[]; | ||
paths: string[]; | ||
} | ||
|
||
/** | ||
* Renders status of executions | ||
* @param items | ||
* @constructor | ||
*/ | ||
const ProjectStatusBar: React.FC<ProjectStatusBarProps> = ({ | ||
items, | ||
paths | ||
}) => { | ||
const styles = useStyles(); | ||
const commonStyles = useCommonStyles(); | ||
|
||
return ( | ||
<div className={styles.barContainer}> | ||
{items.map((item, idx) => { | ||
return ( | ||
<Link | ||
className={commonStyles.linkUnstyled} | ||
to={paths[idx] ?? '#'} | ||
key={`bar-item-${idx}`} | ||
> | ||
<div | ||
className={classNames(styles.barItem, { | ||
[styles.successBarItem]: | ||
item === WorkflowExecutionPhase.SUCCEEDED, | ||
[styles.failedBarItem]: | ||
item >= WorkflowExecutionPhase.FAILED | ||
})} | ||
/> | ||
</Link> | ||
); | ||
})} | ||
</div> | ||
); | ||
}; | ||
|
||
export default ProjectStatusBar; |
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
Oops, something went wrong.