diff --git a/frontend/packages/gitops-plugin/locales/en/gitops-plugin.json b/frontend/packages/gitops-plugin/locales/en/gitops-plugin.json index 09fdb625831..b03f1b00a0e 100644 --- a/frontend/packages/gitops-plugin/locales/en/gitops-plugin.json +++ b/frontend/packages/gitops-plugin/locales/en/gitops-plugin.json @@ -8,6 +8,9 @@ "Commit details not available": "Commit details not available", "Last deployed": "Last deployed", "Application environments": "Application environments", + "Synced": "Synced", + "OutOfSync": "OutOfSync", + "Unknown": "Unknown", "{{x}} of {{total}} Unhealthy": "{{x}} of {{total}} Unhealthy", "{{x}} of {{total}} OutOfSync": "{{x}} of {{total}} OutOfSync", "Resources": "Resources", @@ -28,9 +31,6 @@ "Environment status": "Environment status", "Environment": "Environment", "Last deployment": "Last deployment", - "Synced": "Synced", - "OutOfSync": "OutOfSync", - "Unknown": "Unknown", "No GitOps manifest URLs found": "No GitOps manifest URLs found", "No Application groups found": "No Application groups found", "Environment details were not found. Try reloading the page or contacting an administrator.": "Environment details were not found. Try reloading the page or contacting an administrator." diff --git a/frontend/packages/gitops-plugin/src/components/GitOpsEmptyState.scss b/frontend/packages/gitops-plugin/src/components/GitOpsEmptyState.scss index 8ac243ec06e..d60a78251cb 100644 --- a/frontend/packages/gitops-plugin/src/components/GitOpsEmptyState.scss +++ b/frontend/packages/gitops-plugin/src/components/GitOpsEmptyState.scss @@ -1,4 +1,4 @@ -.odc-gitops-empty-state { +.gop-gitops-empty-state { &__icon { height: var(--pf-c-empty-state__icon--FontSize); max-width: 100%; diff --git a/frontend/packages/gitops-plugin/src/components/GitOpsListPage.scss b/frontend/packages/gitops-plugin/src/components/GitOpsListPage.scss index 8ef1461ee04..a073ab2c57e 100644 --- a/frontend/packages/gitops-plugin/src/components/GitOpsListPage.scss +++ b/frontend/packages/gitops-plugin/src/components/GitOpsListPage.scss @@ -1,4 +1,4 @@ -.odc-gitops-list-page-heading { +.gop-gitops-list-page-heading { align-items: center; font-size: 12px; } diff --git a/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.scss b/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.scss index c9d3e3d3415..a824e74973d 100644 --- a/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.scss +++ b/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.scss @@ -1,4 +1,4 @@ -.odc-gitops-details { +.gop-gitops-details { padding: var(--pf-global--spacer--xl); height: 100%; display: flex; diff --git a/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.tsx b/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.tsx index a762060577d..9baa919ac7b 100644 --- a/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.tsx +++ b/frontend/packages/gitops-plugin/src/components/details/GitOpsDetails.tsx @@ -18,13 +18,9 @@ import { ExternalLink, Timestamp } from '@console/internal/components/utils'; import { useK8sWatchResource } from '@console/internal/components/utils/k8s-watch-hook'; import { ConsoleLinkModel } from '@console/internal/models'; import { K8sResourceKind, referenceForModel } from '@console/internal/module/k8s'; -import { - GreenCheckCircleIcon, - YellowExclamationTriangleIcon, - GrayUnknownIcon, -} from '@console/shared'; import * as argoIcon from '../../images/argo.png'; import { GitOpsEnvironment } from '../utils/gitops-types'; +import GitOpsRenderStatusLabel from './GitOpsRenderStatusLabel'; import GitOpsResourcesSection from './GitOpsResourcesSection'; import './GitOpsDetails.scss'; @@ -46,45 +42,19 @@ const GitOpsDetails: React.FC = ({ envs, appName }) => { link.metadata?.name === 'argocd' && link.spec?.location === 'ApplicationMenu', ); - // eslint-disable-next-line no-shadow - const renderStatusLabel = (status: string) => { - switch (status) { - case 'Synced': - return ( - - ); - case 'OutOfSync': - return ( - - ); - case 'Unknown': - return ( - - ); - default: - return ''; - } - }; - let oldAPI = false; if (envs && envs.length > 0) { oldAPI = envs[0] && envs[0].deployments ? envs[0].deployments === null : true; } return ( -
+
{oldAPI && ( <> {t('gitops-plugin~Compatibility Issue Message')} @@ -94,13 +64,13 @@ const GitOpsDetails: React.FC = ({ envs, appName }) => { envs, (env) => env && ( - + - + -

+

{env.environment} @@ -109,44 +79,44 @@ const GitOpsDetails: React.FC = ({ envs, appName }) => { {env.cluster ? ( {env.cluster} ) : ( -
+
{t('gitops-plugin~Cluster URL not available')}
)} {env.status && ( - + - {renderStatusLabel(env.status)} + )} - + {env.revision ? ( <> {env.revision.message && ( - + {t('gitops-plugin~{{message}}', { message: env.revision.message })} )} - + {env.revision.author && ( - + {t('gitops-plugin~by {{author}}', { author: env.revision.author })}{' '} )} {env.revision.revision && (