Skip to content

Commit 205ea4a

Browse files
committed
#RI-5577 - remove highlighting
1 parent be4cb90 commit 205ea4a

File tree

3 files changed

+24
-45
lines changed

3 files changed

+24
-45
lines changed

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)