Skip to content

Commit 2caed93

Browse files
committed
#RI-3081 - Event AUTO_REFRESH_ENABLED should be sent when user changes rate
#RI-3082 - Event KEY_DETAILS_AUTO_REFRESH_DISABLED doesn't contain length
1 parent 475aba5 commit 2caed93

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

redisinsight/ui/src/pages/browser/components/key-details-header/KeyDetailsHeader.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,20 @@ const KeyDetailsHeader = ({
207207
sendEventTelemetry({
208208
event: getBasedOnViewTypeEvent(viewType, browserViewEvent, treeViewEvent),
209209
eventData: {
210+
length,
210211
databaseId: instanceId,
211212
keyType: type,
212-
length: enableAutoRefresh ? length : undefined,
213-
refreshRate: enableAutoRefresh ? +refreshRate : undefined
213+
refreshRate: +refreshRate
214214
}
215215
})
216216
}
217217

218+
const handleChangeAutoRefreshRate = (enableAutoRefresh: boolean, refreshRate: string) => {
219+
if (enableAutoRefresh) {
220+
handleEnableAutoRefresh(enableAutoRefresh, refreshRate)
221+
}
222+
}
223+
218224
const onMouseEnterTTL = () => {
219225
setTTLIsHovering(true)
220226
}
@@ -619,6 +625,7 @@ const KeyDetailsHeader = ({
619625
containerClassName={styles.actionBtn}
620626
onRefresh={handleRefreshKey}
621627
onEnableAutoRefresh={handleEnableAutoRefresh}
628+
onChangeAutoRefreshRate={handleChangeAutoRefreshRate}
622629
testid="refresh-key-btn"
623630
/>
624631
{keyType && Actions(width)}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,17 @@ const KeysHeader = (props: Props) => {
139139
event: getBasedOnViewTypeEvent(viewType, browserViewEvent, treeViewEvent),
140140
eventData: {
141141
databaseId: instanceId,
142-
refreshRate: enableAutoRefresh ? +refreshRate : undefined
142+
refreshRate: +refreshRate,
143143
}
144144
})
145145
}
146146

147+
const handleChangeAutoRefreshRate = (enableAutoRefresh: boolean, refreshRate: string) => {
148+
if (enableAutoRefresh) {
149+
handleEnableAutoRefresh(enableAutoRefresh, refreshRate)
150+
}
151+
}
152+
147153
const handleScanMore = (config: any) => {
148154
loadMoreItems?.({
149155
...config,
@@ -250,6 +256,7 @@ const KeysHeader = (props: Props) => {
250256
containerClassName={styles.refreshContainer}
251257
onRefresh={handleRefreshKeys}
252258
onEnableAutoRefresh={handleEnableAutoRefresh}
259+
onChangeAutoRefreshRate={handleChangeAutoRefreshRate}
253260
testid="refresh-keys-btn"
254261
/>
255262
</div>

0 commit comments

Comments
 (0)