Skip to content

Commit

Permalink
fix(core): omit colon if there is no server group sequence (#4976)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeach authored and anotherchrisberry committed Mar 9, 2018
1 parent 29e544f commit e69526d
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions app/scripts/modules/core/src/serverGroup/ServerGroupHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,14 @@ export class CloudProviderIcon extends React.Component<IServerGroupHeaderProps>
}
}

export class Sequence extends React.Component<IServerGroupHeaderProps> {
export class SequenceAndBuildAndImages extends React.Component<IServerGroupHeaderProps> {
public render() {
const { serverGroup } = this.props;
const { serverGroup, jenkins, images } = this.props;
const serverGroupSequence = ReactInjector.namingService.getSequence(serverGroup.moniker.sequence);
return <span className="server-group-sequence"> {serverGroupSequence}</span>;
}
}

export class BuildAndImages extends React.Component<IServerGroupHeaderProps> {
public render() {
const { jenkins, images } = this.props;
return (
<div>
{(!!jenkins || !!images) && <span>: </span>}
{!!serverGroupSequence && <span className="server-group-sequence"> {serverGroupSequence}</span>}
{(!!serverGroupSequence && (!!jenkins || !!images)) && <span>: </span>}
{!!jenkins && <a className="build-link" href={jenkins.href} target="_blank">Build: #{jenkins.number}</a>}
{!!images && <span>{images}</span>}
</div>
Expand Down Expand Up @@ -125,8 +119,7 @@ export class ServerGroupHeader extends React.Component<IServerGroupHeaderProps>
<div className="flex-container-h baseline section-title">
<MultiSelectCheckbox {...props}/>
<CloudProviderIcon {...props}/>
<Sequence {...props}/>
<BuildAndImages {...props}/>
<SequenceAndBuildAndImages {...props}/>
<Alerts {...props}/>
</div>

Expand Down

0 comments on commit e69526d

Please sign in to comment.