Skip to content

Commit 8c53dfd

Browse files
committed
Merge branch 'feature/RI-5402-ai-assistant' into be/feature/RI-5724-enhanse-sm-session
2 parents 1a974c7 + b641c1e commit 8c53dfd

File tree

26 files changed

+191
-133
lines changed

26 files changed

+191
-133
lines changed

.circleci/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,6 +1020,13 @@ jobs:
10201020
-r $DOCKER_REPO \
10211021
-v $appVersion
10221022
1023+
docker login -u $DOCKER_V1_USER -p $DOCKER_V1_PASS
1024+
1025+
./.circleci/build/release-docker.sh \
1026+
-d redisinsight \
1027+
-r $DOCKER_V1_REPO \
1028+
-v $appVersion
1029+
10231030
publish-prod-aws:
10241031
executor: linux-executor
10251032
steps:

redisinsight/ui/src/components/oauth/oauth-jobs/OAuthJobs.spec.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { RootState } from 'uiSrc/slices/store'
1010
import { loadInstances } from 'uiSrc/slices/instances/instances'
1111
import { INFINITE_MESSAGES, InfiniteMessagesIds } from 'uiSrc/components/notifications/components'
1212
import { CustomErrorCodes } from 'uiSrc/constants'
13+
import { setSSOFlow } from 'uiSrc/slices/instances/cloud'
1314
import OAuthJobs from './OAuthJobs'
1415

