Skip to content

Commit 38ed0c9

Browse files
committed
refactor: simplify property access in BuildAndTaskSummaryTooltipCard and GitTriggerList components; update class name in Sidebar component
1 parent 351cc9a commit 38ed0c9

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

src/Shared/Components/CICDHistory/BuildAndTaskSummaryTooltipCard.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ const BuildAndTaskSummaryTooltipCard = memo(
3535
</Tooltip>
3636

3737
<WorkerStatus
38-
message={executionInfo?.workerDetails?.message}
39-
podStatus={executionInfo?.workerDetails?.status}
38+
message={executionInfo?.workerDetails.message}
39+
podStatus={executionInfo?.workerDetails.status}
4040
stage={stage}
41-
finishedOn={executionInfo?.workerDetails?.endTime}
42-
clusterId={executionInfo?.workerDetails?.clusterId || DEFAULT_CLUSTER_ID}
41+
finishedOn={executionInfo?.workerDetails.endTime}
42+
clusterId={executionInfo?.workerDetails.clusterId || DEFAULT_CLUSTER_ID}
4343
workerPodName={podName}
4444
namespace={namespace}
4545
workerMessageContainerClassName="cn-7 fs-12 fw-4 lh-18"

src/Shared/Components/CICDHistory/GitTriggerList.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,17 @@ const GitTriggerList = memo(
2121
{Object.keys(gitTriggers ?? {}).length > 0 &&
2222
ciMaterials?.map((ciMaterial) => {
2323
const gitDetail: GitTriggers = gitTriggers[ciMaterial.id]
24-
const sourceType = gitDetail?.CiConfigureSourceType
25-
? gitDetail.CiConfigureSourceType
26-
: ciMaterial?.type
27-
const sourceValue = gitDetail?.CiConfigureSourceValue
28-
? gitDetail.CiConfigureSourceValue
29-
: ciMaterial?.value
30-
const gitMaterialUrl = gitDetail?.GitRepoUrl ? gitDetail.GitRepoUrl : ciMaterial?.url
24+
25+
const sourceType = gitDetail?.CiConfigureSourceType || ciMaterial?.type
26+
const sourceValue = gitDetail?.CiConfigureSourceValue || ciMaterial?.value
27+
const gitMaterialUrl = gitDetail?.GitRepoUrl || ciMaterial?.url
28+
3129
if (sourceType !== SourceTypeMap.WEBHOOK && !gitDetail) {
3230
return null
3331
}
3432

3533
return (
36-
<div className={`${addMarginTop ? 'mt-22' : ''} ci-material-detail"`} key={ciMaterial.id}>
34+
<div className={`${addMarginTop ? 'mt-22' : ''}`} key={ciMaterial.id}>
3735
{sourceType === SourceTypeMap.WEBHOOK ? (
3836
<div className="flex left column">
3937
<CiPipelineSourceConfig

src/Shared/Components/CICDHistory/Sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const DeploymentSummaryTooltipCard = memo(
4848
ciMaterials,
4949
gitTriggers,
5050
}: DeploymentSummaryTooltipCardType): JSX.Element => (
51-
<div className="build-card-popup p-16 br-4 w-400 bg__primary mxh-300 dc__overflow-auto">
51+
<div className="shadow__overlay p-16 br-4 w-400 bg__primary mxh-300 dc__overflow-auto">
5252
<span className="fw-6 fs-16 mb-4" style={{ color: colorMap[status.toLowerCase()] }}>
5353
{getWorkflowNodeStatusTitle(status)}
5454
</span>

0 commit comments

Comments
 (0)