Skip to content

Commit e460b31

Browse files
authored
Merge pull request #2261 from devtron-labs/release-candidate-v0.24.0
chore: release candidate v0.24.0
2 parents 108fa60 + 3214b67 commit e460b31

File tree

86 files changed

+2432
-2853
lines changed

Some content is hidden

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

86 files changed

+2432
-2853
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,4 @@ FEATURE_PROMO_EMBEDDED_BUTTON_TEXT=
6262
FEATURE_PROMO_EMBEDDED_MODAL_TITLE=
6363
FEATURE_PROMO_EMBEDDED_IFRAME_URL=
6464
FEATURE_BULK_RESTART_WORKLOADS_FROM_RB=deployment,rollout,daemonset,statefulset
65+
FEATURE_DEFAULT_LANDING_RB_ENABLE=false

.eslintignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,13 @@ src/components/ClusterNodes/ClusterEvents.tsx
6666
src/components/ClusterNodes/ClusterManifest.tsx
6767
src/components/ClusterNodes/ClusterNodeEmptyStates.tsx
6868
src/components/ClusterNodes/ClusterOverview.tsx
69-
src/components/ClusterNodes/ColumnSelector.tsx
7069
src/components/ClusterNodes/NodeActions/CordonNodeModal.tsx
7170
src/components/ClusterNodes/NodeActions/DeleteNodeModal.tsx
7271
src/components/ClusterNodes/NodeActions/DrainNodeModal.tsx
7372
src/components/ClusterNodes/NodeActions/EditTaintsModal.tsx
7473
src/components/ClusterNodes/NodeActions/NodeActionsMenu.tsx
7574
src/components/ClusterNodes/NodeActions/validationRules.ts
7675
src/components/ClusterNodes/NodeDetails.tsx
77-
src/components/ClusterNodes/NodeDetailsList.tsx
78-
src/components/ClusterNodes/NodeListSearchFilter.tsx
7976
src/components/ClusterNodes/__tests__/ClusterManifest.test.tsx
8077
src/components/ClusterNodes/__tests__/NodeList.test.tsx
8178
src/components/ClusterNodes/constants.ts

.github/workflows/pr-issue-validator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ on:
1111
branches:
1212
- 'main'
1313
- 'release-**'
14+
- 'develop'
1415

1516
jobs:
1617
validate-PR-issue:

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "dashboard",
3-
"version": "1.1.0",
3+
"version": "1.2.0",
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.1.0-patch-1",
7+
"@devtron-labs/devtron-fe-common-lib": "1.2.0",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -14,7 +14,6 @@
1414
"@sentry/tracing": "7.50.0",
1515
"@tippyjs/react": "4.2.6",
1616
"@typeform/embed-react": "2.20.0",
17-
"@types/marked": "4.0.8",
1817
"@vitejs/plugin-react": "4.3.1",
1918
"command-line-parser": "^0.2.10",
2019
"compute-histogram": "^0.9.11",
@@ -23,7 +22,6 @@
2322
"fast-json-patch": "^3.1.1",
2423
"flexsearch": "^0.6.32",
2524
"jsonpath-plus": "^10.0.0",
26-
"marked": "4.3.0",
2725
"moment": "^2.29.4",
2826
"monaco-editor": "0.44.0",
2927
"monaco-yaml": "5.1.1",

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ export default function App() {
337337
<div id="full-screen-modal" />
338338
<div id="visible-modal" />
339339
<div id="visible-modal-2" />
340+
<div id="animated-dialog-backdrop" />
340341
{import.meta.env.VITE_NODE_ENV === 'production' &&
341342
window._env_ &&
342343
window._env_.HOTJAR_ENABLED && <Hotjar />}

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/DeploymentConfigCompare.tsx

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useEffect, useMemo, useState } from 'react'
2-
import { generatePath, useHistory, useRouteMatch } from 'react-router-dom'
1+
import { useEffect, useMemo, useRef, useState } from 'react'
2+
import { generatePath, useHistory, useLocation, useRouteMatch } from 'react-router-dom'
33

