File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ import {
49
49
GlobalVariableDTO ,
50
50
GlobalVariableOptionType ,
51
51
UserRole ,
52
+ EnvAppsMetaDTO ,
53
+ GetAppsInfoForEnvProps ,
52
54
} from './Types'
53
55
import { ApiResourceType , STAGE_MAP } from '../Pages'
54
56
import { RefVariableType , VariableTypeFormat } from './CIPipeline.Types'
@@ -515,3 +517,15 @@ export const getGlobalVariables = async ({
515
517
throw err
516
518
}
517
519
}
520
+
521
+ export const getAppsInfoForEnv = async ( { envId, appIds } : GetAppsInfoForEnvProps ) : Promise < EnvAppsMetaDTO > => {
522
+ const url = getUrlWithSearchParams ( `${ ROUTES . ENV } /${ envId } /${ ROUTES . APP_METADATA } ` , {
523
+ appIds : appIds ?. join ( ) ,
524
+ } )
525
+ const response = await get < EnvAppsMetaDTO > ( url )
526
+
527
+ return {
528
+ appCount : response . result ?. appCount ?? 0 ,
529
+ apps : response . result ?. apps ?? [ ] ,
530
+ }
531
+ }
Original file line number Diff line number Diff line change @@ -157,6 +157,8 @@ export const ROUTES = {
157
157
ENVIRONMENT_DATA : 'global/environment-variables' ,
158
158
DASHBOARD_EVENT : 'dashboard-event' ,
159
159
LICENSE_DATA : 'license/data' ,
160
+ ENV : 'env' ,
161
+ APP_METADATA : 'app-metadata' ,
160
162
} as const
161
163
162
164
export enum KEY_VALUE {
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {
27
27
TargetPlatformItemDTO ,
28
28
ButtonProps ,
29
29
ComponentLayoutType ,
30
+ StatusType ,
30
31
} from '../Shared'
31
32
import {
32
33
ACTION_STATE ,
@@ -1109,3 +1110,19 @@ export enum ActionTypes {
1109
1110
EDIT = 'edit' ,
1110
1111
APPROVER = 'approver' ,
1111
1112
}
1113
+
1114
+ export interface GetAppsInfoForEnvProps {
1115
+ envId : number
1116
+ appIds ?: number [ ]
1117
+ }
1118
+
1119
+ interface AppMeta {
1120
+ appId : number
1121
+ appStatus : StatusType
1122
+ appName : string
1123
+ }
1124
+
1125
+ export interface EnvAppsMetaDTO {
1126
+ appCount : number
1127
+ apps : AppMeta [ ]
1128
+ }
You can’t perform that action at this time.
0 commit comments