Skip to content

Commit

Permalink
feat(core/executions): Render newly migrated execution groups (#8807)
Browse files Browse the repository at this point in the history
* feat(core/executions): Render newly migrated pipelines differently

* Use classnames
  • Loading branch information
caseyhebebrand committed Dec 18, 2020
1 parent 82dca5f commit 29a85a0
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}
}

.nav-section:not(:first-of-type):not(:last-of-type) {
.nav-section:not(:first-of-type) {
border-top: 1px solid var(--color-white);
}
}
Expand Down
1 change: 1 addition & 0 deletions app/scripts/modules/core/src/domain/IPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface IPipeline {
locked?: IPipelineLock;
limitConcurrent: boolean;
manualStartAlert?: IPipelineManualStartAlert;
migrationStatus?: string;
name: string;
notifications?: INotification[];
respectQuietPeriod?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import ReactGA from 'react-ga';
import { Observable, Subject, Subscription } from 'rxjs';
import { flatten, uniq, without } from 'lodash';
import classnames from 'classnames';

import { Application } from 'core/application/application.model';
import { CollapsibleSectionStateCache } from 'core/cache';
Expand All @@ -24,6 +25,7 @@ import { RenderWhenVisible } from 'core/utils/RenderWhenVisible';

import { TriggersTag } from '../../triggers/TriggersTag';
import { AccountTag } from 'core/account';
import { MigrationTag } from './MigrationTag';
import { ReactInjector } from 'core/reactShims';
import { ManualExecutionModal } from '../../manualExecution';
import { PipelineTemplateReader, PipelineTemplateV2Service } from '../../config/templates';
Expand Down Expand Up @@ -251,6 +253,7 @@ export class ExecutionGroup extends React.PureComponent<IExecutionGroupProps, IE
const { group } = this.props;
const { displayExecutionActions, pipelineConfig, triggeringExecution, showingDetails } = this.state;
const pipelineDisabled = pipelineConfig && pipelineConfig.disabled;
const pipelineJustMigrated = pipelineConfig?.migrationStatus === 'STARTED';
const pipelineDescription = pipelineConfig && pipelineConfig.description;
const hasRunningExecutions = group.runningExecutions && group.runningExecutions.length > 0;

Expand Down Expand Up @@ -285,13 +288,20 @@ export class ExecutionGroup extends React.PureComponent<IExecutionGroupProps, IE
);
}

const shadowedClassName = classnames({ shadowed: true, 'in-migration': pipelineJustMigrated });
const groupActionsClassName = classnames({
'text-right': true,
'execution-group-actions': true,
'in-migration': pipelineJustMigrated,
});

return (
<div className={`execution-group ${showingDetails ? 'showing-details' : 'details-hidden'}`}>
{group.heading && (
<div className="clickable sticky-header" onClick={this.handleHeadingClicked}>
<div className={`execution-group-heading ${pipelineDisabled ? 'inactive' : 'active'}`}>
<span className={`glyphicon pipeline-toggle glyphicon-chevron-${this.state.open ? 'down' : 'right'}`} />
<div className="shadowed" style={{ position: 'relative' }}>
<div className={shadowedClassName} style={{ position: 'relative' }}>
<div className={`heading-tag-overflow-group ${this.state.showOverflowAccountTags ? 'shown' : ''}`}>
{groupTargetAccountLabelsExtra}
</div>
Expand All @@ -317,6 +327,7 @@ export class ExecutionGroup extends React.PureComponent<IExecutionGroupProps, IE
<span className="badge">{group.runningExecutions.length}</span>
</span>
)}
{pipelineJustMigrated && <MigrationTag />}
</h4>
{pipelineConfig && (
<EntityNotifications
Expand All @@ -329,7 +340,7 @@ export class ExecutionGroup extends React.PureComponent<IExecutionGroupProps, IE
/>
)}
{displayExecutionActions && (
<div className="text-right execution-group-actions">
<div className={groupActionsClassName}>
{pipelineConfig && <TriggersTag pipeline={pipelineConfig} />}
{pipelineConfig && <NextRunTag pipeline={pipelineConfig} />}
<ExecutionAction handleClick={this.handleConfigureClicked}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,12 @@ export class ExecutionGroups extends React.Component<IExecutionGroupsProps, IExe
const { groups = [], container, showingDetails } = this.state;
const hasGroups = groups.length > 0;
const className = `row pipelines executions ${showingDetails ? 'showing-details' : ''}`;
const executionGroups = groups.map((group: IExecutionGroup) => (

const allGroups = groups
.filter((g: IExecutionGroup) => g.config.migrationStatus === 'STARTED')
.concat(groups.filter((g) => g.config.migrationStatus !== 'STARTED'));

const executionGroups = allGroups.map((group: IExecutionGroup) => (
<ExecutionGroup parent={container} key={group.heading} group={group} application={this.props.application} />
));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import * as React from 'react';
import { Overridable } from 'core/overrideRegistry';

@Overridable('core.executions.migrationTag')
export class MigrationTag extends React.Component<{}, {}> {
public render() {
return <span className="migration-tag sp-margin-s-left">MIGRATED</span>;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@
vertical-align: middle;
}

.migration-tag {
background-color: var(--color-warning);
border-radius: 8px;
color: var(--color-white);
font-size: 10px;
padding: 2px 8px;
}

.execution-group-actions {
background-color: var(--color-accent-g2);
flex: 0 0 auto;
Expand All @@ -110,6 +118,9 @@
margin-left: 40px;
}
}
&.in-migration {
background-color: var(--color-status-warning-light);
}
}

.execution-group {
Expand Down
4 changes: 4 additions & 0 deletions app/scripts/modules/core/src/presentation/stickyHeader.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
flex: 1 1 auto;
background-color: var(--color-accent-g2);
align-items: center;

&.in-migration {
background-color: var(--color-status-warning-light);
}
}
.clearfix();
}
Expand Down

0 comments on commit 29a85a0

Please sign in to comment.