Skip to content

Commit a14121b

Browse files
authored
Merge pull request #359 from devtron-labs/fix/cm-secret-bug-fixes
fix: cm secret bug fixes & UAT changes
2 parents 8d29989 + 135df49 commit a14121b

File tree

9 files changed

+85
-23
lines changed

9 files changed

+85
-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": "0.5.0-beta-1",
3+
"version": "0.5.0-beta-10",
44
"description": "Supporting common component library",
55
"type": "module",
66
"main": "dist/index.js",

src/Assets/Icon/ic-file-code.svg

Lines changed: 20 additions & 0 deletions
Loading

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const DeploymentConfigDiff = ({
1212
navHeading,
1313
navHelpText,
1414
tabConfig,
15+
errorConfig,
1516
...resProps
1617
}: DeploymentConfigDiffProps) => (
1718
<div className="deployment-config-diff">
@@ -23,7 +24,13 @@ export const DeploymentConfigDiff = ({
2324
navHeading={navHeading}
2425
navHelpText={navHelpText}
2526
tabConfig={tabConfig}
27+
errorConfig={errorConfig}
28+
/>
29+
<DeploymentConfigDiffMain
30+
isLoading={isLoading}
31+
configList={configList}
32+
errorConfig={errorConfig}
33+
{...resProps}
2634
/>
27-
<DeploymentConfigDiffMain isLoading={isLoading} configList={configList} {...resProps} />
2835
</div>
2936
)

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
&__tab-list {
4141
label {
42-
flex-grow: 1
42+
flex-grow: 1;
4343
}
4444

4545
.radio__item-label {

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export type DeploymentConfigDiffSelectPickerProps =
4242
}
4343

4444
export interface DeploymentConfigDiffNavigationItem extends Pick<CollapsibleListItem, 'href' | 'title' | 'onClick'> {
45+
Icon?: React.FunctionComponent<React.SVGProps<SVGSVGElement>>
4546
hasDiff?: boolean
4647
}
4748

@@ -84,7 +85,14 @@ export interface DeploymentConfigDiffProps {
8485
export interface DeploymentConfigDiffNavigationProps
8586
extends Pick<
8687
DeploymentConfigDiffProps,
87-
'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText' | 'tabConfig'
88+
| 'isLoading'
89+
| 'navList'
90+
| 'collapsibleNavList'
91+
| 'goBackURL'
92+
| 'navHeading'
93+
| 'navHelpText'
94+
| 'tabConfig'
95+
| 'errorConfig'
8896
> {}
8997

9098
export interface DeploymentConfigDiffMainProps

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { ReactComponent as ICCheck } from '@Icons/ic-check.svg'
22
import { ReactComponent as ICStamp } from '@Icons/ic-stamp.svg'
33
import { ReactComponent as ICEditFile } from '@Icons/ic-edit-file.svg'
4+
import { ReactComponent as ICFileCode } from '@Icons/ic-file-code.svg'
45
import { stringComparatorBySortOrder, yamlComparatorBySortOrder } from '@Shared/Helpers'
56
import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP } from '@Shared/constants'
67
import { YAMLStringify } from '@Common/Helper'
@@ -507,6 +508,7 @@ export const getAppEnvDeploymentConfigList = <ManifestView extends boolean = fal
507508
const element = document.querySelector(`#${deploymentTemplateData.id}`)
508509
element?.scrollIntoView({ block: 'start' })
509510
},
511+
Icon: ICFileCode,
510512
},
511513
]
512514

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffMain.tsx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,18 @@ export const DeploymentConfigDiffMain = ({
169169
)
170170
})
171171

