Skip to content

Commit

Permalink
Fix [Job Artifacts] same artifact opens for all artifacts on Show Det…
Browse files Browse the repository at this point in the history
…ails click (#3009)
  • Loading branch information
illia-prokopchuk authored Jan 13, 2025
1 parent 3c5f22b commit b24d472
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
7 changes: 4 additions & 3 deletions src/components/DetailsArtifacts/detailsArtifacts.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ export const generateArtifactsTabContent = (
) => {
const handleOpenArtifactPopUp = artifact => {
const artifactData = {
kind: artifact.kind,
project: artifact.project || params.projectName,
name: artifact.db_key || artifact.key,
iter: artifact.iter,
tree: artifact.tree,
key: artifact.db_key || artifact.key,
iteration: artifact.iter,
uid: artifact.tree,
tag: artifact.tag
}

Expand Down
27 changes: 9 additions & 18 deletions src/elements/DetailsPopUp/ArtifactPopUp/ArtifactPopUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import {
} from '../../../components/ModelsPage/Models/models.util'

import { fetchDataSets, fetchFiles, fetchModels } from '../../../reducers/artifactsReducer'
import { ARTIFACTS_TAB, DATASETS_TAB, FILES_TAB, MODELS_TAB } from '../../../constants'
import { DATASETS_TAB, FILES_TAB, MODEL_TYPE, MODELS_TAB } from '../../../constants'
import { toggleYaml } from '../../../reducers/appReducer'

const ArtifactPopUp = ({ artifactData, isOpen, onResolve }) => {
Expand All @@ -58,19 +58,19 @@ const ArtifactPopUp = ({ artifactData, isOpen, onResolve }) => {
pageData: generateDatasetPageData(selectedArtifact, viewMode, {}, true),
fetchArtifact: fetchDataSets
}
: artifactData.kind === ARTIFACTS_TAB
: artifactData.kind === MODEL_TYPE
? {
type: FILES_TAB,
generateActionsMenu: generateFileActionsMenu,
pageData: generateFilePageData(viewMode),
fetchArtifact: fetchFiles
}
: {
type: MODELS_TAB,
generateActionsMenu: generateModelActionsMenu,
pageData: generateModelPageData(selectedArtifact, viewMode),
fetchArtifact: fetchModels
}
: {
type: FILES_TAB,
generateActionsMenu: generateFileActionsMenu,
pageData: generateFilePageData(viewMode),
fetchArtifact: fetchFiles
}
}, [selectedArtifact, artifactData.kind, viewMode])

const toggleConvertedYaml = useCallback(
Expand Down Expand Up @@ -122,16 +122,7 @@ const ArtifactPopUp = ({ artifactData, isOpen, onResolve }) => {

onResolve()
})
}, [
artifactContext,
dispatch,
onResolve,
artifactData.iteration,
artifactData.key,
artifactData.project,
artifactData.tag,
artifactData.uid
])
}, [artifactData, artifactContext, dispatch, onResolve])

const actionsMenu = useMemo(
() => fileMin =>
Expand Down

0 comments on commit b24d472

Please sign in to comment.