Skip to content

Commit 9261c12

Browse files
author
Amrit Kashyap Borah
committed
fix: add openai custom model for devtron
1 parent 6b831c6 commit 9261c12

8 files changed

Lines changed: 40 additions & 21 deletions

File tree

src/Assets/IconV2/ic-openai.svg

Lines changed: 10 additions & 0 deletions
Loading
Lines changed: 4 additions & 9 deletions
Loading

src/Common/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const DOCUMENTATION_VERSION = '/devtron/v0.7'
2323
export const DISCORD_LINK = 'https://discord.devtron.ai/'
2424
export const DEFAULT_JSON_SCHEMA_URI = 'https://json-schema.org/draft/2020-12/schema'
2525
export const LICENSE_DASHBOARD_HOME_PAGE = 'https://license.devtron.ai/dashboard'
26+
export const DEVTRON_GPT_LINK = 'https://chatgpt.com/g/g-6826efa4362c8191b23e7bfa0ac036db-devtron-expert'
2627

2728
export const PATTERNS = {
2829
STRING: /^[a-zA-Z0-9_]+$/,

src/Shared/Components/Header/HelpButton.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { SliderButton } from '@typeform/embed-react'
44

55
import { DOCUMENTATION_HOME_PAGE, URLS } from '@Common/Constants'
66
import { ComponentSizeType } from '@Shared/constants'
7-
import { useMainContext } from '@Shared/Providers'
7+
import { SidePanelTab, useMainContext } from '@Shared/Providers'
88
import { InstallationType } from '@Shared/types'
99

1010
import { ActionMenu } from '../ActionMenu'
@@ -81,7 +81,7 @@ export const HelpButton = ({ serverInfo, fetchingServerInfo, onClick }: HelpButt
8181
e.preventDefault()
8282
setSidePanelConfig((prev) => ({
8383
...prev,
84-
open: true,
84+
state: SidePanelTab.DOCUMENTATION,
8585
docLink: DOCUMENTATION_HOME_PAGE,
8686
reinitialize: true,
8787
}))

src/Shared/Components/Header/PageHeader.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { ReactComponent as Close } from '@Icons/ic-close.svg'
2222
import { ReactComponent as ICMediumPaintBucket } from '@IconsV2/ic-medium-paintbucket.svg'
2323
import { InstallationType } from '@Shared/types'
2424

25-
import { TippyCustomized, TippyTheme } from '../../../Common'
25+
import { TippyCustomized, TippyTheme, Tooltip } from '../../../Common'
2626
import { MAX_LOGIN_COUNT, POSTHOG_EVENT_ONBOARDING } from '../../../Common/Constants'
2727
import { SidePanelTab, useMainContext, useTheme, useUserEmail } from '../../Providers'
2828
import GettingStartedCard from '../GettingStartedCard/GettingStarted'
@@ -139,14 +139,16 @@ const PageHeader = ({
139139
const renderLogoutHelpSection = () => (
140140
<>
141141
{window._env_?.FEATURE_ASK_DEVTRON_EXPERT && sidePanelConfig.state === 'closed' && (
142-
<button
143-
className="enable-svg-animation--hover flex dc__no-background p-2 dc__outline-none-imp dc__no-border"
144-
onClick={onAskButtonClick}
145-
type="button"
146-
aria-label="Ask Devtron Expert"
147-
>
148-
<Icon name="ic-devtron-ai" color={null} size={28} />
149-
</button>
142+
<Tooltip content="Ask Devtron AI" placement="bottom" alwaysShowTippyOnHover delay={[500, null]}>
143+
<button
144+
className="enable-svg-animation--hover flex dc__no-background p-2 dc__outline-none-imp dc__no-border"
145+
onClick={onAskButtonClick}
146+
type="button"
147+
aria-label="Ask Devtron Expert"
148+
>
149+
<Icon name="ic-devtron-ai" color={null} size={28} />
150+
</button>
151+
</Tooltip>
150152
)}
151153
<HelpButton
152154
serverInfo={currentServerInfo.serverInfo}

src/Shared/Components/Header/constants.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { DISCORD_LINK, DOCUMENTATION_HOME_PAGE, URLS } from '@Common/Constants'
17+
import { DEVTRON_GPT_LINK, DISCORD_LINK, DOCUMENTATION_HOME_PAGE, URLS } from '@Common/Constants'
1818
import { CONTACT_SUPPORT_LINK, OPEN_NEW_TICKET, RAISE_ISSUE, VIEW_ALL_TICKETS } from '@Shared/constants'
1919

2020
import { HelpButtonActionMenuProps, HelpMenuItems } from './types'
@@ -38,6 +38,14 @@ export const COMMON_HELP_ACTION_MENU_ITEMS: HelpButtonActionMenuProps['options']
3838
componentType: 'anchor',
3939
href: DOCUMENTATION_HOME_PAGE,
4040
},
41+
{
42+
id: HelpMenuItems.DEVTRON_GPT,
43+
label: 'Devtron GPT',
44+
startIcon: { name: 'ic-openai' },
45+
trailingItem: { type: 'icon', config: { name: 'ic-arrow-square-out' } },
46+
componentType: 'anchor',
47+
href: DEVTRON_GPT_LINK,
48+
},
4149
{
4250
id: HelpMenuItems.JOIN_DISCORD_COMMUNITY,
4351
label: 'Join discord community',

src/Shared/Components/Header/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export enum HelpMenuItems {
6868
GIVE_FEEDBACK = 'give-feedback',
6969
CHAT_WITH_SUPPORT = 'chat-with-support',
7070
RAISE_ISSUE_REQUEST = 'raise-issue-request',
71+
DEVTRON_GPT = 'devtron-gpt',
7172
}
7273

7374
export type HelpButtonActionMenuProps = ActionMenuProps<HelpMenuItems>

src/Shared/Components/Icon/Icon.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ import { ReactComponent as ICNodeScript } from '@IconsV2/ic-node-script.svg'
136136
import { ReactComponent as ICOidc } from '@IconsV2/ic-oidc.svg'
137137
import { ReactComponent as ICOpenBox } from '@IconsV2/ic-open-box.svg'
138138
import { ReactComponent as ICOpenInNew } from '@IconsV2/ic-open-in-new.svg'
139+
import { ReactComponent as ICOpenai } from '@IconsV2/ic-openai.svg'
139140
import { ReactComponent as ICOpenshift } from '@IconsV2/ic-openshift.svg'
140141
import { ReactComponent as ICOutOfSync } from '@IconsV2/ic-out-of-sync.svg'
141142
import { ReactComponent as ICPaperPlane } from '@IconsV2/ic-paper-plane.svg'
@@ -332,6 +333,7 @@ export const iconMap = {
332333
'ic-oidc': ICOidc,
333334
'ic-open-box': ICOpenBox,
334335
'ic-open-in-new': ICOpenInNew,
336+
'ic-openai': ICOpenai,
335337
'ic-openshift': ICOpenshift,
336338
'ic-out-of-sync': ICOutOfSync,
337339
'ic-paper-plane-color': ICPaperPlaneColor,

0 commit comments

Comments
 (0)