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
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ describe('DatabaseSidePanels', () => {

(insightsPanelSelector as jest.Mock).mockReturnValue({
isOpen: true,
tabSelected: 'recommendations'
tabSelected: 'tips'
})

render(<DatabaseSidePanels />)
Expand All @@ -138,7 +138,7 @@ describe('DatabaseSidePanels', () => {
it('should render recommendations count with totalUnread > 0', () => {
(insightsPanelSelector as jest.Mock).mockReturnValue({
isOpen: true,
tabSelected: 'recommendations'
tabSelected: 'tips'
});

(recommendationsSelector as jest.Mock).mockImplementationOnce(() => ({
Expand All @@ -161,7 +161,7 @@ describe('DatabaseSidePanels', () => {

(insightsPanelSelector as jest.Mock).mockReturnValue({
isOpen: true,
tabSelected: 'recommendations'
tabSelected: 'tips'
})

render(<DatabaseSidePanels />)
Expand All @@ -174,7 +174,7 @@ describe('DatabaseSidePanels', () => {
databaseId: 'instanceId',
provider: 'RE_CLOUD',
page: '/triggered-functions/libraries',
tab: 'recommendations'
tab: 'tips'
},
});

Expand All @@ -189,7 +189,7 @@ describe('DatabaseSidePanels', () => {

(insightsPanelSelector as jest.Mock).mockReturnValue({
isOpen: true,
tabSelected: 'recommendations'
tabSelected: 'tips'
})

render(<DatabaseSidePanels />)
Expand All @@ -200,7 +200,7 @@ describe('DatabaseSidePanels', () => {
event: TelemetryEvent.INSIGHTS_PANEL_TAB_CHANGED,
eventData: {
databaseId: 'instanceId',
prevTab: 'recommendations',
prevTab: 'tips',
currentTab: 'explore',
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const DatabaseSidePanels = (props: Props) => {
anchorWrapperClassName={styles.onboardingAnchorWrapper}
fullSize
>
<span className={styles.tabName}>Explore Redis</span>
<span className={styles.tabName}>Explore</span>
</OnboardingTour>
</EuiTab>
<EuiTab
Expand All @@ -153,7 +153,7 @@ const DatabaseSidePanels = (props: Props) => {
data-testid="recommendations-tab"
>
<>
<span className={styles.tabName}>Redis Tips</span>
<span className={styles.tabName}>Tips</span>
{!!totalUnread && (
<div
className={styles.tabTotalUnread}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('LiveTimeRecommendations', () => {

expect(pushMock).toHaveBeenCalledWith(Pages.databaseAnalysis('instanceId'))
expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED,
eventData: {
databaseId: 'instanceId',
total: 1,
Expand All @@ -151,7 +151,7 @@ describe('LiveTimeRecommendations', () => {
fireEvent.click(queryByTestId('checkbox-show-hidden')!)

expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_SHOW_HIDDEN,
event: TelemetryEvent.INSIGHTS_TIPS_SHOW_HIDDEN,
eventData: {
databaseId: 'instanceId',
list: RECOMMENDATIONS_DATA_MOCK.recommendations?.map(({ name }) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const LiveTimeRecommendations = () => {
dispatch(createNewAnalysis(instanceId, delimiter))
history.push(Pages.databaseAnalysis(instanceId))
sendEventTelemetry({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED,
eventData: {
databaseId: instanceId,
total: recommendations?.length,
Expand All @@ -83,7 +83,7 @@ const LiveTimeRecommendations = () => {
dispatch(setRecommendationsShowHidden(value))

sendEventTelemetry({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_SHOW_HIDDEN,
event: TelemetryEvent.INSIGHTS_TIPS_SHOW_HIDDEN,
eventData: {
action: !value ? 'hide' : 'show',
...getTelemetryData(recommendations)
Expand Down Expand Up @@ -129,19 +129,19 @@ const LiveTimeRecommendations = () => {
{!!recommendations.length && (
<div className={styles.actions}>
<div>
<EuiTextColor className={styles.boldText}>Our Recommendations</EuiTextColor>
<EuiTextColor className={styles.boldText}>Our Tips</EuiTextColor>
<EuiToolTip
position="bottom"
anchorClassName={styles.tooltipAnchor}
className={styles.tooltip}
content={(
<>
Recommendations will help you improve your database.
Tips will help you improve your database.
<br />
New recommendations appear while you work with your database,
New tips appear while you work with your database,
including how to improve performance and optimize memory usage.
<br />
Eager for more recommendations? Run Database Analysis to get started.
Eager for more tips? Run Database Analysis to get started.
</>
)}
>
Expand Down Expand Up @@ -220,7 +220,7 @@ const LiveTimeRecommendations = () => {
Database Analysis
</EuiLink>
</PopoverRunAnalyze>
{' to get more recommendations'}
{' to get more tips'}
</EuiText>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('Recommendation', () => {

expect(pushMock).toHaveBeenCalledWith({ search: 'guidePath=' })
expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED,
eventData: {
databaseId: INSTANCE_ID_MOCK,
name: 'searchJSON',
Expand Down Expand Up @@ -110,7 +110,7 @@ describe('Recommendation', () => {
search: 'guidePath=quick-guides/working-with-hash.html'
})
expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED,
eventData: {
databaseId: INSTANCE_ID_MOCK,
name: 'searchJSON',
Expand Down Expand Up @@ -144,7 +144,7 @@ describe('Recommendation', () => {
search: 'guidePath=/redis_stack/working_with_json.md'
})
expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED,
eventData: {
databaseId: INSTANCE_ID_MOCK,
name: 'searchJSON',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Recommendation = ({

const handleRedirect = () => {
sendEventTelemetry({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_TUTORIAL_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_TUTORIAL_CLICKED,
eventData: {
databaseId: instanceId,
name: recommendationsContent[name].telemetryEvent || name,
Expand All @@ -89,7 +89,7 @@ const Recommendation = ({
id,
{ hide: !hide },
({ hide, name }) => sendEventTelemetry({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_HIDE,
event: TelemetryEvent.INSIGHTS_TIPS_HIDE,
eventData: {
databaseId: instanceId,
action: hide ? 'hide' : 'show',
Expand All @@ -114,7 +114,7 @@ const Recommendation = ({

const onSuccessActionDelete = () => {
sendEventTelemetry({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_SNOOZED,
event: TelemetryEvent.INSIGHTS_TIPS_SNOOZED,
eventData: {
databaseId: instanceId,
name: recommendationsContent[name]?.telemetryEvent ?? name,
Expand All @@ -125,7 +125,7 @@ const Recommendation = ({

const onRecommendationLinkClick = () => {
sendEventTelemetry({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_LINK_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_LINK_CLICKED,
eventData: {
databaseId: instanceId,
name: recommendationsContent[name]?.telemetryEvent ?? name,
Expand Down Expand Up @@ -210,8 +210,8 @@ const Recommendation = ({
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip
title="Snooze recommendation"
content="This recommendation will be removed from the list and displayed again when relevant."
title="Snooze tip"
content="This tip will be removed from the list and displayed again when relevant."
position="top"
display="inlineBlock"
anchorClassName="flex-row"
Expand All @@ -221,17 +221,17 @@ const Recommendation = ({
iconType={SnoozeIcon}
className={styles.snoozeBtn}
onClick={handleDelete}
aria-label="snooze recommendation"
aria-label="snooze tip"
data-testid={`${name}-delete-btn`}
/>
</EuiToolTip>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiToolTip
title={`${hide ? 'Show' : 'Hide'} recommendation`}
title={`${hide ? 'Show' : 'Hide'} tip`}
content={`${hide
? 'This recommendation will be shown in the list.'
: 'This recommendation will be removed from the list and not displayed again.'
? 'This tip will be shown in the list.'
: 'This tip will be removed from the list and not displayed again.'
}`}
position="top"
display="inlineBlock"
Expand All @@ -242,7 +242,7 @@ const Recommendation = ({
iconType={hide ? 'eyeClosed' : 'eye'}
className={styles.hideBtn}
onClick={toggleHide}
aria-label="hide/unhide recommendation"
aria-label="hide/unhide tip"
data-testid={`toggle-hide-${name}-btn`}
/>
</EuiToolTip>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ describe('WelcomeScreen', () => {
fireEvent.click(screen.getByTestId('approve-insights-db-analysis-btn'))

expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED,
eventData: {
databaseId: 'instanceId',
total: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const NoRecommendationsScreen = () => {
dispatch(createNewAnalysis(instanceId, delimiter))
history.push(Pages.databaseAnalysis(instanceId))
sendEventTelemetry({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_DATABASE_ANALYSIS_CLICKED,
event: TelemetryEvent.INSIGHTS_TIPS_DATABASE_ANALYSIS_CLICKED,
eventData: {
databaseId: instanceId,
total: recommendations?.length,
Expand All @@ -44,15 +44,15 @@ const NoRecommendationsScreen = () => {
return (
<div className={styles.container} data-testid="no-recommendations-screen">
<EuiText className={styles.bigText}>Welcome to</EuiText>
<EuiText className={styles.hugeText}>Recommendations!</EuiText>
<EuiText className={styles.hugeText}>Tips!</EuiText>
<EuiText className={styles.mediumText}>Where we help improve your database.</EuiText>
<EuiText className={cx(styles.text, styles.bigMargin)}>
New recommendations appear while you work with your database,
New tips appear while you work with your database,
including how to improve performance and optimize memory usage.
</EuiText>
<WelcomeIcon className={styles.icon} />
<EuiText className={styles.text}>
Eager for more recommendations? Run Database Analysis to get started.
Eager for more tips? Run Database Analysis to get started.
</EuiText>

<PopoverRunAnalyze
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ describe('InsightsTrigger', () => {
provider: 'RE_CLOUD',
source: 'overview',
page: '/browser',
tab: 'recommendations'
tab: 'tips'
},
})
});

sendEventTelemetry.mockRestore()
(sendEventTelemetry as jest.Mock).mockRestore()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ const InsightsTrigger = () => {
<EuiToolTip
title={isHighlighted ? undefined : 'Insights'}
content={isHighlighted
? 'New recommendations are available'
: 'Open interactive tutorials to learn more about Redis or Redis Stack capabilities, or use recommendations to improve your database.'}
? '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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ describe('ONBOARDING_FEATURES', () => {
expect(
render(<OnboardingTour options={ONBOARDING_FEATURES.ANALYTICS_RECOMMENDATIONS}><span /></OnboardingTour>)
).toBeTruthy()
expect(screen.getByTestId('step-content')).toHaveTextContent('See recommendations to optimize the memory usage, performance')
expect(screen.getByTestId('step-content')).toHaveTextContent('See tips to optimize the memory usage, performance')
})

it('should call proper telemetry events', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,10 +358,10 @@ const ONBOARDING_FEATURES = {
content: (
<>
Use Database Analysis to get summary of your database and receive
recommendations to improve memory usage and performance.
tips to improve memory usage and performance.
<EuiSpacer size="xs" />
Run a new report to get an overview of the database and receive
recommendations to optimize your database usage.
tips to optimize your database usage.
</>
),
onSkip: () => sendClosedTelemetryEvent(...telemetryArgs),
Expand Down Expand Up @@ -389,14 +389,14 @@ const ONBOARDING_FEATURES = {
},
ANALYTICS_RECOMMENDATIONS: {
step: OnboardingSteps.AnalyticsRecommendations,
title: 'Database Recommendations',
title: 'Database Tips',
Inner: () => {
const { id: connectedInstanceId = '' } = useSelector(connectedInstanceSelector)
const history = useHistory()
const telemetryArgs: TelemetryArgs = [connectedInstanceId, OnboardingStepName.DatabaseAnalysisRecommendations]

return {
content: 'See recommendations to optimize the memory usage, performance and increase the security of your Redis database',
content: 'See tips to optimize the memory usage, performance and increase the security of your Redis database',
onSkip: () => sendClosedTelemetryEvent(...telemetryArgs),
onBack: () => sendBackTelemetryEvent(...telemetryArgs),
onNext: () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('RecommendationCopyComponent', () => {
})

expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.INSIGHTS_RECOMMENDATION_KEY_COPIED,
event: TelemetryEvent.INSIGHTS_TIPS_KEY_COPIED,
eventData: {
databaseId: INSTANCE_ID_MOCK,
name: mockTelemetryEvent,
Expand All @@ -65,7 +65,7 @@ describe('RecommendationCopyComponent', () => {
})

expect(sendEventTelemetry).toBeCalledWith({
event: TelemetryEvent.DATABASE_RECOMMENDATIONS_KEY_COPIED,
event: TelemetryEvent.DATABASE_TIPS_KEY_COPIED,
eventData: {
databaseId: INSTANCE_ID_MOCK,
name: mockTelemetryEvent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const RecommendationCopyComponent = ({ live = false, keyName, telemetryEvent, pr
const handleCopy = () => {
sendEventTelemetry({
event: live
? TelemetryEvent.INSIGHTS_RECOMMENDATION_KEY_COPIED
: TelemetryEvent.DATABASE_RECOMMENDATIONS_KEY_COPIED,
? TelemetryEvent.INSIGHTS_TIPS_KEY_COPIED
: TelemetryEvent.DATABASE_TIPS_KEY_COPIED,
eventData: {
databaseId: instanceId,
name: telemetryEvent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('RecommendationVoting', () => {
})

it('should render proper popover and btn should be disabled"', async () => {
userSettingsConfigSelector.mockImplementation(() => ({
(userSettingsConfigSelector as jest.Mock).mockImplementation(() => ({
agreements: {
analytics: false,
},
Expand All @@ -69,7 +69,7 @@ describe('RecommendationVoting', () => {
})
await waitForEuiToolTipVisible()

expect(screen.getByTestId('not useful-vote-tooltip')).toHaveTextContent('Enable Analytics on the Settings page to vote for a recommendation')
expect(screen.getByTestId('not useful-vote-tooltip')).toHaveTextContent('Enable Analytics on the Settings page to vote for a tip')
expect(screen.getByTestId('not useful-vote-btn')).toBeDisabled()
})
})
Loading