Skip to content

Commit 1d8867d

Browse files
committed
Merge branch 'feature/RI-4399-beta_features' into e2e/feature/RI-4399-hide_recommendations_for_users
2 parents 6feebe4 + bcd02bb commit 1d8867d

File tree

11 files changed

+50
-58
lines changed

11 files changed

+50
-58
lines changed

redisinsight/api/src/modules/database-recommendation/scanner/strategies/integer-in-set.strategy.spec.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ describe('IntegersInSetStrategy', () => {
3636
})).toEqual({ isReached: false });
3737
});
3838

39-
it('should return false when some member is not an integer in the first 50 members and not all members are uniq', async () => {
39+
it('should return false when some member is not an integer in the first 50 members', async () => {
4040
expect(await strategy.isRecommendationReached({
4141
client: nodeClient,
4242
databaseId: mockDatabaseId,
43-
members: [...mockIntegerMembers, ...mockNotIntegerMembers, ...mockNotIntegerMembers] as RedisString[],
43+
members: [...mockIntegerMembers, ...mockNotIntegerMembers] as RedisString[],
4444
keyName: mockKeyName,
45-
})).toEqual({ isReached: false });
45+
})).toEqual({ isReached: true, params: { keys: [mockKeyName] } });
4646
});
4747

4848
it('should return false when 51th member is not an integer', async () => {
@@ -53,14 +53,5 @@ describe('IntegersInSetStrategy', () => {
5353
keyName: mockKeyName,
5454
})).toEqual({ isReached: false });
5555
});
56-
57-
it('should return true when some member is not an integer in the first 50 members and all members are uniq', async () => {
58-
expect(await strategy.isRecommendationReached({
59-
client: nodeClient,
60-
databaseId: mockDatabaseId,
61-
members: [...mockIntegerMembers, ...mockNotIntegerMembers] as RedisString[],
62-
keyName: mockKeyName,
63-
})).toEqual({ isReached: true, params: { keys: [mockKeyName] } });
64-
});
6556
});
6657
});

redisinsight/api/src/modules/database-recommendation/scanner/strategies/integer-in-set.strategy.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isNaN, toNumber, uniq } from 'lodash';
1+
import { isNaN, toNumber } from 'lodash';
22
import { AbstractRecommendationStrategy }
33
from 'src/modules/database-recommendation/scanner/strategies/abstract.recommendation.strategy';
44
import { IDatabaseRecommendationStrategyData }
@@ -21,9 +21,7 @@ export class IntegersInSetStrategy extends AbstractRecommendationStrategy {
2121
(member) => isNaN(toNumber(getUTF8FromRedisString(member))),
2222
);
2323

24-
const isAllMembersUniq = uniq(membersForCheck).length === membersForCheck.length;
25-
26-
return isNotIntegerInSet && isAllMembersUniq
24+
return isNotIntegerInSet
2725
? { isReached: true, params: { keys: [data?.keyName] } }
2826
: { isReached: false };
2927
}

redisinsight/ui/src/components/navigation-menu/components/help-menu/HelpMenu.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import React, { useState } from 'react'
1515
import { useDispatch, useSelector } from 'react-redux'
1616

1717
import { EXTERNAL_LINKS } from 'uiSrc/constants/links'
18+
import { ReleaseNotesSource } from 'uiSrc/constants/telemetry'
1819
import { appElectronInfoSelector, setReleaseNotesViewed, setShortcutsFlyoutState } from 'uiSrc/slices/app/info'
1920
import { ONBOARDING_FEATURES } from 'uiSrc/components/onboarding-features'
2021
import { setOnboarding } from 'uiSrc/slices/app/features'
@@ -24,6 +25,8 @@ import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
2425
import { ReactComponent as GithubHelpCenterSVG } from 'uiSrc/assets/img/github.svg'
2526
import { ReactComponent as BulbSVG } from 'uiSrc/assets/img/bulb.svg'
2627

