diff --git a/src/components/Extensibility/components/tests/Badge.cy.js b/src/components/Extensibility/components/tests/Badge.cy.js index 44254a2617..3e9be86a49 100644 --- a/src/components/Extensibility/components/tests/Badge.cy.js +++ b/src/components/Extensibility/components/tests/Badge.cy.js @@ -36,7 +36,7 @@ describe('Badge Component', () => { const value = -2; const structure = { highlights: { - negative: 'data < 0', + critical: 'data < 0', }, }; diff --git a/src/components/Extensibility/helpers/index.js b/src/components/Extensibility/helpers/index.js index f26b95c45d..d955eaa18c 100644 --- a/src/components/Extensibility/helpers/index.js +++ b/src/components/Extensibility/helpers/index.js @@ -269,9 +269,9 @@ export const getTextSearchProperties = ({ }; const TYPE_FALLBACK = new Map([ - ['success', 'Success'], - ['warning', 'Warning'], - ['error', 'Error'], + ['success', 'Positive'], + ['warning', 'Critical'], + ['error', 'Negative'], ['info', 'Information'], ]); @@ -301,11 +301,10 @@ export const getBadgeType = (highlights, value, jsonata, t) => { type = match[0]; } } - - 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'; else if (type === 'none') type = 'None'; type = TYPE_FALLBACK.get(type) || type; diff --git a/src/components/KymaModules/KymaModulesList.js b/src/components/KymaModules/KymaModulesList.js index 84f6d4e0da..c8041a1b42 100644 --- a/src/components/KymaModules/KymaModulesList.js +++ b/src/components/KymaModules/KymaModulesList.js @@ -41,7 +41,7 @@ import pluralize from 'pluralize'; import { Spinner } from 'shared/components/Spinner/Spinner'; import { Label } from 'shared/ResourceForm/components/Label'; import { isFormOpenState } from 'state/formOpenAtom'; -import { ModuleStatus } from './components/ModuleStatus'; +import { ModuleStatus, resolveType } from './components/ModuleStatus'; import { cloneDeep } from 'lodash'; import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge'; import { useNavigate } from 'react-router-dom'; @@ -269,16 +269,7 @@ export default function KymaModulesList({ // Installation State {moduleStatus?.state || 'Unknown'} diff --git a/src/components/KymaModules/components/ModuleStatus.tsx b/src/components/KymaModules/components/ModuleStatus.tsx index 457e7fa867..1063481c7e 100644 --- a/src/components/KymaModules/components/ModuleStatus.tsx +++ b/src/components/KymaModules/components/ModuleStatus.tsx @@ -1,29 +1,30 @@ import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge'; import { useModuleStatus } from '../support'; +export const resolveType = (status: string) => { + switch (status) { + case 'Ready': + return 'Positive'; + case 'Processing': + case 'Deleting': + case 'Unknown': + case 'Unmanaged': + return 'None'; + case 'Warning': + return 'Critical'; + case 'Error': + return 'Negative'; + default: + return 'None'; + } +}; + export const ModuleStatus = ({ resource }: any) => { const { data: status } = useModuleStatus(resource); 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 ( { const overridenStatus = () => { if (condition.type === 'ReplicaFailure') - return condition.status === 'True' ? 'Error' : 'Success'; + return condition.status === 'True' ? 'Negative' : 'Positive'; return undefined; }; return { diff --git a/src/shared/components/ExpandableListItem/ExpandableListItem.tsx b/src/shared/components/ExpandableListItem/ExpandableListItem.tsx index d659f06bd0..dcb528764c 100644 --- a/src/shared/components/ExpandableListItem/ExpandableListItem.tsx +++ b/src/shared/components/ExpandableListItem/ExpandableListItem.tsx @@ -32,10 +32,10 @@ export const ExpandableListItem = ({ let statusType; switch (status) { case 'True': - statusType = 'Success'; + statusType = 'Positive'; break; case 'False': - statusType = 'Error'; + statusType = 'Negative'; break; case 'Unknown': statusType = 'Information';