Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update UI5 from v1 to v2 #3433

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,833 changes: 484 additions & 1,349 deletions package-lock.json

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@
"@types/jsonpath": "^0.2.0",
"@types/pluralize": "^0.0.29",
"@ui-schema/ui-schema": "^0.4.5",
"@ui5/webcomponents": "^1.24.0",
"@ui5/webcomponents-base": "^1.24.0",
"@ui5/webcomponents-fiori": "^1.24.0",
"@ui5/webcomponents-icons": "^1.24.0",
"@ui5/webcomponents-icons-tnt": "^1.24.0",
"@ui5/webcomponents-react": "~1.28.1",
"@ui5/webcomponents-react-base": "^1.28.1",
"@ui5/webcomponents-react-charts": "^1.28.1",
"@ui5/webcomponents": "^2.3.0",
"@ui5/webcomponents-base": "^2.3.0",
"@ui5/webcomponents-compat": "^2.3.0",
"@ui5/webcomponents-fiori": "^2.3.0",
"@ui5/webcomponents-icons": "^2.3.0",
"@ui5/webcomponents-icons-tnt": "^2.3.0",
"@ui5/webcomponents-react": "^2.2.0",
"@ui5/webcomponents-react-base": "^2.2.0",
"@ui5/webcomponents-react-charts": "^2.2.0",
"@ui5/webcomponents-react-compat": "^2.3.0",
"classnames": "^2.2.6",
"copy-to-clipboard": "^3.2.0",
"core-js": "^3.3.6",
Expand All @@ -94,8 +96,8 @@
"pako": "^2.0.4",
"pluralize": "^8.0.0",
"prop-types": "^15.7.2",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-i18next": "^11.18.6",
"react-router-dom": "^6.3.0",
"react-tippy": "^1.4.0",
Expand All @@ -107,7 +109,7 @@
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@testing-library/jest-dom": "^6.4.5",
"@testing-library/react": "^12.1.3",
"@testing-library/react": "^16.0.1",
"@types/didyoumean": "^1.2.0",
"@types/enzyme": "^3.10.12",
"@types/file-saver": "^2.0.5",
Expand All @@ -119,7 +121,6 @@
"@types/react-dom": "^18.0.6",
"@types/uuid": "^9.0.0",
"@vitejs/plugin-react": "^4.3.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
"babel-polyfill": "^6.26.0",
"babel-preset-vite": "^1.1.3",
"concurrently": "^7.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next';
import { EMPTY_TEXT_PLACEHOLDER } from 'shared/constants';
import { HelpEntries } from '../types';

import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './components.scss';

