Skip to content

Commit 953ab36

Browse files
committed
feat: add PipelineMigratedFromType enum and enhance GenericSectionErrorState props
1 parent bdbcc94 commit 953ab36

File tree

3 files changed

+33
-14
lines changed

3 files changed

+33
-14
lines changed

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

Lines changed: 10 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
@@ -142,13 +147,18 @@ interface BaseDeploymentTemplateConfigState {
142147
isOverridden?: never
143148
environmentConfig?: never
144149
mergeStrategy?: never
150+
migratedFrom?: never
145151
}
146152

147153
type EnvironmentOverrideDeploymentTemplateConfigState = {
148154
chartConfig?: never
149155
isOverridden: boolean
150156
environmentConfig: EnvironmentConfigType
151157
mergeStrategy: OverrideMergeStrategyType
158+
/**
159+
* Readonly flag to show the user that the pipeline is migrated from external app to devtron, and can't change its version or delete override
160+
*/
161+
migratedFrom: PipelineMigratedFromType
152162
}
153163

154164
export interface DeploymentTemplateConfigCommonState extends SelectedChartDetailsType {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import { ComponentSizeType } from '@Shared/constants'
1919
import { Progressing } from '@Common/Progressing'
2020
import { ReactComponent as ErrorIcon } from '@Icons/ic-error-exclamation.svg'
2121
import { ReactComponent as ICInfoOutline } from '@Icons/ic-info-outline.svg'
22-
import { ReactComponent as ICArrowCounterClockwise } from '@Icons/ic-arrow-counter-clockwise.svg'
2322
import { Button, ButtonVariantType } from '../Button'
2423
import { GenericSectionErrorStateProps } from './types'
2524

@@ -74,7 +73,6 @@ const GenericSectionErrorState = ({
7473

7574
{reload && (
7675
<Button
77-
startIcon={<ICArrowCounterClockwise className="dc__flip" />}
7876
text={buttonText}
7977
onClick={reload}
8078
variant={ButtonVariantType.text}

src/Shared/Components/GenericSectionErrorState/types.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import { ReactNode } from 'react'
1818
import { ProgressingProps } from '@Common/Types'
1919

20-
export interface GenericSectionErrorStateProps {
20+
export type GenericSectionErrorStateProps = {
2121
/**
2222
* Handler for reloading the section
2323
*/
@@ -48,14 +48,25 @@ export interface GenericSectionErrorStateProps {
4848
* to be applied on parent div
4949
*/
5050
rootClassName?: string
51-
/**
52-
* If provided, would render the Progressing component with given props instead of error icon
53-
*/
54-
progressingProps?: ProgressingProps
55-
/**
56-
* If true, info icon would be used instead of error
57-
*
58-
* @default false
59-
*/
60-
useInfoIcon?: boolean
61-
}
51+
} & (
52+
| {
53+
/**
54+
* If provided, would render the Progressing component with given props instead of error icon
55+
*/
56+
progressingProps: ProgressingProps
57+
useInfoIcon?: never
58+
}
59+
| {
60+
progressingProps?: never
61+
/**
62+
* If true, info icon would be used instead of error
63+
*
64+
* @default false
65+
*/
66+
useInfoIcon: boolean
67+
}
68+
| {
69+
progressingProps?: never
70+
useInfoIcon?: never
71+
}
72+
)

0 commit comments

Comments
 (0)