Skip to content

Commit

Permalink
feat(core/managed): remove non-deploying state indicators (#8101)
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Munson committed Mar 27, 2020
1 parent 83f65d3 commit d34f8f3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
27 changes: 3 additions & 24 deletions app/scripts/modules/core/src/managed/ArtifactDetail.less
Expand Up @@ -18,33 +18,12 @@
height: 16px;
border-radius: 16px;
border-radius: 50%;

&.current {
background-color: #00b237;
}

&.approved {
border: 1px solid var(--color-status-info);
}
// Negative margin, boooo. But we need it to keep the icons
// for each resource aligned with other, non-deploying ones.
margin-left: -8px;

&.deploying {
background-color: var(--color-status-info);
}

&.pending {
border: 1px solid rgba(0, 0, 0, 0.5);
}

&.previous {
background-color: var(--color-nobel);
}

&.vetoed {
background-color: var(--color-status-error);
}

i.fa {
color: var(--color-white);
}
}
}
14 changes: 10 additions & 4 deletions app/scripts/modules/core/src/managed/ArtifactDetail.tsx
Expand Up @@ -135,10 +135,16 @@ export const ArtifactDetail = ({
.filter(resource => shouldDisplayResource(name, type, resource))
.map(resource => (
<div key={resource.id} className="flex-container-h middle">
<div
className={classNames('resource-badge flex-container-h center middle sp-margin-s-right', state)}
></div>
<ManagedResourceObject key={resource.id} resource={resource} />
{state === 'deploying' && (
<div
className={classNames('resource-badge flex-container-h center middle sp-margin-s-right', state)}
/>
)}
<ManagedResourceObject
key={resource.id}
resource={resource}
depth={state === 'deploying' ? 0 : 1}
/>
</div>
))}
</EnvironmentRow>
Expand Down
Expand Up @@ -11,6 +11,7 @@ import { parseName } from './Frigga';
export interface IManagedResourceObjectProps {
resource: IManagedResourceSummary;
artifact?: IManagedEnviromentSummary['artifacts'][0];
depth?: number;
}

const kindIconMap: { [kind: string]: IconNames } = {
Expand All @@ -30,12 +31,14 @@ export const ManagedResourceObject = ({
moniker: { app, stack, detail },
},
artifact,
depth,
}: IManagedResourceObjectProps) => {
const { version: currentVersion, buildNumber: currentBuild } = parseName(artifact?.versions.current || '') || {};
return (
<ObjectRow
icon={getIconTypeFromKind(kind)}
title={[app, stack, detail].filter(Boolean).join('-')}
depth={depth}
metadata={
artifact?.versions.current && (
<Pill text={currentBuild ? `#${currentBuild}` : currentVersion || artifact.versions.current || 'unknown'} />
Expand Down

0 comments on commit d34f8f3

Please sign in to comment.