Skip to content

Commit 52fb68f

Browse files
authored
Merge pull request #2472 from devtron-labs/release-candidate-v0.29.0
release: Release candidate v0.29.0
2 parents d06cfdf + eaa1042 commit 52fb68f

File tree

213 files changed

+4723
-6655
lines changed

Some content is hidden

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

213 files changed

+4723
-6655
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ src/components/ClusterNodes/ClusterEvents.tsx
6161
src/components/ClusterNodes/ClusterManifest.tsx
6262
src/components/ClusterNodes/ClusterNodeEmptyStates.tsx
6363
src/components/ClusterNodes/ClusterOverview.tsx
64-
src/components/ClusterNodes/NodeActions/DeleteNodeModal.tsx
6564
src/components/ClusterNodes/NodeActions/EditTaintsModal.tsx
6665
src/components/ClusterNodes/NodeActions/NodeActionsMenu.tsx
6766
src/components/ClusterNodes/NodeActions/validationRules.ts
@@ -78,9 +77,7 @@ src/components/Jobs/JobsEmptyState.tsx
7877
src/components/Jobs/Service.ts
7978
src/components/Jobs/Utils.ts
8079
src/components/LogViewer/LogViewer.tsx
81-
src/components/ResourceBrowser/ResourceList/ResourceList.component.tsx
8280
src/components/ResourceBrowser/ResourceList/__tests__/Sidebar.test.tsx
83-
src/components/__mocks__/monaco-editor.js
8481
src/components/__mocks__/xterm-webfont.js
8582
src/components/app/LogFilter.test.ts
8683
src/components/app/LogFilter.ts
@@ -221,7 +218,6 @@ src/components/ciPipeline/WebhookSelectorCondition.tsx
221218
src/components/ciPipeline/ciPipeline.service.ts
222219
src/components/ciPipeline/validationRules.ts
223220
src/components/cluster/Cluster.tsx
224-
src/components/cluster/ClusterCodeEditor.tsx
225221
src/components/cluster/ClusterComponentModal.tsx
226222
src/components/cluster/ClusterForm.tsx
227223
src/components/cluster/ClusterInfoStepsModal.tsx
@@ -235,7 +231,6 @@ src/components/command/command.util.ts
235231
src/components/common/Accordian/Accordian.tsx
236232
src/components/common/AppDetailsEmptyState.tsx
237233
src/components/common/Carousel/Carousel.tsx
238-
src/components/common/ClusterNotReachableDailog/ClusterNotReachableDialog.tsx
239234
src/components/common/ContentCard/ContentCard.tsx
240235
src/components/common/Contexts/AppContext.ts
241236
src/components/common/DatePickers/Calender.tsx

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
cache: 'yarn'
2626

2727
- name: Install dependencies
28-
run: yarn install
28+
run: yarn install --frozen-lockfile
2929

3030
- name: Check linting issues
3131
run: yarn lint

.storybook/preview.tsx

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react'
22
import type { Preview } from '@storybook/react'
33
import '../src/css/application.scss'
44
import { BrowserRouter } from 'react-router-dom'
5-
import { ToastManagerContainer } from '@devtron-labs/devtron-fe-common-lib'
5+
import { ThemeProvider, ToastManagerContainer, ThemeSwitcher, noop, customEnv } from '@devtron-labs/devtron-fe-common-lib'
66

77
const preview: Preview = {
88
parameters: {
@@ -12,29 +12,26 @@ const preview: Preview = {
1212
date: /Date$/i,
1313
},
1414
},
15-
backgrounds: {
16-
values: [
17-
{
18-
name: 'Light',
19-
value: 'var(--N0)',
20-
},
21-
{
22-
name: 'Dark',
23-
value: 'var(--N700)',
24-
},
25-
],
26-
default: 'Light',
27-
},
2815
},
29-
tags: ['autodocs'],
30-
decorators: (Story) => (
31-
<>
32-
<BrowserRouter>
33-
<Story />
34-
</BrowserRouter>
35-
<ToastManagerContainer />
36-
</>
37-
),
16+
decorators: (Story) => {
17+
if (!window._env_) {
18+
window._env_ = {
19+
FEATURE_EXPERIMENTAL_THEMING_ENABLE: true,
20+
} as customEnv
21+
}
22+
23+
return (
24+
<ThemeProvider>
25+
<div className="dc__border-bottom mb-10">
26+
<ThemeSwitcher onChange={noop} />
27+
</div>
28+
<BrowserRouter>
29+
<Story />
30+
</BrowserRouter>
31+
<ToastManagerContainer />
32+
</ThemeProvider>
33+
)
34+
},
3835
}
3936

