Skip to content

Commit 1e9c490

Browse files
committed
Merge branch 'develop' of https://github.com/devtron-labs/dashboard into fix/dependabot-issues
2 parents 9d9c7aa + fa331f0 commit 1e9c490

32 files changed

+707
-714
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ src/components/v2/appDetails/appDetails.store.ts
408408
src/components/v2/appDetails/appDetails.type.ts
409409
src/components/v2/appDetails/ea/EAAppDetail.component.tsx
410410
src/components/v2/appDetails/k8Resource/FilterResource.tsx
411-
src/components/v2/appDetails/k8Resource/K8Resource.component.tsx
412411
src/components/v2/appDetails/k8Resource/NodeTreeTabList.tsx
413412
src/components/v2/appDetails/k8Resource/nodeDetail/EphemeralContainerDrawer.tsx
414413
src/components/v2/appDetails/k8Resource/nodeDetail/NodeDetail.component.tsx
@@ -431,7 +430,6 @@ src/components/v2/appDetails/k8Resource/nodeDetail/nodeDetail.util.ts
431430
src/components/v2/appDetails/k8Resource/nodeType/Node.component.tsx
432431
src/components/v2/appDetails/k8Resource/nodeType/NodeDelete.component.tsx
433432
src/components/v2/appDetails/k8Resource/nodeType/NodeTree.component.tsx
434-
src/components/v2/appDetails/k8Resource/nodeType/PodHeader.component.tsx
435433
src/components/v2/appDetails/k8Resource/nodeType/PodTabSection.tsx
436434
src/components/v2/appDetails/k8Resource/nodeType/__tests__/NodeTree.component.test.ts
437435
src/components/v2/appDetails/k8Resource/nodeType/nodeType.util.ts

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

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export const RestartStatusListDrawer = ({
4242
}: RestartStatusListDrawerProps) => {
4343
const [expandedAppIds, setExpandedAppIds] = useState<number[]>([])
4444
const [isExpandableButtonClicked, setExpandableButtonClicked] = useState(false)
45-
4645
const hasPartialDeploymentWindowAccess = (appId) =>
4746
hibernateInfoMap[appId] &&
4847
hibernateInfoMap[appId].userActionState &&

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ export const RestartWorkloadModal = ({
7676
const abortControllerRef = useRef<AbortController>(new AbortController())
7777
const [showResistanceBox, setShowResistanceBox] = useState(false)
7878
const [isExpandableButtonClicked, setExpandableButtonClicked] = useState(false)
79+
7980
const { searchParams } = useSearchString()
8081
const history = useHistory()
8182
const [showStatusModal, setShowStatusModal] = useState(false)
@@ -506,12 +507,35 @@ export const RestartWorkloadModal = ({
506507
}
507508

508509
const postRestartPodBatchFunction = (payload) => () =>
509-
postRestartWorkloadRotatePods(payload).then((response) => {
510-
if (response.result) {
511-
// showing the status modal in case batch promise resolved
512-
updateBulkRotatePodsMapWithStatusCounts(response, payload.appId)
513-
}
514-
})
510+
postRestartWorkloadRotatePods(payload)
511+
.then((response) => {
512+
if (response.result) {
513+
// showing the status modal in case batch promise resolved
514+
updateBulkRotatePodsMapWithStatusCounts(response, payload.appId)
515+
}
516+
})
517+
.catch((serverError) => {
518+
if (serverError.code === 409) {
519+
serverError.errors.map(({ userMessage }) => {
520+
const _bulkRotatePodsMap = { ...bulkRotatePodsMap }
521+
const _resources: ResourcesMetaDataMap = _bulkRotatePodsMap[payload.appId].resources
522+
523+
// Iterate through the Map and update errorResponse
524+
Object.keys(_resources).forEach((kindName) => {
525+
_resources[kindName].containsError = true
526+
_resources[kindName].errorResponse = userMessage
527+
})
528+
529+
_bulkRotatePodsMap[payload.appId].failedCount = Object.keys(_resources).length
530+
_bulkRotatePodsMap[payload.appId].errorResponse = userMessage
531+
_bulkRotatePodsMap[payload.appId].resources = _resources
532+
// Updating the state with the modified map
533+
setBulkRotatePodsMap(_bulkRotatePodsMap)
534+
535+
return null
536+
})
537+
}
538+
})
515539

516540
const createFunctionCallsFromRestartPodMap = () => {
517541
// default case for restart workload for all apps

src/components/ClusterNodes/NodeDetails.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ const NodeDetails = ({ isSuperAdmin, addTab, k8SObjectMapRaw, updateTabUrl }: Cl
211211
label: NODE_DETAILS_TABS.yaml,
212212
tabType: 'navLink',
213213
icon: Edit,
214-
iconType: 'stroke',
215214
props: {
216215
to: `?tab=${NODE_DETAILS_TABS.yaml.toLowerCase()}`,
217216
onClick: changeNodeTab,

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,10 @@ export const Details: React.FC<DetailsType> = ({
408408
.then((response) => {
409409
isVirtualEnvRef.current = response.result?.isVirtualEnvironment
410410
// This means the CD is not triggered and the app is not helm migrated i.e. Empty State
411-
if (!response.result.isPipelineTriggered && response.result.releaseMode === ReleaseMode.NEW_DEPLOYMENT ) {
411+
if (
412+
!response.result.isPipelineTriggered &&
413+
response.result.releaseMode === ReleaseMode.NEW_DEPLOYMENT
414+
) {
412415
setResourceTreeFetchTimeOut(false)
413416
setLoadingResourceTree(false)
414417
setAppDetails(null)
@@ -761,7 +764,6 @@ export const Details: React.FC<DetailsType> = ({
761764
) : (
762765
renderAppDetails()
763766
)}
764-
765767
{detailedStatus && <AppStatusDetailModal close={hideAppDetailsStatus} showAppStatusMessage={false} />}
766768
{location.search.includes(DEPLOYMENT_STATUS_QUERY_PARAM) && (
767769
<DeploymentStatusDetailModal
@@ -909,10 +911,10 @@ export const EnvSelector = ({
909911
return acc
910912
}, []) || []
911913

912-
// Pushing the virtual environment group to the end of the list
913-
if(groupList[0]?.label === 'Virtual environments' && groupList.length === 2) {
914-
groupList.reverse()
915-
}
914+
// Pushing the virtual environment group to the end of the list
915+
if (groupList[0]?.label === 'Virtual environments' && groupList.length === 2) {
916+
groupList.reverse()
917+
}
916918

917919
return (
918920
<>

src/components/app/details/triggerView/CiWebhookDebuggingModal.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
import React, { useState } from 'react'
1818
import { useHistory, useLocation } from 'react-router-dom'
19-
import { showError, Progressing, sortCallback, stopPropagation } from '@devtron-labs/devtron-fe-common-lib'
19+
import { showError, Progressing, sortCallback, stopPropagation, getUrlWithSearchParams } from '@devtron-labs/devtron-fe-common-lib'
2020
import moment from 'moment'
2121
import { getCIWebhookPayload } from './ciWebhook.service'
2222
import { getCIPipelineURL } from '../../../common'
@@ -60,7 +60,7 @@ export default function CiWebhookModal({
6060
'noreferrer',
6161
)
6262
} else {
63-
history.push(`edit/workflow/${workflowId}/ci-pipeline/${ciPipelineId}`)
63+
history.push(`/app/${appId}/edit/workflow/${workflowId}/ci-pipeline/${ciPipelineId}`)
6464
}
6565
}
6666

@@ -267,7 +267,7 @@ export default function CiWebhookModal({
267267

268268
const renderTimeStampDetailedDescription = () => {
269269
return (
270-
<div style={{ height: 'calc(100vh - 75px' }} className="bcn-0 pl-16 mt-20">
270+
<div style={{ height: 'calc(100vh - 75px' }} className="bcn-0 px-16 mt-20">
271271
<div style={{ background: '#f2f4f7' }}>
272272
<div className="cn-9 fs-12 fw-6 pt-12 pl-12">Incoming Payload</div>
273273
<div
@@ -286,11 +286,11 @@ export default function CiWebhookModal({
286286
>
287287
{expandIncomingPayload ? 'Collapse' : 'Expand'}
288288
</button>
289-
<div className="cn-9 fw-6 fs-14 flex left">
289+
<div className="cn-9 fw-6 fs-14 flex left dc__content-space">
290290
Filter matching results
291291
<button
292292
type="button"
293-
className="mr-20 dc__transparent dc__align-right"
293+
className="dc__transparent"
294294
onClick={() => onEditShowEditableCiModal(ciPipelineId, workflowId)}
295295
>
296296
{/* Here the CI model requires the CiPipelineId not the CiPipelineMaterialId */}
@@ -358,7 +358,7 @@ export default function CiWebhookModal({
358358
const renderTimeStampDetailedIncomingModal = () => {
359359
return (
360360
<div
361-
className={`bcn-0 w-800 bcn-0 dc__position-fixed dc__top-0 dc__right-0 timestamp-detail-container ${
361+
className={`bcn-0 w-1024 bcn-0 dc__position-fixed dc__top-0 dc__right-0 timestamp-detail-container ${
362362
fromBulkCITrigger ? 'env-modal-width' : ''
363363
}`}
364364
style={{ zIndex: 100 }}

src/components/externalLinks/ExternalLinks.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export const NodeLevelSelectStyles = {
153153
...customMultiSelectStyles,
154154
menu: (base) => ({
155155
...base,
156-
width: '150px',
156+
width: '120px',
157157
}),
158158
control: (base) => ({
159159
...base,

src/components/v2/appDetails/NodeTreeDetailTab.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
import { useState, useEffect, useRef } from 'react'
18-
import K8ResourceComponent from './k8Resource/K8Resource.component'
18+
import { K8ResourceComponent } from './k8Resource/K8Resource.component'
1919
import './appDetails.scss'
2020
import LogAnalyzerComponent from './logAnalyzer/LogAnalyzer.component'
2121
import { Route, Switch, useRouteMatch, Redirect, useParams } from 'react-router-dom'

src/components/v2/appDetails/appDetails.type.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import { ExternalLink, OptionTypeWithIcon } from '../../externalLinks/ExternalLi
2626
import { iLink } from '../utils/tabUtils/link.type'
2727
import { EphemeralForm, EphemeralFormAdvancedType } from './k8Resource/nodeDetail/nodeDetail.type'
2828
import { useTabs } from '../../common/DynamicTabs/useTabs'
29-
import { ManifestTabJSON } from '../utils/tabUtils/tab.json'
3029

3130
export interface ApplicationObject extends iLink {
3231
selectedNode: string
@@ -470,18 +469,27 @@ export interface ManifestViewRefType {
470469
manifest: string
471470
activeManifestEditorData: string
472471
modifiedManifest: string
473-
isEditmode: boolean
474-
activeTab: (typeof ManifestTabJSON)[number]['name']
475472
}
476473
id: string
477474
}
478475

476+
export enum ManifestCodeEditorMode {
477+
READ = 'read',
478+
EDIT = 'edit',
479+
APPLY_CHANGES = 'applyChanges',
480+
CANCEL = 'cancel',
481+
}
482+
483+
479484
export interface ManifestActionPropsType extends ResourceInfoActionPropsType {
480485
hideManagedFields: boolean
481486
toggleManagedFields: (managedFieldsExist: boolean) => void
482487
manifestViewRef: MutableRefObject<ManifestViewRefType>
483488
getComponentKey: () => string
484-
isExternalApp: boolean
489+
showManifestCompareView: boolean
490+
setShowManifestCompareView: Dispatch<SetStateAction<boolean>>
491+
manifestCodeEditorMode: ManifestCodeEditorMode
492+
setManifestCodeEditorMode: Dispatch<SetStateAction<ManifestCodeEditorMode>>
485493
}
486494

487495
export interface NodeTreeDetailTabProps {

0 commit comments

Comments
 (0)