Skip to content

Commit

Permalink
Bug/WC-33: Fix NEES DOI links by appending project root to paths (#1438)
Browse files Browse the repository at this point in the history
* fix NEES DOI links by appending project root to paths

* remove extraneous string format
  • Loading branch information
jarosenb authored Sep 18, 2024
1 parent 1f3e1bc commit 2600303
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/modules/datafiles/src/nees/NeesDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export const NeesDetails: React.FC<{ neesId: string }> = ({ neesId }) => {
const neesExperiments = data?.metadata.experiments;
const numDOIs = neesExperiments?.filter((exp) => !!exp.doi).length || 0;
const routeParams = useParams();
const path = routeParams.path ?? data?.path;
let path = routeParams.path ?? data?.path;
// Fix for legacy URLs. /Experiment-1 -> /NEES-001.groups/Experiment-1
if (path) path = path.includes(neesId) ? path : `/${neesId}.groups/${path}`;

const [activeTab, setActiveTab] = useState<string>('files');
useEffect(() => setActiveTab('files'), [path]);
Expand Down

0 comments on commit 2600303

Please sign in to comment.