Skip to content

Commit 683b91d

Browse files
Merge branch 'main' of https://github.com/RedisInsight/RedisInsight into bugfix/RI-3631_key_list_loading
2 parents 84a09da + 9936d50 commit 683b91d

File tree

51 files changed

+1788
-438
lines changed

Some content is hidden

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

51 files changed

+1788
-438
lines changed

jest.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ module.exports = {
55
testURL: 'http://localhost/',
66
runner: 'groups',
77
moduleNameMapper: {
8-
'\\.(jpg|jpeg|png|ico|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
8+
'\\.(jpg|jpeg|png|ico|gif|eot|otf|webp|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
99
'<rootDir>/redisinsight/__mocks__/fileMock.js',
10+
'\\.svg': '<rootDir>/redisinsight/__mocks__/svg.js',
1011
'\\.(css|less|sass|scss)$': 'identity-obj-proxy',
1112
'uiSrc/(.*)': '<rootDir>/redisinsight/ui/src/$1',
1213
'monaco-editor': '<rootDir>/redisinsight/__mocks__/monacoMock.js',

redisinsight/__mocks__/svg.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export default 'SvgrURL'
2+
export const ReactComponent = 'div'

redisinsight/api/src/app.module.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
} from '@nestjs/common';
55
import { TypeOrmModule } from '@nestjs/typeorm';
66
import { ServeStaticModule } from '@nestjs/serve-static';
7-
import { EventEmitterModule } from '@nestjs/event-emitter';
87
import { RouterModule } from 'nest-router';
98
import { join } from 'path';
109
import config from 'src/utils/config';
@@ -54,7 +53,6 @@ const PATH_CONFIG = config.get('dir_path');
5453
BulkActionsModule,
5554
ClusterMonitorModule,
5655
DatabaseAnalysisModule,
57-
EventEmitterModule.forRoot(),
5856
...(SERVER_CONFIG.staticContent
5957
? [
6058
ServeStaticModule.forRoot({

redisinsight/api/src/modules/core/core.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { KeytarEncryptionStrategy } from 'src/modules/core/encryption/strategies
88
import { AgreementsEntity } from 'src/modules/core/models/agreements.entity';
99
import { ServerEntity } from 'src/modules/core/models/server.entity';
1010
import { SettingsEntity } from 'src/modules/core/models/settings.entity';
11+
import { EventEmitterModule } from '@nestjs/event-emitter';
1112
import settingsOnPremiseFactory from './providers/settings-on-premise';
1213
import serverOnPremiseFactory from './providers/server-on-premise';
1314
import { CaCertBusinessService } from './services/certificates/ca-cert-business/ca-cert-business.service';
@@ -31,6 +32,7 @@ export class CoreModule {
3132
return {
3233
module: CoreModule,
3334
imports: [
35+
EventEmitterModule.forRoot(),
3436
TypeOrmModule.forFeature([
3537
ServerEntity,
3638
SettingsEntity,

redisinsight/api/src/modules/statics-management/statics-management.module.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,27 @@ const CONTENT_CONFIG = config.get('content');
3434
fallthrough: false,
3535
},
3636
}),
37+
ServeStaticModule.forRoot({
38+
serveRoot: SERVER_CONFIG.defaultPluginsUri,
39+
rootPath: join(PATH_CONFIG.defaultPlugins),
40+
serveStaticOptions: {
41+
fallthrough: false,
42+
},
43+
}),
44+
ServeStaticModule.forRoot({
45+
serveRoot: SERVER_CONFIG.customPluginsUri,
46+
rootPath: join(PATH_CONFIG.customPlugins),
47+
serveStaticOptions: {
48+
fallthrough: false,
49+
},
50+
}),
51+
ServeStaticModule.forRoot({
52+
serveRoot: SERVER_CONFIG.pluginsAssetsUri,
53+
rootPath: join(PATH_CONFIG.pluginsAssets),
54+
serveStaticOptions: {
55+
fallthrough: false,
56+
},
57+
}),
3758
],
3859
providers: [
3960
{

redisinsight/ui/src/components/query-card/QueryCard.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { RunQueryMode, ResultsMode, ResultsSummary } from 'uiSrc/slices/interfac
99
import {
1010
getWBQueryType,
1111
getVisualizationsByCommand,
12-
Maybe
12+
Maybe,
13+
isGroupMode
1314
} from 'uiSrc/utils'
1415
import { appPluginsSelector } from 'uiSrc/slices/app/plugins'
1516
import { CommandExecutionResult, IPluginVisualization } from 'uiSrc/slices/interfaces'
@@ -32,7 +33,7 @@ export interface Props {
3233
mode?: RunQueryMode
3334
activeResultsMode?: ResultsMode
3435
resultsMode?: ResultsMode
35-
emptyCommand: boolean
36+
emptyCommand?: boolean
3637
summary?: ResultsSummary
3738
createdAt?: Date
3839
loading?: boolean
@@ -179,7 +180,7 @@ const QueryCard = (props: Props) => {
179180
? <QueryCardCommonResult loading={loading} result={commonError} />
180181
: (
181182
<>
182-
{resultsMode === ResultsMode.GroupMode && (
183+
{isGroupMode(resultsMode) && (
183184
<QueryCardCliResultWrapper
184185
loading={loading}
185186
query={command}

redisinsight/ui/src/components/query-card/QueryCardCliDefaultResult/styles.module.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
display: flex;
99
flex-grow: 1;
1010
height: 100%;
11+
overflow: hidden !important;
1112
}
1213

1314
.listContent {

redisinsight/ui/src/components/query-card/QueryCardCliResultWrapper/QueryCardCliResultWrapper.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import { isArray } from 'lodash'
55

66
import { CommandExecutionResult } from 'uiSrc/slices/interfaces'
77
import { ResultsMode } from 'uiSrc/slices/interfaces/workbench'
8-
import { formatToText, Maybe } from 'uiSrc/utils'
8+
import { cliParseTextResponse, formatToText, isGroupMode, Maybe } from 'uiSrc/utils'
99

10+
import { CommandExecutionStatus } from 'uiSrc/slices/interfaces/cli'
1011
import QueryCardCliDefaultResult from '../QueryCardCliDefaultResult'
1112
import QueryCardCliGroupResult from '../QueryCardCliGroupResult'
1213
import styles from './styles.module.scss'
@@ -27,19 +28,23 @@ const QueryCardCliResultWrapper = (props: Props) => {
2728
return (
2829
<div className={cx('queryResultsContainer', styles.container)}>
2930
{!loading && (
30-
<div data-testid="query-cli-result" style={{ height: '100%' }}>
31+
<div data-testid="query-cli-result" className={cx(styles.content)}>
3132
{isNotStored && (
3233
<EuiText className={styles.alert} data-testid="query-cli-warning">
3334
<EuiIcon type="alert" className={styles.alertIcon} />
3435
The result is too big to be saved. It will be deleted after the application is closed.
3536
</EuiText>
3637
)}
37-
{resultsMode === ResultsMode.GroupMode && isArray(result[0]?.response)
38+
{isGroupMode(resultsMode) && isArray(result[0]?.response)
3839
? <QueryCardCliGroupResult result={result} isFullScreen={isFullScreen} />
3940
: (
4041
<QueryCardCliDefaultResult
4142
isFullScreen={isFullScreen}
42-
items={formatToText(result[0].response || '(nil)', query).split('\n')}
43+
items={
44+
result[0].status === CommandExecutionStatus.Success
45+
? formatToText(result[0].response || '(nil)', query).split('\n')
46+
: [cliParseTextResponse(result[0].response || '(nil)', '', result[0].status)]
47+
}
4348
/>
4449
)}
4550
</div>

redisinsight/ui/src/components/query-card/QueryCardCliResultWrapper/styles.module.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525
}
2626
}
2727

28+
.content {
29+
display: flex;
30+
flex-direction: column;
31+
height: 100%;
32+
}
33+
2834
.loading {
2935
height: 17px;
3036
max-width: 600px;

redisinsight/ui/src/components/query-card/QueryCardHeader/QueryCardHeader.tsx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ import { useParams } from 'react-router-dom'
1616
import { findIndex } from 'lodash'
1717

1818
import { Theme } from 'uiSrc/constants'
19-
import { getCommandNameFromQuery, getVisualizationsByCommand, truncateText, urlForAsset } from 'uiSrc/utils'
19+
import {
20+
getCommandNameFromQuery,
21+
getVisualizationsByCommand,
22+
isGroupMode,
23+
truncateText,
24+
urlForAsset
25+
} from 'uiSrc/utils'
2026
import { ThemeContext } from 'uiSrc/contexts/themeContext'
2127
import { appPluginsSelector } from 'uiSrc/slices/app/plugins'
2228
import { sendEventTelemetry, TelemetryEvent } from 'uiSrc/telemetry'
@@ -45,7 +51,7 @@ export interface Props {
4551
queryType: WBQueryType
4652
selectedValue: string
4753
loading?: boolean
48-
emptyCommand: boolean
54+
emptyCommand?: boolean
4955
toggleOpen: () => void
5056
toggleFullScreen: () => void
5157
setSelectedValue: (type: WBQueryType, value: string) => void
@@ -68,7 +74,7 @@ const QueryCardHeader = (props: Props) => {
6874
summary,
6975
activeMode,
7076
selectedValue,
71-
emptyCommand,
77+
emptyCommand = false,
7278
setSelectedValue,
7379
onQueryDelete,
7480
onQueryReRun,
@@ -92,7 +98,7 @@ const QueryCardHeader = (props: Props) => {
9298
databaseId: instanceId,
9399
command: getCommandNameFromQuery(query, COMMANDS_SPEC),
94100
rawMode: activeMode === RunQueryMode.Raw,
95-
group: activeResultsMode === ResultsMode.GroupMode,
101+
group: isGroupMode(activeResultsMode),
96102
...additionalData
97103
}
98104
})

0 commit comments

Comments
 (0)