4037
export default preview

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKDIR /app
66
COPY package.json .
77
COPY yarn.lock .
88

9-
RUN yarn install --network-timeout 600000
9+
RUN yarn install --frozen-lockfile --network-timeout 600000
1010

1111
COPY src/ src
1212
COPY nginx.conf .

package.json

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "dashboard",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"private": true,
55
"homepage": "/dashboard",
66
"dependencies": {
7-
"@devtron-labs/devtron-fe-common-lib": "1.6.0-patch-2",
7+
"@devtron-labs/devtron-fe-common-lib": "1.7.0",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -23,8 +23,6 @@
2323
"flexsearch": "^0.6.32",
2424
"jsonpath-plus": "^10.0.0",
2525
"moment": "^2.29.4",
26-
"monaco-editor": "0.44.0",
27-
"monaco-yaml": "5.1.1",
2826
"query-string": "^7.1.1",
2927
"react": "^17.0.2",
3028
"react-csv": "^2.2.2",
@@ -33,7 +31,6 @@
3331
"react-ga4": "^1.4.1",
3432
"react-gtm-module": "^2.0.11",
3533
"react-mde": "^11.5.0",
36-
"react-monaco-editor": "^0.55.0",
3734
"react-router-dom": "^5.3.4",
3835
"react-select": "5.8.0",
3936
"react-virtualized": "^9.22.5",
@@ -42,7 +39,7 @@
4239
"rxjs": "^7.5.4",
4340
"sockjs-client": "1.6.1",
4441
"tippy.js": "^6.3.7",
45-
"vite": "5.4.11",
42+
"vite": "5.4.14",
4643
"vite-plugin-require-transform": "1.0.21",
4744
"vite-plugin-svgr": "^2.4.0",
4845
"xterm": "^4.19.0",
@@ -115,6 +112,7 @@
115112
"husky": "^7.0.4",
116113
"jest-extended": "^2.0.0",
117114
"jest-junit": "^13.0.0",
115+
"json-schema": "^0.4.0",
118116
"lint-staged": "12.5.0",
119117
"mock-socket": "^9.2.1",
120118
"patch-package": "^8.0.0",
@@ -130,8 +128,7 @@
130128
"typescript": "5.5.4",
131129
"vite-plugin-image-optimizer": "^1.1.8",
132130
"vite-plugin-pwa": "^0.21.1",
133-
"vite-tsconfig-paths": "5.0.1",
134-
"vitest": "2.0.5"
131+
"vite-tsconfig-paths": "5.0.1"
135132
},
136133
"jest": {
137134
"collectCoverageFrom": [
@@ -145,11 +142,7 @@
145142
],
146143
"setupFilesAfterEnv": [
147144
"jest-extended"
148-
],
149-
"moduleNameMapper": {
150-
"monaco-editor": "<rootDir>/node_modules/react-monaco-editor",
151-
"monaco-yaml": "<rootDir>/node_modules/react-monaco-editor"
152-
}
145+
]
153146
},
154147
"resolutions": {
155148
"nanoid": "^3.3.8",

src/Pages/Applications/DevtronApps/Details/AppConfigurations/AppConfig.tsx

Lines changed: 74 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,24 @@
1515
*/
1616

1717
import { useState, useEffect } from 'react'
18-
import { useParams, useLocation, useRouteMatch, useHistory, Link } from 'react-router-dom'
18+
import { useParams, useLocation, useRouteMatch, useHistory } from 'react-router-dom'
1919
import {
2020
showError,
2121
Progressing,
2222
ErrorScreenManager,
23-
DeleteDialog,
24-
ConfirmationDialog,
2523
useAsync,
2624
ResourceKindType,
2725
ToastManager,
2826
ToastVariantType,
2927
ResourceIdToResourceApprovalPolicyConfigMapType,
28+
ConfirmationModal,
29+
ConfirmationModalVariantType,
3030
} from '@devtron-labs/devtron-fe-common-lib'
31+
import { DeleteComponentsName } from '@Config/constantMessaging'
32+
import { ApplicationDeletionInfo } from '@Pages/Shared/ApplicationDeletionInfo/ApplicationDeletionInfo'
3133
import { URLS, getAppComposeURL, APP_COMPOSE_STAGE, ViewType } from '../../../../../config'
3234
import { importComponentFromFELibrary } from '../../../../../components/common'
3335
import { getAppOtherEnvironmentMin, getJobOtherEnvironmentMin, getWorkflowList } from '../../../../../services/service'
34-
import warn from '../../../../../assets/icons/ic-warning.svg'
3536
import './appConfig.scss'
3637
import {
3738
AppConfigProps,
@@ -326,30 +327,27 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
326327
}))
327328
}
328329

