Skip to content

Commit 6190664

Browse files
committed
merged develop
2 parents 547b94f + b84f500 commit 6190664

21 files changed

+502
-686
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ src/components/security/SecurityPolicyEdit.tsx
390390
src/components/security/SecurityPolicyEnvironment.tsx
391391
src/components/security/SecurityPolicyGlobal.tsx
392392
src/components/security/UpdateSeverityModal.tsx
393-
src/components/security/VulnerabilityExposure.tsx
394393
src/components/security/security.service.ts
395394
src/components/security/security.util.tsx
396395
src/components/terminal/TerminalWrapper.tsx

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": "0.3.19-beta-3",
7+
"@devtron-labs/devtron-fe-common-lib": "0.3.21",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",

src/components/cdPipeline/CDPipeline.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -663,9 +663,11 @@ export default function CDPipeline({
663663
deploymentAppName: formData.deploymentAppName,
664664
releaseMode: formData.releaseMode,
665665
deploymentAppCreated: formData.deploymentAppCreated,
666-
...(getUserApprovalConfigPayload ? {
667-
userApprovalConfig: getUserApprovalConfigPayload(formData.userApprovalConfig)
668-
}: {}),
666+
...(getUserApprovalConfigPayload
667+
? {
668+
userApprovalConfig: getUserApprovalConfigPayload(formData.userApprovalConfig),
669+
}
670+
: {}),
669671
triggerType: formData.triggerType,
670672
environmentName: formData.environmentName,
671673
preStageConfigMapSecretNames: _preStageConfigMapSecretNames,
@@ -1031,8 +1033,10 @@ export default function CDPipeline({
10311033
})
10321034
.catch((error: ServerErrors) => {
10331035
// 412 is for linked pipeline and 403 is for RBAC
1034-
// 422 is for deployment window
1035-
if (!force && error.code != 403 && error.code != 412 && error.code != 422) {
1036+
//For now we are removing check for error code 422 which is of deployment window,
1037+
// so in that case force delete modal would be shown.
1038+
// This should be done at BE and when done we will revert our changes
1039+
if (!force && error.code != 403 && error.code != 412) {
10361040
setForceDeleteDialogData(error)
10371041
setDeleteDialog(DeleteDialogType.showForceDeleteDialog)
10381042
} else {

src/components/charts/charts.service.ts

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,24 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { get, post, put, trash, sortCallback, ResponseType } from '@devtron-labs/devtron-fe-common-lib'
17+
import {
18+
get,
19+
post,
20+
put,
21+
trash,
22+
sortCallback,
23+
ResponseType,
24+
getUrlWithSearchParams,
25+
} from '@devtron-labs/devtron-fe-common-lib'
1826
import { DELETE_ACTION, Routes } from '../../config'
1927
import { getAPIOptionsWithTriggerTimeout, handleUTCTime } from '../common'
20-
import { ChartValuesType, ChartGroup, HelmTemplateChartRequest, HelmProjectUpdatePayload } from './charts.types'
28+
import {
29+
ChartValuesType,
30+
ChartGroup,
31+
HelmTemplateChartRequest,
32+
HelmProjectUpdatePayload,
33+
DeleteInstalledChartParamsType,
34+
} from './charts.types'
2135
import { SavedValueListResponse } from './SavedValues/types'
2236

2337
interface RootObject {
@@ -57,13 +71,20 @@ export function deleteInstalledChart(
5771
isGitops?: boolean,
5872
deleteAction?: DELETE_ACTION,
5973
) {
60-
let URL: string = `app-store/deployment/application/delete/${installedAppId}?partialDelete=${isGitops ? 'true' : 'false'}`
74+
const baseUrl: string = `app-store/deployment/application/delete/${installedAppId}`
75+
let params: DeleteInstalledChartParamsType = {}
6176
if (deleteAction === DELETE_ACTION.FORCE_DELETE) {
62-
URL += `&force=true`
63-
} else if (deleteAction === DELETE_ACTION.NONCASCADE_DELETE) {
64-
URL += `&cascade=false`
77+
params = {
78+
forceDelete: true,
79+
}
80+
} else if (isGitops) {
81+
params['partialDelete'] = true
82+
if (deleteAction === DELETE_ACTION.NONCASCADE_DELETE) {
83+
params['cascade'] = false
84+
}
6585
}
66-
return trash(URL)
86+
const url = getUrlWithSearchParams(baseUrl, params)
87+
return trash(url)
6788
}
6889

6990
export function getChartValuesTemplateList(chartId: number | string): Promise<SavedValueListResponse> {

src/components/charts/charts.types.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,3 +401,9 @@ export interface ChartHeaderFilterProps {
401401
isGrid: boolean
402402
setIsGrid: (isGrid: boolean) => void
403403
}
404+
405+
export interface DeleteInstalledChartParamsType {
406+
forceDelete?: true
407+
partialDelete?: true
408+
cascade?: false
409+
}

src/components/charts/discoverChartDetail/ChartDeploymentList.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ export const DeploymentRow = ({
176176
fetchDeployments()
177177
} else if (
178178
deleteAction !== DELETE_ACTION.NONCASCADE_DELETE &&
179-
!response.result.deleteResponse?.clusterReachable
179+
!response.result.deleteResponse?.clusterReachable &&
180+
deploymentAppType === DeploymentAppTypes.GITOPS
180181
) {
181182
setClusterName(response.result.deleteResponse?.clusterName)
182183
toggleConfirmation(false)
@@ -208,6 +209,7 @@ export const DeploymentRow = ({
208209
const handleForceDelete = () => {
209210
handleDelete(DELETE_ACTION.FORCE_DELETE)
210211
}
212+
211213
const handleCascadeDelete = () => {
212214
handleDelete(DELETE_ACTION.DELETE)
213215
}
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import {
2+
DEFAULT_BASE_PAGE_SIZE,
3+
GenericFilterEmptyState,
4+
noop,
5+
Pagination,
6+
SortableTableHeaderCell,
7+
SortingOrder,
8+
} from '@devtron-labs/devtron-fe-common-lib'
9+
import { ExposureListProps } from '../security.types'
10+
11+
const ExposureList = ({
12+
appListResponse,
13+
areFiltersApplied,
14+
clearExposureListFilters,
15+
offset,
16+
pageSize,
17+
changePage,
18+
changePageSize,
19+
}: ExposureListProps) => {
20+
const appListLength = appListResponse.result.scanList.length
21+
if (!appListLength && areFiltersApplied) {
22+
return (
23+
<div className="dc__position-rel" style={{ height: 'calc(100vh - 200px)' }}>
24+
<GenericFilterEmptyState handleClearFilters={clearExposureListFilters} />
25+
</div>
26+
)
27+
}
28+
return appListLength ? (
29+
<>
30+
<div className="w-100">
31+
<div className="fs-12 fw-6 lh-20 cn-7 pl-20 pr-20 dc__border-bottom px-20 vulnerability-exp-table-row h-36">
32+
<SortableTableHeaderCell
33+
title="NAME"
34+
isSortable={false}
35+
isSorted
36+
triggerSorting={noop}
37+
disabled={false}
38+
sortOrder={SortingOrder.ASC}
39+
/>
40+
<SortableTableHeaderCell
41+
title="ENVIRONMENT"
42+
isSortable={false}
43+
isSorted
44+
triggerSorting={noop}
45+
disabled
46+
sortOrder={SortingOrder.ASC}
47+
/>
48+
<SortableTableHeaderCell
49+
title="POLICY"
50+
isSortable={false}
51+
isSorted
52+
triggerSorting={noop}
53+
disabled
54+
sortOrder={SortingOrder.ASC}
55+
/>
56+
</div>
57+
{appListResponse.result.scanList.map((cve) => (
58+
<div
59+
key={`${cve.appName}-${cve.envName}`}
60+
className="dc__border-bottom-n1 dc__hover-n50 vulnerability-exp-table-row px-20 h-44 dc__align-items-center fs-13 lh-20 cn-9"
61+
>
62+
<span>{cve.appName}</span>
63+
<span>{cve.envName}</span>
64+
<span>
65+
<span className={`security-tab__cell-policy--${cve.policy}`}>
66+
{cve.policy.toUpperCase()}
67+
</span>
68+
</span>
69+
</div>
70+
))}
71+
</div>
72+
{appListLength > DEFAULT_BASE_PAGE_SIZE && (
73+
<Pagination
74+
rootClassName="flex dc__content-space px-20"
75+
size={appListLength}
76+
pageSize={pageSize}
77+
offset={offset}
78+
changePage={changePage}
79+
changePageSize={changePageSize}
80+
/>
81+
)}
82+
</>
83+
) : null
84+
}
85+
86+
export default ExposureList

0 commit comments

Comments
 (0)