Skip to content

Commit 5e82ec5

Browse files
Merge pull request #555 from devtron-labs/feat/onboard-argo-apps
feat: onboard argo apps
2 parents 7bc3ec4 + a7d6e7c commit 5e82ec5

File tree

16 files changed

+147
-58
lines changed

16 files changed

+147
-58
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.8.5",
3+
"version": "1.8.6",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Common/Constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ export const ROUTES = {
140140
CD_TRIGGER_POST: 'app/cd-pipeline/trigger',
141141
DELETE_RESOURCE: 'k8s/resource/delete',
142142
NODE_CAPACITY: 'k8s/capacity/node',
143+
ENVIRONMENT_DATA: 'global/environment-variables',
143144
}
144145

145146
export enum KEY_VALUE {

src/Common/InfoColorBar/InfoColourbar.tsx

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import { Link } from 'react-router-dom'
1818
import { InfoColourBarType } from '../Types'
1919
import { Tooltip } from '@Common/Tooltip'
20+
import { Button } from '@Shared/Components'
2021
import './infoColourBar.scss'
2122

2223
/**
@@ -85,15 +86,23 @@ const InfoColourBar = ({
8586

8687
const renderMessageWrapper = () => {
8788
if (textConfig) {
88-
const { heading, description } = textConfig
89+
const { heading, description, actionButtonConfig } = textConfig
8990

9091
return (
91-
<div className="flexbox-col">
92-
{heading && <h6 className="m-0 cn-9 fs-13 fw-6 lh-20 dc__truncate">{heading}</h6>}
92+
<div className="flexbox flex-grow-1 dc__content-space dc__align-start">
93+
<div className="flexbox-col">
94+
{heading && <h6 className="m-0 cn-9 fs-13 fw-6 lh-20 dc__truncate">{heading}</h6>}
9395

94-
<Tooltip content={description}>
95-
<p className="dc__truncate--clamp-3 m-0 cn-9 fs-13 fw-4 lh-20">{description}</p>
96-
</Tooltip>
96+
<Tooltip content={description}>
97+
<p className="dc__truncate--clamp-3 m-0 cn-9 fs-13 fw-4 lh-20">{description}</p>
98+
</Tooltip>
99+
</div>
100+
101+
{actionButtonConfig && (
102+
<Button
103+
{...actionButtonConfig}
104+
/>
105+
)}
97106
</div>
98107
)
99108
}
@@ -112,7 +121,7 @@ const InfoColourBar = ({
112121
className={`${classname} info_text flex dc__content-space pt-8 pb-8 pl-12 pr-12 br-4 top fs-13 fw-4`}
113122
style={styles}
114123
>
115-
<div className={`flex top ${typeof renderActionButton === 'function' ? 'mr-5' : ''}`}>
124+
<div className={`flex top ${typeof renderActionButton === 'function' ? 'mr-5' : ''} ${!!textConfig ? 'flex-grow-1' : ''}`}>
116125
{!hideIcon && (
117126
<div className={`icon-dim-${iconSize ?? '20'} mr-10`}>
118127
<Icon className={`icon-dim-${iconSize ?? '20'} ${iconClass || ''} mr-8`} />

src/Common/Types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
Severity,
2626
PolicyBlockInfo,
2727
TargetPlatformItemDTO,
28+
ButtonProps,
2829
ComponentLayoutType,
2930
} from '../Shared'
3031
import {
@@ -218,6 +219,7 @@ interface InfoColourBarTextConfigType {
218219
* If given would be shown below the heading (if given)
219220
*/
220221
description: string
222+
actionButtonConfig?: ButtonProps
221223
}
222224

