-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pipelines): allow user actions via popovers (#3573)
- Loading branch information
1 parent
b9ba12c
commit 4b57469
Showing
27 changed files
with
454 additions
and
134 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
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
52 changes: 46 additions & 6 deletions
52
app/scripts/modules/core/pipeline/config/stages/core/ExecutionBarLabel.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 |
---|---|---|
@@ -1,12 +1,52 @@ | ||
import * as React from 'react'; | ||
import {IExecutionStageSummary} from 'core/domain/index'; | ||
import { OverlayTrigger, Tooltip } from 'react-bootstrap'; | ||
|
||
export class ExecutionBarLabel extends React.Component<{ stage: IExecutionStageSummary }, any> { | ||
import { IExecutionStageSummary, IExecution } from 'core/domain'; | ||
import { ExecutionWindowActions } from 'core/pipeline/config/stages/executionWindows/ExecutionWindowActions'; | ||
import { Application } from 'core/application/application.model'; | ||
import { HoverablePopover } from 'core/presentation/HoverablePopover'; | ||
|
||
export interface IExecutionBarLabelProps { | ||
application: Application; | ||
execution: IExecution; | ||
stage: IExecutionStageSummary; | ||
tooltip?: JSX.Element; | ||
executionMarker: boolean; | ||
} | ||
|
||
export class ExecutionBarLabel extends React.Component<IExecutionBarLabelProps, any> { | ||
public render() { | ||
const { stage, application, execution, executionMarker } = this.props; | ||
const inSuspendedExecutionWindow = stage.inSuspendedExecutionWindow; | ||
if (inSuspendedExecutionWindow && executionMarker) { | ||
const executionWindowStage = stage.stages.find(s => s.type === 'restrictExecutionDuringTimeWindow'); | ||
const template = ( | ||
<div> | ||
<div><b>{stage.name}</b> (waiting for execution window)</div> | ||
<ExecutionWindowActions application={application} execution={execution} stage={executionWindowStage}/> | ||
</div> | ||
); | ||
return ( | ||
<HoverablePopover template={template}> | ||
{this.props.children} | ||
</HoverablePopover> | ||
); | ||
} | ||
if (executionMarker) { | ||
const tooltip = ( | ||
<Tooltip id={stage.id}> | ||
{stage.name} | ||
{inSuspendedExecutionWindow && (<div>(waiting for execution window)</div>)} | ||
</Tooltip> | ||
); | ||
return ( | ||
<OverlayTrigger placement="top" overlay={tooltip}> | ||
{this.props.children} | ||
</OverlayTrigger> | ||
); | ||
} | ||
return ( | ||
<span>{ this.props.stage.name ? this.props.stage.name : this.props.stage.type }</span> | ||
); | ||
<span>{ stage.name ? stage.name : stage.type }</span> | ||
) | ||
} | ||
} | ||
|
||
|
12 changes: 12 additions & 0 deletions
12
app/scripts/modules/core/pipeline/config/stages/core/ExecutionMarkerIcon.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,12 @@ | ||
import * as React from 'react'; | ||
import {IExecutionStageSummary} from 'core/domain/IExecutionStage'; | ||
|
||
export interface IExecutionMarkerIconProps { | ||
stage: IExecutionStageSummary; | ||
} | ||
|
||
export class ExecutionMarkerIcon extends React.Component<IExecutionMarkerIconProps, any> { | ||
public render() { | ||
return this.props.stage.inSuspendedExecutionWindow ? (<span className="fa fa-clock-o"/>) : null; | ||
} | ||
} |
Oops, something went wrong.