Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion redisinsight/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"date-fns": "^2.29.3",
"detect-port": "^1.5.1",
"dotenv": "^16.0.0",
"express": "^4.17.1",
"express": "^4.19.2",
"fs-extra": "^10.0.0",
"ioredis": "^5.2.2",
"is-glob": "^4.0.1",
Expand Down
44 changes: 43 additions & 1 deletion redisinsight/api/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2741,6 +2741,11 @@ cookie@0.5.0:
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==

cookie@0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==

cookie@~0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432"
Expand Down Expand Up @@ -3630,7 +3635,7 @@ expect@^26.6.2:
jest-message-util "^26.6.2"
jest-regex-util "^26.0.0"

express@4.18.2, express@^4.17.1:
express@4.18.2:
version "4.18.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==
Expand Down Expand Up @@ -3667,6 +3672,43 @@ express@4.18.2, express@^4.17.1:
utils-merge "1.0.1"
vary "~1.1.2"

express@^4.19.2:
version "4.19.2"
resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465"
integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==
dependencies:
accepts "~1.3.8"
array-flatten "1.1.1"
body-parser "1.20.2"
content-disposition "0.5.4"
content-type "~1.0.4"
cookie "0.6.0"
cookie-signature "1.0.6"
debug "2.6.9"
depd "2.0.0"
encodeurl "~1.0.2"
escape-html "~1.0.3"
etag "~1.8.1"
finalhandler "1.2.0"
fresh "0.5.2"
http-errors "2.0.0"
merge-descriptors "1.0.1"
methods "~1.1.2"
on-finished "2.4.1"
parseurl "~1.3.3"
path-to-regexp "0.1.7"
proxy-addr "~2.0.7"
qs "6.11.0"
range-parser "~1.2.1"
safe-buffer "5.2.1"
send "0.18.0"
serve-static "1.15.0"
setprototypeof "1.2.0"
statuses "2.0.1"
type-is "~1.6.18"
utils-merge "1.0.1"
vary "~1.1.2"

extend-shallow@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { recommendationsSelector, resetRecommendationsHighlighting } from 'uiSrc
import { InsightsPanelTabs } from 'uiSrc/slices/interfaces/insights'
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
import { Pages } from 'uiSrc/constants'
import { removeFeatureFromHighlighting } from 'uiSrc/slices/app/features'
import InsightsTrigger from './InsightsTrigger'

let store: typeof mockedStore
Expand Down Expand Up @@ -50,7 +49,7 @@ describe('InsightsTrigger', () => {

fireEvent.click(screen.getByTestId('insights-trigger'))

expect(store.getActions()).toEqual([toggleInsightsPanel(), removeFeatureFromHighlighting('insights')])
expect(store.getActions()).toEqual([toggleInsightsPanel()])
})

it('should call proper actions after click on the button when there are any recommendations', () => {
Expand All @@ -65,7 +64,6 @@ describe('InsightsTrigger', () => {
resetRecommendationsHighlighting(),
changeSelectedTab(InsightsPanelTabs.Recommendations),
toggleInsightsPanel(),
removeFeatureFromHighlighting('insights')
])
})

Expand Down
59 changes: 22 additions & 37 deletions redisinsight/ui/src/components/insights-trigger/InsightsTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import { recommendationsSelector, resetRecommendationsHighlighting } from 'uiSrc
import { InsightsPanelTabs } from 'uiSrc/slices/interfaces/insights'
import { sendEventTelemetry, TELEMETRY_EMPTY_VALUE, TelemetryEvent } from 'uiSrc/telemetry'
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
import HighlightedFeature from 'uiSrc/components/hightlighted-feature/HighlightedFeature'
import { BUILD_FEATURES } from 'uiSrc/constants/featuresHighlighting'
import { appFeatureHighlightingSelector, removeFeatureFromHighlighting } from 'uiSrc/slices/app/features'
import { getHighlightingFeatures } from 'uiSrc/utils/highlighting'

import styles from './styles.module.scss'

Expand All @@ -29,9 +25,6 @@ const InsightsTrigger = (props: Props) => {
const { isHighlighted, } = useSelector(recommendationsSelector)
const { provider } = useSelector(connectedInstanceSelector)

const { features } = useSelector(appFeatureHighlightingSelector)
const { insights: insightsHighlighting } = getHighlightingFeatures(features)

const dispatch = useDispatch()
const { pathname, search } = useLocation()
const { instanceId } = useParams<{ instanceId: string }>()
Expand Down Expand Up @@ -67,45 +60,37 @@ const InsightsTrigger = (props: Props) => {
tab: isHighlighted ? InsightsPanelTabs.Recommendations : tabSelected,
},
})

dispatch(removeFeatureFromHighlighting('insights'))
}

return (
<div
className={cx(styles.container, { [styles.isOpen]: isInsightsOpen })}
>
<HighlightedFeature
isHighlight={insightsHighlighting && !isHighlighted}
hideFirstChild={!isHighlighted}
{...(BUILD_FEATURES.insights || {})}
<EuiToolTip
title={isHighlighted && instanceId ? undefined : 'Insights'}
content={isHighlighted && instanceId
? 'New tips are available'
: 'Open interactive tutorials to learn more about Redis or Redis Stack capabilities, or use tips to improve your database.'}
>
<EuiToolTip
title={isHighlighted && instanceId ? undefined : 'Insights'}
content={isHighlighted && instanceId
? 'New tips are available'
: 'Open interactive tutorials to learn more about Redis or Redis Stack capabilities, or use tips to improve your database.'}
<EuiButton
fill
size="s"
color="secondary"
className={styles.btn}
role="button"
iconType={TriggerIcon}
onClick={handleClickTrigger}
data-testid="insights-trigger"
>
<EuiButton
fill
size="s"
color="secondary"
className={styles.btn}
role="button"
iconType={TriggerIcon}
onClick={handleClickTrigger}
data-testid="insights-trigger"
<EuiText className={cx(
styles.triggerText,
)}
>
<EuiText className={cx(
styles.triggerText,
)}
>
Insights
</EuiText>
{(isHighlighted && instanceId) && (<span className={styles.highlighting} />)}
</EuiButton>
</EuiToolTip>
</HighlightedFeature>
Insights
</EuiText>
{(isHighlighted && instanceId) && (<span className={styles.highlighting} />)}
</EuiButton>
</EuiToolTip>
</div>
)
}
Expand Down
6 changes: 1 addition & 5 deletions redisinsight/ui/src/constants/featuresHighlighting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,5 @@ interface BuildHighlightingFeature {
}

export const BUILD_FEATURES: Record<string, BuildHighlightingFeature> = {
insights: {
type: 'tooltip',
title: 'Try Redis Tutorials',
content: 'Try our interactive Tutorials to learn how Redis can solve your use cases.',
}

} as const