|
1 | 1 | import React, { useCallback, useEffect, useState } from 'react'
|
2 | 2 | import cx from 'classnames'
|
3 |
| -import { EuiButton, EuiIcon, EuiLink, EuiText, EuiTextColor, EuiTitle, } from '@elastic/eui' |
| 3 | +import { EuiButton, EuiIcon, EuiLink, EuiText, EuiTextColor, EuiTitle } from '@elastic/eui' |
4 | 4 | import { useSelector } from 'react-redux'
|
5 | 5 |
|
6 | 6 | import MobileIcon from 'uiSrc/assets/img/icons/mobile_module_not_loaded.svg?react'
|
7 | 7 | import DesktopIcon from 'uiSrc/assets/img/icons/module_not_loaded.svg?react'
|
8 | 8 | import TelescopeImg from 'uiSrc/assets/img/telescope-dark.svg?react'
|
9 | 9 | import CheerIcon from 'uiSrc/assets/img/icons/cheer.svg?react'
|
10 |
| -import { MODULE_NOT_LOADED_CONTENT as CONTENT, MODULE_TEXT_VIEW } from 'uiSrc/constants' |
| 10 | +import { FeatureFlags, MODULE_NOT_LOADED_CONTENT as CONTENT, MODULE_TEXT_VIEW } from 'uiSrc/constants' |
11 | 11 | import { OAuthSocialAction, OAuthSocialSource, RedisDefaultModules } from 'uiSrc/slices/interfaces'
|
12 |
| -import { OAuthConnectFreeDb, OAuthSsoHandlerDialog } from 'uiSrc/components' |
| 12 | +import { FeatureFlagComponent, OAuthConnectFreeDb, OAuthSsoHandlerDialog } from 'uiSrc/components' |
13 | 13 | import { freeInstancesSelector } from 'uiSrc/slices/instances/instances'
|
14 | 14 | import { getUtmExternalLink } from 'uiSrc/utils/links'
|
15 | 15 |
|
@@ -133,47 +133,49 @@ const ModuleNotLoaded = ({ moduleName, id, type = 'workbench', onClose }: IProps
|
133 | 133 | />
|
134 | 134 | )}
|
135 | 135 | {!freeDbWithModule && (
|
136 |
| - <> |
137 |
| - <EuiLink |
138 |
| - className={cx(styles.text, styles.link)} |
139 |
| - external={false} |
140 |
| - target="_blank" |
141 |
| - href={getUtmExternalLink(CONTENT[moduleName]?.link, { campaign: utmCampaign })} |
142 |
| - data-testid="learn-more-link" |
143 |
| - > |
144 |
| - Learn More |
145 |
| - </EuiLink> |
146 |
| - <OAuthSsoHandlerDialog> |
147 |
| - {(ssoCloudHandlerClick) => ( |
148 |
| - <EuiLink |
149 |
| - className={styles.link} |
150 |
| - external={false} |
151 |
| - target="_blank" |
152 |
| - href={getUtmExternalLink(EXTERNAL_LINKS.tryFree, { campaign: utmCampaign })} |
153 |
| - onClick={(e) => { |
154 |
| - ssoCloudHandlerClick( |
155 |
| - e, |
156 |
| - { |
157 |
| - source: type === 'browser' ? OAuthSocialSource.BrowserSearch : OAuthSocialSource[module], |
158 |
| - action: OAuthSocialAction.Create |
159 |
| - } |
160 |
| - ) |
161 |
| - onFreeDatabaseClick() |
162 |
| - }} |
163 |
| - data-testid="get-started-link" |
164 |
| - > |
165 |
| - <EuiButton |
166 |
| - fill |
167 |
| - size="s" |
168 |
| - color="secondary" |
169 |
| - className={styles.btnLink} |
| 136 | + <FeatureFlagComponent name={FeatureFlags.envDependent}> |
| 137 | + <> |
| 138 | + <EuiLink |
| 139 | + className={cx(styles.text, styles.link)} |
| 140 | + external={false} |
| 141 | + target="_blank" |
| 142 | + href={getUtmExternalLink(CONTENT[moduleName]?.link, { campaign: utmCampaign })} |
| 143 | + data-testid="learn-more-link" |
| 144 | + > |
| 145 | + Learn More |
| 146 | + </EuiLink> |
| 147 | + <OAuthSsoHandlerDialog> |
| 148 | + {(ssoCloudHandlerClick) => ( |
| 149 | + <EuiLink |
| 150 | + className={styles.link} |
| 151 | + external={false} |
| 152 | + target="_blank" |
| 153 | + href={getUtmExternalLink(EXTERNAL_LINKS.tryFree, { campaign: utmCampaign })} |
| 154 | + onClick={(e) => { |
| 155 | + ssoCloudHandlerClick( |
| 156 | + e, |
| 157 | + { |
| 158 | + source: type === 'browser' ? OAuthSocialSource.BrowserSearch : OAuthSocialSource[module], |
| 159 | + action: OAuthSocialAction.Create |
| 160 | + } |
| 161 | + ) |
| 162 | + onFreeDatabaseClick() |
| 163 | + }} |
| 164 | + data-testid="get-started-link" |
170 | 165 | >
|
171 |
| - Get Started For Free |
172 |
| - </EuiButton> |
173 |
| - </EuiLink> |
174 |
| - )} |
175 |
| - </OAuthSsoHandlerDialog> |
176 |
| - </> |
| 166 | + <EuiButton |
| 167 | + fill |
| 168 | + size="s" |
| 169 | + color="secondary" |
| 170 | + className={styles.btnLink} |
| 171 | + > |
| 172 | + Get Started For Free |
| 173 | + </EuiButton> |
| 174 | + </EuiLink> |
| 175 | + )} |
| 176 | + </OAuthSsoHandlerDialog> |
| 177 | + </> |
| 178 | + </FeatureFlagComponent> |
177 | 179 | )}
|
178 | 180 | </div>
|
179 | 181 | </div>
|
|
0 commit comments