diff --git a/package-lock.json b/package-lock.json
index 54230a428..77ff2bc6b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
- "version": "0.5.0-beta-1",
+ "version": "0.5.0-beta-10",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@devtron-labs/devtron-fe-common-lib",
- "version": "0.5.0-beta-1",
+ "version": "0.5.0-beta-10",
"license": "ISC",
"dependencies": {
"@types/react-dates": "^21.8.6",
diff --git a/package.json b/package.json
index c0cf55e16..712fddef3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@devtron-labs/devtron-fe-common-lib",
- "version": "0.5.0-beta-1",
+ "version": "0.5.0-beta-10",
"description": "Supporting common component library",
"type": "module",
"main": "dist/index.js",
diff --git a/src/Assets/Icon/ic-file-code.svg b/src/Assets/Icon/ic-file-code.svg
new file mode 100644
index 000000000..d8f0955c5
--- /dev/null
+++ b/src/Assets/Icon/ic-file-code.svg
@@ -0,0 +1,20 @@
+
+
+
diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx
index 7c48506d8..addbebca1 100644
--- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx
+++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.component.tsx
@@ -12,6 +12,7 @@ export const DeploymentConfigDiff = ({
navHeading,
navHelpText,
tabConfig,
+ errorConfig,
...resProps
}: DeploymentConfigDiffProps) => (
@@ -23,7 +24,13 @@ export const DeploymentConfigDiff = ({
navHeading={navHeading}
navHelpText={navHelpText}
tabConfig={tabConfig}
+ errorConfig={errorConfig}
+ />
+
-
)
diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.scss b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.scss
index 9e0859448..c3395c14f 100644
--- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.scss
+++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.scss
@@ -39,7 +39,7 @@
&__tab-list {
label {
- flex-grow: 1
+ flex-grow: 1;
}
.radio__item-label {
diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts
index 8a3dd0424..0f8a3b202 100644
--- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts
+++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.types.ts
@@ -42,6 +42,7 @@ export type DeploymentConfigDiffSelectPickerProps =
}
export interface DeploymentConfigDiffNavigationItem extends Pick {
+ Icon?: React.FunctionComponent>
hasDiff?: boolean
}
@@ -84,7 +85,14 @@ export interface DeploymentConfigDiffProps {
export interface DeploymentConfigDiffNavigationProps
extends Pick<
DeploymentConfigDiffProps,
- 'isLoading' | 'navList' | 'collapsibleNavList' | 'goBackURL' | 'navHeading' | 'navHelpText' | 'tabConfig'
+ | 'isLoading'
+ | 'navList'
+ | 'collapsibleNavList'
+ | 'goBackURL'
+ | 'navHeading'
+ | 'navHelpText'
+ | 'tabConfig'
+ | 'errorConfig'
> {}
export interface DeploymentConfigDiffMainProps
diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx
index 2688bce9a..d7674e069 100644
--- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx
+++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiff.utils.tsx
@@ -1,6 +1,7 @@
import { ReactComponent as ICCheck } from '@Icons/ic-check.svg'
import { ReactComponent as ICStamp } from '@Icons/ic-stamp.svg'
import { ReactComponent as ICEditFile } from '@Icons/ic-edit-file.svg'
+import { ReactComponent as ICFileCode } from '@Icons/ic-file-code.svg'
import { stringComparatorBySortOrder, yamlComparatorBySortOrder } from '@Shared/Helpers'
import { DEPLOYMENT_HISTORY_CONFIGURATION_LIST_MAP } from '@Shared/constants'
import { YAMLStringify } from '@Common/Helper'
@@ -507,6 +508,7 @@ export const getAppEnvDeploymentConfigList = {
+ if (isLoading) {
+ return
+ }
+
+ if (errorConfig?.error) {
+ return
+ }
+
+ return {renderDiffs()}
+ }
+
return (
@@ -183,15 +195,7 @@ export const DeploymentConfigDiffMain = ({
{renderSortButton()}
-
- {errorConfig?.error &&
}
- {!errorConfig?.error &&
- (isLoading ? (
-
- ) : (
-
{renderDiffs()}
- ))}
-
+ {renderContent()}
)
}
diff --git a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx
index b8f2d8307..50569b47a 100644
--- a/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx
+++ b/src/Shared/Components/DeploymentConfigDiff/DeploymentConfigDiffNavigation.tsx
@@ -25,6 +25,7 @@ export const DeploymentConfigDiffNavigation = ({
navHeading,
navHelpText,
tabConfig,
+ errorConfig,
}: DeploymentConfigDiffNavigationProps) => {
// STATES
const [expandedIds, setExpandedIds] = useState>({})
@@ -101,17 +102,18 @@ export const DeploymentConfigDiffNavigation = ({
)
}
- const renderContent = () => (
+ const renderNavigation = () => (
<>
- {navList.map(({ title, href, onClick, hasDiff }) => (
+ {navList.map(({ title, href, onClick, hasDiff, Icon }) => (
- {title}
+ {Icon && }
+ {title}
{hasDiff && (
@@ -125,7 +127,7 @@ export const DeploymentConfigDiffNavigation = ({
{navHelpText && (
@@ -133,13 +135,32 @@ export const DeploymentConfigDiffNavigation = ({
>
)
- const renderLoading = () => ['90', '70', '50'].map((item) =>
)
+ const renderContent = () => {
+ if (isLoading) {
+ return ['90', '70', '50'].map((item) =>
)
+ }
+
+ if (errorConfig?.error) {
+ return (
+
+
+
+
+
+ Failed to load files. Please reload or select a different reference to compare with.
+
+
+ )
+ }
+
+ return renderNavigation()
+ }
return (
-
+
{renderTopContent()}
{!!tabConfig?.tabs.length && renderTabConfig()}
-
{isLoading ? renderLoading() : renderContent()}
+
{renderContent()}
)
}