Skip to content

Commit 7baebf7

Browse files
committed
* #RIVS-261 - [Regression] Error when trying to fetch create-redis.json is displayed after removing vs code folder
* #RIVS-262 - [Regression] Stage build from CI not connected to amplitude account * #RIVS-263 - [Regression] AppVersion in telemetry is 2.54.0 * #RIVS-265 - [Regression] Wrong links for welcome page and release notes * #RIVS-275 - [Regression] Tooltip is displayed for add key button * #RIVS-277 - [Regression] Inputs are not visible in white theme
1 parent 356ceb7 commit 7baebf7

File tree

20 files changed

+121
-47
lines changed

20 files changed

+121
-47
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
NODE_ENV='production'
66
RI_BASE_APP_URL='http://localhost'
77
RI_APP_PORT=5541
8+
RI_APP_VERSION='0.0.1'
89
RI_APP_PREFIX='api'
910
RI_APP_FOLDER_NAME='.redis-for-vscode'
1011
RI_CDN_PATH='https://s3.amazonaws.com/redisinsight.download/public/releases/2.54.1/web-mini'

l10n/bundle.l10n.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@
5252
"Score": "Score",
5353
"Use CLI to edit the score": "Use CLI to edit the score",
5454
"Enter Score": "Enter Score",
55+
"This data type is not currently supported.": "This data type is not currently supported.",
56+
"We are constantly working to launch support for more data types. If you have any ideas or suggestions, please ": "We are constantly working to launch support for more data types. If you have any ideas or suggestions, please ",
57+
"contact us.": "contact us.",
5558
"Edit value": "Edit value",
5659
"Empty": "Empty",
5760
"loading...": "loading...",
@@ -312,4 +315,4 @@
312315
"Add": "Add",
313316
"Release Notes": "Release Notes",
314317
"Redis for VS Code extension updated to {0}.": "Redis for VS Code extension updated to {0}."
315-
}
318+
}

src/webviews/src/actions/selectKeyAction.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { VscodeMessageAction } from 'uiSrc/constants'
22
import { PostMessage } from 'uiSrc/interfaces'
3-
import { fetchDatabaseOverview, fetchKeyInfo, useDatabasesStore, useSelectedKeyStore } from 'uiSrc/store'
3+
import { fetchDatabaseOverview, fetchKeyInfo, setInitialStateByType, useDatabasesStore, useSelectedKeyStore } from 'uiSrc/store'
44
import { TelemetryEvent, isEqualBuffers, sendEventTelemetry } from 'uiSrc/utils'
55