223225
type InfoColourBarMessageProp = {

src/Pages/Applications/DevtronApps/Details/AppConfigurations/DeploymentTemplate/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ export interface SelectedChartDetailsType {
129129
selectedChart: DeploymentChartVersionType
130130
}
131131

132+
export enum PipelineMigratedFromType {
133+
HELM_RELEASE = 'helmRelease',
134+
ARGO_APPLICATION = 'argoApplication',
135+
}
136+
132137
interface EnvironmentConfigType {
133138
id: number
134139
status: number

src/Pages/Applications/DevtronApps/Details/CDPipeline/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export interface CustomTagType {
5757

5858
export enum ReleaseMode {
5959
NEW_DEPLOYMENT = 'create',
60-
MIGRATE_HELM = 'link',
60+
MIGRATE_EXTERNAL_APPS = 'link',
6161
}
6262

6363
export interface CDFormType {

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,15 @@ export interface StatusFilterButtonType {
642642
maxInlineFiltersCount?: number
643643
}
644644

645+
export enum NodeStatusDTO {
646+
Healthy = 'Healthy',
647+
Progressing = 'Progressing',
648+
Unknown = 'Unknown',
649+
Suspended = 'Suspended',
650+
Degraded = 'Degraded',
651+
Missing = 'Missing',
652+
}
653+
645654
export enum NodeStatus {
646655
Degraded = 'degraded',
647656
Healthy = 'healthy',

src/Shared/Components/ConfirmationModal/ForceDeleteConfirmationModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export const ForceDeleteConfirmationModal = ({
2525
}: ForceDeleteConfirmationProps) => {
2626
const renderSubtitle = () => (
2727
<>
28-
<p className="mt-12 mb-12 p-8 dc__break-word bg__tertiary">Error: {subtitle}</p>
29-
<p>Do you want to force delete?</p>
28+
<p className="p-8 dc__break-word bg__tertiary mxh-200 dc__overflow-auto br-4 m-0">Error: {subtitle}</p>
29+
<p className="m-0">Do you want to force delete?</p>
3030
</>
3131
)
3232
return (

src/Shared/Components/GenericSectionErrorState/GenericSectionErrorState.component.tsx

Lines changed: 54 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17+
import { ReactNode } from 'react'
1718
import { ComponentSizeType } from '@Shared/constants'
18-
import { ReactComponent as ErrorIcon } from '../../../Assets/Icon/ic-error-exclamation.svg'
19-
import { ReactComponent as ICInfoOutline } from '../../../Assets/Icon/ic-info-outline.svg'
19+
import { Progressing } from '@Common/Progressing'
20+
import { ReactComponent as ErrorIcon } from '@Icons/ic-error-exclamation.svg'
21+
import { ReactComponent as ICInfoOutline } from '@Icons/ic-info-outline.svg'
2022
import { Button, ButtonVariantType } from '../Button'
2123
import { GenericSectionErrorStateProps } from './types'
2224

@@ -29,33 +31,57 @@ const GenericSectionErrorState = ({
2931
buttonText = 'Reload',
3032
rootClassName,
3133
useInfoIcon = false,
32-
}: GenericSectionErrorStateProps) => (
33-
<div className={`flex column dc__gap-8 p-16 ${withBorder ? 'dc__border br-4' : ''} ${rootClassName || ''}`}>
34-
{useInfoIcon ? (
35-
<ICInfoOutline className="icon-dim-24" />
36-
) : (
37-
<ErrorIcon className="icon-dim-24 alert-icon-r5-imp" />
38-
)}
39-
<div className="flex column dc__gap-4 dc__align-center">
40-
<h3 className="fs-13 lh-20 fw-6 cn-9 m-0">{title}</h3>
41-
{(subTitle || description) && (
42-
<div className="flex column fs-13 lh-20 fw-4 cn-7">
43-
{subTitle && <p className="m-0">{subTitle}</p>}
44-
{description && <p className="m-0">{description}</p>}
45-
</div>
34+
progressingProps,
35+
}: GenericSectionErrorStateProps) => {
36+
const renderMarker = () => {
37+
if (progressingProps) {
38+
return <Progressing {...progressingProps} />
39+
}
40+
41+
if (useInfoIcon) {
42+
return <ICInfoOutline className="icon-dim-24" />
43+
}
44+
45+
return <ErrorIcon className="icon-dim-24 alert-icon-r5-imp" />
46+
}
47+
48+
const renderSubHeading = (content: ReactNode) => {
49+
if (!content) {
50+
return null
51+
}
52+
53+
if (typeof content === 'string') {
54+
return <p className="m-0 dc__truncate--clamp-6">{content}</p>
55+
}
56+
57+
return content
58+
}
59+
60+
return (
61+
<div className={`flex column dc__gap-8 p-16 ${withBorder ? 'dc__border br-4' : ''} ${rootClassName || ''}`}>
62+
{renderMarker()}
63+
64+
<div className="flex column dc__gap-4 dc__align-center">
65+
<h3 className="fs-13 lh-20 fw-6 cn-9 m-0">{title}</h3>
66+
{(subTitle || description) && (
67+
<div className="flex column fs-13 lh-20 fw-4 cn-7">
68+
{renderSubHeading(subTitle)}
69+
{renderSubHeading(description)}
70+
</div>
71+
)}
72+
</div>
73+
74+
{reload && (
75+
<Button
76+
text={buttonText}
77+
onClick={reload}
78+
variant={ButtonVariantType.text}
79+
size={ComponentSizeType.small}
80+
dataTestId="generic-section-reload-button"
81+
/>
4682
)}
4783
</div>
48-
49-
{reload && (
50-
<Button
51-
text={buttonText}
52-
onClick={reload}
53-
variant={ButtonVariantType.text}
54-
size={ComponentSizeType.small}
55-
dataTestId="generic-section-reload-button"
56-
/>
57-
)}
58-
</div>
59-
)
84+
)
85+
}
6086

6187
export default GenericSectionErrorState

0 commit comments

Comments
 (0)