@@ -18,15 +18,13 @@ import { Fragment } from 'react'
1818import ReactGA from 'react-ga4'
1919import { NavLink } from 'react-router-dom'
2020import { SliderButton } from '@typeform/embed-react'
21- import { stopPropagation , DOCUMENTATION_HOME_PAGE , URLS , DISCORD_LINK } from '../../../Common'
21+ import { stopPropagation , URLS } from '../../../Common'
2222import { InstallationType , HelpNavType , HelpOptionType } from './types'
23- import { EnterpriseHelpOptions , OSSHelpOptions } from './constants'
2423import { ReactComponent as GettingStartedIcon } from '../../../Assets/Icon/ic-onboarding.svg'
2524import { ReactComponent as Feedback } from '../../../Assets/Icon/ic-feedback.svg'
26- import { ReactComponent as Discord } from '../../../Assets/Icon/ic-discord-fill.svg'
27- import { ReactComponent as File } from '../../../Assets/Icon/ic-file-text.svg'
2825import { useMainContext } from '../../Providers'
2926import { Icon } from '../Icon'
27+ import { getHelpOptions } from './utils'
3028
3129const HelpNav = ( {
3230 className,
@@ -38,22 +36,10 @@ const HelpNav = ({
3836} : HelpNavType ) => {
3937 const { currentServerInfo, handleOpenLicenseInfoDialog, licenseData } = useMainContext ( )
4038 const isEnterprise = currentServerInfo ?. serverInfo ?. installationType === InstallationType . ENTERPRISE
39+ const isTrial = licenseData ?. isTrial ?? false
4140 const FEEDBACK_FORM_ID = `UheGN3KJ#source=${ window . location . hostname } `
4241
43- const CommonHelpOptions : HelpOptionType [ ] = [
44- {
45- name : 'View documentation' ,
46- link : DOCUMENTATION_HOME_PAGE ,
47- icon : File ,
48- } ,
49-
50- {
51- name : 'Join discord community' ,
52- link : DISCORD_LINK ,
53- icon : Discord ,
54- } ,
55- ...( isEnterprise ? EnterpriseHelpOptions : OSSHelpOptions ) ,
56- ]
42+ const CommonHelpOptions : HelpOptionType [ ] = getHelpOptions ( isEnterprise , isTrial )
5743
5844 const onClickGettingStarted = ( ) : void => {
5945 setGettingStartedClicked ( true )
@@ -114,17 +100,19 @@ const HelpNav = ({
114100 < div className = "ml-12 cn-9 fs-14" > { option . name } </ div >
115101 </ a >
116102 { /* licenseData is only set when showLicenseData is received true */ }
117- { isEnterprise && licenseData && index === 1 && (
103+ { isEnterprise && index === 1 && (
118104 < >
119- < button
120- type = "button"
121- className = "dc__transparent help-card__option flexbox dc__align-items-center cn-9 dc__gap-12 fs-14"
122- onClick = { handleOpenLicenseDialog }
123- data-testid = "about-devtron"
124- >
125- < Icon name = "ic-devtron" color = "N600" size = { 20 } />
126- About Devtron
127- </ button >
105+ { licenseData && (
106+ < button
107+ type = "button"
108+ className = "dc__transparent help-card__option flexbox dc__align-items-center cn-9 dc__gap-12 fs-14"
109+ onClick = { handleOpenLicenseDialog }
110+ data-testid = "about-devtron"
111+ >
112+ < Icon name = "ic-devtron" color = "N600" size = { 20 } />
113+ About Devtron
114+ </ button >
115+ ) }
128116 < div className = "help__enterprise pl-8 pb-4-imp pt-4-imp dc__gap-12 flexbox dc__align-items-center h-28" >
129117 Enterprise Support
130118 </ div >
0 commit comments