Skip to content

Commit 76a6e3f

Browse files
committed
chore: doc link added
1 parent 56357c3 commit 76a6e3f

File tree

8 files changed

+65
-42
lines changed

8 files changed

+65
-42
lines changed

src/components/Jobs/JobList/JobsList.tsx

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,10 @@ import {
4141
} from '../Types'
4242
import { getJobStatusLabelFromValue, parseSearchParams } from '../Utils'
4343
import JobListContainer from './JobListContainer'
44+
import { renderAdditionalJobsHeaderInfo } from './utils'
4445

4546
import '../../app/list/list.scss'
4647

47-
// const renderAppGroupDescriptionContent = () =>
48-
// ' Application Groups represent an environment and display all applications deployed to it. They simplify deploying interdependent microservices by allowing you to build and deploy multiple applications together.'
49-
50-
// const renderAdditionalHeaderInfo = () => (
51-
// <FeatureTitleWithInfo
52-
// title="Application Group"
53-
// docLink="APP_GROUP"
54-
// showInfoIconTippy
55-
// renderDescriptionContent={renderAppGroupDescriptionContent}
56-
// />
57-
// )
58-
5948
const JobsList = () => {
6049
const { path } = useRouteMatch()
6150
const history = useHistory()
@@ -169,7 +158,7 @@ const JobsList = () => {
169158
)}
170159
{dataStateType === JobListViewType.LIST && (
171160
<>
172-
<HeaderWithCreateButton headerName="Jobs" />
161+
<HeaderWithCreateButton renderAdditionalHeaderInfo={renderAdditionalJobsHeaderInfo} />
173162
{renderCreateJobRouter()}
174163
<JobListContainer
175164
masterFilters={masterFilters}

src/components/Jobs/JobList/utils.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { FeatureTitleWithInfo } from '@devtron-labs/devtron-fe-common-lib'
2+
3+
const renderAppGroupDescriptionContent = () =>
4+
'Job allows execution of repetitive tasks in a manual or automated manner. Execute custom tasks or choose from a library of preset plugins in your job pipeline.'
5+
6+
export const renderAdditionalJobsHeaderInfo = () => (
7+
<FeatureTitleWithInfo
8+
title="Jobs"
9+
docLink="JOBS"
10+
renderDescriptionContent={renderAppGroupDescriptionContent}
11+
showInfoIconTippy
12+
/>
13+
)

src/components/ResourceBrowser/ResourceBrowser.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import { DEFAULT_CLUSTER_ID } from '@Pages/GlobalConfigurations/ClustersAndEnvir
3030
import { sortObjectArrayAlphabetically } from '../common'
3131
import { renderNewClusterButton } from './PageHeader.buttons'
3232
import { getClusterListing } from './ResourceBrowser.service'
33+
import { renderAdditionalBrowserHeaderInfo } from './Utils'
3334

3435
const ResourceBrowser: React.FC = () => {
3536
const parentRef = useRef<HTMLDivElement>(null)
@@ -80,8 +81,8 @@ const ResourceBrowser: React.FC = () => {
8081
return (
8182
<div className="flexbox-col h-100 bg__primary" ref={parentRef}>
8283
<PageHeader
84+
additionalHeaderInfo={renderAdditionalBrowserHeaderInfo}
8385
isBreadcrumbs={false}
84-
headerName="Kubernetes Resource Browser"
8586
renderActionButtons={renderNewClusterButton(reloadDetailClusterList)}
8687
/>
8788
{renderContent()}

src/components/ResourceBrowser/Utils.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
ALL_NAMESPACE_OPTION,
2424
ApiResourceGroupType,
2525
DATE_TIME_FORMAT_STRING,
26+
FeatureTitleWithInfo,
2627
GVKType,
2728
InitTabType,
2829
K8sResourceDetailDataType,
@@ -416,3 +417,15 @@ export const getClusterChangeRedirectionUrl = (shouldRedirectToInstallationStatu
416417
: `${URLS.RESOURCE_BROWSER}/${id}/${
417418
ALL_NAMESPACE_OPTION.value
418419
}/${SIDEBAR_KEYS.nodeGVK.Kind.toLowerCase()}/${K8S_EMPTY_GROUP}`
420+
421+
const renderAppGroupDescriptionContent = () =>
422+
'Job allows execution of repetitive tasks in a manual or automated manner. Execute custom tasks or choose from a library of preset plugins in your job pipeline.'
423+
424+
export const renderAdditionalBrowserHeaderInfo = () => (
425+
<FeatureTitleWithInfo
426+
title="Kubernetes Resource Browser"
427+
docLink="RESOURCE_BROWSER"
428+
renderDescriptionContent={renderAppGroupDescriptionContent}
429+
showInfoIconTippy
430+
/>
431+
)

src/components/charts/ChartGroupAdvanceDeploy.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ import MultiChartSummary from './MultiChartSummary'
3232
import useChartGroup from './useChartGroup'
3333
import { Select, mapByKey } from '../common'
3434
import AdvancedConfig from './AdvancedConfig'
35-
import { getDeployableChartsFromConfiguredCharts } from './list/DiscoverCharts'
3635
import { deployChartGroup } from './charts.service'
3736
import { ReactComponent as WarningIcon } from '../../assets/icons/ic-alert-triangle.svg'
3837
import { renderChartGroupDeploymentToastMessage } from './charts.helper'
38+
import { getDeployableChartsFromConfiguredCharts } from './list/utils'
3939

4040
export default function ChartGroupAdvanceDeploy() {
4141
const { groupId } = useParams<{ groupId: string }>()

src/components/charts/ChartGroupDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ import MultiChartSummary from './MultiChartSummary'
3838
import useChartGroup from './useChartGroup'
3939
import { URLS } from '../../config'
4040
import { ReactComponent as Pencil } from '@Icons/ic-pencil.svg'
41-
import { getDeployableChartsFromConfiguredCharts } from './list/DiscoverCharts'
4241
import {
4342
deployChartGroup,
4443
getChartGroupInstallationDetails,
@@ -51,6 +50,7 @@ import { DeleteComponentsName } from '../../config/constantMessaging'
5150
import { ChartSelector } from '../AppSelector'
5251
import NoGitOpsConfiguredWarning from '../workflowEditor/NoGitOpsConfiguredWarning'
5352
import { renderChartGroupDeploymentToastMessage } from './charts.helper'
53+
import { getDeployableChartsFromConfiguredCharts } from './list/utils'
5454

5555
export default function ChartGroupDetails() {
5656
const { groupId } = useParams<{ groupId }>()

src/components/charts/list/DiscoverCharts.tsx

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import DiscoverChartDetails from '../discoverChartDetail/DiscoverChartDetails'
4343
import MultiChartSummary from '../MultiChartSummary'
4444
import AdvancedConfig from '../AdvancedConfig'
4545
import useChartGroup from '../useChartGroup'
46-
import { DeployableCharts, deployChartGroup, getChartProviderList } from '../charts.service'
46+
import { deployChartGroup, getChartProviderList } from '../charts.service'
4747
import { ChartGroupEntry, Chart, EmptyCharts, ChartListType } from '../charts.types'
4848
import ChartGroupBasicDeploy from '../modal/ChartGroupBasicDeploy'
4949
import CreateChartGroup from '../modal/CreateChartGroup'
@@ -62,23 +62,7 @@ import { isGitOpsModuleInstalledAndConfigured } from '../../../services/service'
6262
import { ReactComponent as SourceIcon } from '../../../assets/icons/ic-source.svg'
6363
import ChartListPopUp from './ChartListPopUp'
6464
import ChartCardSkeletonRow from './ChartCardSkeleton'
65-
66-
// TODO: move to service
67-
export function getDeployableChartsFromConfiguredCharts(charts: ChartGroupEntry[]): DeployableCharts[] {
68-
return charts
69-
.filter((chart) => chart.isEnabled)
70-
.map((chart) => {
71-
return {
72-
appName: chart.name.value,
73-
environmentId: chart.environment.id,
74-
appStoreVersion: chart.appStoreApplicationVersionId,
75-
valuesOverrideYaml: chart.valuesYaml,
76-
referenceValueId: chart.appStoreValuesVersionId || chart.appStoreApplicationVersionId,
77-
referenceValueKind: chart.kind,
78-
chartGroupEntryId: chart.installedId,
79-
}
80-
})
81-
}
65+
import { getDeployableChartsFromConfiguredCharts, renderAdditionalChartHeaderInfo } from './utils'
8266

8367
const DiscoverChartList = ({ isSuperAdmin }: { isSuperAdmin: boolean }) => {
8468
const { serverMode } = useMainContext()
@@ -233,13 +217,6 @@ const DiscoverChartList = ({ isSuperAdmin }: { isSuperAdmin: boolean }) => {
233217
}
234218
}
235219

236-
function reloadCallback(event): void {
237-
event.preventDefault()
238-
if (isLeavingPageNotAllowed.current) {
239-
event.returnValue = 'Your changes will be lost. Do you want to reload without deploying?'
240-
}
241-
}
242-
243220
async function handleInstall() {
244221
if (!project.id) {
245222
setProject((project) => ({ ...project, error: 'Project is mandatory for deployment.' }))
@@ -399,7 +376,7 @@ const DiscoverChartList = ({ isSuperAdmin }: { isSuperAdmin: boolean }) => {
399376
<div className="flex dc__gap-16">
400377
{state.charts.length === 0 ? (
401378
<>
402-
<span className="fs-16 cn-9">Chart Store</span>
379+
{renderAdditionalChartHeaderInfo()}
403380
{isSuperAdmin && (
404381
<Button
405382
dataTestId="chart-store-source-button"

src/components/charts/list/utils.tsx

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { FeatureTitleWithInfo } from '@devtron-labs/devtron-fe-common-lib'
2+
3+
import { DeployableCharts } from '../charts.service'
4+
import { ChartGroupEntry } from '../charts.types'
5+
6+
const renderChartStoreDescriptionContent = () =>
7+
'The Chart Store offers popular third-party Helm charts for quick deployment. If you don’t find what you need, connect your own chart sources to fetch additional Helm charts.'
8+
9+
export const renderAdditionalChartHeaderInfo = () => (
10+
<FeatureTitleWithInfo
11+
title="Chart Store"
12+
showInfoIconTippy
13+
docLink="CHART_STORE"
14+
renderDescriptionContent={renderChartStoreDescriptionContent}
15+
/>
16+
)
17+
18+
export function getDeployableChartsFromConfiguredCharts(charts: ChartGroupEntry[]): DeployableCharts[] {
19+
return charts
20+
.filter((chart) => chart.isEnabled)
21+
.map((chart) => ({
22+
appName: chart.name.value,
23+
environmentId: chart.environment.id,
24+
appStoreVersion: chart.appStoreApplicationVersionId,
25+
valuesOverrideYaml: chart.valuesYaml,
26+
referenceValueId: chart.appStoreValuesVersionId || chart.appStoreApplicationVersionId,
27+
referenceValueKind: chart.kind,
28+
chartGroupEntryId: chart.installedId,
29+
}))
30+
}

0 commit comments

Comments
 (0)