Skip to content

Commit 8316dbb

Browse files
Merge pull request #705 from RedisInsight/main
update release 2.2.0
2 parents 7d2bb83 + a9a4e09 commit 8316dbb

File tree

9 files changed

+43
-14
lines changed

9 files changed

+43
-14
lines changed

redisinsight/ui/src/components/range-filter/RangeFilter.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ const RangeFilter = (props: Props) => {
116116
}, [end])
117117

118118
useEffect(() => {
119-
if (max && prevValue && prevValue.max !== max && end === prevValue.max) {
119+
if (prevValue.max !== max && end === prevValue.max) {
120120
handleUpdateRangeMax(max)
121121
}
122-
if (min && prevValue && prevValue.min !== min && start === prevValue.min) {
122+
if (prevValue.min !== min && start === prevValue.min) {
123123
handleUpdateRangeMin(min)
124124
}
125125
}, [prevValue])
126126

127-
if (start === 0 && end === 0) {
127+
if (start === 0 && max !== 0 && end === 0 && min !== 0) {
128128
return (
129129
<div data-testid="mock-blank-range" className={styles.rangeWrapper}>
130130
<div className={cx(styles.sliderTrack, styles.mockRange)} />

redisinsight/ui/src/pages/slowLog/SlowLogPage.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ import InstanceHeader from 'uiSrc/components/instance-header'
1717
import { DEFAULT_SLOWLOG_MAX_LEN } from 'uiSrc/constants'
1818
import { DATE_FORMAT } from 'uiSrc/pages/slowLog/components/SlowLogTable/SlowLogTable'
1919
import { convertNumberByUnits } from 'uiSrc/pages/slowLog/utils'
20+
import { appAnalyticsInfoSelector } from 'uiSrc/slices/app/info'
2021
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
21-
import { ConnectionProvider, ConnectionType } from 'uiSrc/slices/interfaces'
22+
import { ConnectionType } from 'uiSrc/slices/interfaces'
2223
import {
2324
clearSlowLogAction,
2425
fetchSlowLogsAction,
2526
getSlowLogConfigAction,
2627
slowLogConfigSelector,
2728
slowLogSelector
2829
} from 'uiSrc/slices/slowlog/slowlog'
29-
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
30+
import { sendPageViewTelemetry, sendEventTelemetry, TelemetryEvent, TelemetryPageView } from 'uiSrc/telemetry'
3031
import { numberWithSpaces } from 'uiSrc/utils/numbers'
3132

3233
import { SlowLog } from 'apiSrc/modules/slow-log/models'
@@ -46,12 +47,14 @@ const countOptions: EuiSuperSelectOption<string>[] = [
4647
]
4748

4849
const SlowLogPage = () => {
49-
const { connectionType, provider } = useSelector(connectedInstanceSelector)
50+
const { connectionType, name: connectedInstanceName } = useSelector(connectedInstanceSelector)
5051
const { data, loading, durationUnit, config } = useSelector(slowLogSelector)
5152
const { slowlogLogSlowerThan = 0, slowlogMaxLen } = useSelector(slowLogConfigSelector)
53+
const { identified: analyticsIdentified } = useSelector(appAnalyticsInfoSelector)
5254
const { instanceId } = useParams<{ instanceId: string }>()
5355

5456
const [count, setCount] = useState<string>(DEFAULT_COUNT_VALUE)
57+
const [isPageViewSent, setIsPageViewSent] = useState(false)
5558

5659
const dispatch = useDispatch()
5760

@@ -65,8 +68,22 @@ const SlowLogPage = () => {
6568
getSlowLogs()
6669
}, [count])
6770

71+
useEffect(() => {
72+
if (connectedInstanceName && !isPageViewSent && analyticsIdentified) {
73+
sendPageView(instanceId)
74+
}
75+
}, [connectedInstanceName, isPageViewSent, analyticsIdentified])
76+
77+
const sendPageView = (instanceId: string) => {
78+
sendPageViewTelemetry({
79+
name: TelemetryPageView.SLOWLOG_PAGE,
80+
databaseId: instanceId
81+
})
82+
setIsPageViewSent(true)
83+
}
84+
6885
const getSlowLogs = (maxLen?: number) => {
69-
const countToSend = (provider === ConnectionProvider.RE_CLOUD && count === MAX_COUNT_VALUE)
86+
const countToSend = count === MAX_COUNT_VALUE
7087
? (maxLen || slowlogMaxLen || DEFAULT_SLOWLOG_MAX_LEN)
7188
: toNumber(count)
7289

redisinsight/ui/src/telemetry/pageViews.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export enum TelemetryPageView {
44
SETTINGS_PAGE = 'Settings',
55
BROWSER_PAGE = 'Browser',
66
WORKBENCH_PAGE = 'Workbench',
7+
SLOWLOG_PAGE = 'Slow Log'
78
}

redisinsight/ui/src/telemetry/segment.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ export class SegmentTelemetryService implements ITelemetryService {
3232

3333
if (!isWebApp) {
3434
pageObject.page = {
35-
path: '', url: '', title: globalThis.document.title
35+
path: '', url: '', title: ''
36+
}
37+
} else {
38+
pageObject.page = {
39+
...pageObject.page, title: ''
3640
}
3741
}
3842

tests/e2e/pageObjects/browser-page.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,10 @@ export class BrowserPage {
172172
streamEntryColumns = Selector(this.streamEntriesContainer.find('[aria-colcount]'));
173173
streamEntryRows = Selector(this.streamEntriesContainer.find('[aria-rowcount]'));
174174
streamEntryDate = Selector('[data-testid*=-date][data-testid*=stream-entry]');
175+
streamEntryIdValue = Selector('.streamEntryId[data-testid*=stream-entry]');
175176
streamFields = Selector('[data-test-id=stream-entries-container] .truncateText span');
176177
streamEntryFields = Selector('[data-testid^=stream-entry-field]');
177-
confirmationMessagePopover = Selector('div.euiPopover__panel');
178+
confirmationMessagePopover = Selector('div.euiPopover__panel .euiText ');
178179

179180
/**
180181
* Common part for Add any new key

tests/e2e/tests/critical-path/browser/stream-key-entry-deletion.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ test('Verify that the Stream information is refreshed and the deleted entry is r
5555
const fieldName = await browserPage.streamFields.nth(i).textContent;
5656
await t.expect(fieldName).notEql(fieldForDeletion, 'The deleted entry is removed from the Stream');
5757
}
58-
await t.click(browserPage.fullScreenModeButton.nth(1));
58+
await t.click(browserPage.fullScreenModeButton);
5959
});
6060
test('Verify that when user delete the last Entry from the Stream the Stream key is not deleted', async t => {
6161
keyName = chance.word({length: 20});

tests/e2e/tests/critical-path/browser/stream-key.e2e.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
const browserPage = new BrowserPage();
1313
const chance = new Chance();
1414

15-
const keyName = chance.word({ length: 20 });
15+
let keyName = chance.word({ length: 20 });
1616
const keyField = chance.word({ length: 20 });
1717
const keyValue = chance.word({ length: 20 });
1818

@@ -28,6 +28,7 @@ fixture `Stream Key`
2828
await deleteDatabase(ossStandaloneConfig.databaseName);
2929
});
3030
test('Verify that user can create Stream key via Add New Key form', async t => {
31+
keyName = chance.word({ length: 20 });
3132
// Add New Stream Key
3233
await browserPage.addStreamKey(keyName, keyField, keyValue);
3334
// Verify that user can see Stream details opened after key creation
@@ -64,6 +65,7 @@ test('Verify that user can add several fields and values during Stream key creat
6465
await t.expect(browserPage.keyNameFormDetails.withExactText(keyName).visible).ok('Stream Key Name');
6566
});
6667
test('Verify that user can add new Stream Entry for Stream data type key which has an Entry ID, Field and Value', async t => {
68+
keyName = chance.word({ length: 20 });
6769
// Add New Stream Key
6870
await browserPage.addStreamKey(keyName, keyField, keyValue);
6971
// Verify that when user adds a new Entry with not existed Field name, a new Field is added to the Stream
@@ -81,6 +83,7 @@ test('Verify that user can add new Stream Entry for Stream data type key which h
8183
await t.expect(paramsAfterExistedFieldAdding[1]).eql(toString(toNumber(paramsBeforeExistedFieldAdding[1]) + 1), 'Increased number of rows after adding');
8284
});
8385
test('Verify that during new entry adding to existing Stream, user can clear the value and the row itself', async t => {
86+
keyName = chance.word({ length: 20 });
8487
// Generate data for stream
8588
const fields = [keyField, chance.word({ length: 20 })];
8689
const values = [keyValue, chance.word({ length: 20 })];
@@ -107,6 +110,7 @@ test('Verify that during new entry adding to existing Stream, user can clear the
107110
await t.expect(browserPage.streamField.count).eql(fieldsNumberAfterDeletion, 'Number of fields after deletion');
108111
});
109112
test('Verify that user can add several fields and values to the existing Stream Key', async t => {
113+
keyName = chance.word({ length: 20 });
110114
// Generate field value data
111115
const entryQuantity = 10;
112116
const fields: string[] = [];

tests/e2e/tests/regression/browser/stream-key.e2e.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ test('Verify that user can see all the columns are displayed by default for Stre
9090
const fieldName = await browserPage.streamFields.nth(i).textContent;
9191
await t.expect(fieldName).eql(fields[i], 'All the columns are displayed by default for Stream');
9292
}
93-
await t.click(browserPage.fullScreenModeButton.nth(1));
93+
await t.click(browserPage.fullScreenModeButton);
9494
});
9595
test('Verify that the multi-line cell value tooltip is available on hover as per standard key details behavior', async t => {
9696
keyName = chance.word({length: 20});
@@ -111,12 +111,14 @@ test('Verify that the multi-line cell value tooltip is available on hover as per
111111
test('Verify that user can see a confirmation message when request to delete an entry in the Stream', async t => {
112112
keyName = chance.word({length: 20});
113113
field = 'fieldForRemoving';
114-
const confirmationMessage = 'This Entry will be removed from';
114+
const confirmationMessage = `will be removed from ${keyName}`;
115115
//Add new Stream key with 1 field
116116
await cliPage.sendCommandInCli(`XADD ${keyName} * ${field} ${value}`);
117117
//Open key details and click on delete entry
118118
await browserPage.openKeyDetails(keyName);
119+
const entryId = await browserPage.streamEntryIdValue.textContent;
119120
await t.click(browserPage.removeEntryButton);
120121
//Check the confirmation message
121122
await t.expect(browserPage.confirmationMessagePopover.textContent).contains(confirmationMessage, `The confirmation message ${keyName}`);
123+
await t.expect(browserPage.confirmationMessagePopover.textContent).contains(entryId, `The confirmation message for removing Entry`);
122124
});

tests/e2e/tests/regression/cli/cli-command-helper.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ test
217217
'BF.MEXISTS key item [item ...]',
218218
'CMS.QUERY key item [item ...]',
219219
'TDIGEST.RESET key',
220-
'TOPK.LIST key numKeys withcount',
220+
'TOPK.LIST key withcount',
221221
'CF.ADD key item'
222222
];
223223
externalPageLinks = [

0 commit comments

Comments
 (0)