1516
jest.mock('react-redux', () => ({
@@ -130,6 +131,7 @@ describe('OAuthJobs', () => {
130131

131132
const expectedActions = [
132133
addErrorNotification({ response: { data: error } } as AxiosError),
134+
setSSOFlow(),
133135
removeInfiniteNotification(InfiniteMessagesIds.oAuthProgress),
134136
]
135137
expect(clearStoreActions(store.getActions())).toEqual(
@@ -160,6 +162,7 @@ describe('OAuthJobs', () => {
160162

161163
const expectedActions = [
162164
addInfiniteNotification(INFINITE_MESSAGES.DATABASE_EXISTS()),
165+
setSSOFlow(),
163166
removeInfiniteNotification(InfiniteMessagesIds.oAuthProgress),
164167
]
165168
expect(clearStoreActions(store.getActions())).toEqual(
@@ -190,6 +193,7 @@ describe('OAuthJobs', () => {
190193

191194
const expectedActions = [
192195
addInfiniteNotification(INFINITE_MESSAGES.DATABASE_EXISTS()),
196+
setSSOFlow(),
193197
removeInfiniteNotification(InfiniteMessagesIds.oAuthProgress),
194198
]
195199
expect(clearStoreActions(store.getActions())).toEqual(

redisinsight/ui/src/components/oauth/oauth-jobs/OAuthJobs.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { INFINITE_MESSAGES, InfiniteMessagesIds } from 'uiSrc/components/notific
1313
import { TelemetryEvent, sendEventTelemetry } from 'uiSrc/telemetry'
1414
import { BrowserStorageItem, CustomErrorCodes } from 'uiSrc/constants'
1515
import { localStorageService } from 'uiSrc/services'
16+
import { setSSOFlow } from 'uiSrc/slices/instances/cloud'
1617

1718
const OAuthJobs = () => {
1819
const {
@@ -70,6 +71,7 @@ const OAuthJobs = () => {
7071
break
7172
}
7273

74+
dispatch(setSSOFlow())
7375
dispatch(removeInfiniteNotification(InfiniteMessagesIds.oAuthProgress))
7476
break
7577

@@ -110,13 +112,15 @@ const OAuthJobs = () => {
110112
sendEventTelemetry({
111113
event: TelemetryEvent.CLOUD_IMPORT_EXISTING_DATABASE_FORM_CLOSED,
112114
})
115+
dispatch(setSSOFlow())
113116
dispatch(removeInfiniteNotification(InfiniteMessagesIds.databaseExists))
114117
}
115118

116119
const closeCreateFreeDatabase = () => {
117120
sendEventTelemetry({
118121
event: TelemetryEvent.CLOUD_CREATE_DATABASE_IN_SUBSCRIPTION_FORM_CLOSED,
119122
})
123+
dispatch(setSSOFlow())
120124
dispatch(removeInfiniteNotification(InfiniteMessagesIds.subscriptionExists))
121125
}
122126

redisinsight/ui/src/components/oauth/oauth-sso-dialog/styles.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.modal {
2-
background: var(--euiColorLightestShade) !important;
2+
background: var(--euiColorEmptyShade) !important;
33
min-width: 420px !important;
44
min-height: auto !important;
55
padding: 0;

redisinsight/ui/src/components/oauth/oauth-sso-handler-dialog/OAuthSsoHandlerDialog.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ const OAuthSsoHandlerDialog = ({ children }: Props) => {
4646
}
4747
e?.preventDefault()
4848

49-
dispatch(setSSOFlow(action))
50-
5149
if (action === OAuthSocialAction.Import && data) {
5250
// if user logged in - do not show dialog, just redirect to subscriptions page
5351
dispatch(fetchSubscriptionsRedisCloud(null, true, () => {
@@ -69,6 +67,7 @@ const OAuthSsoHandlerDialog = ({ children }: Props) => {
6967
})
7068
}
7169

70+
dispatch(setSSOFlow(action))
7271
dispatch(setSocialDialogState(source))
7372
}
7473

redisinsight/ui/src/components/oauth/oauth-sso/oauth-create-db/OAuthCreateDb.spec.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ describe('OAuthCreateDb', () => {
107107

108108
const expectedActions = [
109109
setSSOFlow(OAuthSocialAction.Create),
110-
setSocialDialogState(null),
111-
setJob({ id: '', name: CloudJobName.CreateFreeSubscriptionAndDatabase, status: '' }),
112110
showOAuthProgress(true),
113111
addInfiniteNotification(INFINITE_MESSAGES.PENDING_CREATE_DB(CloudJobStep.Credentials)),
114112
addFreeDb()
@@ -128,8 +126,6 @@ describe('OAuthCreateDb', () => {
128126

129127
const expectedActions = [
130128
setSSOFlow(OAuthSocialAction.Create),
131-
setSocialDialogState(null),
132-
setJob({ id: '', name: CloudJobName.CreateFreeSubscriptionAndDatabase, status: '' }),
133129
showOAuthProgress(true),
134130
addInfiniteNotification(INFINITE_MESSAGES.PENDING_CREATE_DB(CloudJobStep.Credentials)),
135131
getPlans()

redisinsight/ui/src/components/oauth/oauth-sso/oauth-create-db/OAuthCreateDb.tsx

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@ import {
55
createFreeDbJob,
66
fetchPlans,
77
oauthCloudUserSelector,
8-
setJob,
9-
setSocialDialogState,
108
showOAuthProgress
119
} from 'uiSrc/slices/oauth/cloud'
1210

1311
import { OAuthSocialAction, OAuthSocialSource } from 'uiSrc/slices/interfaces'
14-
import { BrowserStorageItem, FeatureFlags } from 'uiSrc/constants'
12+
import { FeatureFlags } from 'uiSrc/constants'
1513
import { appFeatureFlagsFeaturesSelector } from 'uiSrc/slices/app/features'
1614
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
1715
import { CloudJobName, CloudJobStep } from 'uiSrc/electron/constants'
1816
import { addInfiniteNotification, removeInfiniteNotification } from 'uiSrc/slices/app/notifications'
1917
import { INFINITE_MESSAGES, InfiniteMessagesIds } from 'uiSrc/components/notifications/components'
2018
import { setIsRecommendedSettingsSSO, setSSOFlow } from 'uiSrc/slices/instances/cloud'
21-
import { localStorageService } from 'uiSrc/services'
2219
import { Nullable } from 'uiSrc/utils'
2320
import { OAuthAdvantages, OAuthAgreement, OAuthRecommendedSettings, OAuthSocialButtons } from '../../shared'
2421
import styles from './styles.module.scss'
@@ -61,9 +58,6 @@ const OAuthCreateDb = (props: Props) => {
6158

6259
const handleClickCreate = () => {
6360
dispatch(setSSOFlow(OAuthSocialAction.Create))
64-
dispatch(setSocialDialogState(null))
65-
dispatch(setJob({ id: '', name: CloudJobName.CreateFreeSubscriptionAndDatabase, status: '' }))
66-
localStorageService.remove(BrowserStorageItem.OAuthJobId)
6761
dispatch(showOAuthProgress(true))
6862
dispatch(addInfiniteNotification(INFINITE_MESSAGES.PENDING_CREATE_DB(CloudJobStep.Credentials)))
6963

@@ -73,9 +67,6 @@ const OAuthCreateDb = (props: Props) => {
7367
resources: {
7468
isRecommendedSettings: isRecommended
7569
},
76-
onSuccessAction: () => {
77-
dispatch(addInfiniteNotification(INFINITE_MESSAGES.PENDING_CREATE_DB(CloudJobStep.Credentials)))
78-
},
7970
onFailAction: () => {
8071
dispatch(removeInfiniteNotification(InfiniteMessagesIds.oAuthProgress))
8172
dispatch(setSSOFlow(undefined))

redisinsight/ui/src/components/oauth/shared/oauth-advantages/styles.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
}
1717

1818
.logo {
19-
height: 40px;
20-
width: 40px;
19+
height: auto;
20+
width: 120px;
2121
margin-bottom: 12px;
2222
}
2323

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}

0 commit comments

Comments
 (0)