66
export const selectKeyAction = (message: PostMessage) => {
@@ -22,6 +22,7 @@ export const selectKeyAction = (message: PostMessage) => {
2222
window.ri.database = database
2323

2424
fetchKeyInfo({ key }, true, ({ type: keyType, length }) => {
25+
setInitialStateByType(keyType!)
2526
fetchDatabaseOverview()
2627
useDatabasesStore.getState().setConnectedDatabase(database)
2728
sendEventTelemetry({

src/webviews/src/components/ContentEditable.tsx

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import ReactContentEditable, { Props } from 'react-contenteditable'
3-
import { parsePastedText } from 'uiSrc/utils/formatters'
3+
import { parsePastedText } from 'uiSrc/utils'
44

55
const useRefCallback = <T extends any[]>(
66
value: ((...args: T) => void) | undefined,
@@ -17,20 +17,28 @@ const useRefCallback = <T extends any[]>(
1717
}, [])
1818
}
1919

20+
// remove line break and encode angular brackets
21+
export const parseContentEditableChangeHtml = (text: string = '') => text.replace(/&nbsp;/gi, ' ')
22+
23+
export const parseMultilineContentEditableChangeHtml = (text: string = '') =>
24+
parseContentEditableChangeHtml(text).replace(/<br>/gi, ' ')
25+
26+
export const parseContentEditableHtml = (text: string = '') =>
27+
text
28+
.replace(/&nbsp;/gi, ' ')
29+
.replace(/&lt;/gi, '<')
30+
.replace(/&gt;/gi, '>')
31+
.replace(/&amp;/gi, '&')
32+
2033
const onPaste = (e: React.ClipboardEvent) => {
2134
e.preventDefault()
22-
const clipboardData = e.clipboardData || window.Clipboard
35+
36+
const clipboardData = e.clipboardData || window.clipboardData || e.originalEvent?.clipboardData
2337
const text = clipboardData.getData('text/plain') as string
2438

25-
const selection = window.getSelection()
26-
const range = selection?.getRangeAt(0)
27-
if (range && selection) {
28-
range.deleteContents()
29-
range.insertNode(document.createTextNode(parsePastedText(text)))
30-
range.collapse(false)
31-
selection.removeAllRanges()
32-
selection.addRange(range as Range)
33-
}
39+
setTimeout(() => {
40+
document.execCommand('insertText', false, parsePastedText(text))
41+
}, 0)
3442
}
3543

3644
export function ContentEditable({

src/webviews/src/components/no-keys-message/NoKeysMessage.tsx

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { Nullable } from 'uiSrc/interfaces'
77
import { vscodeApi } from 'uiSrc/services'
88
import { Database } from 'uiSrc/store'
99
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/utils'
10-
import { Tooltip } from 'uiSrc/ui'
1110

1211
import styles from './styles.module.scss'
1312

@@ -52,16 +51,14 @@ export const NoKeysMessage: FC<Props> = (props) => {
5251
return (
5352
<div className="flex justify-between">
5453
<div>{l10n.t('Keys are the foundation of Redis.')}</div>
55-
<Tooltip content={l10n.t('Add key')}>
56-
<VSCodeButton
57-
appearance="primary"
58-
data-testid="add-key-from-tree"
59-
className={styles.addKey}
60-
onClick={handleAddKey}
61-
>
62-
{l10n.t('Add key')}
63-
</VSCodeButton>
64-
</Tooltip>
54+
<VSCodeButton
55+
appearance="primary"
56+
data-testid="add-key-from-tree"
57+
className={styles.addKey}
58+
onClick={handleAddKey}
59+
>
60+
{l10n.t('Add key')}
61+
</VSCodeButton>
6562
</div>
6663
)
6764
}

src/webviews/src/constants/external/links.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ export const EXTERNAL_LINKS = {
22
riAppDownload: 'https://redis.io/insight/',
33
jsonModule: 'https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/json/',
44
tryFree: 'https://redis.io/try-free/',
5+
githubIssues: 'https://github.com/RedisInsight/Redis-for-VS-Code/issues',
56
}
67

78
export const UTM_CAMPAIGNS = {

src/webviews/src/modules/key-details/components/dynamic-type-details/DynamicTypeDetails.spec.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ const DynamicTypeDetailsTypeTests: any[] = [
1212
[KeyTypes.ZSet, 'zset-details'],
1313
[KeyTypes.List, 'list-details'],
1414
[KeyTypes.Set, 'set-details'],
15+
[KeyTypes.ReJSON, 'json-details'],
16+
[KeyTypes.Stream, 'unsupported-type-details'],
1517
// [KeyTypes.Stream, 'stream-details'],
16-
// [KeyTypes.ReJSON, 'json-details'],
1718
// [ModulesKeyTypes.Graph, 'modules-type-details'],
1819
// [ModulesKeyTypes.TimeSeries, 'modules-type-details'],
19-
// ['123', 'unsupported-type-details'],
20+
['123', 'unsupported-type-details'],
2021
]
2122

2223
describe('DynamicTypeDetails', () => {
@@ -29,7 +30,7 @@ describe('DynamicTypeDetails', () => {
2930
const { queryByTestId } = render(<DynamicTypeDetails
3031
{...instance(mockedProps)}
3132
keyType={type}
32-
/>)
33+
/>, { withRouter: true })
3334

3435
expect(queryByTestId(testId)).toBeInTheDocument()
3536
})

src/webviews/src/modules/key-details/components/dynamic-type-details/DynamicTypeDetails.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react'
2-
import { KeyTypes } from 'uiSrc/constants'
2+
import { KeyTypes, ModulesKeyTypes } from 'uiSrc/constants'
33
import { KeyDetailsHeaderProps } from 'uiSrc/modules'
44
// import ModulesTypeDetails from '../modules-type-details/ModulesTypeDetails'
5-
// import UnsupportedTypeDetails from '../unsupported-type-details/UnsupportedTypeDetails'
5+
import { UnsupportedTypeDetails } from '../unsupported-type-details'
66
import { StringDetails } from '../string-details'
77
import { HashDetails } from '../hash-details'
88
import { ZSetDetails } from '../zset-details'
99
import { ListDetails } from '../list-details'
10-
import { SetDetails } from '../set-details/SetDetails'
10+
import { SetDetails } from '../set-details'
1111
import { RejsonDetailsWrapper } from '../rejson-details'
1212
// import { StreamDetails } from '../stream-details'
1313

@@ -26,6 +26,7 @@ const DynamicTypeDetails = (props: Props) => {
2626
[KeyTypes.List]: <ListDetails {...props} />,
2727
[KeyTypes.Set]: <SetDetails {...props} />,
2828
[KeyTypes.ReJSON]: <RejsonDetailsWrapper {...props} />,
29+
[KeyTypes.Stream]: <UnsupportedTypeDetails />,
2930
// [KeyTypes.Stream]: <StreamDetails {...props} />,
3031
}
3132

@@ -40,10 +41,10 @@ const DynamicTypeDetails = (props: Props) => {
4041
// }
4142

4243
// // Unsupported key type
43-
// if (!(Object.values(KeyTypes).includes(selectedKeyType as KeyTypes))
44-
// && !(Object.values(ModulesKeyTypes).includes(selectedKeyType as ModulesKeyTypes))) {
45-
// return <UnsupportedTypeDetails />
46-
// }
44+
if (!(Object.values(KeyTypes).includes(selectedKeyType as KeyTypes))
45+
&& !(Object.values(ModulesKeyTypes).includes(selectedKeyType as ModulesKeyTypes))) {
46+
return <UnsupportedTypeDetails />
47+
}
4748

4849
return null
4950
}

src/webviews/src/modules/key-details/components/hash-details/hash-details-table/HashDetailsTable.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
bufferToString,
1515
createDeleteFieldHeader,
1616
createDeleteFieldMessage,
17-
formatLongName,
1817
formattingBuffer,
1918
isEqualBuffers,
2019
isFormatEditable,
@@ -35,7 +34,6 @@ import {
3534
OVER_RENDER_BUFFER_COUNT,
3635
TableCellAlignment,
3736
TEXT_DISABLED_FORMATTER_EDITING,
38-
TEXT_FAILED_CONVENT_FORMATTER,
3937
TEXT_UNPRINTABLE_CHARACTERS,
4038
SCAN_COUNT_DEFAULT,
4139
helpTexts,
@@ -312,7 +310,7 @@ const HashDetailsTable = (props: Props) => {
312310
const decompressedItem = fieldItem
313311
const field = bufferToString(fieldItem) || ''
314312
// Better to cut the long string, because it could affect virtual scroll performance
315-
const { value } = formattingBuffer(decompressedItem, viewFormatProp, { expanded })
313+
const { value } = formattingBuffer(decompressedItem, viewFormatProp, { expanded, skipVector: true })
316314

317315
return (
318316
<div className="max-w-full whitespace-break-spaces">

src/webviews/src/modules/key-details/components/list-details/list-details-table/ListDetailsTable.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ const ListDetailsTable = (props: Props) => {
284284
stringToSerializedBufferFormat(viewFormat, value),
285285
viewFormat,
286286
)?.isValid}
287-
onEdit={(isEditing) => handleEditElement(rowIndex, isEditing)}
287+
onEdit={(isEditing) => handleEditElement(index, isEditing)}
288288
editToolTipContent={!isEditable ? editTooltipContent : null}
289289
onUpdateTextAreaHeight={() => clearCache(rowIndex)}
290-
field={rowIndex.toString()}
290+
field={index.toString()}
291291
testIdPrefix="list"
292292
>
293293
<div className="max-w-full whitespace-break-spaces">

0 commit comments

Comments
 (0)