Skip to content

Commit 8606358

Browse files
committed
Merge branch 'main' into feature/RI-4141_Data_decompressors
# Conflicts: # redisinsight/ui/src/constants/keys.ts # redisinsight/ui/src/pages/browser/components/zset-details/ZSetDetails.tsx
2 parents b7f95ef + 9aea5cd commit 8606358

File tree

72 files changed

+3264
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+3264
-347
lines changed

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ export default merge(commonConfig, {
2525
target: 'web',
2626
entry: ['regenerator-runtime/runtime', './index.tsx'],
2727
output: {
28-
filename: 'js/bundle.[fullhash].min.js',
28+
filename: 'js/bundle.[name].min.js',
2929
path: resolve(__dirname, '../redisinsight/ui/dist'),
3030
publicPath: '/',
31+
chunkFilename: '[id].[chunkhash].js'
3132
},
3233
optimization: {
3334
minimize: true,
@@ -37,6 +38,34 @@ export default merge(commonConfig, {
3738
}),
3839
new CssMinimizerPlugin(),
3940
],
41+
runtimeChunk: 'single',
42+
splitChunks: {
43+
chunks: 'all',
44+
maxInitialRequests: Infinity,
45+
minSize: 0,
46+
cacheGroups: {
47+
reactVendor: {
48+
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
49+
name: "reactVendor"
50+
},
51+
elasticVendor: {
52+
test: /[\\/]node_modules[\\/](@elastic)[\\/]/,
53+
name: "elasticVendor"
54+
},
55+
monacoVendor: {
56+
test: /[\\/]node_modules[\\/](monaco-editor)[\\/]/,
57+
name: "monacoVendor"
58+
},
59+
utilityVendor: {
60+
test: /[\\/]node_modules[\\/](lodash)[\\/]/,
61+
name: "utilityVendor"
62+
},
63+
vendor: {
64+
test: /[\\/]node_modules[\\/](!@elastic)(!monaco-editor)(!lodash)[\\/]/,
65+
name: "vendor"
66+
},
67+
},
68+
},
4069
},
4170
plugins: [
4271
new MiniCssExtractPlugin({

redisinsight/about-panel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const ICON_PATH = app.isPackaged
77

88
export default {
99
applicationName: 'RedisInsight-v2',
10-
applicationVersion: app.getVersion() || '2.2.0',
10+
applicationVersion: app.getVersion() || '2.20.0',
1111
copyright: `Copyright © ${new Date().getFullYear()} Redis Ltd.`,
1212
iconPath: ICON_PATH,
1313
};

redisinsight/api/config/default.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default {
5454
tlsKey: process.env.SERVER_TLS_KEY,
5555
staticContent: !!process.env.SERVER_STATIC_CONTENT || false,
5656
buildType: process.env.BUILD_TYPE || 'ELECTRON',
57-
appVersion: process.env.APP_VERSION || '2.0.0',
57+
appVersion: process.env.APP_VERSION || '2.20.0',
5858
requestTimeout: parseInt(process.env.REQUEST_TIMEOUT, 10) || 25000,
5959
excludeRoutes: [],
6060
excludeAuthRoutes: [],

redisinsight/api/config/swagger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const SWAGGER_CONFIG: Omit<OpenAPIObject, 'paths'> = {
55
info: {
66
title: 'RedisInsight Backend API',
77
description: 'RedisInsight Backend API',
8-
version: '2.0.0',
8+
version: '2.20.0',
99
},
1010
tags: [],
1111
};

redisinsight/api/src/modules/database/database.analytics.spec.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ describe('DatabaseAnalytics', () => {
190190
expect(sendEventSpy).toHaveBeenCalledWith(
191191
TelemetryEvents.RedisInstanceEditedByUser,
192192
{
193-
port: cur.port,
194193
databaseId: cur.id,
195194
connectionType: cur.connectionType,
196195
provider: HostingProvider.RE_CLUSTER,
@@ -201,7 +200,6 @@ describe('DatabaseAnalytics', () => {
201200
useSSH: 'disabled',
202201
timeout: mockDatabaseWithTlsAuth.timeout / 1_000, // milliseconds to seconds
203202
previousValues: {
204-
port: prev.port,
205203
connectionType: prev.connectionType,
206204
provider: prev.provider,
207205
useTLS: 'enabled',
@@ -227,7 +225,6 @@ describe('DatabaseAnalytics', () => {
227225
expect(sendEventSpy).toHaveBeenCalledWith(
228226
TelemetryEvents.RedisInstanceEditedByUser,
229227
{
230-
port: cur.port,
231228
databaseId: cur.id,
232229
connectionType: cur.connectionType,
233230
provider: HostingProvider.RE_CLUSTER,
@@ -238,7 +235,6 @@ describe('DatabaseAnalytics', () => {
238235
useSSH: 'disabled',
239236
timeout: mockDatabaseWithTlsAuth.timeout / 1_000, // milliseconds to seconds
240237
previousValues: {
241-
port: prev.port,
242238
connectionType: prev.connectionType,
243239
provider: prev.provider,
244240
useTLS: 'disabled',

redisinsight/api/src/modules/database/database.analytics.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ export class DatabaseAnalytics extends TelemetryBaseService {
8888
this.sendEvent(
8989
TelemetryEvents.RedisInstanceEditedByUser,
9090
{
91-
port: cur.port,
9291
databaseId: cur.id,
9392
connectionType: cur.connectionType,
9493
provider: cur.provider,
@@ -101,7 +100,6 @@ export class DatabaseAnalytics extends TelemetryBaseService {
101100
useSSH: cur?.ssh ? 'enabled' : 'disabled',
102101
timeout: cur?.timeout / 1_000, // milliseconds to seconds
103102
previousValues: {
104-
port: prev.port,
105103
connectionType: prev.connectionType,
106104
provider: prev.provider,
107105
useTLS: prev.tls ? 'enabled' : 'disabled',

redisinsight/api/test/api/database/GET-databases-id-info.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe(`GET /databases/:id/info`, () => {
6565

6666

6767
describe('ACL', () => {
68-
requirements('rte.acl', 'rte.type=STANDALONE', '!rte.re');
68+
requirements('rte.acl', 'rte.type=STANDALONE', '!rte.re', '!rte.sharedData');
6969
before(async () => rte.data.setAclUserRules('~* +@all'));
7070
beforeEach(rte.data.truncate);
7171

redisinsight/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "redisinsight",
33
"productName": "RedisInsight",
44
"private": true,
5-
"version": "2.18.0",
5+
"version": "2.20.0",
66
"description": "RedisInsight",
77
"main": "./main.prod.js",
88
"author": {

redisinsight/ui/src/components/analytics-tabs/constants.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ export const analyticsViewTabs: AnalyticsTabs[] = [
1414
{
1515
id: AnalyticsViewTab.ClusterDetails,
1616
label: 'Overview',
17-
onboard: ONBOARDING_FEATURES.ANALYTICS_OVERVIEW
17+
onboard: ONBOARDING_FEATURES?.ANALYTICS_OVERVIEW
1818
},
1919
{
2020
id: AnalyticsViewTab.DatabaseAnalysis,
2121
label: 'Database Analysis',
22-
onboard: ONBOARDING_FEATURES.ANALYTICS_DATABASE_ANALYSIS
22+
onboard: ONBOARDING_FEATURES?.ANALYTICS_DATABASE_ANALYSIS
2323
},
2424
{
2525
id: AnalyticsViewTab.SlowLog,
2626
label: 'Slow Log',
27-
onboard: ONBOARDING_FEATURES.ANALYTICS_SLOW_LOG
27+
onboard: ONBOARDING_FEATURES?.ANALYTICS_SLOW_LOG
2828
},
2929
]
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import React from 'react'
2+
import { render, screen, fireEvent } from 'uiSrc/utils/test-utils'
3+
4+
import CodeBlock from './CodeBlock'
5+
6+
const originalClipboard = { ...global.navigator.clipboard }
7+
describe('CodeBlock', () => {
8+
beforeEach(() => {
9+
// @ts-ignore
10+
global.navigator.clipboard = {
11+
writeText: jest.fn(),
12+
}
13+
})
14+
15+
afterEach(() => {
16+
jest.resetAllMocks()
17+
// @ts-ignore
18+
global.navigator.clipboard = originalClipboard
19+
})
20+
21+
it('should render', () => {
22+
expect(render(<CodeBlock>text</CodeBlock>)).toBeTruthy()
23+
})
24+
25+
it('should render proper content', () => {
26+
render(<CodeBlock data-testid="code">text</CodeBlock>)
27+
expect(screen.getByTestId('code')).toHaveTextContent('text')
28+
})
29+
30+
it('should not render copy button by default', () => {
31+
render(<CodeBlock data-testid="code">text</CodeBlock>)
32+
expect(screen.queryByTestId('copy-code-btn')).not.toBeInTheDocument()
33+
})
34+
35+
it('should copy proper text', () => {
36+
render(<CodeBlock data-testid="code" isCopyable>text</CodeBlock>)
37+
fireEvent.click(screen.getByTestId('copy-code-btn'))
38+
expect(navigator.clipboard.writeText).toHaveBeenCalledWith('text')
39+
})
40+
41+
it('should copy proper text when children is ReactNode', () => {
42+
render(<CodeBlock data-testid="code" isCopyable><span>text2</span></CodeBlock>)
43+
fireEvent.click(screen.getByTestId('copy-code-btn'))
44+
expect(navigator.clipboard.writeText).toHaveBeenCalledWith('text2')
45+
})
46+
})

0 commit comments

Comments
 (0)