|
1 | 1 | 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' |
3 | 9 |
|
4 | 10 | export const getComplexityShortNotation = (complexity: string[] | string): string => {
|
5 | 11 | const value = isArray(complexity) ? complexity.join(' ') : complexity
|
@@ -62,16 +68,18 @@ export const getDocUrlForCommand = (
|
62 | 68 | commandGroup: CommandGroup | string = CommandGroup.Generic
|
63 | 69 | ): string => {
|
64 | 70 | 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: |
67 | 75 | return `https://oss.redis.com/redisearch/Commands/#${command}`
|
68 |
| - case CommandGroup.JSON: |
| 76 | + case CommandPrefix.JSON: |
69 | 77 | return `https://oss.redis.com/redisjson/commands/#${command}`
|
70 |
| - case CommandGroup.TimeSeries: |
| 78 | + case CommandPrefix.TimeSeries: |
71 | 79 | return `https://oss.redis.com/redistimeseries/commands/#${command}`
|
72 |
| - case CommandGroup.Graph: |
| 80 | + case CommandPrefix.Graph: |
73 | 81 | return `https://oss.redis.com/redisgraph/commands/#${command}`
|
74 |
| - case CommandGroup.AI: |
| 82 | + case CommandPrefix.AI: |
75 | 83 | return `https://oss.redis.com/redisai/commands/#${command}`
|
76 | 84 | default:
|
77 | 85 | command = commandName.replace(/\s+/g, '-').toLowerCase()
|
|
0 commit comments