Skip to content

Commit 6766a23

Browse files
committed
chore: Refactor Artifacts component to use rootClassName instead of jobCIClass
1 parent 7ecd388 commit 6766a23

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

src/Shared/Components/CICDHistory/Artifacts.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { useEffect, useState } from 'react'
1817
import { useParams } from 'react-router'
1918
import { useDownload } from '@Shared/Hooks'
2019
import {
@@ -133,7 +132,7 @@ const Artifacts = ({
133132
appReleaseTagNames,
134133
tagsEditable,
135134
hideImageTaggingHardDelete,
136-
jobCIClass,
135+
rootClassName,
137136
renderCIListHeader,
138137
}: ArtifactType) => {
139138
const { isSuperAdmin } = useSuperAdmin()
@@ -143,14 +142,6 @@ const Artifacts = ({
143142
triggerId: string
144143
buildId: string
145144
}>()
146-
const [copied, setCopied] = useState(false)
147-
148-
useEffect(() => {
149-
if (!copied) {
150-
return
151-
}
152-
setTimeout(() => setCopied(false), 2000)
153-
}, [copied])
154145

155146
async function handleArtifact() {
156147
await handleDownload({
@@ -215,7 +206,7 @@ const Artifacts = ({
215206
)
216207
}
217208
return (
218-
<div className={`flex left column dc__gap-12 ${jobCIClass ?? ''}`}>
209+
<div className={`flex left column dc__gap-12 ${rootClassName ?? ''}`}>
219210
{!isJobView && type !== HistoryComponentType.CD && (
220211
<CIListItem
221212
type="artifact"

src/Shared/Components/CICDHistory/TriggerOutput.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ const HistoryLogs: React.FC<HistoryLogsProps> = ({
614614
downloadArtifactUrl={CDBuildReportUrl}
615615
type={HistoryComponentType.CD}
616616
renderCIListHeader={renderCIListHeader}
617+
rootClassName="p-16"
617618
/>
618619
)}
619620
</Route>

src/Shared/Components/CICDHistory/types.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ export interface ArtifactType {
585585
appReleaseTagNames?: string[]
586586
tagsEditable?: boolean
587587
hideImageTaggingHardDelete?: boolean
588-
jobCIClass?: string
588+
rootClassName?: string
589589
renderCIListHeader: (renderCIListHeaderProps: RenderCIListHeaderProps) => JSX.Element
590590
}
591591

0 commit comments

Comments
 (0)