From 6b78ea405e06ad6cae1b13587b197159dda6adda Mon Sep 17 00:00:00 2001 From: Dave Falke Date: Fri, 8 Sep 2023 11:16:42 -0400 Subject: [PATCH] Add import route and construct sharing url (#452) --- .../libs/eda/src/lib/map/MapVeuContainer.tsx | 17 +++++++++++++++++ .../eda/src/lib/map/analysis/MapAnalysis.tsx | 9 +++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/libs/eda/src/lib/map/MapVeuContainer.tsx b/packages/libs/eda/src/lib/map/MapVeuContainer.tsx index 04244bad58..acca2b5b88 100644 --- a/packages/libs/eda/src/lib/map/MapVeuContainer.tsx +++ b/packages/libs/eda/src/lib/map/MapVeuContainer.tsx @@ -24,6 +24,7 @@ import './MapVEu.scss'; import { SiteInformationProps } from '.'; import { StudyList } from './StudyList'; import { PublicAnalysesRoute } from '../workspace/PublicAnalysesRoute'; +import { ImportAnalysis } from '../workspace/ImportAnalysis'; interface Props { edaServiceUrl: string; @@ -78,6 +79,22 @@ export function MapVeuContainer(mapVeuContainerProps: Props) { /> )} /> + + ) => { + return ( + + ); + }} + /> {}, setActiveMarkerConfigurationType, setMarkerConfigurations, @@ -259,6 +260,11 @@ function MapAnalysisImpl(props: ImplProps) { const downloadClient = useDownloadClient(); const subsettingClient = useSubsettingClient(); const geoConfig = geoConfigs[0]; + const history = useHistory(); + + // FIXME use the sharingUrl prop to construct this + const sharingUrl = new URL(`../${analysisId}/import`, window.location.href) + .href; const getDefaultVariableDescriptor = useGetDefaultVariableDescriptor(); @@ -547,7 +553,6 @@ function MapAnalysisImpl(props: ImplProps) { return !user.isGuest; }); - const history = useHistory(); function showLoginForm() { const currentUrl = window.location.href; const loginUrl = `${props.siteInformationProps.loginUrl}?destination=${currentUrl}`;