Skip to content

Commit 4c643e5

Browse files
authored
Merge pull request #2929 from devtron-labs/feat/catalog-schema
feat: add support for editing catalog
2 parents cba985d + b2c7aa9 commit 4c643e5

File tree

17 files changed

+77
-44
lines changed

17 files changed

+77
-44
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.20.2-pre-1",
7+
"@devtron-labs/devtron-fe-common-lib": "1.20.3-pre-1",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import {
2323
BreadcrumbStore,
2424
DevtronProgressing,
2525
ErrorScreenManager,
26+
setGlobalAPITimeout,
2627
showError,
2728
URLS as CommonURLS,
2829
useUserEmail,
@@ -147,6 +148,8 @@ const App = () => {
147148
setValidating(false)
148149
defaultRedirection()
149150
}
151+
152+
setGlobalAPITimeout(window._env_.GLOBAL_API_TIMEOUT)
150153
}, [])
151154

152155
const renderRoutesWithErrorBoundary = () =>

src/Pages-Devtron-2.0/ApplicationManagement/Configurations/ConfigurationsRouter.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from '@devtron-labs/devtron-fe-common-lib'
1515

1616
import ChartRepo from '@Components/chartRepo/ChartRepo'
17-
import { importComponentFromFELibrary } from '@Components/common'
1817
import { APPLICATION_MANAGEMENT_CONFIGURATIONS } from '@Components/Navigation'
1918
import { AddNotification } from '@Components/notifications/AddNotification'
2019
import { URLS } from '@Config/routes'
@@ -31,8 +30,6 @@ const BuildInfra = lazy(() =>
3130
import('@Pages/GlobalConfigurations/BuildInfra').then((module) => ({ default: module.BuildInfra })),
3231
)
3332

