-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(core): Convert executionDetailsSectionNav, executionStepDet…
…ails, statusGlyph to react (#4273)
- Loading branch information
Justin Reynolds
authored
Oct 16, 2017
1 parent
963e3f0
commit 85ad05a
Showing
34 changed files
with
229 additions
and
174 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
36 changes: 36 additions & 0 deletions
36
app/scripts/modules/core/src/delivery/details/ExecutionDetailsSectionNav.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,36 @@ | ||
import * as React from 'react'; | ||
import * as ReactGA from 'react-ga'; | ||
import { UISref, UISrefActive } from '@uirouter/react'; | ||
import { UIRouterContext } from '@uirouter/react-hybrid'; | ||
|
||
import { robotToHuman } from 'core/presentation/robotToHumanFilter/robotToHuman.filter'; | ||
|
||
export interface IExecutionDetailsSectionNavProps { | ||
sections: string[]; | ||
} | ||
|
||
@UIRouterContext | ||
export class ExecutionDetailsSectionNav extends React.Component<IExecutionDetailsSectionNavProps> { | ||
public render() { | ||
return ( | ||
<ul className="nav nav-pills"> | ||
{this.props.sections.map((section) => <Section key={section} section={section}/>)} | ||
</ul> | ||
); | ||
} | ||
} | ||
|
||
const Section = (props: { section: string }): JSX.Element => { | ||
const clicked = () => { | ||
ReactGA.event({category: 'Pipeline', action: 'Execution details section selected', label: props.section}); | ||
} | ||
return ( | ||
<li> | ||
<UISrefActive class="active"> | ||
<UISref to=".execution" params={{details: props.section}}> | ||
<span onClick={clicked}>{robotToHuman(props.section)}</span> | ||
</UISref> | ||
</UISrefActive> | ||
</li> | ||
); | ||
} |
8 changes: 8 additions & 0 deletions
8
app/scripts/modules/core/src/delivery/details/executionDetailsSectionNav.component.ts
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,8 @@ | ||
import { module } from 'angular'; | ||
import { react2angular } from 'react2angular'; | ||
|
||
import { ExecutionDetailsSectionNav } from './ExecutionDetailsSectionNav'; | ||
|
||
export const EXECUTION_DETAILS_SECTION_NAV = 'spinnaker.core.delivery.details.executionDetailsSectionNav'; | ||
module(EXECUTION_DETAILS_SECTION_NAV, []) | ||
.component('executionDetailsSectionNav', react2angular(ExecutionDetailsSectionNav, ['sections'])); |
15 changes: 0 additions & 15 deletions
15
app/scripts/modules/core/src/delivery/details/executionDetailsSectionNav.directive.js
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
app/scripts/modules/core/src/delivery/details/executionDetailsSectionNav.html
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,6 +1,6 @@ | ||
import {ITimedItem} from './IOrchestratedItem'; | ||
import { IOrchestratedItem } from './IOrchestratedItem'; | ||
|
||
export interface ITaskStep extends ITimedItem { | ||
export interface ITaskStep extends IOrchestratedItem { | ||
name: string; | ||
status: string; | ||
} |
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
38 changes: 38 additions & 0 deletions
38
app/scripts/modules/core/src/pipeline/config/stages/core/ExecutionStepDetails.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,38 @@ | ||
import * as React from 'react'; | ||
|
||
import { IExecutionStage } from 'core/domain'; | ||
import { StatusGlyph } from 'core/task/StatusGlyph'; | ||
import { displayableTasks } from 'core/task/displayableTasks.filter'; | ||
import { duration } from 'core/utils/timeFormatters'; | ||
import { robotToHuman } from 'core/presentation/robotToHumanFilter/robotToHuman.filter'; | ||
|
||
export interface IExecutionStepDetailsProps { | ||
stage: IExecutionStage; | ||
} | ||
|
||
export class ExecutionStepDetails extends React.Component<IExecutionStepDetailsProps> { | ||
public render() { | ||
return ( | ||
<div className="col-md-9"> | ||
<div className="row"> | ||
<div className="col-md-9"> | ||
<strong>Task</strong> | ||
</div> | ||
<div className="col-md-3 text-right"> | ||
<strong>Duration</strong> | ||
</div> | ||
</div> | ||
{ displayableTasks(this.props.stage.tasks).map((task) => ( | ||
<div className="row"> | ||
<div className="col-md-9"> | ||
<span className="small"><StatusGlyph item={task}/></span> {robotToHuman(task.name)} | ||
</div> | ||
<div className="col-md-3 text-right"> | ||
{duration(task.runningTimeInMs)} | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
app/scripts/modules/core/src/pipeline/config/stages/core/executionStepDetails.component.ts
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,8 @@ | ||
import { module } from 'angular'; | ||
import { react2angular } from 'react2angular'; | ||
|
||
import { ExecutionStepDetails } from './ExecutionStepDetails'; | ||
|
||
export const EXECUTION_STEP_DETAILS_COMPONENT = 'spinnaker.core.pipeline.config.stages.core.executionStepDetails.component'; | ||
module(EXECUTION_STEP_DETAILS_COMPONENT, []) | ||
.component('executionStepDetails', react2angular(ExecutionStepDetails, ['stage'])); |
18 changes: 0 additions & 18 deletions
18
app/scripts/modules/core/src/pipeline/config/stages/core/executionStepDetails.html
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
app/scripts/modules/core/src/pipeline/config/stages/core/executionSteps.directive.js
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
app/scripts/modules/core/src/pipeline/config/stages/core/stage.core.module.js
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
app/scripts/modules/core/src/pipeline/config/stages/core/stage.core.module.ts
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,11 @@ | ||
import { module } from 'angular'; | ||
|
||
import { DISPLAYABLE_TASKS_FILTER } from 'core/task/displayableTasks.filter'; | ||
import { EXECUTION_STEP_DETAILS_COMPONENT } from './executionStepDetails.component'; | ||
|
||
export const STAGE_CORE_MODULE = 'spinnaker.core.pipeline.stage.core'; | ||
|
||
module(STAGE_CORE_MODULE, [ | ||
EXECUTION_STEP_DETAILS_COMPONENT, | ||
DISPLAYABLE_TASKS_FILTER, | ||
]); |
6 changes: 4 additions & 2 deletions
6
app/scripts/modules/core/src/pipeline/config/stages/deploy/deployStage.module.js
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
8 changes: 5 additions & 3 deletions
8
app/scripts/modules/core/src/pipeline/config/stages/jenkins/jenkinsStage.module.js
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.