diff --git a/locales/en/plugin__gitops-plugin.json b/locales/en/plugin__gitops-plugin.json index ea77897e5..cfd115c75 100644 --- a/locales/en/plugin__gitops-plugin.json +++ b/locales/en/plugin__gitops-plugin.json @@ -141,11 +141,11 @@ "Unable to load data": "Unable to load data", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "There was an error retrieving ImageUpdaters. Check your connection and reload the page.", "ImageUpdaters": "ImageUpdaters", - "This list page is under tech preview, but not necessarily the resources it represents": "This list page is under tech preview, but not necessarily the resources it represents", "Create ImageUpdater": "Create ImageUpdater", "Apps": "Apps", "Images": "Images", "Last Checked": "Last Checked", + "Labels": "Labels", "Has Apps": "Has Apps", "No Apps": "No Apps", "Not Ready": "Not Ready", @@ -218,7 +218,6 @@ "There was an error retrieving App Projects. Check your connection and reload the page.": "There was an error retrieving App Projects. Check your connection and reload the page.", "AppProjects": "AppProjects", "Create AppProject": "Create AppProject", - "Labels": "Labels", "Last Updated": "Last Updated", "Has Description": "Has Description", "No Description": "No Description", @@ -343,18 +342,15 @@ "Created at": "Created at", "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.", - "This details page is under tech preview, but not necessarily the resource it represents": "This details page is under tech preview, but not necessarily the resource it represents", "List view": "List view", "Graph view": "Graph view", "Sync": "Sync", "Stop": "Stop", "Refresh": "Refresh", "Refresh (Hard)": "Refresh (Hard)", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Actions": "Actions", "You don't have permission to perform this action": "You don't have permission to perform this action", "annotations": "annotations", "annotation": "annotation", - "No owner": "No owner", - "Tech preview": "Tech preview" + "No owner": "No owner" } diff --git a/locales/en/plugin__gitops-public.json b/locales/en/plugin__gitops-public.json index b0176b468..f0284a431 100644 --- a/locales/en/plugin__gitops-public.json +++ b/locales/en/plugin__gitops-public.json @@ -5,7 +5,6 @@ "View logs": "View logs", "Open URL": "Open URL", "Edit": "Edit", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Rollout": "Rollout", "Name": "Name", "Namespace": "Namespace", diff --git a/locales/ja/plugin__gitops-plugin.json b/locales/ja/plugin__gitops-plugin.json index 52e937fa2..f77e16ac2 100644 --- a/locales/ja/plugin__gitops-plugin.json +++ b/locales/ja/plugin__gitops-plugin.json @@ -141,11 +141,11 @@ "Unable to load data": "Unable to load data", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "There was an error retrieving ImageUpdaters. Check your connection and reload the page.", "ImageUpdaters": "ImageUpdaters", - "This list page is under tech preview, but not necessarily the resources it represents": "This list page is under tech preview, but not necessarily the resources it represents", "Create ImageUpdater": "Create ImageUpdater", "Apps": "Apps", "Images": "Images", "Last Checked": "Last Checked", + "Labels": "Labels", "Has Apps": "Has Apps", "No Apps": "No Apps", "Not Ready": "Not Ready", @@ -218,7 +218,6 @@ "There was an error retrieving App Projects. Check your connection and reload the page.": "There was an error retrieving App Projects. Check your connection and reload the page.", "AppProjects": "AppProjects", "Create AppProject": "Create AppProject", - "Labels": "Labels", "Last Updated": "Last Updated", "Has Description": "Has Description", "No Description": "No Description", @@ -343,18 +342,15 @@ "Created at": "Created at", "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.", - "This details page is under tech preview, but not necessarily the resource it represents": "This details page is under tech preview, but not necessarily the resource it represents", "List view": "List view", "Graph view": "Graph view", "Sync": "Sync", "Stop": "Stop", "Refresh": "Refresh", "Refresh (Hard)": "Refresh (Hard)", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Actions": "Actions", "You don't have permission to perform this action": "You don't have permission to perform this action", "annotations": "annotations", "annotation": "annotation", - "No owner": "No owner", - "Tech preview": "Tech preview" + "No owner": "No owner" } diff --git a/locales/ja/plugin__gitops-public.json b/locales/ja/plugin__gitops-public.json index b0176b468..f0284a431 100644 --- a/locales/ja/plugin__gitops-public.json +++ b/locales/ja/plugin__gitops-public.json @@ -5,7 +5,6 @@ "View logs": "View logs", "Open URL": "Open URL", "Edit": "Edit", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Rollout": "Rollout", "Name": "Name", "Namespace": "Namespace", diff --git a/locales/ko/plugin__gitops-plugin.json b/locales/ko/plugin__gitops-plugin.json index 72ff91288..76b66c62e 100644 --- a/locales/ko/plugin__gitops-plugin.json +++ b/locales/ko/plugin__gitops-plugin.json @@ -141,11 +141,11 @@ "Unable to load data": "Unable to load data", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "There was an error retrieving ImageUpdaters. Check your connection and reload the page.", "ImageUpdaters": "ImageUpdaters", - "This list page is under tech preview, but not necessarily the resources it represents": "This list page is under tech preview, but not necessarily the resources it represents", "Create ImageUpdater": "Create ImageUpdater", "Apps": "Apps", "Images": "Images", "Last Checked": "Last Checked", + "Labels": "Labels", "Has Apps": "Has Apps", "No Apps": "No Apps", "Not Ready": "Not Ready", @@ -218,7 +218,6 @@ "There was an error retrieving App Projects. Check your connection and reload the page.": "There was an error retrieving App Projects. Check your connection and reload the page.", "AppProjects": "AppProjects", "Create AppProject": "Create AppProject", - "Labels": "Labels", "Last Updated": "Last Updated", "Has Description": "Has Description", "No Description": "No Description", @@ -343,18 +342,15 @@ "Created at": "Created at", "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.", - "This details page is under tech preview, but not necessarily the resource it represents": "This details page is under tech preview, but not necessarily the resource it represents", "List view": "List view", "Graph view": "Graph view", "Sync": "Sync", "Stop": "Stop", "Refresh": "Refresh", "Refresh (Hard)": "Refresh (Hard)", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Actions": "Actions", "You don't have permission to perform this action": "You don't have permission to perform this action", "annotations": "annotations", "annotation": "annotation", - "No owner": "No owner", - "Tech preview": "Tech preview" + "No owner": "No owner" } diff --git a/locales/ko/plugin__gitops-public.json b/locales/ko/plugin__gitops-public.json index b0176b468..f0284a431 100644 --- a/locales/ko/plugin__gitops-public.json +++ b/locales/ko/plugin__gitops-public.json @@ -5,7 +5,6 @@ "View logs": "View logs", "Open URL": "Open URL", "Edit": "Edit", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Rollout": "Rollout", "Name": "Name", "Namespace": "Namespace", diff --git a/locales/zh/plugin__gitops-plugin.json b/locales/zh/plugin__gitops-plugin.json index cb6943ef7..d016eedc6 100644 --- a/locales/zh/plugin__gitops-plugin.json +++ b/locales/zh/plugin__gitops-plugin.json @@ -141,11 +141,11 @@ "Unable to load data": "Unable to load data", "There was an error retrieving ImageUpdaters. Check your connection and reload the page.": "There was an error retrieving ImageUpdaters. Check your connection and reload the page.", "ImageUpdaters": "ImageUpdaters", - "This list page is under tech preview, but not necessarily the resources it represents": "This list page is under tech preview, but not necessarily the resources it represents", "Create ImageUpdater": "Create ImageUpdater", "Apps": "Apps", "Images": "Images", "Last Checked": "Last Checked", + "Labels": "Labels", "Has Apps": "Has Apps", "No Apps": "No Apps", "Not Ready": "Not Ready", @@ -218,7 +218,6 @@ "There was an error retrieving App Projects. Check your connection and reload the page.": "There was an error retrieving App Projects. Check your connection and reload the page.", "AppProjects": "AppProjects", "Create AppProject": "Create AppProject", - "Labels": "Labels", "Last Updated": "Last Updated", "Has Description": "Has Description", "No Description": "No Description", @@ -343,18 +342,15 @@ "Created at": "Created at", "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.": "Time is a wrapper around time. Time which supports correct marshaling to YAML and JSON.", "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.": "Owner references link this resource to its parent object. For example, Applications generated by an ApplicationSet will have that ApplicationSet as their owner. This relationship enables proper resource lifecycle management and garbage collection.", - "This details page is under tech preview, but not necessarily the resource it represents": "This details page is under tech preview, but not necessarily the resource it represents", "List view": "List view", "Graph view": "Graph view", "Sync": "Sync", "Stop": "Stop", "Refresh": "Refresh", "Refresh (Hard)": "Refresh (Hard)", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Actions": "Actions", "You don't have permission to perform this action": "You don't have permission to perform this action", "annotations": "annotations", "annotation": "annotation", - "No owner": "No owner", - "Tech preview": "Tech preview" + "No owner": "No owner" } diff --git a/locales/zh/plugin__gitops-public.json b/locales/zh/plugin__gitops-public.json index b0176b468..f0284a431 100644 --- a/locales/zh/plugin__gitops-public.json +++ b/locales/zh/plugin__gitops-public.json @@ -5,7 +5,6 @@ "View logs": "View logs", "Open URL": "Open URL", "Edit": "Edit", - "Rollouts in the Topology View is under tech preview": "Rollouts in the Topology View is under tech preview", "Rollout": "Rollout", "Name": "Name", "Namespace": "Namespace", diff --git a/src/gitops/components/imageupdater/ImageUpdaterList.tsx b/src/gitops/components/imageupdater/ImageUpdaterList.tsx index 2254d273e..24c76b29a 100644 --- a/src/gitops/components/imageupdater/ImageUpdaterList.tsx +++ b/src/gitops/components/imageupdater/ImageUpdaterList.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom-v5-compat'; -import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge'; +import * as YamlFormatter from 'yaml'; import ActionsDropdown from '@gitops/utils/components/ActionDropDown/ActionDropDown'; import { modelToGroupVersionKind } from '@gitops/utils/utils'; @@ -39,6 +39,7 @@ import { useShowOperandsInAllNamespaces, } from '../shared/AllNamespaces'; import { GitOpsDataViewTable, useGitOpsDataViewSort } from '../shared/DataView'; +import MetadataLabels from '../shared/MetadataLabels'; import { useImageUpdaterActionsProvider } from './hooks/useImageUpdaterActionsProvider'; @@ -76,6 +77,7 @@ const ImageUpdaterList: React.FC = ({ 'images', 'last-checked', 'ready', + 'labels', 'actions', ].map((key) => ({ key })); }, [showNamespaceColumn]); @@ -177,15 +179,6 @@ const ImageUpdaterList: React.FC = ({ {showTitle == undefined && ( - ) - } helpText={ location.pathname?.includes('openshift-gitops-operator') ? ( @@ -256,6 +249,10 @@ export const sortData = ( aValue = a.status?.conditions?.find((c) => c.type === 'Ready')?.status || ''; bValue = b.status?.conditions?.find((c) => c.type === 'Ready')?.status || ''; break; + case 'labels': + aValue = YamlFormatter.stringify(a.metadata?.labels || {}); + bValue = YamlFormatter.stringify(b.metadata?.labels || {}); + break; default: return 0; } @@ -282,7 +279,7 @@ export const useColumnsDV = ( cell: t('Name'), props: { 'aria-label': 'name', - className: 'pf-m-width-20', + className: 'pf-m-width-30', sort: getSortParams(0), style: { minWidth: '200px' }, }, @@ -304,7 +301,7 @@ export const useColumnsDV = ( cell: t('Apps'), props: { 'aria-label': 'apps', - className: 'pf-m-width-10', + className: 'pf-m-width-20', sort: getSortParams(1 + i), }, }, @@ -312,7 +309,7 @@ export const useColumnsDV = ( cell: t('Images'), props: { 'aria-label': 'images', - className: 'pf-m-width-10', + className: 'pf-m-width-20', sort: getSortParams(2 + i), }, }, @@ -320,7 +317,7 @@ export const useColumnsDV = ( cell: t('Last Checked'), props: { 'aria-label': 'last checked', - className: 'pf-m-width-15', + className: 'pf-m-width-20', sort: getSortParams(3 + i), }, }, @@ -332,6 +329,14 @@ export const useColumnsDV = ( sort: getSortParams(4 + i), }, }, + { + cell: t('Labels'), + props: { + 'aria-label': 'labels', + className: 'pf-m-width-10', + sort: getSortParams(5 + i), + }, + }, { cell: '', props: { 'aria-label': 'actions' }, @@ -405,6 +410,25 @@ export const useImageUpdaterRowsDV = ( cell: readyCondition ? String(isReady) : '-', dataLabel: 'Ready', }, + { + id: 'labels', + dataLabel: 'Labels', + cell: ( +
+ +
+ ), + }, { id: 'actions-' + index, cell: , diff --git a/src/gitops/components/project/ProjectList.tsx b/src/gitops/components/project/ProjectList.tsx index 06dbfc3cb..579935359 100644 --- a/src/gitops/components/project/ProjectList.tsx +++ b/src/gitops/components/project/ProjectList.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useTranslation } from 'react-i18next'; import { useLocation } from 'react-router-dom-v5-compat'; -import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge'; +import * as YamlFormatter from 'yaml'; import ActionsDropdown from '@gitops/utils/components/ActionDropDown/ActionDropDown'; import { modelToGroupVersionKind, modelToRef } from '@gitops/utils/utils'; @@ -201,15 +201,6 @@ const ProjectList: React.FC = ({ {showTitle == undefined && ( - ) - } helpText={ location.pathname?.includes('openshift-gitops-operator') ? ( @@ -365,8 +356,8 @@ export const sortData = ( bValue = getApplicationsCount(b, applications, appsLoaded); break; case 'labels': - aValue = a.metadata?.labels || {}; - bValue = b.metadata?.labels || {}; + aValue = YamlFormatter.stringify(a.metadata?.labels || {}); + bValue = YamlFormatter.stringify(b.metadata?.labels || {}); break; case 'last-updated': aValue = getLastUpdateTimestamp(a) || ''; @@ -427,10 +418,7 @@ export const useColumnsDV = ( }, { cell: t('Labels'), - props: { - 'aria-label': 'labels', - className: 'pf-m-width-20', - }, + props: sortableHeaderProps('labels', 'pf-m-width-20', getSortParams(3 + i)), }, { cell: t('Last Updated'), diff --git a/src/gitops/components/rollout/RolloutList.tsx b/src/gitops/components/rollout/RolloutList.tsx index af70a362f..5797ca393 100644 --- a/src/gitops/components/rollout/RolloutList.tsx +++ b/src/gitops/components/rollout/RolloutList.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { Link } from 'react-router-dom-v5-compat'; -import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge'; +import * as YamlFormatter from 'yaml'; import { AppProjectKind } from '@gitops/models/AppProjectModel'; import ActionsDropdown from '@gitops/utils/components/ActionDropDown/ActionDropDown'; @@ -184,15 +184,6 @@ const RolloutList: React.FC = ({ {showTitle == undefined && ( - ) - } helpText={ location.pathname?.includes('openshift-gitops-operator') ? ( @@ -261,8 +252,8 @@ export const sortData = ( bValue = b.status?.readyReplicas || ''; break; case 'labels': - aValue = a.metadata?.labels || ''; - bValue = b.metadata?.labels || ''; + aValue = YamlFormatter.stringify(a.metadata?.labels || {}); + bValue = YamlFormatter.stringify(b.metadata?.labels || {}); break; case 'selector': aValue = a.status?.selector || ''; @@ -334,6 +325,7 @@ export const useColumnsDV = ( props: { 'aria-label': 'labels', className: 'pf-m-width-15', + sort: getSortParams(3 + i), }, }, { @@ -426,6 +418,7 @@ export const useRolloutsRowsDV = ( }, { id: 'labels', + dataLabel: 'Labels', cell: (
= ({ 'sync-status', 'health-status', 'revision', + 'labels', 'project', 'actions', ].map((key) => ({ key })), @@ -222,15 +224,6 @@ const ApplicationList: React.FC = ({ {showTitle == undefined && (project == undefined || appset == undefined) && ( - ) - } helpText={ location.pathname?.includes('openshift-gitops-operator') ? ( @@ -330,6 +323,10 @@ export const sortData = ( aValue = a.status?.sync?.revision || ''; bValue = b.status?.sync?.revision || ''; break; + case 'labels': + aValue = YamlFormatter.stringify(a.metadata?.labels || {}); + bValue = YamlFormatter.stringify(b.metadata?.labels || {}); + break; case 'project': aValue = a.spec?.project || ''; bValue = b.spec?.project || ''; @@ -444,6 +441,25 @@ const useApplicationRowsDV = (applicationsList, namespace): DataViewTr[] => { ), }, + { + id: 'labels', + dataLabel: 'Labels', + cell: ( +
+ +
+ ), + }, { id: app.spec?.project, cell: app.spec?.project && ( @@ -519,12 +535,20 @@ const useColumnsDV = ( sort: getSortParams(3 + i), }, }, + { + cell: t('Labels'), + props: { + 'aria-label': 'labels', + className: 'pf-m-width-20', + sort: getSortParams(4 + i), + }, + }, { cell: t('App Project'), props: { 'aria-label': 'project', className: 'pf-m-width-20', - sort: getSortParams(4 + i), + sort: getSortParams(5 + i), }, }, { diff --git a/src/gitops/components/shared/ApplicationSetList.tsx b/src/gitops/components/shared/ApplicationSetList.tsx index 69192b613..81e22031a 100644 --- a/src/gitops/components/shared/ApplicationSetList.tsx +++ b/src/gitops/components/shared/ApplicationSetList.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import { useTranslation } from 'react-i18next'; -import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge'; +import * as YamlFormatter from 'yaml'; import { K8sResourceCommon, @@ -43,6 +43,7 @@ import { useShowOperandsInAllNamespaces, } from './AllNamespaces'; import { GitOpsDataViewTable, useGitOpsDataViewSort } from './DataView'; +import MetadataLabels from './MetadataLabels'; const formatCreationTimestamp = (timestamp: string): string => { if (!timestamp) return '-'; @@ -152,6 +153,7 @@ const ApplicationSetList: React.FC = ({ 'status', 'generated-apps', 'generators', + 'labels', 'created-at', 'actions', ].map((key) => ({ key })), @@ -260,15 +262,6 @@ const ApplicationSetList: React.FC = ({ {showTitle == undefined && ( - ) - } helpText={ location.pathname?.includes('openshift-gitops-operator') ? ( @@ -367,6 +360,25 @@ const useApplicationSetRowsDV = ( id: 'generators-' + index, cell:
{getAppSetGeneratorCount(appSet).toString()}
, }, + { + id: 'labels', + dataLabel: 'Labels', + cell: ( +
+ +
+ ), + }, { id: 'created-at-' + index, cell:
{formatCreationTimestamp(appSet.metadata.creationTimestamp)}
, @@ -432,12 +444,20 @@ const useColumnsDV = ( sort: getSortParams(3 + i), }, }, + { + cell: t('Labels'), + props: { + 'aria-label': 'labels', + className: 'pf-m-width-20', + sort: getSortParams(4 + i), + }, + }, { cell: t('Created At'), props: { 'aria-label': 'created at', className: 'pf-m-width-15', - sort: getSortParams(4 + i), + sort: getSortParams(5 + i), }, }, { @@ -497,11 +517,14 @@ export const sortData = ( aValue = getGeneratedAppsCount(a, applications, appsLoaded); bValue = getGeneratedAppsCount(b, applications, appsLoaded); break; - case 'generators': aValue = getAppSetGeneratorCount(a); bValue = getAppSetGeneratorCount(b); break; + case 'labels': + aValue = YamlFormatter.stringify(a.metadata?.labels || {}); + bValue = YamlFormatter.stringify(b.metadata?.labels || {}); + break; case 'created-at': aValue = new Date(a.metadata?.creationTimestamp || 0).getTime(); bValue = new Date(b.metadata?.creationTimestamp || 0).getTime(); diff --git a/src/gitops/components/shared/DetailsPageHeader/DetailsPageHeader.tsx b/src/gitops/components/shared/DetailsPageHeader/DetailsPageHeader.tsx index a145b5e16..0d8d9e8f5 100644 --- a/src/gitops/components/shared/DetailsPageHeader/DetailsPageHeader.tsx +++ b/src/gitops/components/shared/DetailsPageHeader/DetailsPageHeader.tsx @@ -1,6 +1,5 @@ import * as React from 'react'; import { Link } from 'react-router-dom-v5-compat'; -import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge'; import FavoriteButton from '@gitops/components/shared/FavoriteButton/FavoriteButton'; import ActionsDropdown from '@gitops/utils/components/ActionDropDown/ActionDropDown'; @@ -97,16 +96,6 @@ const DetailsPageHeader: React.FC = ({ {name ?? obj?.metadata?.name}{' '} {isApplicationRefreshing(obj) ? : } - - - diff --git a/src/gitops/components/shared/MetadataLabels/MetadataLabels.tsx b/src/gitops/components/shared/MetadataLabels/MetadataLabels.tsx index 183c717a2..00c2aec42 100644 --- a/src/gitops/components/shared/MetadataLabels/MetadataLabels.tsx +++ b/src/gitops/components/shared/MetadataLabels/MetadataLabels.tsx @@ -41,7 +41,11 @@ type MetadataLabelsProps = { export const MetadataLabels: React.FC = ({ kind, labels, numLabels = 10 }) => { const { t } = useGitOpsTranslation(); return labels && Object.keys(labels).length > 0 ? ( - + {Object.keys(labels || {})?.map((key) => { return ( diff --git a/src/gitops/topology/sidebar/DeploymentSideBarDetails.tsx b/src/gitops/topology/sidebar/DeploymentSideBarDetails.tsx index fe0dc70c6..6c27fc3cf 100644 --- a/src/gitops/topology/sidebar/DeploymentSideBarDetails.tsx +++ b/src/gitops/topology/sidebar/DeploymentSideBarDetails.tsx @@ -2,7 +2,6 @@ import * as React from 'react'; import { useTranslation } from 'react-i18next'; import classNames from 'classnames'; import * as _ from 'lodash'; -import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge'; import { DetailsTabSectionExtensionHook, @@ -242,11 +241,6 @@ export const DeploymentSideBarDetails: React.FC = <>
-
diff --git a/src/gitops/topology/sidebar/resource-sections.tsx b/src/gitops/topology/sidebar/resource-sections.tsx index 0170455ef..dd5f3a890 100644 --- a/src/gitops/topology/sidebar/resource-sections.tsx +++ b/src/gitops/topology/sidebar/resource-sections.tsx @@ -1,7 +1,5 @@ import * as React from 'react'; -import TechPreviewBadge from 'src/plugin/import/badges/TechPreviewBadge'; -import { t } from '@gitops/utils/hooks/useGitOpsTranslation'; import { DetailsTabSectionExtensionHook, K8sResourceKind, @@ -61,12 +59,7 @@ export const ResourceSection: React.FC<{ return (
- - - - +
{statusOfPods && statusOfPods.pods && (
diff --git a/src/plugin/import/badges/Badge.scss b/src/plugin/import/badges/Badge.scss deleted file mode 100644 index 93f1d8cbe..000000000 --- a/src/plugin/import/badges/Badge.scss +++ /dev/null @@ -1,8 +0,0 @@ -.gitops-plugin__preview-badge { - &.pf-v5-c-label { - --pf-v5-c-label--BackgroundColor: #d93f00; - --pf-v5-c-label--Color: var(--pf-v5-global--palette--white); - margin-top: 3px; - padding-bottom: 7px; - } -} diff --git a/src/plugin/import/badges/TechPreviewBadge.test.tsx b/src/plugin/import/badges/TechPreviewBadge.test.tsx deleted file mode 100644 index b3e6576c1..000000000 --- a/src/plugin/import/badges/TechPreviewBadge.test.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { renderToStaticMarkup } from 'react-dom/server'; -import TechPreviewBadge from './TechPreviewBadge'; - -describe('TechPreviewBadge', () => { - it('renders label without tooltip', () => { - expect(renderToStaticMarkup()).toMatchInlineSnapshot( - `"plugin__gitops-plugin~Tech preview"`, - ); - }); - - it('renders with tooltip when tooltipContent provided', () => { - expect( - renderToStaticMarkup(), - ).toMatchInlineSnapshot( - `"plugin__gitops-plugin~Tech preview"`, - ); - }); -}); diff --git a/src/plugin/import/badges/TechPreviewBadge.tsx b/src/plugin/import/badges/TechPreviewBadge.tsx deleted file mode 100644 index ee406eb59..000000000 --- a/src/plugin/import/badges/TechPreviewBadge.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as React from 'react'; -import { TFunction, useTranslation } from 'react-i18next'; - -import { Label, Tooltip } from '@patternfly/react-core'; - -import './Badge.scss'; - -const getBadgeLabel = (t: TFunction) => { - return ( - - ); -}; - -const TechPreviewBadge: React.FC<{ tooltipContent?: string }> = ({ tooltipContent }) => { - const { t } = useTranslation('plugin__gitops-plugin'); - return tooltipContent ? ( - {getBadgeLabel(t)} - ) : ( - getBadgeLabel(t) - ); -}; - -export default TechPreviewBadge;