Skip to content

Commit d5f4a3d

Browse files
committed
Merge branch 'develop' of github.com:devtron-labs/devtron-fe-common-lib into feat/use-rjsf-chart-store
2 parents 4b567cb + 5697f74 commit d5f4a3d

10 files changed

+265
-92
lines changed

src/Common/AppStatus/AppStatus.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616

1717
import Tippy from '@tippyjs/react'
18+
import { ReactComponent as ICErrorCross } from '@Icons/ic-error-cross.svg'
1819
import { ReactComponent as InfoIcon } from '../../Assets/Icon/ic-info-outlined.svg'
1920
import { StatusConstants, YET_TO_RUN } from './constants'
2021
import { AppStatusType } from './types'
@@ -52,7 +53,11 @@ export default function AppStatus({
5253

5354
const renderIcon = () => {
5455
if (iconClass) {
55-
return <span className={`dc__app-summary__icon icon-dim-16 ${iconClass} ${iconClass}--node`} />
56+
return iconClass === 'failed' || iconClass === 'error' ? (
57+
<ICErrorCross className="icon-dim-16 dc__no-shrink ic-error-cross-red" />
58+
) : (
59+
<span className={`dc__app-summary__icon icon-dim-16 ${iconClass} ${iconClass}--node`} />
60+
)
5661
}
5762
if (isVirtualEnv) {
5863
return (

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DeploymentConfigDiffNavigation } from './DeploymentConfigDiffNavigation'
22
import { DeploymentConfigDiffMain } from './DeploymentConfigDiffMain'
3-
import { DeploymentConfigDiffProps } from './types'
3+
import { DeploymentConfigDiffProps } from './DeploymentConfigDiff.types'
44
import './DeploymentConfigDiff.scss'
55

66
export const DeploymentConfigDiff = ({
@@ -11,6 +11,7 @@ export const DeploymentConfigDiff = ({
1111
goBackURL,
1212
navHeading,
1313
navHelpText,
14+
tabConfig,
1415
...resProps
1516
}: DeploymentConfigDiffProps) => (
1617
<div className="deployment-config-diff">
@@ -21,6 +22,7 @@ export const DeploymentConfigDiff = ({
2122
goBackURL={goBackURL}
2223
navHeading={navHeading}
2324
navHelpText={navHelpText}
25+
tabConfig={tabConfig}
2426
/>
2527
<DeploymentConfigDiffMain isLoading={isLoading} configList={configList} {...resProps} />
2628
</div>

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
height: calc(100vh - 122px);
2222
overflow: auto;
2323

24+
&__heading {
25+
display: grid;
26+
// -15px to accommodate the right side bar of the code-editor
27+
grid-template-columns: calc(50% - 15px) calc(50% - 15px);
28+
grid-template-rows: auto;
29+
}
30+
2431
&__comparison {
2532
margin: 16px 0 0;
2633
}
@@ -29,4 +36,14 @@
2936
& .react-monaco-editor-container {
3037
min-height: 100px;
3138
}
39+
40+
&__tab-list {
41+
label {
42+
flex-grow: 1
43+
}
44+
45+
.radio__item-label {
46+
justify-content: center;
47+
}
48+
}
3249
}

src/Shared/Components/DeploymentConfigDiff/types.ts renamed to src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import { SortingOrder } from '@Common/Constants'
22

3-
import { ConfigMapSecretDataConfigDatumDTO, DeploymentTemplateDTO } from '@Shared/Services'
3+
import {
4+
AppEnvDeploymentConfigDTO,
5+
ConfigMapSecretDataConfigDatumDTO,
6+
DeploymentTemplateDTO,
7+
EnvResourceType,
8+
ManifestTemplateDTO,
9+
} from '@Shared/Services'
10+
411
import { DeploymentHistoryDetail } from '../CICDHistory'
512
import { CollapsibleListConfig, CollapsibleListItem } from '../CollapsibleList'
613
import { SelectPickerProps } from '../SelectPicker'
@@ -45,6 +52,11 @@ export interface DeploymentConfigDiffNavigationCollapsibleItem
4552

4653
export interface DeploymentConfigDiffProps {
4754
isLoading?: boolean
55+
errorConfig?: {
56+
error: boolean
57+
code: number
58+
reload: () => void
59+
}
4860
configList: DeploymentConfigListItem[]
4961
headerText?: string
5062
scrollIntoViewId?: string
@@ -62,18 +74,29 @@ export interface DeploymentConfigDiffProps {
6274
goBackURL?: string
6375
navHeading: string
6476
navHelpText?: string
77+
tabConfig?: {
78+
tabs: string[]
79+
activeTab: string
80+
onClick: (tab: string) => void
81+
}
6582
}
6683

6784
export interface DeploymentConfigDiffNavigationProps
6885
extends Pick<
6986
DeploymentConfigDiffProps,
70-
'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText'
87+
'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText' | 'tabConfig'
7188
> {}
7289

7390
export interface DeploymentConfigDiffMainProps
7491
extends Pick<
7592
DeploymentConfigDiffProps,
76-
'isLoading' | 'headerText' | 'configList' | 'scrollIntoViewId' | 'selectorsConfig' | 'sortingConfig'
93+
| 'isLoading'
94+
| 'errorConfig'
95+
| 'headerText'
96+
| 'configList'
97+
| 'scrollIntoViewId'
98+
| 'selectorsConfig'
99+
| 'sortingConfig'
77100
> {}
78101

79102
export interface DeploymentConfigDiffAccordionProps extends Pick<CollapseProps, 'onTransitionEnd'> {
@@ -88,3 +111,18 @@ export interface DeploymentConfigDiffAccordionProps extends Pick<CollapseProps,
88111
export type DiffHeadingDataType<DeploymentTemplate> = DeploymentTemplate extends true
89112
? DeploymentTemplateDTO
90113
: ConfigMapSecretDataConfigDatumDTO
114+
115+
export type AppEnvDeploymentConfigListParams<IsManifestView> = (IsManifestView extends true
116+
? {
117+
currentList: ManifestTemplateDTO
118+
compareList: ManifestTemplateDTO
119+
sortOrder?: never
120+
}
121+
: {
122+
currentList: AppEnvDeploymentConfigDTO
123+
compareList: AppEnvDeploymentConfigDTO
124+
sortOrder?: SortingOrder
125+
}) & {
126+
getNavItemHref: (resourceType: EnvResourceType, resourceName: string) => string
127+
isManifestView?: IsManifestView
128+
}

0 commit comments

Comments
 (0)