Skip to content

Commit 65860b6

Browse files
authored
Merge pull request #1173 from devtron-labs/argo-app-list
feat: Argo app list & Details page
2 parents 6880819 + fec8669 commit 65860b6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1196
-382
lines changed

.eslintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,13 @@ src/components/app/list-new/AppList.tsx
270270
src/components/app/list-new/AppListService.ts
271271
src/components/app/list-new/Constants.ts
272272
src/components/app/list-new/HelmAppList.tsx
273+
src/components/app/list-new/ExternalArgoList.tsx
274+
src/components/app/list-new/ExternalArgoApp.tsx
275+
src/components/app/list-new/ExternalArgoAppDetail.tsx
276+
src/components/externalArgoApps/externalArgoApp.type.ts
277+
src/components/v2/appDetails/sourceInfo/environmentStatus/CurrentSyncStatus.tsx
278+
src/components/v2/appDetails/sourceInfo/environmentStatus/notesDrawer.type.ts
279+
src/components/app/list-new/AppListType.tsx
273280
src/components/app/service.ts
274281
src/components/app/types.ts
275282
src/components/app/typing.d.ts

src/components/ApplicationGroup/Details/EnvironmentOverview/EnvironmentOverview.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import {
2323
import './envOverview.scss'
2424
import moment from 'moment'
2525
import { Moment12HourFormat } from '../../../../config'
26-
import { EditDescRequest } from '../../../app/types'
27-
import { toast } from 'react-toastify'
2826
import { ReactComponent as ActivityIcon } from '../../../../assets/icons/ic-activity.svg'
2927
import { ReactComponent as DockerIcon } from '../../../../assets/icons/git/docker.svg'
3028
import { ReactComponent as HibernateIcon } from '../../../../assets/icons/ic-hibernate-3.svg'

src/components/app/list-new/AppList.tsx

Lines changed: 207 additions & 173 deletions
Large diffs are not rendered by default.

src/components/app/list-new/AppListService.ts

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,11 @@
11
import { getNamespaceListMin as getNamespaceList, getAppFilters } from '../../../services/service';
22
import {Routes, SERVER_MODE} from '../../../config';
3-
import {get, ResponseType} from '@devtron-labs/devtron-fe-common-lib';
3+
import {get} from '@devtron-labs/devtron-fe-common-lib';
44
import { EnvironmentListHelmResult, EnvironmentHelmResult, Cluster, EnvironmentListHelmResponse} from '../../../services/service.types';
55
import { APP_STATUS } from '../config';
66
import { getProjectList } from '../../project/service';
77
import { getClusterList } from '../../cluster/cluster.service';
8-
9-
10-
export interface AppListResponse extends ResponseType{
11-
result?: AppsListResult
12-
}
13-
14-
interface AppsListResult {
15-
clusterIds : number[],
16-
applicationType : string, //DEVTRON-CHART-STORE, DEVTRON-APP ,HELM-APP
17-
errored: boolean,
18-
errorMsg : string,
19-
helmApps : HelmApp[]
20-
}
21-
22-
23-
export interface HelmApp {
24-
appName: string,
25-
appId: string,
26-
isExternal : boolean,
27-
chartName: string,
28-
chartVersion: string,
29-
chartAvatar: string,
30-
projectId: number,
31-
lastDeployedAt: string,
32-
environmentDetail: AppEnvironmentDetail,
33-
appStatus: string
34-
}
35-
36-
export interface AppEnvironmentDetail {
37-
environmentName: string,
38-
environmentId: number,
39-
namespace: string,
40-
clusterName: string,
41-
clusterId: number,
42-
isVirtualEnvironment?: boolean
43-
}
8+
import { AppListResponse } from './AppListType';
449

4510
async function commonAppFilters(serverMode) {
4611
if(serverMode === SERVER_MODE.FULL){
@@ -189,7 +154,7 @@ export const getNamespaces = (clusterIdCsv : string, clusterVsNamespaceMap : Map
189154
}
190155

191156
export const getDevtronInstalledHelmApps = (clusterIdsCsv: string, appStatuses?: string) : Promise<AppListResponse> => {
192-
let url = `${Routes.CHART_INSTALLED}`
157+
let url = Routes.CHART_INSTALLED
193158
if (clusterIdsCsv) {
194159
url = `${url}?clusterIds=${clusterIdsCsv}`
195160
}
@@ -199,6 +164,17 @@ export const getDevtronInstalledHelmApps = (clusterIdsCsv: string, appStatuses?:
199164
return get(url);
200165
}
201166

167+
export const getArgoInstalledExternalApps = (clusterIdsCsv: string, appStatuses?: string) => {
168+
let url = Routes.ARGO_APPS
169+
if (clusterIdsCsv) {
170+
url = `${url}?clusterIds=${clusterIdsCsv}`
171+
}
172+
if (appStatuses) {
173+
url = `${url}${clusterIdsCsv ? '&' : '?'}appStatuses=${appStatuses}`
174+
}
175+
return get(url)
176+
}
177+
202178
const sortByLabel = (a, b) => {
203179
if (a.label < b.label) { return -1; }
204180
if (a.label > b.label) { return 1; }
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { ResponseType } from '@devtron-labs/devtron-fe-common-lib'
2+
3+
export interface ArgoAppListResult {
4+
appName: string
5+
clusterName: string
6+
namespace: string
7+
appStatus: string
8+
syncStatus?: string
9+
clusterId?: string
10+
}
11+
export interface ArgoAppListResponse extends ArgoAppListResult {
12+
result?: ArgoAppListResult
13+
}
14+
15+
export interface AppListResponse extends ResponseType {
16+
result?: AppsListResult
17+
}
18+
19+
interface AppsListResult {
20+
clusterIds: number[]
21+
applicationType: string
22+
errored: boolean
23+
errorMsg: string
24+
helmApps: HelmApp[]
25+
}
26+
27+
export interface HelmApp {
28+
appName: string
29+
appId: string
30+
isExternal: boolean
31+
chartName: string
32+
chartVersion: string
33+
chartAvatar: string
34+
projectId: number
35+
lastDeployedAt: string
36+
environmentDetail: AppEnvironmentDetail
37+
appStatus: string
38+
}
39+
40+
export interface AppEnvironmentDetail {
41+
environmentName: string
42+
environmentId: number
43+
namespace: string
44+
clusterName: string
45+
clusterId: number
46+
isVirtualEnvironment?: boolean
47+
}

0 commit comments

Comments
 (0)