-
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(core/amazon): add a visual indicator to infra managed by Keel (#…
- Loading branch information
Erik Munson
committed
Jun 28, 2019
1 parent
d9e58aa
commit 2fd1aa9
Showing
14 changed files
with
106 additions
and
42 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
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
4 changes: 4 additions & 0 deletions
4
app/scripts/modules/core/src/managed/ManagedResourceDetailsIndicator.less
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,4 @@ | ||
.ManagedResourceDetailsIndicator > .icon { | ||
text-shadow: 0px 1px 4px rgba(0, 0, 0, 0.5); | ||
padding-right: 5px; | ||
} |
41 changes: 41 additions & 0 deletions
41
app/scripts/modules/core/src/managed/ManagedResourceDetailsIndicator.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,41 @@ | ||
import * as React from 'react'; | ||
import { get } from 'lodash'; | ||
|
||
import { IEntityTags } from 'core/domain'; | ||
import { HoverablePopover } from 'core/presentation'; | ||
|
||
import './ManagedResourceDetailsIndicator.less'; | ||
|
||
export const MANAGED_BY_SPINNAKER_TAG_NAME = 'spinnaker_ui_notice:managed_by_spinnaker'; | ||
|
||
export interface IManagedResourceDetailsIndicatorProps { | ||
entityTags: IEntityTags[]; | ||
} | ||
|
||
export const ManagedResourceDetailsIndicator = ({ entityTags }: IManagedResourceDetailsIndicatorProps) => { | ||
const isManaged = | ||
get(entityTags, 'length') && | ||
entityTags.some(({ tags }) => tags.some(({ name }) => name === MANAGED_BY_SPINNAKER_TAG_NAME)); | ||
|
||
if (!isManaged) { | ||
return null; | ||
} | ||
|
||
const helpText = ( | ||
<> | ||
<p> | ||
<b>Spinnaker is continuously managing this resource.</b> | ||
</p> | ||
<p>Changes made in the UI will be stomped in favor of the existing declarative configuration.</p> | ||
</> | ||
); | ||
|
||
return ( | ||
<HoverablePopover template={helpText} placement="left"> | ||
<div className="band band-info ManagedResourceDetailsIndicator"> | ||
<span className="icon">🌈</span> | ||
Managed by Spinnaker | ||
</div> | ||
</HoverablePopover> | ||
); | ||
}; |
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,2 @@ | ||
export * from './ManagedResourceDetailsIndicator'; | ||
export * from './managedResourceDetailsIndicator.component'; |
10 changes: 10 additions & 0 deletions
10
app/scripts/modules/core/src/managed/managedResourceDetailsIndicator.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,10 @@ | ||
import { module } from 'angular'; | ||
import { react2angular } from 'react2angular'; | ||
|
||
import { ManagedResourceDetailsIndicator } from './ManagedResourceDetailsIndicator'; | ||
|
||
export const MANAGED_RESOURCE_DETAILS_INDICATOR = 'spinnaker.core.managed.resourceDetailsIndicator.component'; | ||
module(MANAGED_RESOURCE_DETAILS_INDICATOR, []).component( | ||
'managedResourceDetailsIndicator', | ||
react2angular(ManagedResourceDetailsIndicator, ['entityTags']), | ||
); |
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