export function SuggestedQuery({
Expand Down
3 changes: 1 addition & 2 deletions src/components/App/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ export default function App() {
const setNamespace = useSetRecoilState(activeNamespaceIdState);
const { namespace } = useUrl();
const makeGardenerLoginRoute = useMakeGardenerLoginRoute();
const { t, i18n } = useTranslation();

useInitTheme();

const { t, i18n } = useTranslation();

useEffect(() => {
setNamespace(namespace);
}, [setNamespace, namespace]);
Expand Down
2 changes: 1 addition & 1 deletion src/components/App/ContentWrapper/ContentWrapper.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
:root {
--solidBg: var(--_ui5-v1-24-0_fcl_solid_bg);
--solidBg: var(--_ui5-v2-3-0_fcl_solid_bg);
}

#content-wrap {
Expand Down
2 changes: 1 addition & 1 deletion src/components/App/ContentWrapper/ContentWrapper.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './ContentWrapper.scss';

type ContentWrapperProps = {
Expand Down
5 changes: 2 additions & 3 deletions src/components/BusolaExtensions/BusolaExtensionDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ModalWithForm } from 'shared/components/ModalWithForm/ModalWithForm';
import { ErrorBoundary } from 'shared/components/ErrorBoundary/ErrorBoundary';
import { extensibilitySchemasState } from 'state/extensibilitySchemasAtom';
import { useUrl } from 'hooks/useUrl';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';

import {
formatCurrentVersion,
Expand Down Expand Up @@ -194,8 +194,7 @@ export function BusolaExtensionDetails({ name, namespace }) {
<>
<Button
disabled={currentVersion === getLatestVersion()}
icon="forward"
iconEnd
endIcon="forward"
onClick={() => {
const newBusolaExtension = migrateToLatest(configmap);
updateBusolaExtension(newBusolaExtension, configmap);
Expand Down
2 changes: 1 addition & 1 deletion src/components/BusolaExtensions/ColumnsInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export function ColumnsInput({ value: columns, setValue: setColumns }) {

if (!columns?.length) {
return (
<MessageStrip design="Warning" hideCloseButton>
<MessageStrip design="Critical" hideCloseButton>
{t('extensibility.starter-modal.messages.no-columns')}
</MessageStrip>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Clusters/components/AddClusterDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export function AddClusterDialog() {
open={showWizard}
className="add-cluster-wizard-dialog"
headerText={t('clusters.add.title')}
onAfterClose={() => setShowWizard(false)}
onClose={() => setShowWizard(false)}
>
<ErrorBoundary>
<AddClusterDialogComponent />
Expand Down
8 changes: 3 additions & 5 deletions src/components/Clusters/components/AddClusterWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { ChooseStorage } from './ChooseStorage';
import { WizardButtons } from 'shared/components/WizardButtons/WizardButtons';
import { ClusterPreview } from './ClusterPreview';

import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './AddClusterWizard.scss';
import { isFormOpenState } from 'state/formOpenAtom';

Expand Down Expand Up @@ -171,7 +171,6 @@ export function AddClusterWizard({ kubeconfig, setKubeconfig, config }) {
className="cluster-wizard__buttons__sticky"
/>
</WizardStep>

{kubeconfig && (!hasAuth || !hasOneContext) && (
<WizardStep
titleText={t('clusters.wizard.authentication')}
Expand Down Expand Up @@ -203,7 +202,6 @@ export function AddClusterWizard({ kubeconfig, setKubeconfig, config }) {
/>
</WizardStep>
)}

<WizardStep
titleText={t('clusters.wizard.storage')}
selected={
Expand Down Expand Up @@ -233,8 +231,8 @@ export function AddClusterWizard({ kubeconfig, setKubeconfig, config }) {
<Popover
opener="storageDescriptionOpener"
open={showTitleDescription}
onAfterClose={() => setShowTitleDescription(false)}
placementType="Right"
onClose={() => setShowTitleDescription(false)}
placement="End"
>
<Text className="description">
{t('clusters.storage.info')}
Expand Down
4 changes: 2 additions & 2 deletions src/components/Clusters/components/AuthForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { ResourceForm } from 'shared/ResourceForm';
import * as Inputs from 'shared/ResourceForm/inputs';
import { getUser, getUserIndex } from '../shared';

import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import { TextArrayInput } from 'shared/ResourceForm/fields';

const OIDCform = ({ resource, setResource, ...props }) => {
Expand Down Expand Up @@ -127,7 +127,7 @@ export function AuthForm({
<div className="add-cluster__content-container">
<Title level="H5">{t('clusters.wizard.update')}</Title>
<MessageStrip
design="Warning"
design="Critical"
hideCloseButton
style={spacing.sapUiSmallMarginTopBottom}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Clusters/components/ChooseStorage.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FlexBox, RadioButton } from '@ui5/webcomponents-react';
import { useTranslation } from 'react-i18next';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './ChooseStorage.scss';

export function ChooseStorage({ storage, setStorage }) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Clusters/components/ClusterPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Button, FlexBox, RadioButton, Title } from '@ui5/webcomponents-react';
import { useTranslation } from 'react-i18next';
import './ClusterPreview.scss';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import {
findInitialValue,
findInitialValues,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MessageStrip, Select, Option, Title } from '@ui5/webcomponents-react';

import { ResourceForm } from 'shared/ResourceForm';

import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './ContextChooser.scss';

export function ContextChooser(params) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { FileInput } from 'shared/components/FileInput/FileInput';
import { Title, Button, Popover, Text } from '@ui5/webcomponents-react';
import { useTranslation } from 'react-i18next';
import { createPortal } from 'react-dom';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';

export function KubeconfigFileUpload({ onKubeconfigTextAdded }) {
const { t } = useTranslation();
Expand Down Expand Up @@ -40,8 +40,8 @@ export function KubeconfigFileUpload({ onKubeconfigTextAdded }) {
<Popover
opener="descriptionOpener"
open={showTitleDescription}
onAfterClose={() => setShowTitleDescription(false)}
placementType="Right"
onClose={() => setShowTitleDescription(false)}
placement="End"
>
<Text className="description">{t('clusters.wizard.intro')}</Text>
</Popover>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
import { KubeconfigFileUpload } from './KubeconfigFileUpload';
import jsyaml from 'js-yaml';

import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './KubeconfigUpload.scss';
import { ClusterDataForm } from 'components/Clusters/views/EditCluster/EditCluster';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Clusters/views/ClusterList.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { useFeature } from 'hooks/useFeature';
import { useNavigate } from 'react-router-dom';
import { createPortal } from 'react-dom';

import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './ClusterList.scss';
import { useSetRecoilState } from 'recoil';
import { showAddClusterWizard } from 'state/showAddClusterWizard';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { CountingCard } from 'shared/components/CountingCard/CountingCard';
import { useKymaModulesQuery } from 'components/KymaModules/KymaModulesQuery';
import { useUrl } from 'hooks/useUrl';
import { useNavigate } from 'react-router-dom';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';

const GardenerProvider = () => {
const { t } = useTranslation();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { useClustersInfo } from 'state/utils/getClustersInfo';
import { useNotification } from 'shared/contexts/NotificationContext';
import { useNavigate } from 'react-router-dom';
import { deleteCluster } from 'components/Clusters/shared';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import './ClusterOverview.scss';
import { useSetRecoilState } from 'recoil';
import { showYamlUploadDialogState } from 'state/showYamlUploadDialogAtom';
Expand Down Expand Up @@ -90,6 +90,7 @@ export function ClusterOverview() {
/>
<Title
level="H3"
size="H3"
style={{
...spacing.sapUiMediumMarginBegin,
...spacing.sapUiMediumMarginTopBottom,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';
import { useTranslation } from 'react-i18next';
import { UI5RadialChart } from 'shared/components/UI5RadialChart/UI5RadialChart';
import { Card, CardHeader, Title } from '@ui5/webcomponents-react';
Expand Down Expand Up @@ -108,6 +108,7 @@ export default function ClusterStats({ nodesData }) {
<>
<Title
level="H3"
size="H3"
style={{
...spacing.sapUiMediumMarginBegin,
...spacing.sapUiMediumMarginTopBottom,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
Card,
CardHeader,
FlexBox,
Loader,
ProgressIndicator,
} from '@ui5/webcomponents-react';
import { ClusterValidationConfigurationDialog } from './ClusterValidationConfiguration';
Expand Down Expand Up @@ -154,29 +153,25 @@ export const ClusterValidation = () => {
headerActions={
<>
<Button
icon="play"
iconEnd
endIcon="play"
onClick={scan}
disabled={!!scanProgress || !scanReady}
>
{t('cluster-validation.scan.buttons.scan')}
</Button>
<Button
icon="settings"
iconEnd
endIcon="settings"
onClick={configure}
disabled={!!scanProgress || !scanReady}
>
{t('cluster-validation.scan.buttons.configure')}
</Button>
<Button icon="reset" iconEnd onClick={clear} disabled={!scanProgress}>
<Button endIcon="reset" onClick={clear} disabled={!scanProgress}>
{t('cluster-validation.scan.buttons.clear')}
</Button>
</>
}
>
{!scanReady && <Loader type="Indeterminate" />}

<Section titleText={t('cluster-validation.scan.scope')}>
<FlexBox className="bsl-has-padding-small">
<InfoTile
Expand All @@ -193,7 +188,6 @@ export const ClusterValidation = () => {
/>
</FlexBox>
</Section>

{scanProgress && (
<Section
titleText={t('cluster-validation.scan.progress')}
Expand All @@ -213,20 +207,18 @@ export const ClusterValidation = () => {
}
valueState={
scanProgress && scanProgress.total === scanProgress.scanned
? 'Success'
? 'Positive'
: 'None'
}
style={{ width: '96%', padding: '5px 2%' }}
/>
</Section>
)}

{scanResult && (
<Section titleText={t('cluster-validation.scan.result')}>
<ScanResultTree scanResult={scanResult} />
</Section>
)}

{createPortal(
<ClusterValidationConfigurationDialog
show={isConfigurationOpen}
Expand Down Expand Up @@ -275,7 +267,7 @@ const Section = ({
<CardHeader
titleText={titleText}
subtitleText={subtitleText}
status={status}
additionalText={status}
/>
) : (
header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export function ClusterValidationConfigurationDialog({

return (
<Dialog
onAfterClose={onCancel}
onClose={onCancel}
open={show}
headerText={t('cluster-validation.scan.common.headers.configuration')}
footer={
Expand Down
2 changes: 1 addition & 1 deletion src/components/Clusters/views/ClusterStorageType.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useState } from 'react';
import { HintButton } from 'shared/components/DescriptionHint/DescriptionHint';
import { useTranslation } from 'react-i18next';
import { spacing } from '@ui5/webcomponents-react-base';
import { spacing } from 'shared/helpers/spacing';

export function ClusterStorageType({ clusterConfig }) {
const { t } = useTranslation();
Expand Down
Loading
Loading