diff --git a/src/components/Clusters/views/ClusterOverview/ClusterNodes.js b/src/components/Clusters/views/ClusterOverview/ClusterNodes.js index e787b5e827..6bd2b5930c 100644 --- a/src/components/Clusters/views/ClusterOverview/ClusterNodes.js +++ b/src/components/Clusters/views/ClusterOverview/ClusterNodes.js @@ -19,7 +19,7 @@ export function ClusterNodes({ data, error, loading }) { const { t } = useTranslation(); const getStatusType = status => { - if (status === 'Ready') return 'Success'; + if (status === 'Ready') return 'Positive'; return undefined; }; diff --git a/src/components/Extensibility/components/Badge.js b/src/components/Extensibility/components/Badge.js index 0dafa3092b..ad07f66233 100644 --- a/src/components/Extensibility/components/Badge.js +++ b/src/components/Extensibility/components/Badge.js @@ -11,9 +11,9 @@ import { import './Badge.scss'; const TYPE_FALLBACK = new Map([ - ['success', 'Success'], - ['warning', 'Warning'], - ['error', 'Error'], + ['positive', 'Positive'], + ['critical', 'Critical'], + ['negative', 'Negative'], ['info', 'Information'], ]); @@ -63,10 +63,10 @@ export function Badge({ } } - if (type === 'negative') type = 'Warning'; + if (type === 'negative') type = 'Critical'; else if (type === 'informative') type = 'Information'; - else if (type === 'positive') type = 'Success'; - else if (type === 'critical') type = 'Error'; + else if (type === 'positive') type = 'Positive'; + else if (type === 'critical') type = 'Negative'; type = TYPE_FALLBACK.get(type) || type; diff --git a/src/components/HelmReleases/HelmReleaseStatus.js b/src/components/HelmReleases/HelmReleaseStatus.js index 4518b499d7..ce4327776a 100644 --- a/src/components/HelmReleases/HelmReleaseStatus.js +++ b/src/components/HelmReleases/HelmReleaseStatus.js @@ -1,14 +1,13 @@ -import React from 'react'; import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge'; export function HelmReleaseStatus({ status }) { const resolveType = status => { switch (status) { case 'deployed': - return 'Success'; + return 'Positive'; case 'uninstalling': case 'failed': - return 'Error'; + return 'Negative'; case 'unknown': return 'None'; default: diff --git a/src/components/KymaModules/KymaModulesList.js b/src/components/KymaModules/KymaModulesList.js index fd65ae9381..f1dd1ba6d2 100644 --- a/src/components/KymaModules/KymaModulesList.js +++ b/src/components/KymaModules/KymaModulesList.js @@ -224,7 +224,7 @@ export default function KymaModulesList({ resourceKind="kymas" type={ moduleStatus?.state === 'Ready' - ? 'Success' + ? 'Positive' : moduleStatus?.state === 'Processing' || moduleStatus?.state === 'Deleting' || moduleStatus?.state === 'Unmanaged' || diff --git a/src/components/KymaModules/components/ModuleStatus.tsx b/src/components/KymaModules/components/ModuleStatus.tsx index 26ddffe262..457e7fa867 100644 --- a/src/components/KymaModules/components/ModuleStatus.tsx +++ b/src/components/KymaModules/components/ModuleStatus.tsx @@ -7,18 +7,27 @@ export const ModuleStatus = ({ resource }: any) => { const moduleState = status?.state || 'Unknown'; const moduleMessage = status?.description; + const resolveType = (status: string) => { + switch (status) { + case 'Ready': + return 'Positive'; + case 'Processing': + case 'Deleting': + case 'Unknown': + return 'None'; + case 'Warning': + return 'Critical'; + case 'Error': + return 'Negative'; + default: + return 'None'; + } + }; + return ( {moduleState} diff --git a/src/resources/CustomResourceDefinitions/CurrentCRDVersion.js b/src/resources/CustomResourceDefinitions/CurrentCRDVersion.js index ac7d7ef340..5acc16905e 100644 --- a/src/resources/CustomResourceDefinitions/CurrentCRDVersion.js +++ b/src/resources/CustomResourceDefinitions/CurrentCRDVersion.js @@ -57,7 +57,7 @@ export const CurrentCRDVersion = resource => { 'custom-resource-definitions.subtitle.version', )} ${storageVersion.name}`} @@ -67,7 +67,7 @@ export const CurrentCRDVersion = resource => { {storageVersion.storage && ( diff --git a/src/resources/Ingresses/IngressDetails.js b/src/resources/Ingresses/IngressDetails.js index ea80654ba5..51cae208ad 100644 --- a/src/resources/Ingresses/IngressDetails.js +++ b/src/resources/Ingresses/IngressDetails.js @@ -72,8 +72,8 @@ export function IngressDetails(props) { totalPorts === 0 ? 'Information' : totalPorts === healthyPorts - ? 'Success' - : 'Error'; + ? 'Positive' + : 'Negative'; return ( { if (type === 'Complete') { - return 'Success'; + return 'Positive'; } else if (type === 'Failed') { - return 'Error'; + return 'Negative'; } else { return 'Information'; } diff --git a/src/resources/Namespaces/NamespaceStatus.js b/src/resources/Namespaces/NamespaceStatus.js index f46f85b014..b597320ff2 100644 --- a/src/resources/Namespaces/NamespaceStatus.js +++ b/src/resources/Namespaces/NamespaceStatus.js @@ -1,15 +1,14 @@ -import React from 'react'; import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge'; export function NamespaceStatus({ namespaceStatus }) { const badgeType = status => { switch (status) { case 'Active': - return 'Success'; + return 'Positive'; case 'Terminating': return 'Information'; default: - return 'Error'; + return 'Negative'; } }; diff --git a/src/resources/PersistentVolumes/PersistentVolumeStatus.js b/src/resources/PersistentVolumes/PersistentVolumeStatus.js index 45221ebab0..d19612ab80 100644 --- a/src/resources/PersistentVolumes/PersistentVolumeStatus.js +++ b/src/resources/PersistentVolumes/PersistentVolumeStatus.js @@ -1,4 +1,3 @@ -import React from 'react'; import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge'; export function PersistentVolumeStatus({ status }) { @@ -6,12 +5,12 @@ export function PersistentVolumeStatus({ status }) { switch (status) { case 'Bound': case 'Available': - return 'Success'; + return 'Positive'; case 'Released': case 'Pending': return 'Information'; default: - return 'Error'; + return 'Negative'; } }; diff --git a/src/resources/Pods/ContainerStatus.js b/src/resources/Pods/ContainerStatus.js index 8ee7dc76e7..cff752bbd1 100644 --- a/src/resources/Pods/ContainerStatus.js +++ b/src/resources/Pods/ContainerStatus.js @@ -17,7 +17,7 @@ export function ContainerStatus({ status }) { case 'running': case 'completed': case 'succeeded': - return 'Success'; + return 'Positive'; case 'containercreating': case 'initing': case 'pending': @@ -27,7 +27,7 @@ export function ContainerStatus({ status }) { case 'unknown': return 'None'; default: - return 'Error'; + return 'Negative'; } }; diff --git a/src/resources/Pods/PodRestarts.js b/src/resources/Pods/PodRestarts.js index 90f4655ea2..ae8d5c05ee 100644 --- a/src/resources/Pods/PodRestarts.js +++ b/src/resources/Pods/PodRestarts.js @@ -5,7 +5,7 @@ export default function PodRestarts({ statuses }) { const { t } = useTranslation(); const restartCount = statuses?.reduce((acc, c) => acc + c.restartCount, 0); - const type = restartCount ? 'Error' : 'Success'; + const type = restartCount ? 'Negative' : 'Positive'; const getTooltipContent = () => { if (!restartCount) return t('pods.tooltips.no-restarts'); diff --git a/src/resources/Pods/PodStatus.js b/src/resources/Pods/PodStatus.js index 3589950dcd..50d02d931c 100644 --- a/src/resources/Pods/PodStatus.js +++ b/src/resources/Pods/PodStatus.js @@ -32,7 +32,7 @@ const badgeType = status => { case 'Running': case 'Succeeded': case 'Completed': - return 'Success'; + return 'Positive'; case 'Terminated': case 'Pending': case 'Terminating': @@ -42,7 +42,7 @@ const badgeType = status => { case 'Unknown': return 'None'; default: - return 'Error'; + return 'Negative'; } }; diff --git a/src/shared/components/BTPResourceStatus.js b/src/shared/components/BTPResourceStatus.js index 0dad7a7300..3f641380e8 100644 --- a/src/shared/components/BTPResourceStatus.js +++ b/src/shared/components/BTPResourceStatus.js @@ -7,7 +7,7 @@ export function BTPResourceStatus({ status, resourceKind }) { if (status?.ready === 'True' && lastCondition.type === 'Ready') { return ( - + {lastCondition.reason} ); diff --git a/src/shared/components/ExpandableListItem/ExpandableListItem.tsx b/src/shared/components/ExpandableListItem/ExpandableListItem.tsx index d454dc4d43..0f8ad6751a 100644 --- a/src/shared/components/ExpandableListItem/ExpandableListItem.tsx +++ b/src/shared/components/ExpandableListItem/ExpandableListItem.tsx @@ -50,7 +50,7 @@ export const ExpandableListItem = ({ {header} {status && ( {status} diff --git a/src/shared/components/PersistentVolumeClaimStatus.js b/src/shared/components/PersistentVolumeClaimStatus.js index a9ad5b8689..1de1c84c83 100644 --- a/src/shared/components/PersistentVolumeClaimStatus.js +++ b/src/shared/components/PersistentVolumeClaimStatus.js @@ -1,4 +1,3 @@ -import React from 'react'; import { useTranslation } from 'react-i18next'; import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge'; @@ -6,17 +5,17 @@ const createPhaseProperties = (phase, t) => { switch (phase) { case 'Bound': return { - type: 'Success', + type: 'Positive', tooltipContent: t('persistent-volume-claims.tooltips.bound'), }; case 'Lost': return { - type: 'Error', + type: 'Negative', tooltipContent: t('persistent-volume-claims.tooltips.lost'), }; case 'Pending': return { - type: 'Warning', + type: 'Critical', tooltipContent: t('persistent-volume-claims.tooltips.pending'), }; default: diff --git a/src/shared/components/PopoverBadge/PopoverBadge.tsx b/src/shared/components/PopoverBadge/PopoverBadge.tsx index af3074424d..8bf50cfb32 100644 --- a/src/shared/components/PopoverBadge/PopoverBadge.tsx +++ b/src/shared/components/PopoverBadge/PopoverBadge.tsx @@ -9,7 +9,7 @@ import { createPortal } from 'react-dom'; interface PopoverBadgeProps { children?: ReactNode; tooltipContent: ReactNode; - type: 'Information' | 'Success' | 'Error' | 'Warning' | 'None'; + type: 'Information' | 'Positive' | 'Negative' | 'Critical' | 'None'; className?: string; } diff --git a/src/shared/components/RunningPodsStatus.js b/src/shared/components/RunningPodsStatus.js index e22073c680..3f7ad30598 100644 --- a/src/shared/components/RunningPodsStatus.js +++ b/src/shared/components/RunningPodsStatus.js @@ -7,7 +7,7 @@ export function RunningPodsStatus({ running, expected }) { running === 1 ? t('common.tooltips.running-pods-singular') : t('common.tooltips.running-pods-plural', { running }); - const statusType = running === expected ? 'Success' : 'Error'; + const statusType = running === expected ? 'Positive' : 'Negative'; return ( { case 'Success': case 'Succeeded': case 'Ok': - return 'Success'; + return 'Positive'; case 'Unknown': case 'Warning': - return 'Warning'; + return 'Critical'; case 'Failed': case 'Error': case 'Failure': case 'Invalid': - return 'Error'; + return 'Negative'; default: return 'None'; @@ -58,9 +58,9 @@ const prepareTranslationPath = (resourceKind, value, type) => { }; const TYPE_FALLBACK = new Map([ - ['success', 'Success'], - ['warning', 'Warning'], - ['error', 'Error'], + ['positive', 'Positive'], + ['critical', 'Critical'], + ['negative', 'Negative'], ['info', 'Information'], ]); @@ -168,7 +168,13 @@ export const StatusBadge = ({ StatusBadge.propTypes = { additionalContent: PropTypes.node, tooltipContent: PropTypes.node, - type: PropTypes.oneOf(['Information', 'Success', 'Error', 'Warning', 'None']), + type: PropTypes.oneOf([ + 'Information', + 'Positive', + 'Negative', + 'Critical', + 'None', + ]), autoResolveType: PropTypes.bool, noTooltip: PropTypes.bool, resourceKind: PropTypes.string, diff --git a/src/shared/components/SubscriptionConditionStatus.js b/src/shared/components/SubscriptionConditionStatus.js index 47c160a9e5..d3b1a1cb88 100644 --- a/src/shared/components/SubscriptionConditionStatus.js +++ b/src/shared/components/SubscriptionConditionStatus.js @@ -7,11 +7,11 @@ export const SubscriptionConditionStatus = ({ condition }) => { const statusBadgeProperties = condition?.status === 'True' ? { - type: 'Success', + type: 'Positive', text: t('common.statuses.ready'), } : { - type: 'Error', + type: 'Negative', text: t('common.statuses.error'), }; return ( diff --git a/src/shared/components/TooltipBadge/TooltipBadge.js b/src/shared/components/TooltipBadge/TooltipBadge.js index f1337f04b8..bad968809d 100644 --- a/src/shared/components/TooltipBadge/TooltipBadge.js +++ b/src/shared/components/TooltipBadge/TooltipBadge.js @@ -39,7 +39,13 @@ export const TooltipBadge = ({ TooltipBadge.propTypes = { tooltipContent: PropTypes.node, - type: PropTypes.oneOf(['Information', 'Success', 'Error', 'Warning', 'None']), + type: PropTypes.oneOf([ + 'Information', + 'Positive', + 'Negative', + 'Critical', + 'None', + ]), tooltipProps: PropTypes.object, className: PropTypes.string, };