Skip to content

Commit e7ea4a0

Browse files
authored
Merge pull request #1166 from RedisInsight/fe/feature/RI-3466_change-tooltip-text
#RI-3466 - change tooltip text for formatters
2 parents 8372080 + 3159bd0 commit e7ea4a0

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

redisinsight/ui/src/constants/browser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ export const TEXT_UNPRINTABLE_CHARACTERS = {
44
title: 'Non-printable characters have been detected',
55
text: 'Use Workbench or CLI to edit without data loss.',
66
}
7+
8+
export const TEXT_DISABLED_FORMATTER_EDITING = 'Cannot edit the value in this format'

redisinsight/ui/src/pages/browser/components/hash-details/HashDetails.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,13 @@ import { selectedKeyDataSelector, keysSelector, selectedKeySelector } from 'uiSr
4040
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
4141
import { SCAN_COUNT_DEFAULT } from 'uiSrc/constants/api'
4242
import HelpTexts from 'uiSrc/constants/help-texts'
43-
import { KeyTypes, OVER_RENDER_BUFFER_COUNT, TableCellAlignment, TEXT_UNPRINTABLE_CHARACTERS } from 'uiSrc/constants'
43+
import {
44+
KeyTypes,
45+
OVER_RENDER_BUFFER_COUNT,
46+
TableCellAlignment,
47+
TEXT_DISABLED_FORMATTER_EDITING,
48+
TEXT_UNPRINTABLE_CHARACTERS
49+
} from 'uiSrc/constants'
4450
import { getColumnWidth } from 'uiSrc/components/virtual-grid'
4551
import { StopPropagation } from 'uiSrc/components/virtual-table'
4652
import { stringToBuffer } from 'uiSrc/utils/formatters/bufferFormatters'
@@ -408,7 +414,7 @@ const HashDetails = (props: Props) => {
408414
return (
409415
<StopPropagation>
410416
<div className="value-table-actions">
411-
<EuiToolTip content={!isEditable ? 'Cannot change data in this format' : null}>
417+
<EuiToolTip content={!isEditable ? TEXT_DISABLED_FORMATTER_EDITING : null}>
412418
<EuiButtonIcon
413419
iconType="pencil"
414420
aria-label="Edit field"

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,15 @@ import AutoSizer from 'react-virtualized-auto-sizer'
1919

2020
import { GroupBadge } from 'uiSrc/components'
2121
import InlineItemEditor from 'uiSrc/components/inline-item-editor/InlineItemEditor'
22-
import { KEY_TYPES_ACTIONS, KeyTypes, LENGTH_NAMING_BY_TYPE, ModulesKeyTypes, STREAM_ADD_ACTION, TEXT_UNPRINTABLE_CHARACTERS } from 'uiSrc/constants'
22+
import {
23+
KEY_TYPES_ACTIONS,
24+
KeyTypes,
25+
LENGTH_NAMING_BY_TYPE,
26+
ModulesKeyTypes,
27+
STREAM_ADD_ACTION,
28+
TEXT_DISABLED_FORMATTER_EDITING,
29+
TEXT_UNPRINTABLE_CHARACTERS
30+
} from 'uiSrc/constants'
2331
import { AddCommonFieldsFormConfig } from 'uiSrc/pages/browser/components/add-key/constants/fields-config'
2432
import { initialKeyInfo, keysSelector, selectedKeyDataSelector, selectedKeySelector } from 'uiSrc/slices/browser/keys'
2533
import { streamSelector } from 'uiSrc/slices/browser/stream'
@@ -393,7 +401,7 @@ const KeyDetailsHeader = ({
393401
{KEY_TYPES_ACTIONS[keyType] && 'editItem' in KEY_TYPES_ACTIONS[keyType] && (
394402
<div className={styles.actionBtn}>
395403
<EuiToolTip
396-
content={!isEditable ? 'Cannot change data in this format' : null}
404+
content={!isEditable ? TEXT_DISABLED_FORMATTER_EDITING : null}
397405
>
398406
<EuiButtonIcon
399407
disabled={!isEditable}

redisinsight/ui/src/pages/browser/components/list-details/ListDetails.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ import { SCAN_COUNT_DEFAULT } from 'uiSrc/constants/api'
2323
import { connectedInstanceSelector } from 'uiSrc/slices/instances/instances'
2424
import { RedisResponseBuffer } from 'uiSrc/slices/interfaces'
2525
import { sendEventTelemetry, TelemetryEvent, getBasedOnViewTypeEvent } from 'uiSrc/telemetry'
26-
import { KeyTypes, OVER_RENDER_BUFFER_COUNT, TableCellAlignment, TEXT_UNPRINTABLE_CHARACTERS } from 'uiSrc/constants'
26+
import {
27+
KeyTypes,
28+
OVER_RENDER_BUFFER_COUNT,
29+
TableCellAlignment,
30+
TEXT_DISABLED_FORMATTER_EDITING,
31+
TEXT_UNPRINTABLE_CHARACTERS
32+
} from 'uiSrc/constants'
2733
import {
2834
bufferToSerializedFormat,
2935
bufferToString,
@@ -354,7 +360,7 @@ const ListDetails = (props: Props) => {
354360
return (
355361
<StopPropagation>
356362
<div className="value-table-actions">
357-
<EuiToolTip content={!isEditable ? 'Cannot change data in this format' : null}>
363+
<EuiToolTip content={!isEditable ? TEXT_DISABLED_FORMATTER_EDITING : null}>
358364
<EuiButtonIcon
359365
iconType="pencil"
360366
aria-label="Edit element"

tests/e2e/tests/critical-path/browser/formatters.e2e.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ notEditableFormattersSet.forEach(formatter => {
197197
// Hover on disabled button
198198
await t.hover(editBtn);
199199
// Verify tooltip content
200-
await t.expect(browserPage.tooltip.textContent).contains('Cannot change data in this format', 'Tooltip has wrong text');
200+
await t.expect(browserPage.tooltip.textContent).contains('Cannot edit the value in this format', 'Tooltip has wrong text');
201201
}
202202
}
203203
});

0 commit comments

Comments
 (0)