Skip to content

Commit 4781480

Browse files
committed
#RI-4939 - [Regression][FE] CREATE_FREE_CLOUD_DATABASE_CLICKED event is sent when SSO feature available
1 parent 0bd19dc commit 4781480

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import { appFeatureFlagsFeaturesSelector } from 'uiSrc/slices/app/features'
88
import { setSignInDialogState } from 'uiSrc/slices/oauth/cloud'
99

1010
export interface Props {
11-
children: (ssoCloudHandlerClick: (e: React.MouseEvent, source: OAuthSocialSource) => void) => React.ReactElement
11+
children: (
12+
ssoCloudHandlerClick: (e: React.MouseEvent, source: OAuthSocialSource) => void,
13+
isSSOEnabled: boolean,
14+
) => React.ReactElement
1215
}
1316

1417
const OAuthSsoHandlerDialog = ({ children }: Props) => {
@@ -32,7 +35,7 @@ const OAuthSsoHandlerDialog = ({ children }: Props) => {
3235
})
3336
}
3437

35-
return children?.(ssoCloudHandlerClick)
38+
return children?.(ssoCloudHandlerClick, !!feature?.flag)
3639
}
3740

3841
export default OAuthSsoHandlerDialog

redisinsight/ui/src/pages/home/components/HomeHeader/HomeHeader.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ const HomeHeader = ({ onAddInstance, direction }: Props) => {
185185
const linkStyles = stylesCss ? stylesCss[theme] : {}
186186
const promoLink = (
187187
<OAuthSsoHandlerDialog>
188-
{(ssoCloudHandlerClick) => (
188+
{(ssoCloudHandlerClick, isSSOEnabled) => (
189189
<PromoLink
190190
title={title}
191191
description={description}
@@ -199,7 +199,10 @@ const HomeHeader = ({ onAddInstance, direction }: Props) => {
199199
: undefined
200200
}}
201201
onClick={(e) => {
202-
handleCreateDatabaseClick(HELP_LINKS.cloud.event, { source: 'My Redis databases' })
202+
!isSSOEnabled && handleCreateDatabaseClick(
203+
HELP_LINKS.cloud.event,
204+
{ source: HELP_LINKS.cloud.sources.databaseList },
205+
)
203206
ssoCloudHandlerClick(e, OAuthSocialSource.ListOfDatabases)
204207
}}
205208
/>

0 commit comments

Comments
 (0)