Skip to content

Commit 1cc752f

Browse files
Merge pull request #1488 from devtron-labs/fix/issues-card-refactor
fix: UAT fixed for app details cards
2 parents 07dba56 + bf2adc9 commit 1cc752f

15 files changed

+60
-63
lines changed

src/components/app/details/appDetails/AppDetails.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ export const Details: React.FC<DetailsType> = ({
614614

615615
return (
616616
<React.Fragment>
617-
<div className="w-100 pt-16 pr-20 pb-16 pl-20">
617+
<div className="w-100 pt-16 pr-20 pb-16 pl-20 app-info-bg-gradient">
618618
<SourceInfo
619619
appDetails={appDetails}
620620
appStreamData={streamData}

src/components/app/details/appDetails/AppMetrics.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ export const AppMetrics: React.FC<{ appName: string, environment, podMap: Map<st
212212
return (
213213
<AppMetricsEmptyState
214214
isLoading={datasource.isLoading}
215-
addSpace={addSpace}
216215
isConfigured={datasource.isConfigured}
217216
isHealthy={datasource.isHealthy}
218217
hostURLConfig={hostURLConfig}
@@ -445,7 +444,7 @@ function MonitoringModuleNotInstalled({ addSpace }: { addSpace: string }) {
445444
)
446445
}
447446

448-
function AppMetricsEmptyState({ isLoading, isConfigured, isHealthy, hostURLConfig, addSpace }) {
447+
function AppMetricsEmptyState({ isLoading, isConfigured, isHealthy, hostURLConfig }) {
449448
const [collapsed, toggleCollapsed] = useState<boolean>(true);
450449

451450
const toggleHeader = () => {
@@ -460,7 +459,7 @@ function AppMetricsEmptyState({ isLoading, isConfigured, isHealthy, hostURLConfi
460459
subtitle = 'Datasource configuration is incorrect or prometheus is not healthy. Please review configuration and try reloading this page.';
461460
}
462461
return (
463-
<div className={`app-metrics-graph__empty-state-wrapper bcn-0 w-100 pt-18 pb-18 pl-20 pr-20 cursor ${addSpace}`}>
462+
<div className="app-metrics-graph__empty-state-wrapper bcn-0 w-100 pt-18 pb-18 pl-20 pr-20 cursor" >
464463
<div onClick={toggleHeader} className="flex left w-100 lh-20">
465464
<span className="fs-14 fw-6 cn-7 flex left mr-16">
466465
<GraphIcon className="mr-8 fcn-7 icon-dim-20" />

src/components/app/details/appDetails/AppStatusCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const AppStatusCard = ({ appDetails, status, cardLoading, setDetailed, message }
6868
</div>
6969
<div className="flex br-4">
7070
<figure
71-
className={`${status.toLowerCase()} dc__app-summary__icon h-24 w-24`}
71+
className={`${status.toLowerCase()} h-24 w-24`}
7272
style={{ margin: 'auto', backgroundSize: 'contain, contain' }}
7373
></figure>
7474
</div>

src/components/app/details/appDetails/DeployedCommitCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const DeployedCommitCard = ({ cardLoading, showCommitInfoDrawer, envId, ciArtifa
5656
</div>
5757
<div className="flex fs-12 fw-4">
5858
<CommitIcon className="icon-dim-20" />
59-
<div className="dc__ellipsis-right cn-7 ml-2 fw-4 fs-12">{commitId}</div>
59+
<div className="dc__ellipsis-right cn-7 ml-2 fw-4 fs-12 dc__ff-monospace">{commitId}</div>
6060
</div>
6161
</div>
6262
<GitHub className="github-icon" />

src/components/app/details/appDetails/DeploymentStatusCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function DeploymentStatusCard({
6767
</div>
6868
<div className="app-details-info-card__bottom-container dc__content-space">
6969
<div className="app-details-info-card__bottom-container__message fs-12 fw-4">
70-
<span className="fs-13 mr-5 fw-6">
70+
<span className="fs-12 mr-5 fw-6">
7171
{validateMomentDate(deploymentTriggerTime, 'YYYY-MM-DDTHH:mm:ssZ')}
7272
</span>
7373
by {triggeredBy || '-'}

src/components/app/details/appDetails/IssuesCard.tsx

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,16 @@ const IssuesCard = ({ appStreamData, cardLoading, setErrorsList, toggleIssuesMod
5151

5252
useEffect(() => {
5353
if (appDetails.appType === AppType.DEVTRON_APP && appDetails.resourceTree?.nodes?.length) {
54-
for (let index = 0; index < appDetails.resourceTree.nodes.length; index++) {
55-
const node = appDetails.resourceTree.nodes[index]
56-
let _isImagePullBackOff = false
57-
if (node.info?.length) {
58-
for (let index = 0; index < node.info.length; index++) {
59-
const info = node.info[index]
60-
if (
61-
info.value &&
62-
(info.value.toLowerCase() === AppDetailsErrorType.ERRIMAGEPULL ||
63-
info.value.toLowerCase() === AppDetailsErrorType.IMAGEPULLBACKOFF)
64-
) {
65-
_isImagePullBackOff = true
66-
break
67-
}
68-
}
69-
70-
if (_isImagePullBackOff) {
71-
setIsImagePullBackOff(true)
72-
break
73-
}
74-
}
54+
const hasImagePullBackOff = appDetails.resourceTree.nodes.some((node) => {
55+
return node.info?.some((info) =>
56+
info.value &&
57+
(info.value.toLowerCase() === AppDetailsErrorType.ERRIMAGEPULL ||
58+
info.value.toLowerCase() === AppDetailsErrorType.IMAGEPULLBACKOFF)
59+
);
60+
});
61+
62+
if (hasImagePullBackOff) {
63+
setIsImagePullBackOff(true);
7564
}
7665
}
7766
}, [appDetails])

src/components/app/details/appDetails/SourceInfo.tsx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { URLS } from '../../../../config'
66
import { EnvSelector } from './AppDetails'
77
import { DeploymentAppTypeNameMapping } from '../../../../config/constantMessaging'
88
import { ReactComponent as ScaleDown } from '../../../../assets/icons/ic-scale-down.svg'
9-
import { ReactComponent as CommitIcon } from '../../../../assets/icons/ic-code-commit.svg'
109
import { useParams } from 'react-router'
1110
import { Nodes, SourceInfoType } from '../../types'
1211
import Tippy from '@tippyjs/react'
@@ -129,16 +128,6 @@ export function SourceInfo({
129128
URLs
130129
</button>
131130
)}
132-
{appDetails?.dataSource !== 'EXTERNAL' && showCommitInfo && (
133-
<button
134-
className="cta cta-with-img small cancel fs-12 fw-6 mr-6"
135-
onClick={onClickShowCommitInfo}
136-
data-testid="app-details-commit-info"
137-
>
138-
<CommitIcon className="icon-dim-16 mr-6" />
139-
commit info
140-
</button>
141-
)}
142131
{!isVirtualEnvironment && showHibernateModal && (
143132
<ConditionalWrap
144133
condition={appDetails?.userApprovalConfig?.length > 0}

src/components/app/details/appDetails/appDetails.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,8 +1688,7 @@ table.resource-tree {
16881688
}
16891689

16901690
.app-metrics-graph__empty-state-wrapper {
1691-
border-bottom: solid 1px var(--N200);
1692-
border-top: solid 1px var(--N200);
1691+
border-bottom: solid 1px var(--N100);
16931692
}
16941693

16951694
.app-metrics-graph__empty-state {
@@ -1914,6 +1913,7 @@ table.resource-tree {
19141913
align-items: flex-start;
19151914
flex-direction: column;
19161915
overflow: hidden;
1916+
box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.20);
19171917

19181918
&__top-container {
19191919
align-items: flex-start;

src/components/v2/appDetails/AppDetails.component.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { AppStreamData, AppType } from './appDetails.type'
55
import IndexStore from './index.store'
66
import EnvironmentStatusComponent from './sourceInfo/environmentStatus/EnvironmentStatus.component'
77
import EnvironmentSelectorComponent from './sourceInfo/EnvironmentSelector.component'
8-
import SyncErrorComponent from './SyncError.component'
98
import { importComponentFromFELibrary, useEventSource } from '../../common'
109
import { AppLevelExternalLinks } from '../../externalLinks/ExternalLinks.component'
1110
import NodeTreeDetailTab from './NodeTreeDetailTab'
@@ -183,7 +182,7 @@ const AppDetailsComponent = ({
183182

184183
return (
185184
<div className="helm-details" data-testid="app-details-wrapper">
186-
<div>
185+
<div className="app-info-bg-gradient">
187186
<EnvironmentSelectorComponent
188187
isExternalApp={isExternalApp}
189188
_init={_init}
@@ -202,8 +201,6 @@ const AppDetailsComponent = ({
202201
/>
203202
)}
204203
</div>
205-
206-
<SyncErrorComponent appStreamData={streamData} />
207204
{!appDetails.deploymentAppDeleteRequest && (
208205
<AppLevelExternalLinks
209206
helmAppDetails={appDetails}

src/components/v2/appDetails/appDetails.scss

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@
1818
}
1919
/* End: Container height fixes */
2020

21-
.helm-details{
22-
display: flex;
23-
flex-direction: column;
24-
flex: 1
25-
}
21+
.helm-details {
22+
display: flex;
23+
flex-direction: column;
24+
flex: 1;
25+
}
26+
27+
.app-info-bg-gradient {
28+
background: linear-gradient(to top, #ffffff 0, #ffffff 50px, var(--window-bg) 50px);
29+
}

0 commit comments

Comments
 (0)