Skip to content

Commit

Permalink
Add maps sharing prefix (#1050)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmfalke committed Apr 26, 2024
1 parent fa591ee commit 44e60b1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/libs/eda/src/lib/map/MapVeuContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface Props {
edaServiceUrl: string;
singleAppMode?: string;
siteInformationProps: SiteInformationProps;
sharingUrl: string;
sharingUrlPrefix?: string;
showLinkToEda?: boolean;
}

Expand All @@ -43,7 +43,7 @@ export function MapVeuContainer(mapVeuContainerProps: Props) {
singleAppMode,
siteInformationProps,
edaServiceUrl,
sharingUrl,
sharingUrlPrefix,
showLinkToEda,
} = mapVeuContainerProps;
const edaClient = useConfiguredSubsettingClient(edaServiceUrl);
Expand Down Expand Up @@ -152,7 +152,7 @@ export function MapVeuContainer(mapVeuContainerProps: Props) {
analysisId={routeProps.match.params.analysisId}
siteInformationProps={siteInformationProps}
studyId={routeProps.match.params.studyId}
sharingUrl={sharingUrl}
sharingUrlPrefix={sharingUrlPrefix}
showLinkToEda={showLinkToEda}
/>
</EDAWorkspaceContainer>
Expand Down
13 changes: 8 additions & 5 deletions packages/libs/eda/src/lib/map/analysis/MapAnalysis.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const mapStyle: React.CSSProperties = {

interface Props {
analysisId?: string;
sharingUrl: string;
sharingUrlPrefix?: string;
singleAppMode?: string;
studyId: string;
siteInformationProps: SiteInformationProps;
Expand Down Expand Up @@ -215,7 +215,7 @@ function MapAnalysisImpl(props: ImplProps) {
setViewport,
setBoundsZoomLevel,
setSubsetVariableAndEntity,
// sharingUrl,
sharingUrlPrefix,
setIsSidePanelExpanded,
setMarkerConfigurations,
setActiveMarkerConfigurationType,
Expand All @@ -236,9 +236,12 @@ function MapAnalysisImpl(props: ImplProps) {
const subsettingClient = useSubsettingClient();
const history = useHistory();

// FIXME use the sharingUrl prop to construct this
const sharingUrl = new URL(`../${analysisId}/import`, window.location.href)
.href;
const sharingUrl = new URL(
sharingUrlPrefix
? `${sharingUrlPrefix}/${analysisId}`
: `../${analysisId}/import`,
window.location.href
).href;

const getDefaultVariableDescriptor = useGetDefaultVariableDescriptor();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@ export function EdaMapController() {
siteInformationProps={{
loginUrl: '/user/login',
siteHomeUrl: webAppUrl,
// TODO Remove hardcoded logo after demo
// Hardcode veupathdb logo for now.
siteLogoSrc: `${webAppUrl}/images/VEuPathDB/icons-footer/${projectId.toLowerCase()}.png`,
// siteLogoSrc: `${webAppUrl}/images/VEuPathDB/icons-footer/VEuPathDB.png`,
siteName: projectConfig?.displayName ?? '',
}}
sharingUrl={''}
sharingUrlPrefix={'/maps'}
showLinkToEda={projectId === 'ClinEpiDB'}
/>
</Suspense>
Expand Down

0 comments on commit 44e60b1

Please sign in to comment.