-
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: Improve UX for Single Task Executions (#103)
* refactor: make workflow details generic so it can be used for tasks (#96) * refactor: make workflow details generic so it can be used for tasks * chore: cleanup and moving tests over * feat: adding route and navigation to the task details page (#97) * Refactor Launch form to use a state machine (#99) * refactor: filling out details of the state machine for launch * refactor: checkpoint * refactor: mostly finished wiring of machine to component state * refactor: more work to get form component migrated to using machine * refactor: cleaning up state for selectors * fix: type error due to patch version upgrade * refactor: trying a flat state structure * fix: getting all tests passing again * chore: cleanup and docs * chore: pull request feedback * refactor: Make launch state and components generic (#100) * refactor: splitting launch machine into two separate types * refactor: move shared state out to component * refactor: use composition to create workflow form * refactor: update usage of LaunchWorkflowForm -> LaunchForm * chore: cleanup and fix tests * feat: Add Task support to Launch form (#101) * feat: add task support in launch components * test: updating launch form tests to handle task cases * fix: remaining broken tests * Cleanup work for launching single task executions. (#102) * feat: add support for launch tasks in entity details view * fix: correctly map initial parameters when relaunching * fix: correct parent name and back link in execution details page * fix: pass through referenceExecution when relaunching * test: check rendering of referenceExecution * test: adding tests for relaunch flow
- Loading branch information
Showing
96 changed files
with
6,457 additions
and
3,016 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,102 @@ | ||
import { Dialog } from '@material-ui/core'; | ||
import { makeStyles, Theme } from '@material-ui/core/styles'; | ||
import { contentMarginGridUnits } from 'common/layout'; | ||
import { WaitForData } from 'components/common'; | ||
import { EntityDescription } from 'components/Entities/EntityDescription'; | ||
import { useProject } from 'components/hooks'; | ||
import { LaunchForm } from 'components/Launch/LaunchForm/LaunchForm'; | ||
import { ResourceIdentifier, ResourceType } from 'models'; | ||
import * as React from 'react'; | ||
import { entitySections } from './constants'; | ||
import { EntityDetailsHeader } from './EntityDetailsHeader'; | ||
import { EntityExecutions } from './EntityExecutions'; | ||
import { EntitySchedules } from './EntitySchedules'; | ||
|
||
const useStyles = makeStyles((theme: Theme) => ({ | ||
metadataContainer: { | ||
display: 'flex', | ||
marginBottom: theme.spacing(5), | ||
marginTop: theme.spacing(2), | ||
width: '100%' | ||
}, | ||
descriptionContainer: { | ||
flex: '2 1 auto', | ||
marginRight: theme.spacing(2) | ||
}, | ||
executionsContainer: { | ||
display: 'flex', | ||
flex: '1 1 auto', | ||
flexDirection: 'column', | ||
margin: `0 -${theme.spacing(contentMarginGridUnits)}px` | ||
}, | ||
schedulesContainer: { | ||
flex: '1 2 auto', | ||
marginRight: theme.spacing(30) | ||
} | ||
})); | ||
|
||
export interface EntityDetailsProps { | ||
id: ResourceIdentifier; | ||
} | ||
|
||
function getLaunchProps(id: ResourceIdentifier) { | ||
if (id.resourceType === ResourceType.TASK) { | ||
return { taskId: id }; | ||
} | ||
|
||
return { workflowId: id }; | ||
} | ||
|
||
/** A view which optionally renders description, schedules, executions, and a | ||
* launch button/form for a given entity. Note: not all components are suitable | ||
* for use with all entities (not all entities have schedules, for example). | ||
*/ | ||
export const EntityDetails: React.FC<EntityDetailsProps> = ({ id }) => { | ||
const sections = entitySections[id.resourceType]; | ||
const project = useProject(id.project); | ||
const styles = useStyles(); | ||
const [showLaunchForm, setShowLaunchForm] = React.useState(false); | ||
const onLaunch = () => setShowLaunchForm(true); | ||
const onCancelLaunch = () => setShowLaunchForm(false); | ||
|
||
return ( | ||
<WaitForData {...project}> | ||
<EntityDetailsHeader | ||
project={project.value} | ||
id={id} | ||
launchable={!!sections.launch} | ||
onClickLaunch={onLaunch} | ||
/> | ||
<div className={styles.metadataContainer}> | ||
{!!sections.description ? ( | ||
<div className={styles.descriptionContainer}> | ||
<EntityDescription id={id} /> | ||
</div> | ||
) : null} | ||
{!!sections.schedules ? ( | ||
<div className={styles.schedulesContainer}> | ||
<EntitySchedules id={id} /> | ||
</div> | ||
) : null} | ||
</div> | ||
{!!sections.executions ? ( | ||
<div className={styles.executionsContainer}> | ||
<EntityExecutions id={id} /> | ||
</div> | ||
) : null} | ||
{!!sections.launch ? ( | ||
<Dialog | ||
scroll="paper" | ||
maxWidth="sm" | ||
fullWidth={true} | ||
open={showLaunchForm} | ||
> | ||
<LaunchForm | ||
onClose={onCancelLaunch} | ||
{...getLaunchProps(id)} | ||
/> | ||
</Dialog> | ||
) : null} | ||
</WaitForData> | ||
); | ||
}; |
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.