Skip to content

Commit 3b66835

Browse files
committed
Merge branch 'kubecon-2025' of https://github.com/devtron-labs/dashboard into feat/cost-config
2 parents 8244e3f + 94e9310 commit 3b66835

File tree

31 files changed

+1220
-1595
lines changed

31 files changed

+1220
-1595
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ src/components/app/details/cdDetails/CDDetails.tsx
9292
src/components/app/details/cicdHistory/History.components.tsx
9393
src/components/app/details/main.tsx
9494
src/components/app/details/metrics/BenchmarkModal.tsx
95-
src/components/app/details/metrics/DeploymentMetrics.tsx
9695
src/components/app/details/metrics/DeploymentTable.tsx
9796
src/components/app/details/metrics/DeploymentTableModal.tsx
9897
src/components/app/details/metrics/deploymentMetrics.service.ts

package.json

Lines changed: 1 addition & 3 deletions
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": "1.20.3-pre-7",
7+
"@devtron-labs/devtron-fe-common-lib": "1.20.3-alpha-9",
88
"@esbuild-plugins/node-globals-polyfill": "0.2.3",
99
"@rjsf/core": "^5.13.3",
1010
"@rjsf/utils": "^5.13.3",
@@ -31,7 +31,6 @@
3131
"react-router-dom": "^5.3.4",
3232
"react-select": "5.8.0",
3333
"react-virtualized": "^9.22.5",
34-
"recharts": "^2.1.9",
3534
"rollup-plugin-node-polyfills": "0.2.1",
3635
"rxjs": "^7.5.4",
3736
"sockjs-client": "1.6.1",
@@ -79,7 +78,6 @@
7978
"@types/react-dom": "17.0.13",
8079
"@types/react-router-dom": "^5.3.3",
8180
"@types/react-transition-group": "^4.4.4",
82-
"@types/recharts": "^1.8.23",
8381
"@types/recompose": "^0.30.10",
8482
"@typescript-eslint/eslint-plugin": "8.3.0",
8583
"@typescript-eslint/parser": "8.3.0",

src/Pages/Applications/DevtronApps/Details/AppConfigurations/Navigation/EnvironmentOverrideRouter.tsx

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,18 @@ import { Fragment, useEffect, useState } from 'react'
1818
import { Link, NavLink, useLocation, useParams, useRouteMatch } from 'react-router-dom'
1919

