diff --git a/src/renderer/src/components/shared/DatasetTreeViewRenderer/index.jsx b/src/renderer/src/components/shared/DatasetTreeViewRenderer/index.jsx index a27bed283..fc8a8ff04 100644 --- a/src/renderer/src/components/shared/DatasetTreeViewRenderer/index.jsx +++ b/src/renderer/src/components/shared/DatasetTreeViewRenderer/index.jsx @@ -49,8 +49,6 @@ const getFileTypeIcon = (fileName) => { // FileItem component const FileItem = ({ name, content, onFileClick, getFileBackgroundColor }) => { const filesRelativePath = content.relativePath; - const filesEntity = getEntityForRelativePath("subjects", filesRelativePath); - const fileBackgroundColor = getFileBackgroundColor(filesRelativePath); return (
))} {Object.keys(content.files || {}).map((fileName) => ( diff --git a/src/renderer/src/components/shared/manifest/ManifestEntitySelector.jsx b/src/renderer/src/components/shared/manifest/ManifestEntitySelector.jsx index 0d3c863dd..30fb548aa 100644 --- a/src/renderer/src/components/shared/manifest/ManifestEntitySelector.jsx +++ b/src/renderer/src/components/shared/manifest/ManifestEntitySelector.jsx @@ -5,7 +5,9 @@ import DatasetTreeViewRenderer from "../DatasetTreeViewRenderer"; import { setActiveEntity, toggleRelativeFilePathForManifestEntity, + getEntityForRelativePath, } from "../../../stores/slices/manifestEntitySelectorSlice"; +import { get } from "jquery"; const ManifestEntitySelector = () => { const datasetStructureJSONObj = useGlobalStore((state) => state.datasetStructureJSONObj); @@ -32,6 +34,22 @@ const ManifestEntitySelector = () => { toggleRelativeFilePathForManifestEntity(entityType, activeEntity, fileContents.relativePath); }; + const getFolderBackgroundColor = (folderRelativePath) => { + const folderIsSelected = getEntityForRelativePath(folderRelativePath); + return folderIsSelected ? "blue" : "white"; + }; + + const getFileBackgroundColor = (fileRelativePath) => { + if (fileRelativePath === "primary/sub-1/code_description.xlsx") { + console.log("Active entity:", activeEntity); + } + const fileIsSelected = getEntityForRelativePath(fileRelativePath); + if (fileIsSelected) { + console.log("File is selected:", fileRelativePath); + } + return fileIsSelected ? "blue" : "white"; + }; + return (