From 9888d5016a1e226f3cfb92ef4318596ac3dab8b2 Mon Sep 17 00:00:00 2001 From: Rohit Raj Date: Fri, 23 May 2025 11:55:08 +0530 Subject: [PATCH 1/4] refactor: ActionMenuItem - improve layout for consistent click on menu item --- .../Components/ActionMenu/ActionMenuItem.tsx | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/src/Shared/Components/ActionMenu/ActionMenuItem.tsx b/src/Shared/Components/ActionMenu/ActionMenuItem.tsx index 636e3d464..96300da47 100644 --- a/src/Shared/Components/ActionMenu/ActionMenuItem.tsx +++ b/src/Shared/Components/ActionMenu/ActionMenuItem.tsx @@ -7,6 +7,8 @@ import { Icon } from '../Icon' import { getTooltipProps } from '../SelectPicker/common' import { ActionMenuItemProps } from './types' +const COMMON_ACTION_MENU_ITEM_CLASS = 'flex-grow-1 flex left top dc__gap-8 py-6 px-8' + export const ActionMenuItem = ({ item, itemRef, @@ -52,19 +54,25 @@ export const ActionMenuItem = ({ const renderContent = () => ( <> - - {label} - - {description && - (typeof description === 'string' ? ( - - {description} + {renderIcon(startIcon)} + + + + {label} - ) : ( - description - ))} + + {description && + (typeof description === 'string' ? ( + + {description} + + ) : ( + description + ))} + + {renderIcon(endIcon)} ) @@ -74,7 +82,7 @@ export const ActionMenuItem = ({ return ( } - className="flex-grow-1" + className={COMMON_ACTION_MENU_ITEM_CLASS} href={item.href} target="_blank" rel="noreferrer" @@ -84,7 +92,11 @@ export const ActionMenuItem = ({ ) case 'link': return ( - } className="flex-grow-1" to={item.to}> + } + className={COMMON_ACTION_MENU_ITEM_CLASS} + to={item.to} + > {renderContent()} ) @@ -94,7 +106,7 @@ export const ActionMenuItem = ({ @@ -111,13 +123,11 @@ export const ActionMenuItem = ({ onMouseEnter={onMouseEnter} tabIndex={-1} // Intentionally added margin to the left and right to have the gap on the edges of the options - className={`action-menu__option br-4 flex left top dc__gap-8 mr-4 ml-4 py-6 px-8 ${isDisabled ? 'dc__disabled' : 'cursor'} ${isNegativeType ? 'dc__hover-r50' : 'dc__hover-n50'} ${isFocused ? `action-menu__option--focused${isNegativeType ? '-negative' : ''}` : ''}`} + className={`action-menu__option br-4 mr-4 ml-4 ${isDisabled ? 'dc__disabled' : 'cursor'} ${isNegativeType ? 'dc__hover-r50' : 'dc__hover-n50'} ${isFocused ? `action-menu__option--focused${isNegativeType ? '-negative' : ''}` : ''}`} onClick={!isDisabled ? handleClick : undefined} aria-disabled={isDisabled} > - {renderIcon(startIcon)} {renderComponent()} - {renderIcon(endIcon)} ) From 2aef17c926690b4494929c281b8c7474f7e029fb Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Fri, 23 May 2025 12:10:49 +0530 Subject: [PATCH 2/4] feat: update deployment status mapping and add new workflow runner statuses --- src/Shared/Components/AppStatusModal/AppStatusBody.tsx | 2 +- src/Shared/Components/DeploymentStatusBreakdown/constants.ts | 4 ++++ src/Shared/Components/DeploymentStatusBreakdown/types.ts | 5 ++++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Shared/Components/AppStatusModal/AppStatusBody.tsx b/src/Shared/Components/AppStatusModal/AppStatusBody.tsx index 7c8c2e2dd..b50a568b4 100644 --- a/src/Shared/Components/AppStatusModal/AppStatusBody.tsx +++ b/src/Shared/Components/AppStatusModal/AppStatusBody.tsx @@ -19,7 +19,7 @@ import { getAppStatusMessageFromAppDetails } from './utils' const InfoCardItem = ({ heading, value, isLast = false, alignCenter = false }: InfoCardItemProps) => (

{heading}

diff --git a/src/Shared/Components/DeploymentStatusBreakdown/constants.ts b/src/Shared/Components/DeploymentStatusBreakdown/constants.ts index 3b961cb7c..c9c1ceba3 100644 --- a/src/Shared/Components/DeploymentStatusBreakdown/constants.ts +++ b/src/Shared/Components/DeploymentStatusBreakdown/constants.ts @@ -41,6 +41,10 @@ export const WFR_STATUS_DTO_TO_DEPLOYMENT_STATUS_MAP: Readonly< [WorkflowRunnerStatusDTO.PROGRESSING]: DEPLOYMENT_STATUS.INPROGRESS, [WorkflowRunnerStatusDTO.QUEUED]: DEPLOYMENT_STATUS.QUEUED, + + [WorkflowRunnerStatusDTO.UNKNOWN]: DEPLOYMENT_STATUS.UNKNOWN, + [WorkflowRunnerStatusDTO.SUSPENDED]: DEPLOYMENT_STATUS.UNKNOWN, + [WorkflowRunnerStatusDTO.MISSING]: DEPLOYMENT_STATUS.UNKNOWN, } export const PROGRESSING_DEPLOYMENT_STATUS: Readonly<(typeof DEPLOYMENT_STATUS)[keyof typeof DEPLOYMENT_STATUS][]> = [ diff --git a/src/Shared/Components/DeploymentStatusBreakdown/types.ts b/src/Shared/Components/DeploymentStatusBreakdown/types.ts index 6c0cc185e..3ff56bf80 100644 --- a/src/Shared/Components/DeploymentStatusBreakdown/types.ts +++ b/src/Shared/Components/DeploymentStatusBreakdown/types.ts @@ -15,9 +15,12 @@ export enum WorkflowRunnerStatusDTO { STARTING = 'Starting', QUEUED = 'Queued', INITIATING = 'Initiating', - // Not found on BE but added for Backward compatibility + // Coming in specific cases of helm apps HEALTHY = 'Healthy', DEGRADED = 'Degraded', + MISSING = 'Missing', + UNKNOWN = 'Unknown', + SUSPENDED = 'Suspended', } export interface ProcessUnableToFetchOrTimedOutStatusType { From 0c14950c1eaf9077870950a5d223bf741db60ec3 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Fri, 23 May 2025 12:39:27 +0530 Subject: [PATCH 3/4] fix: update workflow runner status mapping for suspended and unknown states --- .../Components/DeploymentStatusBreakdown/constants.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Shared/Components/DeploymentStatusBreakdown/constants.ts b/src/Shared/Components/DeploymentStatusBreakdown/constants.ts index c9c1ceba3..9ced31e1f 100644 --- a/src/Shared/Components/DeploymentStatusBreakdown/constants.ts +++ b/src/Shared/Components/DeploymentStatusBreakdown/constants.ts @@ -39,12 +39,12 @@ export const WFR_STATUS_DTO_TO_DEPLOYMENT_STATUS_MAP: Readonly< [WorkflowRunnerStatusDTO.INITIATING]: DEPLOYMENT_STATUS.INITIATING, [WorkflowRunnerStatusDTO.STARTING]: DEPLOYMENT_STATUS.STARTING, [WorkflowRunnerStatusDTO.PROGRESSING]: DEPLOYMENT_STATUS.INPROGRESS, + [WorkflowRunnerStatusDTO.SUSPENDED]: DEPLOYMENT_STATUS.INPROGRESS, [WorkflowRunnerStatusDTO.QUEUED]: DEPLOYMENT_STATUS.QUEUED, - [WorkflowRunnerStatusDTO.UNKNOWN]: DEPLOYMENT_STATUS.UNKNOWN, - [WorkflowRunnerStatusDTO.SUSPENDED]: DEPLOYMENT_STATUS.UNKNOWN, - [WorkflowRunnerStatusDTO.MISSING]: DEPLOYMENT_STATUS.UNKNOWN, + [WorkflowRunnerStatusDTO.UNKNOWN]: DEPLOYMENT_STATUS.UNABLE_TO_FETCH, + [WorkflowRunnerStatusDTO.MISSING]: DEPLOYMENT_STATUS.UNABLE_TO_FETCH, } export const PROGRESSING_DEPLOYMENT_STATUS: Readonly<(typeof DEPLOYMENT_STATUS)[keyof typeof DEPLOYMENT_STATUS][]> = [ From 9b9fff1816f98ef5acd36f81e9bb8d8801c27c74 Mon Sep 17 00:00:00 2001 From: AbhishekA1509 Date: Fri, 23 May 2025 12:39:46 +0530 Subject: [PATCH 4/4] chore: bump version to 1.14.1 in package.json and package-lock.json --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 297fadd1c..4c5ea27c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.0", + "version": "1.14.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.0", + "version": "1.14.1", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index 198fe2859..89ae92f13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtron-labs/devtron-fe-common-lib", - "version": "1.14.0", + "version": "1.14.1", "description": "Supporting common component library", "type": "module", "main": "dist/index.js",