Skip to content

Commit afc535e

Browse files
authored
Merge pull request #3188 from RedisInsight/fe/feature/RI-5577-remove-highlighting
Fe/feature/ri 5577 remove highlighting
2 parents 014c474 + 205ea4a commit afc535e

File tree

5 files changed

+68
-47
lines changed

5 files changed

+68
-47
lines changed

redisinsight/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"date-fns": "^2.29.3",
6767
"detect-port": "^1.5.1",
6868
"dotenv": "^16.0.0",
69-
"express": "^4.17.1",
69+
"express": "^4.19.2",
7070
"fs-extra": "^10.0.0",
7171
"ioredis": "^5.2.2",
7272
"is-glob": "^4.0.1",

redisinsight/api/yarn.lock

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2741,6 +2741,11 @@ [email protected]:
27412741
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b"
27422742
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==
27432743

2744+
2745+
version "0.6.0"
2746+
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
2747+
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==
2748+
27442749
cookie@~0.4.1:
27452750
version "0.4.2"
27462751
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432"
@@ -3630,7 +3635,7 @@ expect@^26.6.2:
36303635
jest-message-util "^26.6.2"
36313636
jest-regex-util "^26.0.0"
36323637

3633-
[email protected], express@^4.17.1:
3638+
36343639
version "4.18.2"
36353640
resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59"
36363641
integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==
@@ -3667,6 +3672,43 @@ [email protected], express@^4.17.1:
36673672
utils-merge "1.0.1"
36683673
vary "~1.1.2"
36693674

3675+
express@^4.19.2:
3676+
version "4.19.2"
3677+
resolved "https://registry.yarnpkg.com/express/-/express-4.19.2.tgz#e25437827a3aa7f2a827bc8171bbbb664a356465"
3678+
integrity sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==
3679+
dependencies:
3680+
accepts "~1.3.8"
3681+
array-flatten "1.1.1"
3682+
body-parser "1.20.2"
3683+
content-disposition "0.5.4"
3684+
content-type "~1.0.4"
3685+
cookie "0.6.0"
3686+
cookie-signature "1.0.6"
3687+
debug "2.6.9"
3688+
depd "2.0.0"
3689+
encodeurl "~1.0.2"
3690+
escape-html "~1.0.3"
3691+
etag "~1.8.1"
3692+
finalhandler "1.2.0"
3693+
fresh "0.5.2"
3694+
http-errors "2.0.0"
3695+
merge-descriptors "1.0.1"
3696+
methods "~1.1.2"
3697+
on-finished "2.4.1"
3698+
parseurl "~1.3.3"
3699+
path-to-regexp "0.1.7"
3700+
proxy-addr "~2.0.7"
3701+
qs "6.11.0"
3702+
range-parser "~1.2.1"
3703+
safe-buffer "5.2.1"
3704+
send "0.18.0"
3705+
serve-static "1.15.0"
3706+
setprototypeof "1.2.0"
3707+
statuses "2.0.1"
3708+
type-is "~1.6.18"
3709+
utils-merge "1.0.1"
3710+
vary "~1.1.2"
3711+
36703712
extend-shallow@^2.0.1:
36713713
version "2.0.1"
36723714
resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"

redisinsight/ui/src/components/insights-trigger/InsightsTrigger.spec.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { recommendationsSelector, resetRecommendationsHighlighting } from 'uiSrc
88
import { InsightsPanelTabs } from 'uiSrc/slices/interfaces/insights'
99
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
1010
import { Pages } from 'uiSrc/constants'
11-
import { removeFeatureFromHighlighting } from 'uiSrc/slices/app/features'
1211
import InsightsTrigger from './InsightsTrigger'
1312

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

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

53-
expect(store.getActions()).toEqual([toggleInsightsPanel(), removeFeatureFromHighlighting('insights')])
52+
expect(store.getActions()).toEqual([toggleInsightsPanel()])
5453
})
5554

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

