diff --git a/core/src/main/javascript/ApplicationState.js b/core/src/main/javascript/ApplicationState.js index 0d6036d91..46700b2dc 100644 --- a/core/src/main/javascript/ApplicationState.js +++ b/core/src/main/javascript/ApplicationState.js @@ -9,7 +9,8 @@ export type Page = | { id: "" } | { id: "workflow", - jobId?: string + jobId?: string, + showDetail: boolean } | { id: "executions/started", diff --git a/core/src/main/javascript/app/components/Link.js b/core/src/main/javascript/app/components/Link.js index 14bed7d7d..49f31da65 100644 --- a/core/src/main/javascript/app/components/Link.js +++ b/core/src/main/javascript/app/components/Link.js @@ -12,7 +12,8 @@ type Props = { className: string, children: any, open: (href: string) => void, - replace: boolean + replace: boolean, + title: string }; const Link = ({ @@ -21,13 +22,15 @@ const Link = ({ className, children, open, - replace = false + replace = false, + title = "" }: Props) => { return ( {children} diff --git a/core/src/main/javascript/app/components/SlidePanel.js b/core/src/main/javascript/app/components/SlidePanel.js deleted file mode 100644 index 87277ed20..000000000 --- a/core/src/main/javascript/app/components/SlidePanel.js +++ /dev/null @@ -1,96 +0,0 @@ -// @flow - -import React from "react"; -import injectSheet from "react-jss"; -import classNames from "classnames"; - -type Props = { - classes: any, - title: string, - children: any, - open: boolean -}; - -type State = { - open: boolean -}; - -class SlidePanel extends React.Component { - state: State; - props: Props; - - constructor(props: Props) { - super(props); - this.state = { - open: props.open - }; - } - - closePanel() { - this.setState({ - open: false - }); - } - - openPanel() { - this.setState({ - open: true - }); - } - - render() { - const { classes, children } = this.props; - const { open } = this.state; - return ( -
-
-
- {children} -
-
-
- ); - } -} - -const styles = { - container: { - position: "absolute", - right: 0, - top: 0, - height: "100%" - }, - innerContainer: { - backgroundColor: "rgba(255,255,255,0.75)", - width: "50px", - transition: "all .1s ease-out", - height: "100%", - border: "none", - outline: "none", - overflow: "hidden", - right: 0, - boxShadow: "0px 1px 5px 0px #BECBD6", - "&:hover": { - backgroundColor: "rgba(255,255,255,0.75)", - boxShadow: "0px 1px 5px 0px #BECBD6", - width: "60px" - }, - "&.open": { - transition: "none", - backgroundColor: "rgba(255,255,255,0.95)", - width: "800px", - overflowX: "hidden", - overflowY: "auto" - }, - "& .content": { - width: "800px" - } - } -}; - -export default injectSheet(styles)(SlidePanel); diff --git a/core/src/main/javascript/app/pages/Workflow.js b/core/src/main/javascript/app/pages/Workflow.js index a6a249cd5..004bff6a2 100644 --- a/core/src/main/javascript/app/pages/Workflow.js +++ b/core/src/main/javascript/app/pages/Workflow.js @@ -17,7 +17,7 @@ import reduce from "lodash/reduce"; import some from "lodash/some"; import type { Edge, Node } from "../../graph/dagger/dataAPI/genericGraph"; -import type { Dependency, Job, Tag, Workflow } from "../../datamodel"; +import type { Dependency, Job, Workflow } from "../../datamodel"; import Select from "react-select"; import { navigate } from "redux-url"; @@ -25,10 +25,12 @@ import { connect } from "react-redux"; import { markdown } from "markdown"; import TagIcon from "react-icons/lib/md/label"; +import MdList from "react-icons/lib/md/list"; import Dagger from "../../graph/Dagger"; -import SlidePanel from "../components/SlidePanel"; +import Window from "../components/Window"; import FancyTable from "../components/FancyTable"; import Spinner from "../components/Spinner"; +import Link from "../components/Link"; import moment from "moment"; import PopoverMenu from "../components/PopoverMenu"; @@ -39,7 +41,8 @@ type Props = { workflow: Workflow, selectedJobs: string[], job: string, - navTo: () => void + navTo: () => void, + showDetail: boolean }; type State = { @@ -250,7 +253,8 @@ class WorkflowComponent extends React.Component { workflow = {}, job, selectedJobs = [], - navTo + navTo, + showDetail } = this.props; const filteredJobs = filter(workflow.jobs, j => @@ -305,7 +309,7 @@ class WorkflowComponent extends React.Component { const charts = (data: any) => { if (data) { return ( -
+

Average run/wait times over last 30 days

navTo("/workflow/" + id)} /> - ({ value: n.id, label: n.name }))} + onChange={o => navTo("/workflow/" + o.value)} + value={startNode.id} + clearable={false} + /> + + + +
+ {showDetail && + +
+ + +
Id:
+
{startNode.id}
+
Name:
+
{startNode.name}
+ {renderTimeSeriesSechduling()} + {startNode.tags.length > 0 && [ +
Tags:
, +
+ {map(startNode.tags, t => [ + + + {tagsDictionnary[t].name} + , + + ])} +
+ ]} + {startNode.description && [ +
Description:
, +
+ ]} + {this.state.jobColors && + this.state.jobColors[startNode.id] && [ +
Status:
, +
+ +
+ ]} +
+
+ {charts(this.state.data)} +
}
); } @@ -455,6 +467,12 @@ const styles = { height: "calc(100vh - 4em)", position: "relative" }, + charts: { + overflow: "auto", + display: "flex", + flexWrap: "wrap", + justifyContent: "space-around" + }, chartSection: { "& > .chart": { marginLeft: "50px", @@ -487,11 +505,20 @@ const styles = { textAlign: "justify !important", overflowY: "scroll" }, - jobSelector: { + controller: { position: "absolute", top: "2em", - left: "50%", - marginLeft: "-300px", + display: "flex", + justifyContent: "center", + width: "100%" + }, + detailIcon: { + fontSize: "30px", + color: "#607e96", + marginLeft: ".25em", + cursor: "pointer" + }, + jobSelector: { width: "600px", "& .Select-control": { height: "1em", @@ -527,9 +554,8 @@ const styles = { } }; -export default connect( - () => ({}), - dispatch => ({ - navTo: link => dispatch(navigate(link)) - }) -)(injectSheet(styles)(WorkflowComponent)); +const mapStateToProps = ({ app: { page: { showDetail } } }) => ({ showDetail }); + +export default connect(mapStateToProps, dispatch => ({ + navTo: link => dispatch(navigate(link)) +}))(injectSheet(styles)(WorkflowComponent)); diff --git a/core/src/main/javascript/index.js b/core/src/main/javascript/index.js index d51be4fcb..f0286a220 100644 --- a/core/src/main/javascript/index.js +++ b/core/src/main/javascript/index.js @@ -32,8 +32,9 @@ const routes = { openPage({ id: "executions/paused", page, sort, order }), "/executions/:id": ({ id }) => openPage({ id: "executions/detail", execution: id }), - "/workflow/*": ({ _ }) => openPage({ id: "workflow", jobId: _ }), - "/workflow": () => openPage({ id: "workflow" }), + "/workflow/*": ({ _ }, { showDetail }) => + openPage({ id: "workflow", jobId: _, showDetail: Boolean(showDetail) }), + "/workflow": () => openPage({ id: "workflow", showDetail: false }), "/timeseries/calendar": () => openPage({ id: "timeseries/calendar" }), "/timeseries/calendar/:start_:end": ({ start, end }) => openPage({ id: "timeseries/calendar/focus", start, end }),