diff options
Diffstat (limited to 'app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js')
-rw-r--r-- | app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js b/app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js new file mode 100644 index 00000000000..9dab16984f5 --- /dev/null +++ b/app/assets/javascripts/super_sidebar/components/global_search/command_palette/constants.js @@ -0,0 +1,45 @@ +import { s__, sprintf } from '~/locale'; + +export const COMMAND_HANDLE = '>'; +export const USER_HANDLE = '@'; +export const PROJECT_HANDLE = '&'; +export const ISSUE_HANDLE = '#'; + +export const COMMON_HANDLES = [COMMAND_HANDLE, USER_HANDLE, PROJECT_HANDLE, ISSUE_HANDLE]; +export const SEARCH_OR_COMMAND_MODE_PLACEHOLDER = sprintf( + s__( + 'CommandPalette|Type %{commandHandle} for command, %{userHandle} for user, %{projectHandle} for project, %{issueHandle} for issue or perform generic search...', + ), + { + commandHandle: COMMAND_HANDLE, + userHandle: USER_HANDLE, + issueHandle: ISSUE_HANDLE, + projectHandle: PROJECT_HANDLE, + }, + false, +); + +export const SEARCH_SCOPE_PLACEHOLDER = { + [COMMAND_HANDLE]: s__('CommandPalette|command'), + [USER_HANDLE]: s__('CommandPalette|user (enter at least 3 chars)'), + [PROJECT_HANDLE]: s__('CommandPalette|project (enter at least 3 chars)'), + [ISSUE_HANDLE]: s__('CommandPalette|issue (enter at least 3 chars)'), +}; + +export const SEARCH_SCOPE = { + [USER_HANDLE]: 'user', + [PROJECT_HANDLE]: 'project', + [ISSUE_HANDLE]: 'issue', +}; + +export const GLOBAL_COMMANDS_GROUP_TITLE = s__('CommandPalette|Global Commands'); +export const USERS_GROUP_TITLE = s__('GlobalSearch|Users'); +export const PAGES_GROUP_TITLE = s__('CommandPalette|Pages'); +export const PROJECTS_GROUP_TITLE = s__('GlobalSearch|Projects'); +export const ISSUE_GROUP_TITLE = s__('GlobalSearch|Recent issues'); + +export const GROUP_TITLES = { + [USER_HANDLE]: USERS_GROUP_TITLE, + [PROJECT_HANDLE]: PROJECTS_GROUP_TITLE, + [ISSUE_HANDLE]: ISSUE_GROUP_TITLE, +}; |