Skip to content

Commit 5d434da

Browse files
Merge pull request #751 from devtron-labs/fix/add-more-wfr-status
feat: update deployment status mapping and add new workflow runner statuses
2 parents 4335197 + 9b9fff1 commit 5d434da

File tree

6 files changed

+40
-23
lines changed

6 files changed

+40
-23
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@devtron-labs/devtron-fe-common-lib",
3-
"version": "1.14.0",
3+
"version": "1.14.1",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Shared/Components/ActionMenu/ActionMenuItem.tsx

Lines changed: 28 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import { Icon } from '../Icon'
77
import { getTooltipProps } from '../SelectPicker/common'
88
import { ActionMenuItemProps } from './types'
99

10+
const COMMON_ACTION_MENU_ITEM_CLASS = 'flex-grow-1 flex left top dc__gap-8 py-6 px-8'
11+
1012
export const ActionMenuItem = <T extends string | number>({
1113
item,
1214
itemRef,
@@ -52,19 +54,25 @@ export const ActionMenuItem = <T extends string | number>({
5254

5355
const renderContent = () => (
5456
<>
55-
<Tooltip content={label} placement="right">
56-
<span className={`m-0 fs-13 fw-4 lh-20 dc__truncate ${isNegativeType ? 'cr-5' : 'cn-9'}`}>{label}</span>
57-
</Tooltip>
58-
{description &&
59-
(typeof description === 'string' ? (
60-
<span
61-
className={`m-0 fs-12 fw-4 lh-18 cn-7 ${!disableDescriptionEllipsis ? 'dc__ellipsis-right__2nd-line' : 'dc__word-break'}`}
62-
>
63-
{description}
57+
{renderIcon(startIcon)}
58+
<span>
59+
<Tooltip content={label} placement="right">
60+
<span className={`m-0 fs-13 fw-4 lh-20 dc__truncate ${isNegativeType ? 'cr-5' : 'cn-9'}`}>
61+
{label}
6462
</span>
65-
) : (
66-
description
67-
))}
63+
</Tooltip>
64+
{description &&
65+
(typeof description === 'string' ? (
66+
<span
67+
className={`m-0 fs-12 fw-4 lh-18 cn-7 ${!disableDescriptionEllipsis ? 'dc__ellipsis-right__2nd-line' : 'dc__word-break'}`}
68+
>
69+
{description}
70+
</span>
71+
) : (
72+
description
73+
))}
74+
</span>
75+
{renderIcon(endIcon)}
6876
</>
6977
)
7078

@@ -74,7 +82,7 @@ export const ActionMenuItem = <T extends string | number>({
7482
return (
7583
<a
7684
ref={itemRef as LegacyRef<HTMLAnchorElement>}
77-
className="flex-grow-1"
85+
className={COMMON_ACTION_MENU_ITEM_CLASS}
7886
href={item.href}
7987
target="_blank"
8088
rel="noreferrer"
@@ -84,7 +92,11 @@ export const ActionMenuItem = <T extends string | number>({
8492
)
8593
case 'link':
8694
return (
87-
<Link ref={itemRef as Ref<HTMLAnchorElement>} className="flex-grow-1" to={item.to}>
95+
<Link
96+
ref={itemRef as Ref<HTMLAnchorElement>}
97+
className={COMMON_ACTION_MENU_ITEM_CLASS}
98+
to={item.to}
99+
>
88100
{renderContent()}
89101
</Link>
90102
)
@@ -94,7 +106,7 @@ export const ActionMenuItem = <T extends string | number>({
94106
<button
95107
ref={itemRef as LegacyRef<HTMLButtonElement>}
96108
type="button"
97-
className="dc__transparent p-0 flex-grow-1"
109+
className={`dc__transparent ${COMMON_ACTION_MENU_ITEM_CLASS}`}
98110
>
99111
{renderContent()}
100112
</button>
@@ -111,13 +123,11 @@ export const ActionMenuItem = <T extends string | number>({
111123
onMouseEnter={onMouseEnter}
112124
tabIndex={-1}
113125
// Intentionally added margin to the left and right to have the gap on the edges of the options
114-
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' : ''}` : ''}`}
126+
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' : ''}` : ''}`}
115127
onClick={!isDisabled ? handleClick : undefined}
116128
aria-disabled={isDisabled}
117129
>
118-
{renderIcon(startIcon)}
119130
{renderComponent()}
120-
{renderIcon(endIcon)}
121131
</li>
122132
</Tooltip>
123133
)

src/Shared/Components/AppStatusModal/AppStatusBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { getAppStatusMessageFromAppDetails } from './utils'
1919

2020
const InfoCardItem = ({ heading, value, isLast = false, alignCenter = false }: InfoCardItemProps) => (
2121
<div
22-
className={`py-12 px-16 dc__grid dc__column-gap-16 info-card-item ${alignCenter ? 'dc__align-items-center' : ''} ${!isLast ? 'border__secondary--bottom' : ''} ${alignCenter ? 'dc__align-center' : ''}`}
22+
className={`py-12 px-16 dc__grid dc__column-gap-16 info-card-item ${alignCenter ? 'dc__align-items-center' : ''} ${!isLast ? 'border__secondary--bottom' : ''}`}
2323
>
2424
<Tooltip content={heading}>
2525
<h3 className="cn-9 fs-13 fw-4 lh-1-5 dc__truncate m-0 dc__no-shrink">{heading}</h3>

src/Shared/Components/DeploymentStatusBreakdown/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,12 @@ export const WFR_STATUS_DTO_TO_DEPLOYMENT_STATUS_MAP: Readonly<
3939
[WorkflowRunnerStatusDTO.INITIATING]: DEPLOYMENT_STATUS.INITIATING,
4040
[WorkflowRunnerStatusDTO.STARTING]: DEPLOYMENT_STATUS.STARTING,
4141
[WorkflowRunnerStatusDTO.PROGRESSING]: DEPLOYMENT_STATUS.INPROGRESS,
42+
[WorkflowRunnerStatusDTO.SUSPENDED]: DEPLOYMENT_STATUS.INPROGRESS,
4243

4344
[WorkflowRunnerStatusDTO.QUEUED]: DEPLOYMENT_STATUS.QUEUED,
45+
46+
[WorkflowRunnerStatusDTO.UNKNOWN]: DEPLOYMENT_STATUS.UNABLE_TO_FETCH,
47+
[WorkflowRunnerStatusDTO.MISSING]: DEPLOYMENT_STATUS.UNABLE_TO_FETCH,
4448
}
4549

4650
export const PROGRESSING_DEPLOYMENT_STATUS: Readonly<(typeof DEPLOYMENT_STATUS)[keyof typeof DEPLOYMENT_STATUS][]> = [

src/Shared/Components/DeploymentStatusBreakdown/types.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ export enum WorkflowRunnerStatusDTO {
1515
STARTING = 'Starting',
1616
QUEUED = 'Queued',
1717
INITIATING = 'Initiating',
18-
// Not found on BE but added for Backward compatibility
18+
// Coming in specific cases of helm apps
1919
HEALTHY = 'Healthy',
2020
DEGRADED = 'Degraded',
21+
MISSING = 'Missing',
22+
UNKNOWN = 'Unknown',
23+
SUSPENDED = 'Suspended',
2124
}
2225

2326
export interface ProcessUnableToFetchOrTimedOutStatusType {

0 commit comments

Comments
 (0)