Skip to content

Commit 266e6a5

Browse files
committed
#RI-5739 - change behaviour to unblock chatbot input
#RI-5738 - fix action on login screen in chatbots
1 parent 41ca2e3 commit 266e6a5

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/assistance-chat/AssistanceChat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ const AssistanceChat = () => {
201201
onAgreementsDisplayed={handleAgreementsDisplay}
202202
agreements={!agreements ? ASSISTANCE_CHAT_AGREEMENTS : undefined}
203203
placeholder="Ask me about Redis"
204-
isDisabled={!!inProgressMessage}
204+
isDisabled={inProgressMessage?.content === ''}
205205
onSubmit={handleSubmit}
206206
/>
207207
</div>

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/expert-chat/ExpertChat.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ const ExpertChat = () => {
226226
<ChatForm
227227
onAgreementsDisplayed={handleAgreementsDisplay}
228228
agreements={!isAgreementsAccepted ? EXPERT_CHAT_AGREEMENTS : undefined}
229-
isDisabled={!instanceId || !!inProgressMessage}
229+
isDisabled={!instanceId || inProgressMessage?.content === ''}
230230
validation={getValidationMessage()}
231231
placeholder="Ask me to query your data (e.g. How many road bikes?)"
232232
onSubmit={handleSubmit}

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/welcome-ai-assistant/WelcomeAiAssistant.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { cleanup, fireEvent, mockedStore, render, screen, act } from 'uiSrc/util
55
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
66
import { setSSOFlow } from 'uiSrc/slices/instances/cloud'
77
import { OAuthSocialAction, OAuthSocialSource } from 'uiSrc/slices/interfaces'
8-
import { signIn } from 'uiSrc/slices/oauth/cloud'
8+
import { setOAuthCloudSource, signIn } from 'uiSrc/slices/oauth/cloud'
99
import WelcomeAiAssistant from './WelcomeAiAssistant'
1010

1111
jest.mock('uiSrc/telemetry', () => ({
@@ -49,7 +49,7 @@ describe('WelcomeAiAssistant', () => {
4949
fireEvent.click(screen.getByTestId('google-oauth'))
5050
})
5151

52-
expect(store.getActions()).toEqual([signIn(), setSSOFlow(OAuthSocialAction.SignIn)])
52+
expect(store.getActions()).toEqual([signIn(), setOAuthCloudSource(OAuthSocialSource.AiChat)])
5353

5454
expect(sendEventTelemetry).toBeCalledWith({
5555
event: TelemetryEvent.CLOUD_SIGN_IN_SOCIAL_ACCOUNT_SELECTED,

redisinsight/ui/src/components/side-panels/panels/ai-assistant/components/welcome-ai-assistant/WelcomeAiAssistant.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { OAuthAgreement, OAuthSocialButtons } from 'uiSrc/components/oauth/share
66
import { OAuthSocialAction, OAuthSocialSource } from 'uiSrc/slices/interfaces'
77
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
88
import { setSSOFlow } from 'uiSrc/slices/instances/cloud'
9-
import { setSocialDialogState } from 'uiSrc/slices/oauth/cloud'
9+
import { setOAuthCloudSource } from 'uiSrc/slices/oauth/cloud'
1010
import styles from './styles.module.scss'
1111

1212
const WelcomeAiAssistant = () => {
1313
const dispatch = useDispatch()
1414

1515
const handleSsoClick = (accountOption: string) => {
1616
dispatch(setSSOFlow(OAuthSocialAction.SignIn))
17-
dispatch(setSocialDialogState(OAuthSocialSource.AiChat))
17+
dispatch(setOAuthCloudSource(OAuthSocialSource.AiChat))
1818

1919
sendEventTelemetry({
2020
event: TelemetryEvent.CLOUD_SIGN_IN_SOCIAL_ACCOUNT_SELECTED,

0 commit comments

Comments
 (0)