-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconstants.ts
More file actions
119 lines (113 loc) · 3.94 KB
/
constants.ts
File metadata and controls
119 lines (113 loc) · 3.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
* Copyright (c) 2024. Devtron Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DEVTRON_GPT_LINK, DISCORD_LINK, DOCUMENTATION_HOME_PAGE, URLS } from '@Common/Constants'
import { CONTACT_SUPPORT_LINK, OPEN_NEW_TICKET, RAISE_ISSUE, VIEW_ALL_TICKETS } from '@Shared/constants'
import { HelpButtonActionMenuProps, HelpMenuItems, PageHeaderType } from './types'
export const getCommonHelpActionMenuItems = ({
docPath,
}: Pick<PageHeaderType, 'docPath'>): HelpButtonActionMenuProps['options'][number]['items'] => [
...((!window._env_?.K8S_CLIENT
? [
{
id: HelpMenuItems.GETTING_STARTED,
label: 'Getting started',
startIcon: { name: 'ic-path' },
componentType: 'link',
to: `/${URLS.GETTING_STARTED}`,
},
]
: []) satisfies HelpButtonActionMenuProps['options'][number]['items']),
{
id: HelpMenuItems.VIEW_DOCUMENTATION,
label: 'View documentation',
startIcon: { name: 'ic-book-open' },
componentType: 'anchor',
href: `${DOCUMENTATION_HOME_PAGE}${docPath ? `/${docPath}` : ''}`,
},
{
id: HelpMenuItems.DEVTRON_GPT,
label: 'Devtron GPT',
startIcon: { name: 'ic-openai' },
trailingItem: { type: 'icon', config: { name: 'ic-arrow-square-out' } },
componentType: 'anchor',
href: DEVTRON_GPT_LINK,
},
{
id: HelpMenuItems.JOIN_DISCORD_COMMUNITY,
label: 'Join discord community',
startIcon: { name: 'ic-discord-fill' },
componentType: 'anchor',
href: DISCORD_LINK,
},
{
id: HelpMenuItems.ABOUT_DEVTRON,
label: 'About Devtron',
startIcon: { name: 'ic-devtron' },
},
]
export const OSS_HELP_ACTION_MENU_ITEMS: HelpButtonActionMenuProps['options'][number]['items'] = [
{
id: HelpMenuItems.CHAT_WITH_SUPPORT,
label: 'Chat with support',
componentType: 'anchor',
href: DISCORD_LINK,
startIcon: { name: 'ic-chat-circle-online' },
},
{
id: HelpMenuItems.RAISE_ISSUE_REQUEST,
label: 'Raise an issue/request',
startIcon: { name: 'ic-file-edit' },
componentType: 'anchor',
href: RAISE_ISSUE,
},
{
id: HelpMenuItems.UPGRADE_TO_OSS_PLUS,
label: 'Upgrade to OSS Plus',
startIcon: { name: 'ic-arrow-up-circle' },
componentType: 'button',
description: 'Run Devtron OSS with Expert Support',
},
]
export const ENTERPRISE_TRIAL_HELP_ACTION_MENU_ITEMS: HelpButtonActionMenuProps['options'][number]['items'] = [
{
id: HelpMenuItems.REQUEST_SUPPORT,
label: 'Request Support',
startIcon: { name: 'ic-file-edit' },
componentType: 'anchor',
href: CONTACT_SUPPORT_LINK,
},
]
export const ENTERPRISE_HELP_ACTION_MENU_ITEMS: HelpButtonActionMenuProps['options'][number]['items'] = [
{
id: HelpMenuItems.OPEN_NEW_TICKET,
label: 'Open new ticket',
startIcon: { name: 'ic-edit' },
componentType: 'anchor',
href: OPEN_NEW_TICKET,
},
{
id: HelpMenuItems.VIEW_ALL_TICKETS,
label: 'View all tickets',
startIcon: { name: 'ic-files' },
componentType: 'anchor',
href: VIEW_ALL_TICKETS,
},
{
id: HelpMenuItems.GIVE_FEEDBACK,
label: 'Give feedback',
startIcon: { name: 'ic-megaphone-right' },
},
]