Skip to content

Commit 7c9fb3d

Browse files
committed
fix: ui5 errors after merge
1 parent 7fe7b16 commit 7c9fb3d

File tree

7 files changed

+28
-44
lines changed

7 files changed

+28
-44
lines changed

src/components/App/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ export default function App() {
8181
useGetKymaResources();
8282

8383
const showCompanion = useRecoilValue(showKymaCompanionState);
84+
8485
if (isLoading) {
8586
return <Spinner />;
8687
}

src/components/KymaCompanion/components/Chat/Chat.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { useTranslation } from 'react-i18next';
44
import React, { useEffect, useRef, useState } from 'react';
55
import { useRecoilValue } from 'recoil';
66
import { FlexBox, Icon, Input } from '@ui5/webcomponents-react';
7-
import { spacing } from '@ui5/webcomponents-react-base';
87
import { initialPromptState } from 'components/KymaCompanion/state/initalPromptAtom';
98
import Message from './messages/Message';
109
import Bubbles from './messages/Bubbles';
@@ -113,11 +112,7 @@ export default function Chat() {
113112
justifyContent="SpaceBetween"
114113
className="chat-container"
115114
>
116-
<div
117-
className="chat-list"
118-
style={spacing.sapUiTinyMargin}
119-
ref={containerRef}
120-
>
115+
<div className="chat-list sap-margin-tiny" ref={containerRef}>
121116
{chatHistory.map((message, index) => {
122117
return message.author === 'ai' ? (
123118
<React.Fragment key={index}>
@@ -149,7 +144,7 @@ export default function Chat() {
149144
/>
150145
)}
151146
</div>
152-
<div style={spacing.sapUiTinyMarginBeginEnd}>
147+
<div className="sap-margin-x-tiny">
153148
<Input
154149
className="full-width"
155150
disabled={chatHistory[chatHistory.length - 1]?.isLoading}

src/components/KymaCompanion/components/Chat/messages/CodePanel.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,11 @@ export default function CodePanel({ text }: CodePanelProps): JSX.Element {
1111
//const { language, code } = formatCodeSegment(text);
1212
return !language ? (
1313
<div className="code-response">
14-
<Text className="text" renderWhitespace>
15-
{code}
16-
</Text>
14+
<Text className="text">{code}</Text>
1715
</div>
1816
) : (
1917
<Panel headerText={language} className="code-panel" fixed>
20-
<Text className="text" renderWhitespace>
21-
{code}
22-
</Text>
18+
<Text className="text">{code}</Text>
2319
</Panel>
2420
);
2521
}

src/components/KymaCompanion/components/Chat/messages/ErrorMessage.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Button, IllustratedMessage } from '@ui5/webcomponents-react';
22
import { useTranslation } from 'react-i18next';
3-
import { spacing } from '@ui5/webcomponents-react-base';
43

54
interface ErrorMessageProps {
65
errorOnInitialMessage: boolean;
@@ -19,7 +18,7 @@ export default function ErrorMessage({
1918
key="error-message"
2019
titleText={t('kyma-companion.error.title')}
2120
subtitleText={t('kyma-companion.error.subtitle')}
22-
style={{ ...spacing.sapUiSmallMarginTop, padding: 0 }}
21+
className="sap-margin-top-small no-padding"
2322
>
2423
{errorOnInitialMessage && (
2524
<Button onClick={resendInitialPrompt}>

src/components/KymaCompanion/components/Chat/messages/Message.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ export default function Message({
3333
<Text className="text">{chunk?.result}</Text>
3434
<div className="loading-status">
3535
{index !== messageChunks.length - 1 ? (
36-
<ObjectStatus state="Success" showDefaultIcon />
36+
<ObjectStatus state="Positive" showDefaultIcon />
3737
) : (
38-
<BusyIndicator active size="Small" delay={0} />
38+
<BusyIndicator active size="S" delay={0} />
3939
)}
4040
</div>
4141
</FlexBox>
4242
))
4343
) : (
44-
<BusyIndicator active size="Medium" delay={0} />
44+
<BusyIndicator active size="M" delay={0} />
4545
)}
4646
</div>
4747
);
@@ -53,16 +53,16 @@ export default function Message({
5353
return (
5454
<div className={'message ' + className}>
5555
{segmentedText && (
56-
<Text className="text" renderWhitespace hyphenated>
56+
<Text className="text">
5757
{segmentedText.map((segment, index) =>
5858
segment.type === 'bold' ? (
59-
<Text key={index} className="text bold" renderWhitespace>
59+
<Text key={index} className="text bold">
6060
{segment.content}
6161
</Text>
6262
) : segment.type === 'code' ? (
6363
<CodePanel key={index} text={segment.content} />
6464
) : segment.type === 'highlighted' ? (
65-
<Text key={index} className="text highlighted" renderWhitespace>
65+
<Text key={index} className="text highlighted">
6666
{segment.content}
6767
</Text>
6868
) : segment.type === 'link' ? (

src/components/KymaCompanion/components/CompanionOpener.tsx

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22
/* eslint-disable @typescript-eslint/no-unused-vars */
33
import {
44
Button,
5-
CustomListItem,
5+
ListItemCustom,
66
FlexBox,
77
Icon,
88
Input,
99
List,
10-
Loader,
1110
Popover,
1211
Text,
1312
Title,
13+
BusyIndicator,
1414
} from '@ui5/webcomponents-react';
15-
import { spacing } from '@ui5/webcomponents-react-base';
1615
import { useTranslation } from 'react-i18next';
1716
import { useState } from 'react';
1817
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
@@ -100,10 +99,10 @@ export default function CompanionOpener({
10099
<Popover
101100
className="suggestions-popover"
102101
open={popoverOpen}
103-
onAfterClose={() => setPopoverOpen(false)}
102+
onClose={() => setPopoverOpen(false)}
104103
opener="openPopoverBtn"
105-
placementType="Bottom"
106-
horizontalAlign="Right"
104+
horizontalAlign="End"
105+
placement="Bottom"
107106
>
108107
<Input
109108
icon={<Icon name="paper-plane" onClick={onSubmitInput} />}
@@ -113,42 +112,38 @@ export default function CompanionOpener({
113112
placeholder={t('kyma-companion.opener.input-placeholder')}
114113
className="popover-input"
115114
/>
116-
<Title level="H5" style={spacing.sapUiTinyMargin}>
115+
<Title level="H5" className="sap-margin-tiny">
117116
{t('kyma-companion.opener.suggestions')}
118117
</Title>
119118
{errorOccured || (!isLoading && suggestions.length === 0) ? (
120119
<FlexBox
121120
alignItems="Center"
122121
direction="Column"
123-
style={{ gap: '8px', ...spacing.sapUiTinyMarginBottom }}
122+
className="sap-margin-bottom-tiny"
123+
style={{ gap: '8px' }}
124124
>
125-
<Text style={spacing.sapUiTinyMargin}>
125+
<Text className="sap-margin-tiny">
126126
{t('kyma-companion.opener.error-message')}
127127
</Text>
128128
<Button onClick={fetchSuggestions}>
129129
{t('common.buttons.retry')}
130130
</Button>
131131
</FlexBox>
132132
) : isLoading ? (
133-
<div
134-
style={{
135-
...spacing.sapUiTinyMargin,
136-
...spacing.sapUiSmallMarginTop,
137-
}}
138-
>
139-
<Loader progress="60%" />
133+
<div className="sap-margin-tiny sap-margin-top-small">
134+
<BusyIndicator active delay={1000} size="M" />
140135
</div>
141136
) : (
142-
<List style={spacing.sapUiTinyMarginTop}>
137+
<List className="sap-margin-top-tiny">
143138
{suggestions.map((suggestion, index) => (
144-
<CustomListItem
139+
<ListItemCustom
145140
key={index}
146141
onClick={() => sendInitialPrompt(suggestion)}
147142
className="custom-list-item"
148143
>
149144
<Text className="text">{suggestion}</Text>
150145
<Icon name="navigation-right-arrow" />
151-
</CustomListItem>
146+
</ListItemCustom>
152147
))}
153148
</List>
154149
)}

src/components/KymaCompanion/components/KymaCompanion.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
Toolbar,
99
ToolbarSpacer,
1010
} from '@ui5/webcomponents-react';
11-
import { spacing } from '@ui5/webcomponents-react-base';
1211
import { useRecoilState } from 'recoil';
1312
import {
1413
ShowKymaCompanion,
@@ -24,11 +23,11 @@ export default function KymaCompanion() {
2423
);
2524

2625
return (
27-
<div id="companion_wrapper" style={spacing.sapUiTinyMargin}>
26+
<div id="companion_wrapper" className="sap-margin-tiny">
2827
<Card
2928
className="kyma-companion"
3029
header={
31-
<Toolbar toolbarStyle="Clear" className="kyma-companion__header">
30+
<Toolbar design="Transparent" className="kyma-companion__header">
3231
<Title level="H4" className="title">
3332
{t('kyma-companion.name')}
3433
</Title>
@@ -60,7 +59,6 @@ export default function KymaCompanion() {
6059
}
6160
>
6261
<TabContainer
63-
fixed
6462
contentBackgroundDesign="Transparent"
6563
className={`tab-container`}
6664
>

0 commit comments

Comments
 (0)