172+
const renderContent = () => {
173+
if (isLoading) {
174+
return <Progressing fullHeight pageLoader />
175+
}
176+
177+
if (errorConfig?.error) {
178+
return <ErrorScreenManager code={errorConfig.code} reload={errorConfig.reload} />
179+
}
180+
181+
return <div className="flexbox-col dc__gap-12 p-12">{renderDiffs()}</div>
182+
}
183+
172184
return (
173185
<div className="bcn-0 deployment-config-diff__main-top">
174186
<div className="dc__border-bottom-n1 flexbox dc__align-items-center dc__position-sticky dc__top-0 bcn-0 w-100 dc__zi-11">
@@ -183,15 +195,7 @@ export const DeploymentConfigDiffMain = ({
183195
{renderSortButton()}
184196
</div>
185197
</div>
186-
<div className="deployment-config-diff__main-content">
187-
{errorConfig?.error && <ErrorScreenManager code={errorConfig.code} reload={errorConfig.reload} />}
188-
{!errorConfig?.error &&
189-
(isLoading ? (
190-
<Progressing fullHeight size={48} />
191-
) : (
192-
<div className="flexbox-col dc__gap-12 p-12">{renderDiffs()}</div>
193-
))}
194-
</div>
198+
<div className="deployment-config-diff__main-content">{renderContent()}</div>
195199
</div>
196200
)
197201
}

src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export const DeploymentConfigDiffNavigation = ({
2525
navHeading,
2626
navHelpText,
2727
tabConfig,
28+
errorConfig,
2829
}: DeploymentConfigDiffNavigationProps) => {
2930
// STATES
3031
const [expandedIds, setExpandedIds] = useState<Record<string, boolean>>({})
@@ -101,17 +102,18 @@ export const DeploymentConfigDiffNavigation = ({
101102
)
102103
}
103104

104-
const renderContent = () => (
105+
const renderNavigation = () => (
105106
<>
106-
{navList.map(({ title, href, onClick, hasDiff }) => (
107+
{navList.map(({ title, href, onClick, hasDiff, Icon }) => (
107108
<NavLink
108109
key={title}
109110
data-testid="env-deployment-template"
110-
className="dc__nav-item cursor dc__gap-8 fs-13 lh-32 cn-7 w-100 br-4 px-8 flexbox dc__align-items-center dc__content-space dc__no-decor"
111+
className="dc__nav-item cursor dc__gap-8 fs-13 lh-32 cn-7 w-100 br-4 px-8 flexbox dc__align-items-center dc__no-decor"
111112
to={href}
112113
onClick={onClick}
113114
>
114-
<span className="dc__truncate">{title}</span>
115+
{Icon && <Icon className="icon-dim-16 dc__nav-item__start-icon dc__no-shrink" />}
116+
<span className="dc__truncate flex-grow-1">{title}</span>
115117
{hasDiff && (
116118
<Tippy className="default-tt" content="File has difference" arrow={false} placement="right">
117119
<div className="flex">
@@ -125,21 +127,40 @@ export const DeploymentConfigDiffNavigation = ({
125127
{navHelpText && (
126128
<div className="mt-8 py-6 px-8 flexbox dc__align-items-center dc__gap-8">
127129
<span className="flex p-2 dc__align-self-start">
128-
<ICInfoOutlined className="icon-dim-16 fcn-6" />
130+
<ICInfoOutlined className="icon-dim-16 fcn-7" />
129131
</span>
130132
<p className="m-0 fs-12 lh-1-5 cn-9">{navHelpText}</p>
131133
</div>
132134
)}
133135
</>
134136
)
135137

136-
const renderLoading = () => ['90', '70', '50'].map((item) => <ShimmerText key={item} width={item} />)
138+
const renderContent = () => {
139+
if (isLoading) {
140+
return ['90', '70', '50'].map((item) => <ShimmerText key={item} width={item} />)
141+
}
142+
143+
if (errorConfig?.error) {
144+
return (
145+
<div className="mt-8 py-6 px-8 flexbox dc__align-items-center dc__gap-8">
146+
<span className="flex p-2 dc__align-self-start">
147+
<ICInfoOutlined className="icon-dim-16 fcn-7" />
148+
</span>
149+
<p className="m-0 fs-12 lh-1-5 cn-9">
150+
Failed to load files. Please reload or select a different reference to compare with.
151+
</p>
152+
</div>
153+
)
154+
}
155+
156+
return renderNavigation()
157+
}
137158

138159
return (
139-
<div className="bcn-0 dc__border-right">
160+
<div className="bcn-0 dc__border-right flexbox-col dc__overflow-hidden">
140161
{renderTopContent()}
141162
{!!tabConfig?.tabs.length && renderTabConfig()}
142-
<div className="mw-none p-8">{isLoading ? renderLoading() : renderContent()}</div>
163+
<div className="mw-none p-8 flex-grow-1 dc__overflow-auto">{renderContent()}</div>
143164
</div>
144165
)
145166
}

0 commit comments

Comments
 (0)