Skip to content

Commit 93fb64b

Browse files
Merge pull request #72 from RedisInsight/main
A new release candidate
2 parents 8f3a5de + 0105228 commit 93fb64b

File tree

2 files changed

+23
-7
lines changed

2 files changed

+23
-7
lines changed

redisinsight/ui/src/constants/commands.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ export enum CommandGroup {
6262
AI = 'ai'
6363
}
6464

65+
export enum CommandPrefix {
66+
AI = 'AI',
67+
Graph = 'GRAPH',
68+
TimeSeries = 'TS',
69+
Search = 'FT',
70+
JSON = 'JSON'
71+
}
72+
6573
export enum CommandRediSearch {
6674
Search = 'FT.SEARCH',
6775
Aggregate = 'FT.AGGREGATE',

redisinsight/ui/src/utils/commands.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import { flatten, isArray, isEmpty, reject } from 'lodash'
2-
import { CommandArgsType, CommandGroup, ICommandArg, ICommandArgGenerated } from 'uiSrc/constants'
2+
import {
3+
CommandArgsType,
4+
CommandGroup,
5+
CommandPrefix,
6+
ICommandArg,
7+
ICommandArgGenerated
8+
} from 'uiSrc/constants'
39

410
export const getComplexityShortNotation = (complexity: string[] | string): string => {
511
const value = isArray(complexity) ? complexity.join(' ') : complexity
@@ -62,16 +68,18 @@ export const getDocUrlForCommand = (
6268
commandGroup: CommandGroup | string = CommandGroup.Generic
6369
): string => {
6470
let command = getExternalCommandFormat(commandName)
65-
switch (commandGroup) {
66-
case CommandGroup.Search:
71+
const commandStartsWith = commandName.split('.')[0]
72+
73+
switch (commandStartsWith) {
74+
case CommandPrefix.Search:
6775
return `https://oss.redis.com/redisearch/Commands/#${command}`
68-
case CommandGroup.JSON:
76+
case CommandPrefix.JSON:
6977
return `https://oss.redis.com/redisjson/commands/#${command}`
70-
case CommandGroup.TimeSeries:
78+
case CommandPrefix.TimeSeries:
7179
return `https://oss.redis.com/redistimeseries/commands/#${command}`
72-
case CommandGroup.Graph:
80+
case CommandPrefix.Graph:
7381
return `https://oss.redis.com/redisgraph/commands/#${command}`
74-
case CommandGroup.AI:
82+
case CommandPrefix.AI:
7583
return `https://oss.redis.com/redisai/commands/#${command}`
7684
default:
7785
command = commandName.replace(/\s+/g, '-').toLowerCase()

0 commit comments

Comments
 (0)