Skip to content

Commit c229756

Browse files
committed
Merge branch 'main' into fe/feature/RI-3426_Invalid_format_warning
# Conflicts: # redisinsight/ui/src/constants/browser.ts # redisinsight/ui/src/pages/browser/components/hash-details/HashDetails.tsx # redisinsight/ui/src/pages/browser/components/list-details/ListDetails.tsx
2 parents acf2530 + 1c302d4 commit c229756

File tree

7 files changed

+46
-7
lines changed

7 files changed

+46
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,6 @@ vendor
5858

5959
# Parcel
6060
.parcel-cache
61+
62+
# caches
63+
.temp_cache

configs/webpack.config.web.dev.babel.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* https://webpack.js.org/concepts/hot-module-replacement/
66
*/
77

8+
import path from 'path';
89
import webpack from 'webpack';
910
import { merge } from 'webpack-merge';
1011
import ip from 'ip';
@@ -21,6 +22,18 @@ export default merge(commonConfig, {
2122

2223
mode: 'development',
2324

25+
cache: {
26+
type: 'filesystem',
27+
allowCollectingMemory: true,
28+
cacheDirectory: path.resolve(__dirname, '../.temp_cache'),
29+
name: 'webpack',
30+
maxAge: 86_400_000, // 1 day
31+
buildDependencies: {
32+
// This makes all dependencies of this file - build dependencies
33+
config: [__filename],
34+
}
35+
},
36+
2437
devtool: 'source-map',
2538

2639
entry: [

redisinsight/ui/src/constants/browser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ 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+
export const TEXT_DISABLED_FORMATTER_EDITING = 'Cannot edit the value in this format'
78

89
export const TEXT_INVALID_VALUE = {
910
title: 'Value will be saved as Unicode',

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,14 @@ 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_INVALID_VALUE, TEXT_UNPRINTABLE_CHARACTERS } from 'uiSrc/constants'
43+
import {
44+
KeyTypes,
45+
OVER_RENDER_BUFFER_COUNT,
46+
TableCellAlignment,
47+
TEXT_INVALID_VALUE,
48+
TEXT_DISABLED_FORMATTER_EDITING,
49+
TEXT_UNPRINTABLE_CHARACTERS
50+
} from 'uiSrc/constants'
4451
import { getColumnWidth } from 'uiSrc/components/virtual-grid'
4552
import { StopPropagation } from 'uiSrc/components/virtual-table'
4653
import { stringToBuffer } from 'uiSrc/utils/formatters/bufferFormatters'
@@ -414,7 +421,7 @@ const HashDetails = (props: Props) => {
414421
return (
415422
<StopPropagation>
416423
<div className="value-table-actions">
417-
<EuiToolTip content={!isEditable ? 'Cannot change data in this format' : null}>
424+
<EuiToolTip content={!isEditable ? TEXT_DISABLED_FORMATTER_EDITING : null}>
418425
<EuiButtonIcon
419426
iconType="pencil"
420427
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: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,14 @@ 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_INVALID_VALUE, TEXT_UNPRINTABLE_CHARACTERS } from 'uiSrc/constants'
26+
import {
27+
KeyTypes,
28+
OVER_RENDER_BUFFER_COUNT,
29+
TableCellAlignment,
30+
TEXT_INVALID_VALUE,
31+
TEXT_DISABLED_FORMATTER_EDITING,
32+
TEXT_UNPRINTABLE_CHARACTERS
33+
} from 'uiSrc/constants'
2734
import {
2835
bufferToSerializedFormat,
2936
bufferToString,
@@ -360,7 +367,7 @@ const ListDetails = (props: Props) => {
360367
return (
361368
<StopPropagation>
362369
<div className="value-table-actions">
363-
<EuiToolTip content={!isEditable ? 'Cannot change data in this format' : null}>
370+
<EuiToolTip content={!isEditable ? TEXT_DISABLED_FORMATTER_EDITING : null}>
364371
<EuiButtonIcon
365372
iconType="pencil"
366373
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)