Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/common/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,7 +1188,8 @@ export const toMapperURL = path => {
if(window.location.host.match('app.*.openconceptlab.org'))
url = window.location.origin.replace('//app.', '//map.')

let referrerParams = `referrer=${window.location.href}`
// The Mapper reads auth only from the segment after the first '?' in the referrer's hash, so drop this page's own query
let referrerParams = `referrer=${window.location.href.split('?')[0]}`
if(isLoggedIn())
referrerParams += '?auth=true'

Expand Down
13 changes: 11 additions & 2 deletions src/components/common/AppsMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import React from 'react';
import { Link } from 'react-router-dom';
import { useLocation } from 'react-router';
import { Apps as AppsIcon , Web as MetadataBrowserIcon, Publish as ImportsIcon } from '@mui/icons-material';
import MapperIcon from '@mui/icons-material/MotionPhotosAutoOutlined';
import { Tooltip, IconButton, Box, Typography } from '@mui/material';
import useToggle from '../../hooks/useToggle';
import { getSiteTitle } from '../../common/utils';
import { getSiteTitle, toMapperURL } from '../../common/utils';
import PopperGrow from './PopperGrow';

const SITE_TITLE = getSiteTitle()
Expand Down Expand Up @@ -35,7 +36,7 @@ const AppsMenu = props => {
<AppsIcon/>
</IconButton>
</Tooltip>
<PopperGrow open={open.value} anchorRef={anchorRef} handleClose={handleClose}>
<PopperGrow open={open.value} anchorRef={anchorRef} handleClose={handleClose} minWidth='min(390px, 100vw - 16px)'>
<div className='app-menu'>
<Box className="app-container" display="inline-block" justifyContent="space-around" style={{width: '100%'}}>
{
Expand All @@ -60,6 +61,14 @@ const AppsMenu = props => {
</Box>
</Link>
}
<a href={toMapperURL()} target='_blank' rel='noopener noreferrer' className='no-anchor-styles' onClick={handleClose}>
<Box className="app" display="inline-block">
<MapperIcon fontSize="large"/>
<Typography style={{lineHeight:"1.2", marginTop:"15px"}} align="center" component="h6">
OCL <br/> Mapper
</Typography>
</Box>
</a>
</Box>
</div>
</PopperGrow>
Expand Down
Loading