redisinsight/ui/src/components/insights-trigger/InsightsTrigger.tsx

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ import { recommendationsSelector, resetRecommendationsHighlighting } from 'uiSrc
1212
import { InsightsPanelTabs } from 'uiSrc/slices/interfaces/insights'
1313
import { sendEventTelemetry, TELEMETRY_EMPTY_VALUE, TelemetryEvent } from 'uiSrc/telemetry'
1414
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
15-
import HighlightedFeature from 'uiSrc/components/hightlighted-feature/HighlightedFeature'
16-
import { BUILD_FEATURES } from 'uiSrc/constants/featuresHighlighting'
17-
import { appFeatureHighlightingSelector, removeFeatureFromHighlighting } from 'uiSrc/slices/app/features'
18-
import { getHighlightingFeatures } from 'uiSrc/utils/highlighting'
1915

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

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

32-
const { features } = useSelector(appFeatureHighlightingSelector)
33-
const { insights: insightsHighlighting } = getHighlightingFeatures(features)
34-
3528
const dispatch = useDispatch()
3629
const { pathname, search } = useLocation()
3730
const { instanceId } = useParams<{ instanceId: string }>()
@@ -67,45 +60,37 @@ const InsightsTrigger = (props: Props) => {
6760
tab: isHighlighted ? InsightsPanelTabs.Recommendations : tabSelected,
6861
},
6962
})
70-
71-
dispatch(removeFeatureFromHighlighting('insights'))
7263
}
7364

7465
return (
7566
<div
7667
className={cx(styles.container, { [styles.isOpen]: isInsightsOpen })}
7768
>
78-
<HighlightedFeature
79-
isHighlight={insightsHighlighting && !isHighlighted}
80-
hideFirstChild={!isHighlighted}
81-
{...(BUILD_FEATURES.insights || {})}
69+
<EuiToolTip
70+
title={isHighlighted && instanceId ? undefined : 'Insights'}
71+
content={isHighlighted && instanceId
72+
? 'New tips are available'
73+
: 'Open interactive tutorials to learn more about Redis or Redis Stack capabilities, or use tips to improve your database.'}
8274
>
83-
<EuiToolTip
84-
title={isHighlighted && instanceId ? undefined : 'Insights'}
85-
content={isHighlighted && instanceId
86-
? 'New tips are available'
87-
: 'Open interactive tutorials to learn more about Redis or Redis Stack capabilities, or use tips to improve your database.'}
75+
<EuiButton
76+
fill
77+
size="s"
78+
color="secondary"
79+
className={styles.btn}
80+
role="button"
81+
iconType={TriggerIcon}
82+
onClick={handleClickTrigger}
83+
data-testid="insights-trigger"
8884
>
89-
<EuiButton
90-
fill
91-
size="s"
92-
color="secondary"
93-
className={styles.btn}
94-
role="button"
95-
iconType={TriggerIcon}
96-
onClick={handleClickTrigger}
97-
data-testid="insights-trigger"
85+
<EuiText className={cx(
86+
styles.triggerText,
87+
)}
9888
>
99-
<EuiText className={cx(
100-
styles.triggerText,
101-
)}
102-
>
103-
Insights
104-
</EuiText>
105-
{(isHighlighted && instanceId) && (<span className={styles.highlighting} />)}
106-
</EuiButton>
107-
</EuiToolTip>
108-
</HighlightedFeature>
89+
Insights
90+
</EuiText>
91+
{(isHighlighted && instanceId) && (<span className={styles.highlighting} />)}
92+
</EuiButton>
93+
</EuiToolTip>
10994
</div>
11095
)
11196
}

redisinsight/ui/src/constants/featuresHighlighting.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,5 @@ interface BuildHighlightingFeature {
1212
}
1313

1414
export const BUILD_FEATURES: Record<string, BuildHighlightingFeature> = {
15-
insights: {
16-
type: 'tooltip',
17-
title: 'Try Redis Tutorials',
18-
content: 'Try our interactive Tutorials to learn how Redis can solve your use cases.',
19-
}
15+
2016
} as const

0 commit comments

Comments
 (0)