From b24d472243d618c95e04ce2ca2c1d1194d60c304 Mon Sep 17 00:00:00 2001 From: illia-prokopchuk <78905712+illia-prokopchuk@users.noreply.github.com> Date: Mon, 13 Jan 2025 19:37:05 +0200 Subject: [PATCH] Fix [Job Artifacts] same artifact opens for all artifacts on Show Details click (#3009) --- .../DetailsArtifacts/detailsArtifacts.util.js | 7 ++--- .../ArtifactPopUp/ArtifactPopUp.js | 27 +++++++------------ 2 files changed, 13 insertions(+), 21 deletions(-) diff --git a/src/components/DetailsArtifacts/detailsArtifacts.util.js b/src/components/DetailsArtifacts/detailsArtifacts.util.js index 6b25fdc78..a582dfbaa 100644 --- a/src/components/DetailsArtifacts/detailsArtifacts.util.js +++ b/src/components/DetailsArtifacts/detailsArtifacts.util.js @@ -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 } diff --git a/src/elements/DetailsPopUp/ArtifactPopUp/ArtifactPopUp.js b/src/elements/DetailsPopUp/ArtifactPopUp/ArtifactPopUp.js index 588d26654..15e9a3e8e 100644 --- a/src/elements/DetailsPopUp/ArtifactPopUp/ArtifactPopUp.js +++ b/src/elements/DetailsPopUp/ArtifactPopUp/ArtifactPopUp.js @@ -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 }) => { @@ -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( @@ -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 =>