diff --git a/docs/extensibility/display-section.md b/docs/extensibility/display-section.md index ace5f23cdd..ac8075aa62 100644 --- a/docs/extensibility/display-section.md +++ b/docs/extensibility/display-section.md @@ -211,7 +211,7 @@ Badge widgets render texts as a status badge, using a set of predefined rules to - **placeholder** - an optional property to change the default empty text placeholder `-` with a custom string. If the **translations** section has a translation entry with the ID that is the same as the **placeholder** string, the translation is used. -- **highlights** - an optional map of highlight rules. Key refers to the type of highlight, while the rule can just be a plain array of values or a string containing a [JSONata](jsonata.md) rule. Allowed keys are `informative` `positive`, `negative` and `critical`. +- **highlights** - an optional map of highlight rules. Key refers to the type of highlight, while the rule can just be a plain array of values or a string containing a [JSONata](jsonata.md) rule. Allowed keys are `information`, `success`, `warning` and `error`. - **description** - a [JSONata](jsonata.md) expression used to fetch additional information that will be displayed in a tooltip when hovering over the badge. - **copyable** - an optional flag to display a **Copy to clipboard** button next to the widget. By default set to `false`. @@ -219,10 +219,10 @@ Badge widgets render texts as a status badge, using a set of predefined rules to When no highlights are provided, the following values are automatically handled: -- rendered as informative: `initial`, `pending`, `available`, `released`. -- rendered as positive: `ready`, `bound`, `running`, `success`, `succeeded`, `ok`. -- rendered as negative: `unknown`, `warning`. -- rendered as critical: `error`, `failure`, `invalid`. +- rendered as information: `initial`, `pending`, `available`, `released`. +- rendered as success: `ready`, `bound`, `running`, `success`, `succeeded`, `ok`. +- rendered as warning: `unknown`, `warning`. +- rendered as error: `error`, `failure`, `invalid`. #### Example @@ -231,10 +231,10 @@ When no highlights are provided, the following values are automatically handled: widget: Badge placeholder: '-' highlights: - positive: + success: - Running - ok - negative: $item < 0 + error: $item < 0 description: status.message ``` @@ -835,11 +835,10 @@ injections: |- - name: status widget: Badge highlights: - positive: + success: - 'OK' - negative: + error: - 'ERROR' - critical: - 'SKIPPED' source: 'status.APIRuleStatus.code ? status.APIRuleStatus.code : "UNKNOWN"' description: status.APIRuleStatus.desc diff --git a/examples/injections/apirules.yaml b/examples/injections/apirules.yaml index b456d068ff..bc00cac5ff 100644 --- a/examples/injections/apirules.yaml +++ b/examples/injections/apirules.yaml @@ -20,11 +20,10 @@ injections: |- - name: status widget: Badge highlights: - positive: + success: - 'OK' - negative: + error: - 'ERROR' - critical: - 'SKIPPED' source: 'status.APIRuleStatus.code ? status.APIRuleStatus.code : "UNKNOWN"' description: status.APIRuleStatus.desc diff --git a/examples/injections/functions.yaml b/examples/injections/functions.yaml index 028387fa7c..4ad9430006 100644 --- a/examples/injections/functions.yaml +++ b/examples/injections/functions.yaml @@ -17,17 +17,16 @@ injections: |- - name: header.status widget: Badge highlights: - positive: + success: - RUNNING - negative: + error: - FAILED - ERROR - informative: - - INITIALIZING - critical: - DEPLOYING - BUILDING - PENDING + information: + - INITIALIZING source: >- ($.status = undefined or $.status.conditions = undefined or $count($.status.conditions) = 0) ? 'INITIALIZING' : diff --git a/examples/services/configuration.yaml b/examples/services/configuration.yaml index a3f3f42da2..cccde6b769 100644 --- a/examples/services/configuration.yaml +++ b/examples/services/configuration.yaml @@ -52,9 +52,9 @@ data: sort: true widget: Badge highlights: - positive: + success: - 'true' - negative: + error: - 'false' - widget: ResourceList source: $apirules() diff --git a/public/i18n/en.yaml b/public/i18n/en.yaml index e57840acef..301cc1320a 100644 --- a/public/i18n/en.yaml +++ b/public/i18n/en.yaml @@ -710,12 +710,6 @@ gardener: provider: Provider generic-list: no-entries-found: No entries found -grafana: - logs: Logs - missing-domain: Grafana service does not have a host defined - not-exposed: Grafana service is not exposed - open-in-grafana: Open in Grafana - unavailable: No Grafana link graphs: capacity: Capacity cpu: CPU diff --git a/public/schemas/schema-details.yaml b/public/schemas/schema-details.yaml index da678e7888..4d244eb988 100644 --- a/public/schemas/schema-details.yaml +++ b/public/schemas/schema-details.yaml @@ -119,7 +119,7 @@ $widgets: type: object widget: FormGroup properties: - informative: + information: type: [string, array] widget: MultiType widgets: @@ -127,7 +127,7 @@ $widgets: array: SimpleList items: type: string - positive: + success: type: [string, array] widget: MultiType widgets: @@ -135,15 +135,7 @@ $widgets: array: SimpleList items: type: string - negative: - type: [string, array] - widget: MultiType - widgets: - string: Jsonata - array: SimpleList - items: - type: string - critical: + error: type: [string, array] widget: MultiType widgets: diff --git a/public/schemas/schema-injections.yaml b/public/schemas/schema-injections.yaml index 4bab6d82f9..951bb648ab 100644 --- a/public/schemas/schema-injections.yaml +++ b/public/schemas/schema-injections.yaml @@ -143,7 +143,7 @@ items: type: object widget: FormGroup properties: - informative: + information: type: - string - array @@ -153,7 +153,7 @@ items: array: SimpleList items: type: string - positive: + success: type: - string - array @@ -163,17 +163,7 @@ items: array: SimpleList items: type: string - negative: - type: - - string - - array - widget: MultiType - widgets: - string: Jsonata - array: SimpleList - items: - type: string - critical: + error: type: - string - array diff --git a/public/schemas/schema-list.yaml b/public/schemas/schema-list.yaml index baa34cc5f7..ef5d2f85a7 100644 --- a/public/schemas/schema-list.yaml +++ b/public/schemas/schema-list.yaml @@ -104,7 +104,7 @@ $widgets: type: object widget: FormGroup properties: - informative: + information: type: [string, array] widget: MultiType widgets: @@ -112,7 +112,7 @@ $widgets: array: SimpleList items: type: string - positive: + success: type: [string, array] widget: MultiType widgets: @@ -120,15 +120,7 @@ $widgets: array: SimpleList items: type: string - negative: - type: [string, array] - widget: MultiType - widgets: - string: Jsonata - array: SimpleList - items: - type: string - critical: + error: type: [string, array] widget: MultiType widgets: diff --git a/src/components/Clusters/components/ContextChooser/ContextChooser.js b/src/components/Clusters/components/ContextChooser/ContextChooser.js index d530389efa..42f9f9b425 100644 --- a/src/components/Clusters/components/ContextChooser/ContextChooser.js +++ b/src/components/Clusters/components/ContextChooser/ContextChooser.js @@ -1,7 +1,5 @@ -import React from 'react'; import { useTranslation } from 'react-i18next'; -import { MessageStrip } from '@ui5/webcomponents-react'; -import { Select } from 'fundamental-react'; +import { MessageStrip, Select, Option } from '@ui5/webcomponents-react'; import { ResourceForm } from 'shared/ResourceForm'; @@ -24,6 +22,11 @@ export function ContextChooser(params) { text: t('clusters.wizard.all-contexts'), }); + const onChange = (event, setValue) => { + const selectedContext = event.detail.selectedOption.value; + setValue(selectedContext); + }; + return ( ( )} /> {kubeconfig['current-context'] === '-all-' && ( diff --git a/src/components/Clusters/views/ClusterStorageType.js b/src/components/Clusters/views/ClusterStorageType.js index 2d76064af9..0822928557 100644 --- a/src/components/Clusters/views/ClusterStorageType.js +++ b/src/components/Clusters/views/ClusterStorageType.js @@ -8,7 +8,7 @@ export function ClusterStorageType({ clusterConfig }) { return ( {storage || 'unknown'} diff --git a/src/components/Extensibility/components-form/KeyValuePairRenderer.js b/src/components/Extensibility/components-form/KeyValuePairRenderer.js index 1c815baecb..702d41676b 100644 --- a/src/components/Extensibility/components-form/KeyValuePairRenderer.js +++ b/src/components/Extensibility/components-form/KeyValuePairRenderer.js @@ -23,6 +23,9 @@ const getEnumComponent = ( return ({ onChange, setValue, onBlur, value, ...props }) => ( { + event.preventDefault(); + }} value={value} options={options} setValue={v => { diff --git a/src/components/Extensibility/components-form/Modules/Modules.js b/src/components/Extensibility/components-form/Modules/Modules.js index 42ce964ad7..3de42a5e3a 100644 --- a/src/components/Extensibility/components-form/Modules/Modules.js +++ b/src/components/Extensibility/components-form/Modules/Modules.js @@ -162,7 +162,6 @@ export function Modules({ storeKeys, resource, onChange, schema, required }) { { expect(status).toHaveLength(1); }); - it('Renders a badge with positive type for custom highlights', () => { + it('Renders a badge with success type for custom highlights', () => { const value = 'yes'; const structure = { highlights: { - positive: ['yes', 'ok'], + Success: ['yes', 'ok'], }, }; const wrapper = shallow(); const status = wrapper.find(StatusBadge); const badgeProps = status.props(); - expect(badgeProps.type).toEqual('positive'); + expect(badgeProps.type).toEqual('Success'); expect(badgeProps.autoResolveType).toEqual(false); expect(status).toHaveLength(1); }); - it('Renders a badge with positive type for custom highlights', () => { + it('Renders a badge with error type for custom highlights', () => { const value = -2; const structure = { highlights: { - negative: 'data < 0', + Error: 'data < 0', }, }; const wrapper = shallow(); const status = wrapper.find(StatusBadge); const badgeProps = status.props(); - expect(badgeProps.type).toEqual('negative'); + expect(badgeProps.type).toEqual('Error'); expect(badgeProps.autoResolveType).toEqual(false); expect(status).toHaveLength(1); }); diff --git a/src/components/HelmReleases/HelmReleaseStatus.js b/src/components/HelmReleases/HelmReleaseStatus.js index d0dfdc45fc..4518b499d7 100644 --- a/src/components/HelmReleases/HelmReleaseStatus.js +++ b/src/components/HelmReleases/HelmReleaseStatus.js @@ -7,7 +7,6 @@ export function HelmReleaseStatus({ status }) { case 'deployed': return 'Success'; case 'uninstalling': - return 'Error'; case 'failed': return 'Error'; case 'unknown': diff --git a/src/components/HelmReleases/ReleaseDataPanel.js b/src/components/HelmReleases/ReleaseDataPanel.js index 21c0787722..541ce89972 100644 --- a/src/components/HelmReleases/ReleaseDataPanel.js +++ b/src/components/HelmReleases/ReleaseDataPanel.js @@ -30,7 +30,7 @@ export function ReleaseDataPanel({ release, simpleHeader }) { {name}
- + {t('helm-releases.headers.release-version', { version })}
diff --git a/src/components/Preferences/LanguageSettings.tsx b/src/components/Preferences/LanguageSettings.tsx index aae9204cbc..77d1b7de74 100644 --- a/src/components/Preferences/LanguageSettings.tsx +++ b/src/components/Preferences/LanguageSettings.tsx @@ -1,9 +1,7 @@ -import React from 'react'; import { useTranslation } from 'react-i18next'; import { useSetRecoilState } from 'recoil'; -import { Select } from 'fundamental-react'; +import { Select, Option } from '@ui5/webcomponents-react'; import { languageAtom } from 'state/preferences/languageAtom'; -import { Option } from 'fundamental-react/lib/Select/Select'; const AVAILABLE_LANGUAGES = [{ key: 'en', text: 'English' }]; @@ -11,21 +9,24 @@ export default function LanguageSettings() { const { t, i18n } = useTranslation(); const setLanguage = useSetRecoilState(languageAtom); - const selectLanguage = ( - event: React.MouseEvent | React.KeyboardEvent, - language: Option, - ) => { - setLanguage(language.key); + const onChange = (event: CustomEvent) => { + const selectedLanguage = event.detail.selectedOption.value; + setLanguage(selectedLanguage); }; return (
{t('settings.language')} - + {AVAILABLE_LANGUAGES.map(available_language => ( + + ))} +
); } diff --git a/src/components/Preferences/OtherSettings.tsx b/src/components/Preferences/OtherSettings.tsx index 222585d08f..e0ef633184 100644 --- a/src/components/Preferences/OtherSettings.tsx +++ b/src/components/Preferences/OtherSettings.tsx @@ -1,6 +1,6 @@ import { useTranslation } from 'react-i18next'; import { useRecoilState } from 'recoil'; -import { Select } from 'fundamental-react'; +import { Select, Option } from '@ui5/webcomponents-react'; import { pageSizeState } from 'state/preferences/pageSizeAtom'; const AVAILABLE_PAGE_SIZES = [10, 20, 50]; @@ -9,21 +9,26 @@ export default function OtherSettings() { const [pageSize, setPageSize] = useRecoilState(pageSizeState); - const pageSizeOptions = AVAILABLE_PAGE_SIZES.map(s => ({ - key: s.toString(), - text: s.toString(), - })); + const onChange = (event: any) => { + const selectedSize = event.detail.selectedOption.value; + setPageSize(parseInt(selectedSize)); + }; return (
{t('settings.other.default-page-size')} - + {AVAILABLE_PAGE_SIZES.map(available_size => ( + + ))} +
); } diff --git a/src/hooks/useMessageList.js b/src/hooks/useMessageList.js index db68942a4f..632f8ac4a3 100644 --- a/src/hooks/useMessageList.js +++ b/src/hooks/useMessageList.js @@ -78,7 +78,6 @@ export const useMessageList = (defaultType = EVENT_MESSAGE_TYPE.ALL) => { const MessageSelector = ( ({ key: el.key, text: t(`node-details.${el.text}`), diff --git a/src/resources/CronJobs/CronJobConcurrencyPolicy.js b/src/resources/CronJobs/CronJobConcurrencyPolicy.js index ba0c8a70cf..1238f38a8f 100644 --- a/src/resources/CronJobs/CronJobConcurrencyPolicy.js +++ b/src/resources/CronJobs/CronJobConcurrencyPolicy.js @@ -4,7 +4,7 @@ import { StatusBadge } from 'shared/components/StatusBadge/StatusBadge'; export function CronJobConcurrencyPolicy({ concurrencyPolicy }) { return ( diff --git a/src/resources/Jobs/JobCompletions.js b/src/resources/Jobs/JobCompletions.js index 516cfcfbda..bb607bb625 100644 --- a/src/resources/Jobs/JobCompletions.js +++ b/src/resources/Jobs/JobCompletions.js @@ -7,7 +7,7 @@ export function JobCompletions({ job }) { const succeeded = job.status.succeeded || 0; const completions = job.spec.completions || 0; - const statusType = succeeded === completions ? 'positive' : 'informative'; + const statusType = succeeded === completions ? 'Success' : 'Information'; return ( { if (type === 'Complete') { - return 'success'; + return 'Success'; } else if (type === 'Failed') { - return 'error'; + return 'Error'; } else { - return 'info'; + return 'Information'; } }; const rowRenderer = condition => { diff --git a/src/resources/Namespaces/MemoryQuotas.js b/src/resources/Namespaces/MemoryQuotas.js index 8338c0f4b0..1d80e27293 100644 --- a/src/resources/Namespaces/MemoryQuotas.js +++ b/src/resources/Namespaces/MemoryQuotas.js @@ -46,7 +46,6 @@ export function MemoryInput({ {...otherProps} /> { switch (status) { case 'Active': - return 'success'; + return 'Success'; case 'Terminating': - return 'info'; + return 'Information'; default: - return 'error'; + return 'Error'; } }; diff --git a/src/resources/PersistentVolumes/PersistentVolumeStatus.js b/src/resources/PersistentVolumes/PersistentVolumeStatus.js index e3bf06a5e7..45221ebab0 100644 --- a/src/resources/PersistentVolumes/PersistentVolumeStatus.js +++ b/src/resources/PersistentVolumes/PersistentVolumeStatus.js @@ -6,12 +6,12 @@ export function PersistentVolumeStatus({ status }) { switch (status) { case 'Bound': case 'Available': - return 'success'; + return 'Success'; case 'Released': case 'Pending': - return 'info'; + return 'Information'; default: - return 'error'; + return 'Error'; } }; diff --git a/src/resources/Pods/ContainerStatus.js b/src/resources/Pods/ContainerStatus.js index 5f9c66c63c..8ee7dc76e7 100644 --- a/src/resources/Pods/ContainerStatus.js +++ b/src/resources/Pods/ContainerStatus.js @@ -17,17 +17,17 @@ export function ContainerStatus({ status }) { case 'running': case 'completed': case 'succeeded': - return 'success'; + return 'Success'; case 'containercreating': case 'initing': case 'pending': case 'podinitializing': case 'terminating': - return 'info'; + return 'Information'; case 'unknown': - return undefined; + return 'None'; default: - return 'error'; + return 'Error'; } }; diff --git a/src/resources/Pods/ContainersLogs.js b/src/resources/Pods/ContainersLogs.js index 924e6c7b1f..e64271928c 100644 --- a/src/resources/Pods/ContainersLogs.js +++ b/src/resources/Pods/ContainersLogs.js @@ -1,8 +1,14 @@ -import React, { useState, useEffect, useRef } from 'react'; +import { useState, useEffect, useRef } from 'react'; import { saveAs } from 'file-saver'; -import { Button, Label, Switch, Text } from '@ui5/webcomponents-react'; -import { Select, FormLabel } from 'fundamental-react'; -import { LogsLink } from 'shared/components/LogsLink/LogsLink'; +import { + Button, + Label, + Switch, + Select, + Option, + Text, +} from '@ui5/webcomponents-react'; +import { FormLabel } from 'fundamental-react'; import { useGetStream } from 'shared/hooks/BackendAPI/useGet'; import { useWindowTitle } from 'shared/hooks/useWindowTitle'; import { useNotification } from 'shared/contexts/NotificationContext'; @@ -183,12 +189,20 @@ const ContainersLogs = ({ params }) => { {t('pods.labels.filter-timeframe')} @@ -203,12 +217,6 @@ const ContainersLogs = ({ params }) => { disabled={!logsToSave?.length} onChange={onReverseChange} /> - - {t('grafana.open-in-grafana')} -