329-
const redirectToWorkflowEditor = () => getAppComposeURL(appId, APP_COMPOSE_STAGE.WORKFLOW_EDITOR, isJob)
330-
331-
const deleteAppHandler = () => {
332-
deleteApp(appId)
333-
.then((response) => {
334-
if (response.code === 200) {
335-
if (isJob) {
336-
ToastManager.showToast({
337-
variant: ToastVariantType.success,
338-
description: 'Job Deleted!',
339-
})
340-
history.push(`${URLS.JOB}/${URLS.APP_LIST}`)
341-
} else {
342-
ToastManager.showToast({
343-
variant: ToastVariantType.success,
344-
description: 'Application Deleted!',
345-
})
346-
history.push(`${URLS.APP}/${URLS.APP_LIST}`)
347-
}
330+
const deleteAppHandler = async () => {
331+
try {
332+
const response = await deleteApp(appId)
333+
if (response) {
334+
if (isJob) {
335+
ToastManager.showToast({
336+
variant: ToastVariantType.success,
337+
description: 'Job Deleted!',
338+
})
339+
history.push(`${URLS.JOB}/${URLS.APP_LIST}`)
340+
} else {
341+
ToastManager.showToast({
342+
variant: ToastVariantType.success,
343+
description: 'Application Deleted!',
344+
})
345+
history.push(`${URLS.APP}/${URLS.APP_LIST}`)
348346
}
349-
})
350-
.catch((error) => {
351-
showError(error)
352-
})
347+
}
348+
} catch (error) {
349+
showError(error)
350+
}
353351
}
354352

355353
const respondOnSuccess = (redirection: boolean = false) => {
@@ -395,52 +393,57 @@ export const AppConfig = ({ appName, resourceKind, filteredEnvIds }: AppConfigPr
395393
})
396394
}
397395

396+
const closeDeleteConfirmationModal = () => setState((prevState) => ({ ...prevState, showDeleteConfirm: false }))
397+
398+
const onClickCloseCannotDeleteModal = () => setState((prevState) => ({ ...prevState, showDeleteConfirm: false }))
399+
400+
const redirectToWorkflowEditor = () => {
401+
onClickCloseCannotDeleteModal()
402+
history.push(getAppComposeURL(appId, APP_COMPOSE_STAGE.WORKFLOW_EDITOR, isJob))
403+
}
404+
398405
const renderDeleteDialog = () => {
399-
if (state.showDeleteConfirm) {
400-
return state.canDeleteApp ? (
401-
<DeleteDialog
402-
title={`Delete '${appName}'?`}
403-
delete={deleteAppHandler}
404-
closeDelete={() => {
405-
setState((prevState) => ({ ...prevState, showDeleteConfirm: false }))
406+
// Using Confirmation Dialog Modal instead of Delete Confirmation as we are evaluating status on the basis of local variable despite of error code
407+
if (!state.showDeleteConfirm) return null
408+
return (
409+
<>
410+
<ConfirmationModal
411+
title={`Delete ${isJob ? DeleteComponentsName.Job : DeleteComponentsName.Application} '${appName}' ?`}
412+
variant={ConfirmationModalVariantType.delete}
413+
showConfirmationModal={state.canDeleteApp}
414+
subtitle={<ApplicationDeletionInfo />}
415+
buttonConfig={{
416+
secondaryButtonConfig: {
417+
text: 'Cancel',
418+
onClick: closeDeleteConfirmationModal,
419+
},
420+
primaryButtonConfig: {
421+
text: 'Delete',
422+
onClick: deleteAppHandler,
423+
isLoading: state.view === ViewType.LOADING,
424+
},
406425
}}
407-
>
408-
<DeleteDialog.Description>
409-
<p className="fs-13 cn-7 lh-1-54">
410-
This will delete all resources associated with this application.
411-
</p>
412-
<p className="fs-13 cn-7 lh-1-54">Deleted applications cannot be restored.</p>
413-
</DeleteDialog.Description>
414-
</DeleteDialog>
415-
) : (
416-
<ConfirmationDialog>
417-
<ConfirmationDialog.Icon src={warn} />
418-
<ConfirmationDialog.Body title={`Cannot Delete ${isJob ? 'job' : 'application'}`} />
419-
<p className="fs-13 cn-7 lh-1-54">
420-
Delete all pipelines and workflows before deleting this {isJob ? 'job' : 'application'}.
421-
</p>
422-
<ConfirmationDialog.ButtonGroup>
423-
<button
424-
type="button"
425-
className="cta cancel"
426-
onClick={() => {
427-
setState((prevState) => ({ ...prevState, showDeleteConfirm: false }))
428-
}}
429-
>
430-
Cancel
431-
</button>
432-
<Link
433-
onClick={() => setState((prevState) => ({ ...prevState, showDeleteConfirm: false }))}
434-
to={redirectToWorkflowEditor()}
435-
className="cta ml-12 dc__no-decor"
436-
>
437-
View Workflows
438-
</Link>
439-
</ConfirmationDialog.ButtonGroup>
440-
</ConfirmationDialog>
441-
)
442-
}
443-
return null
426+
handleClose={closeDeleteConfirmationModal}
427+
/>
428+
<ConfirmationModal
429+
title={`Cannot Delete ${isJob ? DeleteComponentsName.Job : DeleteComponentsName.Application} '${appName}'`}
430+
variant={ConfirmationModalVariantType.warning}
431+
subtitle={`Delete all pipelines and workflows before deleting this ${isJob ? DeleteComponentsName.Job : DeleteComponentsName.Application}`}
432+
showConfirmationModal={!state.canDeleteApp}
433+
buttonConfig={{
434+
secondaryButtonConfig: {
435+
text: 'Cancel',
436+
onClick: onClickCloseCannotDeleteModal,
437+
},
438+
primaryButtonConfig: {
439+
text: 'View Workflows',
440+
onClick: redirectToWorkflowEditor,
441+
},
442+
}}
443+
handleClose={onClickCloseCannotDeleteModal}
444+
/>
445+
</>
446+
)
444447
}
445448

446449
const getAdditionalParentClass = () => {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const CompareConfigView = ({
3434
selectedChartVersion,
3535
draftChartVersion,
3636
isDeleteOverrideView,
37-
editorKey = `${compareFromSelectedOptionValue || 'compare'}-draft-editor-key`,
3837
className = '',
3938
errorInfo,
4039
handleErrorReload,
@@ -72,7 +71,6 @@ const CompareConfigView = ({
7271
) : (
7372
<div className="p-16">
7473
<DeploymentHistoryDiffView
75-
key={editorKey}
7674
currentConfiguration={getCompareViewHistoryDiffConfigProps(
7775
publishedEditorTemplate,
7876
publishedEditorConfig,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const ConfigDryRun = ({
9595
return (
9696
<CodeEditor
9797
value={editorTemplate}
98-
height="100%"
98+
height="fitToParent"
9999
readOnly
100100
mode={MODES.YAML}
101101
noParsing
@@ -155,7 +155,7 @@ const ConfigDryRun = ({
155155
>
156156
<CodeEditor
157157
value={manifestResponse?.result?.data || ''}
158-
height="100%"
158+
height="fitToParent"
159159
mode={MODES.YAML}
160160
readOnly
161161
noParsing

0 commit comments

Comments
 (0)