34-
const CatalogFramework = importComponentFromFELibrary('CatalogFramework')
35-
3633
export const Configurations = () => {
3734
const { pathname } = useLocation()
3835
const { featureGitOpsFlags: isFeatureGitOpsEnabled, serverMode, isSuperAdmin } = useMainContext()
@@ -115,14 +112,6 @@ export const Configurations = () => {
115112
>
116113
{(props) => <Notifications {...props} isSuperAdmin={isSuperAdmin} />}
117114
</Route>
118-
{CatalogFramework && (
119-
<Route
120-
key={COMMON_URLS.APPLICATION_MANAGEMENT_CONFIGURATIONS_CATALOG_FRAMEWORK}
121-
path={COMMON_URLS.APPLICATION_MANAGEMENT_CONFIGURATIONS_CATALOG_FRAMEWORK}
122-
>
123-
<CatalogFramework isSuperAdmin={isSuperAdmin} />
124-
</Route>
125-
)}
126115
{...serverMode !== SERVER_MODE.EA_ONLY &&
127116
window._env_.ENABLE_SCOPED_VARIABLES && [
128117
<Route

src/components/ClusterNodes/ClusterOverview.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,13 @@ function ClusterOverview({ selectedCluster, addTab }: ClusterOverviewProps) {
481481
)}
482482
{renderClusterError()}
483483
{ClusterAddOns && <ClusterAddOns clusterId={clusterId} getAvailableCharts={getAvailableCharts} />}
484-
{Catalog && <Catalog resourceId={clusterId} resourceType={ResourceKindType.cluster} />}
484+
{Catalog && (
485+
<Catalog
486+
resourceId={clusterId}
487+
resourceType={ResourceKindType.cluster}
488+
catalogSchemaResourceId={clusterDetails?.catalogSchemaResourceId}
489+
/>
490+
)}
485491
<GenericDescription
486492
isClusterTerminal
487493
clusterId={clusterId}

src/components/ClusterNodes/clusterNodes.service.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ export const getClusterOverviewDetails = async ({
145145
_moment = moment(result.clusterCreatedOn, 'YYYY-MM-DDTHH:mm:ssZ')
146146
clusterDetails.addedOn = _moment.format(Moment12HourFormat)
147147
clusterDetails.serverURL = result.serverUrl
148+
clusterDetails.catalogSchemaResourceId = result.catalogSchemaResourceId
148149

149150
const data: DescriptionDataType = CLUSTER_DESCRIPTION_DUMMY_DATA
150151

src/components/ClusterNodes/types.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export interface ClusterDescriptionType {
5353
clusterCreatedBy: string
5454
clusterCreatedOn: string
5555
clusterNote?: ClusterNoteType
56+
catalogSchemaResourceId?: number
5657
}
5758

5859
export interface ClusterNoteType {
@@ -261,7 +262,7 @@ export interface DescriptionDataType {
261262
descriptionUpdatedOn: string
262263
}
263264

264-
export interface ClusterDetailsType {
265+
export interface ClusterDetailsType extends Pick<ClusterDescriptionType, 'catalogSchemaResourceId'> {
265266
clusterName: string
266267
shortDescription: string
267268
serverURL: string

src/components/Navigation/constants.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,6 @@ export const APPLICATION_MANAGEMENT_CONFIGURATIONS: NavigationItemType['subItems
5151
href: URLS.APPLICATION_MANAGEMENT_CONFIGURATIONS_NOTIFICATIONS,
5252
keywords: ['config'],
5353
},
54-
{
55-
title: 'Catalog Frameworks',
56-
dataTestId: 'click-on-configurations-catalog-frameworks',
57-
id: 'application-management-configurations-catalog-frameworks',
58-
href: COMMON_URLS.APPLICATION_MANAGEMENT_CONFIGURATIONS_CATALOG_FRAMEWORK,
59-
keywords: ['config'],
60-
},
6154
{
6255
title: 'Scoped Variables',
6356
dataTestId: 'click-on-configurations-scoped-variables',
@@ -279,14 +272,6 @@ export const NAVIGATION_LIST: NavigationGroupType[] = [
279272
icon: 'ic-cube',
280273
href: COMMON_URLS.INFRASTRUCTURE_MANAGEMENT_RESOURCE_BROWSER,
281274
},
282-
{
283-
title: 'Catalog Framework',
284-
dataTestId: 'catalog-framework',
285-
id: 'infrastructure-management-catalog-framework',
286-
icon: 'ic-file',
287-
disabled: true,
288-
href: '/dummy-url',
289-
},
290275
{
291276
title: 'Resource Watcher',
292277
dataTestId: 'resource-watcher',

src/components/app/Overview/Overview.tsx

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,16 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
212212
}
213213

214214
const renderSideInfoColumn = () => {
215-
const { appName, description, gitMaterials = [], createdOn, createdBy, projectName, chartUsed, templateConfig } = appMetaInfo
215+
const {
216+
appName,
217+
description,
218+
gitMaterials = [],
219+
createdOn,
220+
createdBy,
221+
projectName,
222+
chartUsed,
223+
templateConfig,
224+
} = appMetaInfo
216225

217226
const handleSaveDescription = async (value: string) => {
218227
const payload: EditAppRequest = {
@@ -452,7 +461,13 @@ export default function AppOverview({ appMetaInfo, getAppMetaInfoRes, filteredEn
452461
function renderAppDescription() {
453462
return (
454463
<div>
455-
{Catalog && <Catalog resourceId={appId} resourceType={getResourceKindFromAppType(appType)} />}
464+
{Catalog && (
465+
<Catalog
466+
resourceId={appId}
467+
resourceType={getResourceKindFromAppType(appType)}
468+
catalogSchemaResourceId={appMetaInfo.catalogSchemaResourceId}
469+
/>
470+
)}
456471
{DeploymentWindowOverview && (
457472
<DeploymentWindowOverview appId={Number(appId)} filteredEnvIds={filteredEnvIds} />
458473
)}

src/components/app/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,6 @@ interface GitMaterial {
107107
}
108108

109109
export interface AppMetaInfo extends BaseAppMetaData, Partial<Pick<CreateAppFormStateType, 'templateConfig'>> {
110-
appId: number
111-
appName: string
112110
createdBy: string
113111
description: string
114112
createdOn: string
@@ -121,6 +119,7 @@ export interface AppMetaInfo extends BaseAppMetaData, Partial<Pick<CreateAppForm
121119
chartUsed?: ChartUsed
122120
note?: Note
123121
gitMaterials?: GitMaterial[]
122+
catalogSchemaResourceId?: number
124123
}
125124

126125
export interface ArtifactsCiJob {

src/components/common/ClusterNotReachableDialog/ClusterNotReachableDialog.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,12 @@ import { ForceDeleteConfirmationModal } from '@devtron-labs/devtron-fe-common-li
1919
import { NON_CASCADE_DELETE_DIALOG_INTERNAL_MESSAGE } from '../../../config/constantMessaging'
2020
import { ClusterNotReachableDialogType } from './ClusterNotReachableDialog.type'
2121

22-
const ClusterNotReachableDialog = ({ clusterName, onClickCancel, onClickDelete }: ClusterNotReachableDialogType) => {
22+
const ClusterNotReachableDialog = ({
23+
clusterName,
24+
onClickCancel,
25+
onClickDelete,
26+
isDeleting,
27+
}: ClusterNotReachableDialogType) => {
2328
if (!clusterName) {
2429
return null
2530
}
@@ -34,6 +39,7 @@ const ClusterNotReachableDialog = ({ clusterName, onClickCancel, onClickDelete }
3439
</p>
3540
}
3641
onDelete={onClickDelete}
42+
isDeleting={isDeleting}
3743
closeConfirmationModal={onClickCancel}
3844
/>
3945
)

0 commit comments

Comments
 (0)