Skip to content

Commit 91258b9

Browse files
committed
fix: optionals
1 parent e3d4522 commit 91258b9

File tree

3 files changed

+19
-13
lines changed

3 files changed

+19
-13
lines changed

cypress/e2e/builder/main.cy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { BUILDER_VIEW_CY, buildDataCy } from '../../../src/config/selectors';
55
describe('Builder View', () => {
66
beforeEach(() => {
77
cy.setUpApi(
8-
{},
8+
{ appActions: [] },
99
{
1010
context: Context.Builder,
1111
permission: PermissionLevel.Admin,

src/modules/analytics/FrequentWords.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { useMemo, useState } from 'react';
1+
import { useMemo, useState } from 'react';
22
import { useTranslation } from 'react-i18next';
33

44
import {
55
Button,
66
Chip,
7-
Grid,
7+
Grid2,
88
Stack,
99
TextField,
1010
Typography,
@@ -126,8 +126,11 @@ const FrequentWords = ({
126126
))}
127127
</Stack>
128128
</Stack>
129-
<Grid container sx={{ height: '500px' }}>
130-
<Grid item xs={12} md={6} sx={{ height: '100%', overflowY: 'auto' }}>
129+
<Grid2 container sx={{ height: '500px' }}>
130+
<Grid2
131+
size={{ xs: 12, md: 6 }}
132+
sx={{ height: '100%', overflowY: 'auto' }}
133+
>
131134
<Stack spacing={2} p={1}>
132135
{commentsMatchSelectedWords.map((ele) => (
133136
<TextWithHighlightedKeywords
@@ -144,16 +147,19 @@ const FrequentWords = ({
144147
<Typography mt={2}>{t('NO_RESULTS_MATCH_WORDS')}</Typography>
145148
)}
146149
</Stack>
147-
</Grid>
150+
</Grid2>
148151
{chatMemberID && (
149-
<Grid item xs={12} md={6} sx={{ height: '100%', overflow: 'hidden' }}>
152+
<Grid2
153+
size={{ xs: 12, md: 6 }}
154+
sx={{ height: '100%', overflow: 'hidden' }}
155+
>
150156
<PlayerView
151157
id={chatMemberID}
152158
threadSx={{ overflow: 'auto', height: '100%' }}
153159
/>
154-
</Grid>
160+
</Grid2>
155161
)}
156-
</Grid>
162+
</Grid2>
157163
</Stack>
158164
);
159165
};

src/modules/settings/ChatbotSettings.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,12 @@ const ChatbotSettings = (): JSX.Element => {
6868
name: SettingsKeys.ChatbotPrompt,
6969
});
7070
const chatbotPrompt = chatbotPromptSettings?.[0];
71-
const initialPrompt = chatbotPrompt?.data?.initialPrompt || [];
71+
const initialPrompt = chatbotPrompt?.data?.initialPrompt ?? [];
7272
const stringifiedJsonPrompt = JSON.stringify(initialPrompt, null, 2);
73-
const chatbotCue = chatbotPrompt?.data?.chatbotCue || '';
74-
const chatbotName = chatbotPrompt?.data?.chatbotName || DEFAULT_BOT_USERNAME;
73+
const chatbotCue = chatbotPrompt?.data?.chatbotCue ?? '';
74+
const chatbotName = chatbotPrompt?.data?.chatbotName ?? DEFAULT_BOT_USERNAME;
7575
const chatbotVersion =
76-
chatbotPrompt?.data?.gptVersion || GPTVersion.GPT_3_5_TURBO;
76+
chatbotPrompt?.data?.gptVersion ?? GPTVersion.GPT_3_5_TURBO;
7777

7878
const [newChatbotPrompt, setNewChatbotPrompt] = useState(
7979
stringifiedJsonPrompt,

0 commit comments

Comments
 (0)