Skip to content

Commit 4e5e985

Browse files
committed
chore: app config & app details documentation link modification
1 parent d68e7cc commit 4e5e985

File tree

15 files changed

+146
-89
lines changed

15 files changed

+146
-89
lines changed

src/Pages/App/CreateAppModal/Sidebar.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import { ModalSidebarPanel } from '@devtron-labs/devtron-fe-common-lib'
1818

1919
import { DOCUMENTATION } from '@Config/constants'
20+
import { getDocumentationUrl } from '@Config/DocLink'
2021

2122
import { CreationMethodType, SidebarProps } from './types'
2223

@@ -57,7 +58,7 @@ const Sidebar = ({
5758
<div className="divider__secondary--horizontal" />
5859
<ModalSidebarPanel
5960
heading={null}
60-
documentationLink={DOCUMENTATION.APP_CREATE}
61+
documentationLink={getDocumentationUrl(DOCUMENTATION.APP_CREATE)}
6162
rootClassName="w-100 dc__no-background-imp"
6263
>
6364
<div className="flexbox-col dc__gap-24">

src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.utils.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
URLS as CommonURLS,
2626
} from '@devtron-labs/devtron-fe-common-lib'
2727

28+
import { getDocumentationUrl } from '@Config/DocLink'
2829
import { APP_COMPOSE_STAGE, DOCUMENTATION, getAppComposeURL, URLS } from '@Config/index'
2930

3031
import { AppConfigStatusItemType, EnvConfigDTO } from '../../service.types'
@@ -137,7 +138,7 @@ export const getNavItems = ({
137138
href: `/job/${appId}/edit/materials`,
138139
stage: STAGE_NAME.GIT_MATERIAL,
139140
isLocked: !_isUnlocked.material,
140-
supportDocumentURL: DOCUMENTATION.JOB_SOURCE_CODE,
141+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.JOB_SOURCE_CODE),
141142
flowCompletionPercent: completedPercent,
142143
currentStep: completedSteps,
143144
required: true,
@@ -147,7 +148,7 @@ export const getNavItems = ({
147148
href: `/job/${appId}/edit/workflow`,
148149
stage: STAGE_NAME.WORKFLOW,
149150
isLocked: !_isUnlocked.workflowEditor,
150-
supportDocumentURL: DOCUMENTATION.JOB_WORKFLOW_EDITOR,
151+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.JOB_WORKFLOW_EDITOR),
151152
flowCompletionPercent: completedPercent,
152153
currentStep: completedSteps,
153154
required: true,
@@ -165,7 +166,7 @@ export const getNavItems = ({
165166
href: getAppComposeURL(appId, APP_COMPOSE_STAGE.CONFIG_MAPS, true, isTemplateView),
166167
stage: STAGE_NAME.CONFIGMAP,
167168
isLocked: !_isUnlocked.configmap,
168-
supportDocumentURL: DOCUMENTATION.APP_CREATE_CONFIG_MAP,
169+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.APP_CREATE_CONFIG_MAP),
169170
flowCompletionPercent: completedPercent,
170171
currentStep: completedSteps,
171172
isProtectionAllowed: true,
@@ -177,7 +178,7 @@ export const getNavItems = ({
177178
href: getAppComposeURL(appId, APP_COMPOSE_STAGE.SECRETS, true, isTemplateView),
178179
stage: STAGE_NAME.SECRETS,
179180
isLocked: !_isUnlocked.secret,
180-
supportDocumentURL: DOCUMENTATION.APP_CREATE_SECRET,
181+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.APP_CREATE_SECRET),
181182
flowCompletionPercent: completedPercent,
182183
currentStep: completedSteps,
183184
isProtectionAllowed: true,
@@ -203,7 +204,7 @@ export const getNavItems = ({
203204
href: `${basePath}/edit/materials`,
204205
stage: STAGE_NAME.GIT_MATERIAL,
205206
isLocked: !_isUnlocked.material,
206-
supportDocumentURL: DOCUMENTATION.APP_CREATE_MATERIAL,
207+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.APP_CREATE_MATERIAL),
207208
flowCompletionPercent: completedPercent,
208209
currentStep: completedSteps,
209210
required: true,
@@ -213,7 +214,7 @@ export const getNavItems = ({
213214
href: `${basePath}/edit/docker-build-config`,
214215
stage: STAGE_NAME.CI_CONFIG,
215216
isLocked: !_isUnlocked.dockerBuildConfig,
216-
supportDocumentURL: DOCUMENTATION.APP_CREATE_CI_CONFIG,
217+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.APP_CREATE_CI_CONFIG),
217218
flowCompletionPercent: completedPercent,
218219
currentStep: completedSteps,
219220
required: true,
@@ -232,7 +233,7 @@ export const getNavItems = ({
232233
href: getAppComposeURL(appId, APP_COMPOSE_STAGE.DEPLOYMENT_TEMPLATE, null, isTemplateView),
233234
stage: STAGE_NAME.DEPLOYMENT_TEMPLATE,
234235
isLocked: !_isUnlocked.deploymentTemplate,
235-
supportDocumentURL: DOCUMENTATION.APP_DEPLOYMENT_TEMPLATE,
236+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.APP_DEPLOYMENT_TEMPLATE),
236237
flowCompletionPercent: completedPercent,
237238
currentStep: completedSteps,
238239
isProtectionAllowed: true,
@@ -254,7 +255,7 @@ export const getNavItems = ({
254255
href: `${basePath}/edit/workflow`,
255256
stage: STAGE_NAME.WORKFLOW,
256257
isLocked: !_isUnlocked.workflowEditor,
257-
supportDocumentURL: DOCUMENTATION.APP_CREATE_WORKFLOW,
258+
supportDocumentURL: 'test',
258259
flowCompletionPercent: completedPercent,
259260
currentStep: completedSteps,
260261
required: true,
@@ -264,7 +265,7 @@ export const getNavItems = ({
264265
href: getAppComposeURL(appId, APP_COMPOSE_STAGE.CONFIG_MAPS, null, isTemplateView),
265266
stage: STAGE_NAME.CONFIGMAP,
266267
isLocked: !_isUnlocked.configmap,
267-
supportDocumentURL: DOCUMENTATION.APP_CREATE_CONFIG_MAP,
268+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.APP_CREATE_CONFIG_MAP),
268269
flowCompletionPercent: completedPercent,
269270
currentStep: completedSteps,
270271
isProtectionAllowed: true,
@@ -276,7 +277,7 @@ export const getNavItems = ({
276277
href: getAppComposeURL(appId, APP_COMPOSE_STAGE.SECRETS, null, isTemplateView),
277278
stage: STAGE_NAME.SECRETS,
278279
isLocked: !_isUnlocked.secret,
279-
supportDocumentURL: DOCUMENTATION.APP_CREATE_SECRET,
280+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.APP_CREATE_SECRET),
280281
flowCompletionPercent: completedPercent,
281282
currentStep: completedSteps,
282283
isProtectionAllowed: true,
@@ -291,7 +292,7 @@ export const getNavItems = ({
291292
href: `${basePath}/edit/external-links`,
292293
stage: STAGE_NAME.EXTERNAL_LINKS,
293294
isLocked: false,
294-
supportDocumentURL: DOCUMENTATION.EXTERNAL_LINKS,
295+
supportDocumentURL: getDocumentationUrl(DOCUMENTATION.EXTERNAL_LINKS),
295296
flowCompletionPercent: completedPercent,
296297
currentStep: completedSteps,
297298
},

src/Pages/Shared/EnvironmentOverride/EnvironmentOverrides.types.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import React from 'react'
1818

1919
import { AppConfigProps } from '@devtron-labs/devtron-fe-common-lib'
2020

21+
import { getDocumentationUrl } from '@Config/DocLink'
2122
import {
2223
AppConfigState,
2324
EnvConfigurationState,
@@ -45,12 +46,12 @@ export const SECTION_HEADING_INFO: Record<string, SectionHeadingType> = {
4546
title: 'ConfigMaps',
4647
subtitle:
4748
'ConfigMap is used to store common configuration variables, allowing users to unify environment variables for different modules in a distributed system into one object.',
48-
learnMoreLink: DOCUMENTATION.APP_CREATE_CONFIG_MAP,
49+
learnMoreLink: getDocumentationUrl(DOCUMENTATION.APP_CREATE_CONFIG_MAP),
4950
},
5051
[URLS.APP_CS_CONFIG]: {
5152
title: 'Secrets',
5253
subtitle: 'A Secret is an object that contains sensitive data such as passwords, OAuth tokens, and SSH keys.',
53-
learnMoreLink: DOCUMENTATION.APP_CREATE_SECRET,
54+
learnMoreLink: getDocumentationUrl(DOCUMENTATION.APP_CREATE_SECRET),
5455
},
5556
}
5657

src/components/CIPipelineN/Sidebar.tsx

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import { ReactComponent as Add } from '../../assets/icons/ic-add.svg'
3737
import { ReactComponent as Remove } from '../../assets/icons/ic-close.svg'
3838
import { GeneratedHelmPush } from '../cdPipeline/cdPipeline.types'
3939
import { EnvironmentList } from './EnvironmentList'
40+
import { getDocumentationUrl } from '@Config/DocLink'
4041

4142
const MandatoryPluginWarning = importComponentFromFELibrary('MandatoryPluginWarning')
4243
const CacheConfiguration = importComponentFromFELibrary('CacheConfiguration', null, 'function')
@@ -69,7 +70,7 @@ export const Sidebar = ({
6970
const [addConfigSecret, setAddConfigSecret] = useState<boolean>(false)
7071
const [helpData, setHelpData] = useState<{ helpText: string; docLink: string }>({
7172
helpText: 'Docs: Configure build stage',
72-
docLink: DOCUMENTATION.BUILD_STAGE,
73+
docLink: getDocumentationUrl(DOCUMENTATION.BUILD_STAGE),
7374
})
7475
const isPreBuildTab = activeStageName === BuildStageVariable.PreBuild
7576
const changeTriggerType = (appCreationType: string): void => {
@@ -80,13 +81,25 @@ export const Sidebar = ({
8081
const isJobCard = isJobCI || isJobView // common constant for both job and CI_JOB
8182
useEffect(() => {
8283
if (isJobCard) {
83-
setHelpData({ helpText: 'Docs: Configure job', docLink: DOCUMENTATION.JOB_WORKFLOW_EDITOR })
84+
setHelpData({
85+
helpText: 'Docs: Configure job',
86+
docLink: getDocumentationUrl(DOCUMENTATION.JOB_WORKFLOW_EDITOR),
87+
})
8488
} else if (activeStageName === BuildStageVariable.Build) {
85-
setHelpData({ helpText: 'Docs: Configure build stage', docLink: DOCUMENTATION.BUILD_STAGE })
89+
setHelpData({
90+
helpText: 'Docs: Configure build stage',
91+
docLink: getDocumentationUrl(DOCUMENTATION.BUILD_STAGE),
92+
})
8693
} else if (activeStageName === BuildStageVariable.PostBuild) {
87-
setHelpData({ helpText: 'Docs: Configure post-build tasks', docLink: DOCUMENTATION.PRE_POST_BUILD_STAGE })
94+
setHelpData({
95+
helpText: 'Docs: Configure post-build tasks',
96+
docLink: getDocumentationUrl(DOCUMENTATION.PRE_POST_BUILD_STAGE),
97+
})
8898
} else if (isPreBuildTab) {
89-
setHelpData({ helpText: 'Docs: Configure pre-build tasks', docLink: DOCUMENTATION.PRE_POST_BUILD_STAGE })
99+
setHelpData({
100+
helpText: 'Docs: Configure pre-build tasks',
101+
docLink: getDocumentationUrl(DOCUMENTATION.PRE_POST_BUILD_STAGE),
102+
})
90103
}
91104
}, [activeStageName])
92105

@@ -319,28 +332,36 @@ export const Sidebar = ({
319332
if (!formData.workflowCacheConfig) {
320333
return
321334
}
322-
335+
323336
const newWorkflowCacheConfigType =
324337
formData.workflowCacheConfig.type === WORKFLOW_CACHE_CONFIG_ENUM.INHERIT
325338
? WORKFLOW_CACHE_CONFIG_ENUM.OVERRIDE
326339
: WORKFLOW_CACHE_CONFIG_ENUM.INHERIT
327340

328-
setFormData({ ...formData, workflowCacheConfig: {
329-
...formData.workflowCacheConfig,
330-
type: newWorkflowCacheConfigType,
331-
...(newWorkflowCacheConfigType === WORKFLOW_CACHE_CONFIG_ENUM.INHERIT ? {
332-
value: formData.workflowCacheConfig.globalValue
333-
} : {}),
334-
}})
341+
setFormData({
342+
...formData,
343+
workflowCacheConfig: {
344+
...formData.workflowCacheConfig,
345+
type: newWorkflowCacheConfigType,
346+
...(newWorkflowCacheConfigType === WORKFLOW_CACHE_CONFIG_ENUM.INHERIT
347+
? {
348+
value: formData.workflowCacheConfig.globalValue,
349+
}
350+
: {}),
351+
},
352+
})
335353
}
336354

337355
const handleSetUseRemoteCache = () => {
338356
// NOTE: don't do anything if in oss
339357
if (!formData.workflowCacheConfig) {
340358
return
341359
}
342-
343-
setFormData({ ...formData, workflowCacheConfig: { ...formData.workflowCacheConfig, value: !formData.workflowCacheConfig.value } })
360+
361+
setFormData({
362+
...formData,
363+
workflowCacheConfig: { ...formData.workflowCacheConfig, value: !formData.workflowCacheConfig.value },
364+
})
344365
}
345366

346367
return (
@@ -382,9 +403,7 @@ export const Sidebar = ({
382403
</div>
383404
) : (
384405
<div className="sidebar-action-container pr-20 flexbox-col dc__gap-4">
385-
<div className="dc__uppercase fw-6 fs-12 cn-6">
386-
Trigger {isJobCard ? 'JOB' : 'BUILD'} PIPELINE
387-
</div>
406+
<div className="dc__uppercase fw-6 fs-12 cn-6">Trigger {isJobCard ? 'JOB' : 'BUILD'} PIPELINE</div>
388407
<div>
389408
<RadioGroup
390409
className="no-border"
@@ -412,17 +431,20 @@ export const Sidebar = ({
412431
)}
413432
{isCdPipeline && activeStageName !== BuildStageVariable.Build && renderConfigSecret()}
414433

415-
{!isCdPipeline && CacheConfiguration && activeStageName === BuildStageVariable.Build && formData.workflowCacheConfig && (
416-
<div className='sidebar-action-container sidebar-action-container-border dc__border-top-n1'>
417-
<CacheConfiguration
418-
isInheriting={formData.workflowCacheConfig.type === WORKFLOW_CACHE_CONFIG_ENUM.INHERIT}
419-
handleSetIsInheriting={handleSetIsInheriting}
420-
useRemoteCache={formData.workflowCacheConfig.value}
421-
handleSetUseRemoteCache={handleSetUseRemoteCache}
422-
isBlobStorageConfigured={isBlobStorageConfigured}
423-
/>
424-
</div>
425-
)}
434+
{!isCdPipeline &&
435+
CacheConfiguration &&
436+
activeStageName === BuildStageVariable.Build &&
437+
formData.workflowCacheConfig && (
438+
<div className="sidebar-action-container sidebar-action-container-border dc__border-top-n1">
439+
<CacheConfiguration
440+
isInheriting={formData.workflowCacheConfig.type === WORKFLOW_CACHE_CONFIG_ENUM.INHERIT}
441+
handleSetIsInheriting={handleSetIsInheriting}
442+
useRemoteCache={formData.workflowCacheConfig.value}
443+
handleSetUseRemoteCache={handleSetUseRemoteCache}
444+
isBlobStorageConfigured={isBlobStorageConfigured}
445+
/>
446+
</div>
447+
)}
426448

427449
{!isCdPipeline && (
428450
<div className="sidebar-action-container pr-20">

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import { ReactComponent as ForwardArrow } from '@Icons/ic-arrow-forward.svg'
4444
import { ReactComponent as Trash } from '@Icons/ic-delete-dots.svg'
4545
import AppNotConfiguredIcon from '@Images/app-not-configured.png'
4646
import noGroups from '@Images/[email protected]'
47+
import { DocLink } from '@Config/DocLink'
4748

4849
import {
4950
DEFAULT_STATUS,
@@ -159,9 +160,11 @@ export const AppNotConfigured = ({
159160
subtitle || (
160161
<>
161162
{APP_DETAILS.APP_FULLY_NOT_CONFIGURED}&nbsp;
162-
<a href={DOCUMENTATION.APP_CREATE} target="_blank" rel="noreferrer">
163-
{APP_DETAILS.NEED_HELP}
164-
</a>
163+
<DocLink
164+
docLinkText={APP_DETAILS.NEED_HELP}
165+
docLink={DOCUMENTATION.APP_CREATE}
166+
dataTestId="app-details-empty"
167+
/>
165168
</>
166169
)
167170
}

src/components/app/details/triggerView/TriggerView.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import { CIMaterialModal } from './CIMaterialModal'
9191
import { WebhookReceivedPayloadModal } from './WebhookReceivedPayloadModal'
9292
import { getExternalCIConfig } from '@Components/ciPipeline/Webhook/webhook.service'
9393
import { shouldRenderWebhookAddImageModal } from './TriggerView.utils'
94+
import { DocLink } from '@Config/DocLink'
9495

9596
const ApprovalMaterialModal = importComponentFromFELibrary('ApprovalMaterialModal')
9697
const getCIBlockState: (...props) => Promise<BlockedStateData> = importComponentFromFELibrary(
@@ -1430,9 +1431,11 @@ class TriggerView extends Component<TriggerViewProps, TriggerViewState> {
14301431
return (
14311432
<>
14321433
{APP_DETAILS.JOB_FULLY_NOT_CONFIGURED.subTitle}&nbsp;
1433-
<a href={DOCUMENTATION.APP_CREATE} target="_blank noopener noreferrer">
1434-
{APP_DETAILS.NEED_HELP}
1435-
</a>
1434+
<DocLink
1435+
docLinkText={APP_DETAILS.NEED_HELP}
1436+
docLink={DOCUMENTATION.APP_CREATE}
1437+
dataTestId="learn-more-about-creating-job-link"
1438+
/>
14361439
</>
14371440
)
14381441
}

src/components/ciConfig/CIConfigForm.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import {
5050
initCurrentCIBuildConfig,
5151
processBuildArgs,
5252
} from './CIConfig.utils'
53+
import { getDocumentationUrl } from '@Config/DocLink'
5354

5455
export default function CIConfigForm({
5556
parentReloading,
@@ -360,7 +361,7 @@ export default function CIConfigForm({
360361
className="flex right dc__link"
361362
rel="noreferrer noopener"
362363
target="_blank"
363-
href={DOCUMENTATION.APP_CREATE_CI_CONFIG}
364+
href={getDocumentationUrl(DOCUMENTATION.APP_CREATE_CI_CONFIG)}
364365
>
365366
<BookOpenIcon className="icon-dim-16 mr-8" />
366367
<span>View documentation</span>

src/components/externalLinks/ExternalLinks.component.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,14 @@ import { ReactComponent as ICClose } from '@Icons/ic-close.svg'
6060
import ICWebpage from '@Icons/tools/ic-link-webpage.png'
6161
import { AddLinkButton } from './AddLinkButton'
6262
import { Link } from 'react-router-dom'
63+
import { DocLink, getDocumentationUrl } from '@Config/DocLink'
6364

6465
export const ExternalLinksLearnMore = (): JSX.Element => {
6566
return (
66-
<a href={DOCUMENTATION.EXTERNAL_LINKS} target="_blank" rel="noreferrer noopener">
67-
Learn more
68-
</a>
67+
<DocLink
68+
docLink={DOCUMENTATION.EXTERNAL_LINKS}
69+
dataTestId="external-links-learn-more"
70+
/>
6971
)
7072
}
7173

src/components/externalLinks/ExternalLinks.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
} from '@devtron-labs/devtron-fe-common-lib'
3333

3434
import { DeleteComponentsName } from '@Config/constantMessaging'
35+
import { getDocumentationUrl } from '@Config/DocLink'
3536

3637
import { DOCUMENTATION, SERVER_MODE } from '../../config'
3738
import { sortOptionsByLabel, sortOptionsByValue } from '../common'
@@ -264,7 +265,7 @@ const ExternalLinks = ({ isAppConfigView, userRole }: ExternalLinksProps) => {
264265
heading="External Links"
265266
infoText="Configure links to third-party applications (e.g. Kibana, New Relic) for quick access. Configured
266267
links will be available in the App details page."
267-
documentationLink={DOCUMENTATION.EXTERNAL_LINKS}
268+
documentationLink={getDocumentationUrl(DOCUMENTATION.EXTERNAL_LINKS)}
268269
iconClassName="icon-dim-20 fcn-6 ml-8"
269270
/>
270271
</h3>

0 commit comments

Comments
 (0)