44
import {
55
useUrlFilters,
@@ -57,9 +57,11 @@ export const DeploymentConfigCompare = ({
5757
const { push } = useHistory()
5858
const { path, params } = useRouteMatch<DeploymentConfigParams>()
5959
const { compareTo, resourceType, resourceName, appId, envId } = params
60+
const location = useLocation()
6061

6162
// STATES
6263
const [convertVariables, setConvertVariables] = useState(false)
64+
const isDefaultLandingPreviousDeploymentSet = useRef<boolean>(false)
6365

6466
// GLOBAL CONSTANTS
6567
const isManifestView = resourceType === EnvResourceType.Manifest
@@ -133,6 +135,32 @@ export const DeploymentConfigCompare = ({
133135
[options, optionsLoader],
134136
)
135137

138+
useEffect(() => {
139+
if (!compareEnvOptions || isDefaultLandingPreviousDeploymentSet.current) {
140+
return
141+
}
142+
143+
isDefaultLandingPreviousDeploymentSet.current = true
144+
145+
if (!compareEnvOptions.previousDeployments?.length) {
146+
updateSearchParams({
147+
compareWith: null,
148+
})
149+
150+
return
151+
}
152+
153+
const previousDeploymentData = compareEnvOptions.previousDeployments[0]
154+
155+
updateSearchParams({
156+
[AppEnvDeploymentConfigQueryParams.COMPARE_WITH_CONFIG_TYPE]:
157+
AppEnvDeploymentConfigType.PREVIOUS_DEPLOYMENTS,
158+
compareWithIdentifierId: previousDeploymentData.deploymentTemplateHistoryId,
159+
compareWithPipelineId: previousDeploymentData.pipelineId,
160+
compareWithManifestChartRefId: isManifestView ? previousDeploymentData.chartRefId : null,
161+
})
162+
}, [compareEnvOptions])
163+
136164
const fetchManifestData = async () => {
137165
const [{ result: currentList }, { result: compareList }] = await Promise.all([
138166
getDeploymentTemplateData({ type, appName, envName, configType, compareName: compareTo }),
@@ -480,13 +508,49 @@ export const DeploymentConfigCompare = ({
480508
if (_isManifestView) {
481509
setConvertVariables(false)
482510
}
483-
push(
484-
generatePath(path, {
511+
512+
const currentSearchParams = new URLSearchParams(location.search)
513+
514+
// NOTE: need to find the corresponding chartRefId(s) for compareWith and compareTo
515+
// and set/delete them based on _isManifestView
516+
const _compareWithManifestChartRefId =
517+
currentSearchParams.has('compareWithIdentifierId') && _isManifestView
518+
? compareEnvOptions.previousDeployments.find(
519+
(prev) =>
520+
prev.deploymentTemplateHistoryId ===
521+
Number(currentSearchParams.get('compareWithIdentifierId')),
522+
)?.chartRefId ?? null
523+
: null
524+
525+
const _manifestChartRefId =
526+
currentSearchParams.has('identifierId') && _isManifestView
527+
? currentEnvOptions.previousDeployments.find(
528+
(prev) => prev.deploymentTemplateHistoryId === Number(currentSearchParams.get('identifierId')),
529+
)?.chartRefId ?? null
530+
: null
531+
532+
if (_compareWithManifestChartRefId) {
533+
currentSearchParams.set('compareWithManifestChartRefId', String(_compareWithManifestChartRefId))
534+
} else {
535+
// NOTE: make sure to not set null as URLSearchParams will save the null as string
536+
// i.e suppose we save 'hello' = null, we get ?hello=null as search param
537+
currentSearchParams.delete('compareWithManifestChartRefId')
538+
}
539+
540+
if (_manifestChartRefId) {
541+
currentSearchParams.set('manifestChartRefId', String(_manifestChartRefId))
542+
} else {
543+
currentSearchParams.delete('manifestChartRefId')
544+
}
545+
546+
push({
547+
pathname: generatePath(path, {
485548
...params,
486549
resourceType: _isManifestView ? EnvResourceType.Manifest : EnvResourceType.DeploymentTemplate,
487550
resourceName: null,
488551
}),
489-
)
552+
search: currentSearchParams.toString(),
553+
})
490554
}
491555

492556
const tabConfig: DeploymentConfigDiffProps['tabConfig'] = {

src/Pages/Applications/DevtronApps/Details/AppConfigurations/MainContent/DeploymentConfigCompare/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const parseCompareWithSearchParams =
120120
// If `type` is 'app' (Application), set `compareWith` to the first environment if available,
121121
// otherwise `null` (base configuration).
122122
if (type === 'app') {
123-
compareWith = environments.length && !compareTo ? environments[0].name : null
123+
compareWith = compareTo || (environments.length ? environments[0].name : null)
124124
} else {
125125
// If `type` is 'appGroup' (Application Groups), set `compareWith` to the first application.
126126
// If the application to compare (`compareTo`) is the same as the first application,

src/Pages/GlobalConfigurations/Authorization/Shared/components/K8sObjectPermissions/K8sListItemCard.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import {
3030
GVKType,
3131
getK8sResourceList,
3232
EntityTypes,
33+
ApiResourceGroupType,
3334
} from '@devtron-labs/devtron-fe-common-lib'
3435
import CreatableSelect from 'react-select/creatable'
3536
import Tippy from '@tippyjs/react'
@@ -177,13 +178,16 @@ const K8sListItemCard = ({
177178
const createKindData = (selected, _allKindMapping, _k8SObjectMap = null) => {
178179
const kind = []
179180
let selectedGvk: GVKType
181+
const isAllNamespaceSelected = k8sPermission.namespace.some((option) => option.value === SELECT_ALL_VALUE)
180182
if (_k8SObjectMap ?? processedData) {
181183
if (selected.value === SELECT_ALL_VALUE) {
182184
// eslint-disable-next-line no-restricted-syntax
183185
for (const value of (_k8SObjectMap ?? processedData).values()) {
184186
// eslint-disable-next-line no-loop-func
185-
value?.child.forEach((ele: { gvk: GVKType }) => {
186-
kind.push({ value: ele.gvk.Kind, label: ele.gvk.Kind, gvk: ele.gvk })
187+
value?.child.forEach((ele: ApiResourceGroupType) => {
188+
if (isAllNamespaceSelected || ele.namespaced) {
189+
kind.push({ label: ele.gvk.Kind, value: ele.gvk.Kind, gvk: ele.gvk })
190+
}
187191
if (!selectedGvk && ele.gvk.Kind === k8sPermission.kind?.value) {
188192
selectedGvk = ele.gvk
189193
}
@@ -192,7 +196,7 @@ const K8sListItemCard = ({
192196
} else {
193197
const data = (_k8SObjectMap ?? processedData).get(selected.value === 'k8sempty' ? '' : selected.value)
194198
data?.child?.forEach((ele) => {
195-
if (ele.namespaced) {
199+
if (isAllNamespaceSelected || ele.namespaced) {
196200
kind.push({ label: ele.gvk.Kind, value: ele.gvk.Kind, gvk: ele.gvk })
197201
}
198202
if (!selectedGvk && ele.gvk.Kind === k8sPermission.kind?.value) {

src/components/ApplicationGroup/AppGroup.types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ export interface BulkCITriggerType extends BulkRuntimeParamsType {
116116
onClickTriggerBulkCI: (appIgnoreCache: Record<number, boolean>, appsToRetry?: Record<string, boolean>) => void
117117
getWebhookPayload: (id, webhookTimeStampOrder: typeof TIME_STAMP_ORDER) => void
118118
webhookPayloads: WebhookPayloadType
119+
setWebhookPayloads: React.Dispatch<React.SetStateAction<WebhookPayloadType>>
119120
isWebhookPayloadLoading: boolean
120121
isShowRegexModal: (_appId: number, ciNodeId: number, inputMaterialList: any[]) => boolean
121122
responseList: ResponseRowType[]

src/components/ApplicationGroup/Details/TriggerView/BulkCITrigger.tsx

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ const BulkCITrigger = ({
100100
setRuntimeParamsErrorState,
101101
setPageViewType,
102102
webhookPayloads,
103+
setWebhookPayloads,
103104
isWebhookPayloadLoading,
104105
}: BulkCITriggerType) => {
105106
const [showRegexModal, setShowRegexModal] = useState(false)
@@ -299,7 +300,10 @@ const BulkCITrigger = ({
299300
}
300301
}
301302

302-
const onCloseWebhookModal = () => setIsWebhookBulkCI(false)
303+
const onCloseWebhookModal = () => {
304+
setIsWebhookBulkCI(false)
305+
setWebhookPayloads(null)
306+
}
303307

304308
const renderHeaderSection = (): JSX.Element | null => {
305309
if (showWebhookModal) {
@@ -658,21 +662,19 @@ const BulkCITrigger = ({
658662
)
659663
}
660664

661-
const renderWebhookModal = (): JSX.Element => {
662-
return (
663-
<WebhookReceivedPayloadModal
664-
workflowId={+selectedApp.workFlowId}
665-
webhookPayloads={webhookPayloads}
666-
isWebhookPayloadLoading={isWebhookPayloadLoading}
667-
material={selectedApp.material}
668-
pipelineId={selectedApp.ciPipelineId}
669-
title={selectedApp.ciPipelineName}
670-
getWebhookPayload={getWebhookPayload}
671-
appId={selectedApp.appId.toString()}
672-
isBulkCIWebhook={isWebhookBulkCI}
673-
/>
674-
)
675-
}
665+
const renderWebhookModal = (selectedMaterialList: CIMaterialType[]): JSX.Element => (
666+
<WebhookReceivedPayloadModal
667+
workflowId={+selectedApp.workFlowId}
668+
webhookPayloads={webhookPayloads}
669+
isWebhookPayloadLoading={isWebhookPayloadLoading}
670+
material={selectedMaterialList}
671+
pipelineId={selectedApp.ciPipelineId}
672+
title={selectedApp.ciPipelineName}
673+
getWebhookPayload={getWebhookPayload}
674+
appId={selectedApp.appId.toString()}
675+
isBulkCIWebhook={isWebhookBulkCI}
676+
/>
677+
)
676678

677679
const renderBodySection = (): JSX.Element => {
678680
if (isLoading) {
@@ -697,7 +699,7 @@ const BulkCITrigger = ({
697699
return (
698700
<div className={`bulk-ci-trigger ${showWebhookModal ? 'webhook-modal' : ''}`}>
699701
{isWebhookBulkCI ? (
700-
renderWebhookModal()
702+
renderWebhookModal(selectedMaterialList)
701703
) : (
702704
<div className="sidebar bcn-0 dc__height-inherit dc__overflow-auto">
703705
<div

0 commit comments

Comments
 (0)