28+
import { addMessageNotification } from 'uiSrc/slices/app/notifications'
29+
import successMessages from 'uiSrc/components/notifications/success-messages'
2730
import navStyles from '../../styles.module.scss'
2831
import styles from './styles.module.scss'
2932

@@ -40,6 +43,15 @@ const HelpMenu = () => {
4043
}
4144

4245
const onClickReleaseNotes = async () => {
46+
dispatch(addMessageNotification(
47+
successMessages.INSTALLED_NEW_UPDATE('2.2.1', () => dispatch(setReleaseNotesViewed(true)))
48+
))
49+
sendEventTelemetry({
50+
event: TelemetryEvent.RELEASE_NOTES_LINK_CLICKED,
51+
eventData: {
52+
source: ReleaseNotesSource.helpCenter
53+
}
54+
})
4355
if (isReleaseNotesViewed === false) {
4456
dispatch(setReleaseNotesViewed(true))
4557
}

redisinsight/ui/src/components/notifications/success-messages.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ export default {
163163
<>
164164
Action completed
165165
<br />
166-
<EuiText color="ghost">Data uploaded with file: {formatLongName(fileName, 24, 5)}</EuiText>
166+
<EuiText color="ghost">Commands executed from file:</EuiText>
167+
<EuiText color="ghost">{formatLongName(fileName, 34, 5)}</EuiText>
167168
</>
168169
),
169170
message: (

redisinsight/ui/src/constants/featuresHighlighting.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,5 @@ interface BuildHighlightingFeature {
1010
}
1111

1212
export const BUILD_FEATURES: Record<string, BuildHighlightingFeature> = {
13-
bulkUpload: {
14-
type: 'tooltip',
15-
title: (<span><i>New:</i> Bulk Upload</span>),
16-
content: 'Upload your data in bulk from a file.',
17-
}
13+
1814
} as const
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export enum ReleaseNotesSource {
2+
helpCenter = 'Help Center',
3+
updateNotification = 'Update notification'
4+
}

redisinsight/ui/src/electron/utils/ipcCheckUpdates.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ipcRenderer } from 'electron'
22
import { Dispatch } from 'react'
33
import { omit } from 'lodash'
44
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
5+
import { ReleaseNotesSource } from 'uiSrc/constants/telemetry'
56
import { setElectronInfo, setReleaseNotesViewed } from 'uiSrc/slices/app/info'
67
import { addMessageNotification } from 'uiSrc/slices/app/notifications'
78
import successMessages from 'uiSrc/components/notifications/success-messages'
@@ -23,7 +24,15 @@ export const ipcCheckUpdates = async (serverInfo: GetServerInfoResponse, dispatc
2324
if (isUpdateDownloaded && !isUpdateAvailable) {
2425
if (serverInfo.appVersion === updateDownloadedVersion) {
2526
dispatch(addMessageNotification(
26-
successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion, () => dispatch(setReleaseNotesViewed(true)))
27+
successMessages.INSTALLED_NEW_UPDATE(updateDownloadedVersion, () => {
28+
dispatch(setReleaseNotesViewed(true))
29+
sendEventTelemetry({
30+
event: TelemetryEvent.RELEASE_NOTES_LINK_CLICKED,
31+
eventData: {
32+
source: ReleaseNotesSource.updateNotification
33+
}
34+
})
35+
})
2736
))
2837
}
2938

redisinsight/ui/src/pages/browser/components/bulk-actions/BulkUpload/BulkUpload.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ const BulkUpload = (props: Props) => {
131131
loading={loading}
132132
status={status}
133133
progress={progress}
134-
title="Upload with file"
134+
title="Commands executed from file"
135135
subTitle={(<div className="truncateText" style={{ paddingTop: 6 }}>{fileName}</div>)}
136136
>
137137
<BulkActionSummary

redisinsight/ui/src/pages/browser/components/keys-header/KeysHeader.tsx

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,11 @@ import { isRedisearchAvailable } from 'uiSrc/utils'
2424

2525
import { OnboardingStepName, OnboardingSteps } from 'uiSrc/constants/onboarding'
2626
import {
27-
appFeatureHighlightingSelector,
28-
incrementOnboardStepAction,
29-
removeFeatureFromHighlighting
27+
incrementOnboardStepAction
3028
} from 'uiSrc/slices/app/features'
3129
import { OnboardingTour } from 'uiSrc/components'
3230
import { ONBOARDING_FEATURES } from 'uiSrc/components/onboarding-features'
3331
import { setBulkActionType } from 'uiSrc/slices/browser/bulkActions'
34-
import { BUILD_FEATURES } from 'uiSrc/constants/featuresHighlighting'
35-
import HighlightedFeature from 'uiSrc/components/hightlighted-feature/HighlightedFeature'
36-
import { getHighlightingFeatures } from 'uiSrc/utils/highlighting'
3732
import AutoRefresh from '../auto-refresh'
3833
import FilterKeyType from '../filter-key-type'
3934
import RediSearchIndexesList from '../redisearch-key-list'
@@ -84,8 +79,6 @@ const KeysHeader = (props: Props) => {
8479
const { id: instanceId, modules } = useSelector(connectedInstanceSelector)
8580
const { viewType, searchMode, isFiltered } = useSelector(keysSelector)
8681
const { selectedIndex } = useSelector(redisearchSelector)
87-
const { features } = useSelector(appFeatureHighlightingSelector)
88-
const { bulkUpload: bulkUploadHighlighting } = getHighlightingFeatures(features)
8982

9083
const rootDivRef: Ref<HTMLDivElement> = useRef(null)
9184

@@ -250,7 +243,6 @@ const KeysHeader = (props: Props) => {
250243
const openBulkActions = () => {
251244
dispatch(setBulkActionType(BulkActionsType.Delete))
252245
handleBulkActionsPanel(true)
253-
dispatch(removeFeatureFromHighlighting('bulkUpload'))
254246
}
255247

256248
const handleSwitchView = (type: KeyViewType) => {
@@ -311,27 +303,18 @@ const KeysHeader = (props: Props) => {
311303
)
312304

313305
const BulkActionsBtn = (
314-
<HighlightedFeature
315-
isHighlight={bulkUploadHighlighting}
316-
title={BUILD_FEATURES?.bulkUpload?.title}
317-
content={BUILD_FEATURES?.bulkUpload?.content}
318-
type={BUILD_FEATURES?.bulkUpload?.type}
319-
wrapperClassName={styles.bulkActionsHighlighting}
320-
hideFirstChild
321-
>
322-
<EuiToolTip content="Bulk Actions" position="top">
323-
<EuiButton
324-
fill
325-
size="s"
326-
color="secondary"
327-
onClick={openBulkActions}
328-
className={styles.bulkActions}
329-
data-testid="btn-bulk-actions"
330-
>
331-
<EuiIcon type={BulkActionsIcon} />
332-
</EuiButton>
333-
</EuiToolTip>
334-
</HighlightedFeature>
306+
<EuiToolTip content="Bulk Actions" position="top">
307+
<EuiButton
308+
fill
309+
size="s"
310+
color="secondary"
311+
onClick={openBulkActions}
312+
className={styles.bulkActions}
313+
data-testid="btn-bulk-actions"
314+
>
315+
<EuiIcon type={BulkActionsIcon} />
316+
</EuiButton>
317+
</EuiToolTip>
335318
)
336319

337320
const ViewSwitch = (width: number) => (

redisinsight/ui/src/pages/browser/components/keys-header/styles.module.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
padding: 0 !important;
3030
}
3131
}
32-
33-
.bulkActionsHighlighting {
34-
display: inline-block;
35-
}
3632
}
3733

3834
.top,

0 commit comments

Comments
 (0)