2020
import {
21+
ActionMenu,
22+
ButtonStyleType,
23+
ButtonVariantType,
2124
ComponentSizeType,
2225
ConfirmationModal,
2326
ConfirmationModalVariantType,
2427
DeleteConfirmationModal,
2528
DocLink,
2629
EnvResourceType,
2730
getEnvironmentListMinPublic,
31+
Icon,
2832
InfoBlock,
29-
PopupMenu,
3033
Progressing,
3134
SelectPicker,
3235
showError,
@@ -37,10 +40,7 @@ import {
3740
import { ReactComponent as ICStamp } from '@Icons/ic-stamp.svg'
3841

3942
import { ReactComponent as Add } from '../../../../../../assets/icons/ic-add.svg'
40-
import { ReactComponent as DeleteIcon } from '../../../../../../assets/icons/ic-delete-interactive.svg'
41-
import { ReactComponent as More } from '../../../../../../assets/icons/ic-more-option.svg'
4243
import { createClusterEnvGroup, usePrevious } from '../../../../../../components/common'
43-
import { RESOURCE_ACTION_MENU } from '../../../../../../components/ResourceBrowser/Constants'
4444
import { URLS } from '../../../../../../config'
4545
import { addJobEnvironment, deleteJobEnvironment, getCIConfig } from '../../../../../../services/service'
4646
import { AppConfigState, JobEnvOverrideRouteProps } from '../AppConfig.types'
@@ -150,8 +150,7 @@ const JobEnvOverrideRoute = ({ envOverride, ciPipelines, reload, isEnvProtected
150150
return renderDeleteDialog()
151151
}
152152

153-
const toggleDeleteDialog = (e) => {
154-
e.stopPropagation()
153+
const toggleDeleteDialog = () => {
155154
setDeleteView(true)
156155
const pipeline = ciPipelines?.find((env) => env.environmentId === envOverride.environmentId)
157156
if (pipeline) {
@@ -160,25 +159,38 @@ const JobEnvOverrideRoute = ({ envOverride, ciPipelines, reload, isEnvProtected
160159
}
161160
}
162161

163-
const deletePopUpMenu = (): JSX.Element => (
164-
<PopupMenu autoClose>
165-
<PopupMenu.Button rootClassName="flex" isKebab>
166-
<More className="icon-dim-16 fcn-6" data-testid="popup-env-delete-button" />
167-
</PopupMenu.Button>
168-
<PopupMenu.Body rootClassName="dc__border pt-4 pb-4 w-100px">
169-
<div className="fs-13 fw-4 lh-20">
170-
<button
171-
type="button"
172-
className="dc__unset-button-styles w-100 flex left h-32 cursor pl-12 pr-12 cr-5 dc__hover-n50"
173-
onClick={toggleDeleteDialog}
174-
data-testid="delete-jobs-environment-link"
175-
>
176-
<DeleteIcon className="icon-dim-16 mr-8 scr-5" />
177-
{RESOURCE_ACTION_MENU.delete}
178-
</button>
179-
</div>
180-
</PopupMenu.Body>
181-
</PopupMenu>
162+
const handleActionDelete = (item) => {
163+
if (item.id === 'delete') {
164+
toggleDeleteDialog()
165+
}
166+
return null
167+
}
168+
169+
const renderDeletePopUpMenu = (): JSX.Element => (
170+
<ActionMenu
171+
id="delete-env-action-menu"
172+
onClick={handleActionDelete}
173+
options={[
174+
{
175+
items: [
176+
{
177+
id: 'delete',
178+
label: 'Delete',
179+
startIcon: { name: 'ic-delete' },
180+
type: 'negative',
181+
},
182+
],
183+
},
184+
]}
185+
buttonProps={{
186+
dataTestId: 'delete-env-action-menu-button',
187+
icon: <Icon name="ic-more-vertical" color={null} rotateBy={90} />,
188+
variant: ButtonVariantType.borderLess,
189+
ariaLabel: 'Open action menu',
190+
style: ButtonStyleType.neutral,
191+
size: ComponentSizeType.xs,
192+
}}
193+
/>
182194
)
183195

184196
return (
@@ -191,7 +203,7 @@ const JobEnvOverrideRoute = ({ envOverride, ciPipelines, reload, isEnvProtected
191203
<span className="dc__truncate">{envOverride.environmentName}</span>
192204
{isEnvProtected && <ICStamp className="icon-dim-20 scv-5 dc__no-shrink" />}
193205
</NavLink>
194-
{deletePopUpMenu()}
206+
{renderDeletePopUpMenu()}
195207
{showDelete && showDeleteDialog(deletePipeline)}
196208
</div>
197209
)

src/assets/icons/ic-file-download.svg

Lines changed: 0 additions & 22 deletions
This file was deleted.

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

Lines changed: 59 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { Prompt, Route, Switch, useHistory, useLocation, useParams, useRouteMatc
1919
import Tippy from '@tippyjs/react'
2020

2121
import {
22+
ActionMenu,
23+
ActionMenuProps,
2224
Button,
2325
ButtonStyleType,
2426
ButtonVariantType,
@@ -29,7 +31,6 @@ import {
2931
DEFAULT_ROUTE_PROMPT_MESSAGE,
3032
DeploymentNodeType,
3133
ErrorScreenManager,
32-
PopupMenu,
3334
Progressing,
3435
ServerErrors,
3536
showError,
@@ -78,6 +79,7 @@ import BulkSourceChange from './BulkSourceChange'
7879
import { getSelectedNodeAndAppId } from './utils'
7980

8081
import './EnvTriggerView.scss'
82+
import { EnvTriggerViewActionKey } from './types'
8183

8284
const ApprovalMaterialModal = importComponentFromFELibrary('ApprovalMaterialModal')
8385
const processDeploymentWindowStateAppGroup = importComponentFromFELibrary(
@@ -527,6 +529,25 @@ const EnvTriggerView = ({ filteredAppIds, isVirtualEnv }: AppGroupDetailDefaultT
527529
)
528530
}
529531

532+
const handleActionClick: ActionMenuProps['onClick'] = (item) => {
533+
switch (item.id) {
534+
case EnvTriggerViewActionKey.PRE_DEPLOY:
535+
setBulkTriggerType(DeploymentNodeType.PRECD)
536+
setShowBulkCDModal(true)
537+
break
538+
case EnvTriggerViewActionKey.DEPLOY:
539+
setBulkTriggerType(DeploymentNodeType.CD)
540+
setShowBulkCDModal(true)
541+
break
542+
case EnvTriggerViewActionKey.POST_DEPLOY:
543+
setBulkTriggerType(DeploymentNodeType.POSTCD)
544+
setShowBulkCDModal(true)
545+
break
546+
default:
547+
break
548+
}
549+
}
550+
530551
const renderApprovalMaterial = () => {
531552
if (ApprovalMaterialModal && location.search.includes(TRIGGER_VIEW_PARAMS.APPROVAL_NODE)) {
532553
const { node, appId } = getSelectedNodeAndAppId(filteredWorkflows, location.search)
@@ -550,45 +571,43 @@ const EnvTriggerView = ({ filteredAppIds, isVirtualEnv }: AppGroupDetailDefaultT
550571
}
551572

552573
const renderDeployPopupMenu = (): JSX.Element => (
553-
<PopupMenu autoClose>
554-
<PopupMenu.Button
555-
isKebab
556-
rootClassName="h-32 popup-button-kebab dc__border-left-b4 pl-8 pr-8 dc__no-left-radius flex bcb-5"
557-
dataTestId="deploy-popup"
558-
>
559-
<Dropdown className="icon-dim-20 fcn-0" />
560-
</PopupMenu.Button>
561-
<PopupMenu.Body rootClassName=" dc__border pt-4 pb-4 mb-8">
562-
{showPreDeployment && (
563-
<div
564-
className="flex left p-10 dc__hover-n50 pointer fs-13"
565-
data-trigger-type="PRECD"
566-
onClick={onShowBulkCDModal}
567-
data-testid="pre-deploy-popup-button"
568-
>
569-
Trigger Pre-deployment stage
570-
</div>
571-
)}
572-
<div
573-
className="flex left p-10 dc__hover-n50 pointer fs-13"
574-
data-trigger-type="CD"
575-
onClick={onShowBulkCDModal}
576-
data-testid="deploy-popup-button"
577-
>
578-
Trigger Deployment
579-
</div>
580-
{showPostDeployment && (
581-
<div
582-
className="flex left p-10 dc__hover-n50 pointer fs-13"
583-
data-trigger-type="POSTCD"
584-
onClick={onShowBulkCDModal}
585-
data-testid="post-deploy-popup-button"
586-
>
587-
Trigger Post-deployment stage
588-
</div>
589-
)}
590-
</PopupMenu.Body>
591-
</PopupMenu>
574+
<ActionMenu<EnvTriggerViewActionKey>
575+
id="deploy-popup"
576+
onClick={handleActionClick}
577+
options={[
578+
{
579+
items: [
580+
...(showPreDeployment
581+
? [
582+
{
583+
id: EnvTriggerViewActionKey.PRE_DEPLOY,
584+
label: 'Trigger Pre-deployment stage',
585+
},
586+
]
587+
: []),
588+
{
589+
id: EnvTriggerViewActionKey.DEPLOY,
590+
label: 'Trigger Deployment',
591+
},
592+
...(showPostDeployment
593+
? [
594+
{
595+
id: EnvTriggerViewActionKey.POST_DEPLOY,
596+
label: 'Trigger Post-deployment stage',
597+
},
598+
]
599+
: []),
600+
],
601+
},
602+
]}
603+
buttonProps={{
604+
dataTestId: 'deploy-popup',
605+
icon: <Dropdown className="icon-dim-20 fcn-0" />,
606+
variant: ButtonVariantType.primary,
607+
size: ComponentSizeType.medium,
608+
ariaLabel: 'Deploy options',
609+
}}
610+
/>
592611
)
593612

594613
const renderBulkTriggerActionButtons = (): JSX.Element => {

src/components/ApplicationGroup/Details/TriggerView/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ export interface SourceUpdateResponseModalProps {
2727
responseList: any
2828
isLoading: any
2929
}
30+
31+
export enum EnvTriggerViewActionKey {
32+
PRE_DEPLOY = 'pre-deploy',
33+
DEPLOY = 'deploy',
34+
POST_DEPLOY = 'post-deploy',
35+
}

src/components/CIPipelineN/Constants.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ export const CONTAINER_CONDITION_TYPE_TO_CONDITION_TYPE_MAP = {
2929
[ConditionContainerType.TRIGGER_SKIP]: [ConditionType.TRIGGER, ConditionType.SKIP],
3030
[ConditionContainerType.PASS_FAILURE]: [ConditionType.PASS, ConditionType.FAIL],
3131
}
32+
33+
export enum TaskActionMenuOptionIdEnum {
34+
DELETE = 'delete',
35+
MOVE = 'move',
36+
}

0 commit comments

Comments
 (0)