Skip to content

Commit 8fca0c5

Browse files
Revert "#RI-2509-add wb group mode (#1122)" (#1123)
This reverts commit 6fada36.
1 parent 6fada36 commit 8fca0c5

File tree

22 files changed

+33
-307
lines changed

22 files changed

+33
-307
lines changed

redisinsight/api/migration/1662523634724-workbench-summary.ts

Lines changed: 0 additions & 24 deletions
This file was deleted.

redisinsight/api/migration/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import { sni1650278664000 } from "./1650278664000-sni";
1616
import { notification1655821010349 } from './1655821010349-notification';
1717
import { notificationCategory1659687030433 } from './1659687030433-notification-category';
1818
import { workbenchMode1660664717573 } from './1660664717573-workbench-mode';
19-
import { workbenchSummary1662523634724 } from './1662523634724-workbench-summary';
2019

2120
export default [
2221
initialMigration1614164490968,
@@ -37,5 +36,4 @@ export default [
3736
notification1655821010349,
3837
notificationCategory1659687030433,
3938
workbenchMode1660664717573,
40-
workbenchSummary1662523634724,
4139
];

redisinsight/api/src/modules/workbench/dto/create-command-execution.dto.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
22
import {
3-
IsBoolean, IsEnum, IsNotEmpty, IsNotEmptyObject, IsOptional, IsString, ValidateNested,
3+
IsEnum, IsNotEmpty, IsNotEmptyObject, IsOptional, IsString, ValidateNested,
44
} from 'class-validator';
55
import { Type } from 'class-transformer';
66
import { ClusterSingleNodeOptions } from 'src/modules/cli/dto/cli.dto';
@@ -38,14 +38,6 @@ export class CreateCommandExecutionDto {
3838
})
3939
mode?: RunQueryMode = RunQueryMode.ASCII;
4040

41-
@ApiPropertyOptional({
42-
description: 'Workbench group mode',
43-
default: false,
44-
})
45-
@IsOptional()
46-
@IsBoolean()
47-
isGroupMode?: boolean;
48-
4941
@ApiPropertyOptional({
5042
description: 'Execute command for nodes with defined role',
5143
default: ClusterNodeRole.All,

redisinsight/api/src/modules/workbench/dto/create-command-executions.dto.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
22
import {
3-
IsBoolean, IsEnum, IsArray, IsNotEmptyObject, IsOptional, ArrayNotEmpty, ValidateNested,
3+
IsEnum, IsArray, IsNotEmptyObject, IsOptional, ArrayNotEmpty, ValidateNested,
44
} from 'class-validator';
55
import { Type } from 'class-transformer';
66
import { ClusterSingleNodeOptions } from 'src/modules/cli/dto/cli.dto';
@@ -29,14 +29,6 @@ export class CreateCommandExecutionsDto {
2929
})
3030
mode?: RunQueryMode = RunQueryMode.ASCII;
3131

32-
@ApiPropertyOptional({
33-
description: 'Workbench group mode',
34-
default: false,
35-
})
36-
@IsOptional()
37-
@IsBoolean()
38-
isGroupMode?: boolean;
39-
4032
@ApiPropertyOptional({
4133
description: 'Execute command for nodes with defined role',
4234
default: ClusterNodeRole.All,

redisinsight/api/src/modules/workbench/entities/command-execution.entity.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ export class CommandExecutionEntity {
4343
@Column({ nullable: true })
4444
role?: string;
4545

46-
@Column({ nullable: true })
47-
summary?: string;
48-
4946
@Column({ nullable: true })
5047
@Transform((object) => JSON.stringify(object), { toClassOnly: true })
5148
@Transform((string) => {

redisinsight/api/src/modules/workbench/models/command-execution.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ export class CommandExecution {
3434
@Expose()
3535
mode?: RunQueryMode = RunQueryMode.ASCII;
3636

37-
@ApiPropertyOptional({
38-
description: 'Workbench executions summary',
39-
type: String,
40-
})
41-
@Expose()
42-
summary?: string;
43-
4437
@ApiProperty({
4538
description: 'Command execution result',
4639
type: () => CommandExecutionResult,

redisinsight/api/src/modules/workbench/providers/command-execution.provider.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,7 @@ export class CommandExecutionProvider {
8181
const entities = await this.commandExecutionRepository
8282
.createQueryBuilder('e')
8383
.where({ databaseId })
84-
.select([
85-
'e.id',
86-
'e.command',
87-
'e.databaseId',
88-
'e.createdAt',
89-
'e.encryption',
90-
'e.role',
91-
'e.nodeOptions',
92-
'e.mode',
93-
'e.summary',
94-
])
84+
.select(['e.id', 'e.command', 'e.databaseId', 'e.createdAt', 'e.encryption', 'e.role', 'e.nodeOptions', 'e.mode'])
9585
.orderBy('e.createdAt', 'DESC')
9686
.limit(WORKBENCH_CONFIG.maxItemsPerDb)
9787
.getMany();

redisinsight/api/src/modules/workbench/workbench.service.ts

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -52,57 +52,6 @@ export class WorkbenchService {
5252
return commandExecution;
5353
}
5454

55-
/**
56-
* Send redis command from workbench and save history
57-
*
58-
* @param clientOptions
59-
* @param dto
60-
*/
61-
async createCommandsExecution(
62-
clientOptions: IFindRedisClientInstanceByOptions,
63-
dto: Partial<CreateCommandExecutionDto>,
64-
commands: string[],
65-
): Promise<Partial<CommandExecution>> {
66-
const commandExecution: Partial<CommandExecution> = {
67-
...dto,
68-
databaseId: clientOptions.instanceId,
69-
};
70-
71-
const executionResults = await Promise.all(commands.map(async (singleCommand) => {
72-
const command = multilineCommandToOneLine(singleCommand);
73-
const deprecatedCommand = this.findCommandInBlackList(command);
74-
if (deprecatedCommand) {
75-
return {
76-
[command]: [
77-
{
78-
response: ERROR_MESSAGES.WORKBENCH_COMMAND_NOT_SUPPORTED(deprecatedCommand.toUpperCase()),
79-
status: CommandExecutionStatus.Fail,
80-
},
81-
],
82-
};
83-
}
84-
return ({ [command]: await this.commandsExecutor.sendCommand(clientOptions, { ...dto, command }) });
85-
}));
86-
87-
const successCommands = executionResults.filter(
88-
(command) => Object.values(command)[0][0].status === CommandExecutionStatus.Success,
89-
);
90-
const failedCommands = executionResults.filter(
91-
(command) => Object.values(command)[0][0].status === CommandExecutionStatus.Fail,
92-
);
93-
94-
commandExecution.summary = `
95-
${executionResults.length} Commands - ${successCommands.length} success, ${failedCommands.length} errors
96-
`;
97-
commandExecution.command = commands.join('\r\n');
98-
commandExecution.result = [{
99-
status: CommandExecutionStatus.Success,
100-
response: executionResults,
101-
}];
102-
103-
return commandExecution;
104-
}
105-
10655
/**
10756
* Send redis command from workbench and save history
10857
*
@@ -113,11 +62,6 @@ export class WorkbenchService {
11362
clientOptions: IFindRedisClientInstanceByOptions,
11463
dto: CreateCommandExecutionsDto,
11564
): Promise<CommandExecution[]> {
116-
if (dto.isGroupMode) {
117-
return this.commandExecutionProvider.createMany(
118-
[await this.createCommandsExecution(clientOptions, dto, dto.commands)],
119-
);
120-
}
12165
// todo: rework to support pipeline
12266
// prepare and execute commands
12367
const commandExecutions = await Promise.all(

redisinsight/ui/src/assets/img/icons/group_mode.svg

Lines changed: 0 additions & 6 deletions
This file was deleted.

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export interface Props {
3030
result: Maybe<CommandExecutionResult[]>
3131
activeMode: RunQueryMode
3232
mode: RunQueryMode
33-
summary?: string
3433
createdAt?: Date
3534
loading?: boolean
3635
onQueryDelete: () => void
@@ -48,7 +47,6 @@ const QueryCard = (props: Props) => {
4847
result,
4948
activeMode,
5049
mode,
51-
summary,
5250
isOpen,
5351
createdAt,
5452
onQueryOpen,
@@ -148,7 +146,6 @@ const QueryCard = (props: Props) => {
148146
selectedValue={selectedViewValue}
149147
activeMode={activeMode}
150148
mode={mode}
151-
summary={summary}
152149
toggleOpen={toggleOpen}
153150
toggleFullScreen={toggleFullScreen}
154151
setSelectedValue={changeViewTypeSelected}
@@ -182,7 +179,6 @@ const QueryCard = (props: Props) => {
182179
<QueryCardCliResult
183180
loading={loading}
184181
query={command}
185-
summary={summary}
186182
result={result}
187183
/>
188184
)}

0 commit comments

Comments
 (0)