forked from openshift/console
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GitOps: Add Sync Status and Latest Deployment Time to List Page (751)
Signed-off-by: Keith Chong <[email protected]>
- Loading branch information
1 parent
b201205
commit 697848e
Showing
8 changed files
with
184 additions
and
27 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
43 changes: 43 additions & 0 deletions
43
frontend/packages/gitops-plugin/src/components/list/GitOpsSyncFragment.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,43 @@ | ||
import * as React from 'react'; | ||
import { Flex, FlexItem, Tooltip } from '@patternfly/react-core'; | ||
import { | ||
GreenCheckCircleIcon, | ||
YellowExclamationTriangleIcon, | ||
GrayUnknownIcon, | ||
} from '@console/shared'; | ||
|
||
interface SyncProps { | ||
tooltip: any[]; | ||
count: number; | ||
icon: string; | ||
} | ||
|
||
const GitOpsSyncFragment: React.FC<SyncProps> = ({ tooltip, count, icon }) => { | ||
let targetIcon: React.ReactNode; | ||
if (icon === 'check') { | ||
targetIcon = <GreenCheckCircleIcon />; | ||
} else if (icon === 'exclamation') { | ||
targetIcon = <YellowExclamationTriangleIcon />; | ||
} else { | ||
targetIcon = <GrayUnknownIcon />; | ||
} | ||
return ( | ||
<Flex flex={{ default: 'flex_1' }}> | ||
<FlexItem> | ||
{count > 0 ? ( | ||
<Tooltip isContentLeftAligned content={<div>{tooltip}</div>}> | ||
<div> | ||
{targetIcon} {count} | ||
</div> | ||
</Tooltip> | ||
) : ( | ||
<div> | ||
{targetIcon} {count} | ||
</div> | ||
)} | ||
</FlexItem> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default GitOpsSyncFragment; |
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
9 changes: 9 additions & 0 deletions
9
frontend/packages/gitops-plugin/src/components/list/GitOpsTableRow.scss
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,9 @@ | ||
.odc-gitops-syncStatus { | ||
max-width: '100px' | ||
} | ||
.odc-gitops-lastDeploymentTime { | ||
color: var(--pf-global--palette--black-600); | ||
} | ||
.odc-gitops-tooltip-text { | ||
color: white; | ||
} |
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