Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ICAT
Datahub
Commits
9a2dabf7
Commit
9a2dabf7
authored
Aug 26, 2020
by
Axel Bocciarelli
Browse files
Don't show sample tracking features to anonymous users
parent
dd1f182b
Pipeline
#31961
passed with stage
in 3 minutes and 17 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/App.js
View file @
9a2dabf7
...
...
@@ -93,6 +93,9 @@ function App() {
);
}
const
isSampleTrackingEnabled
=
UI
.
sampleTracking
.
enabled
&&
!
user
.
isAnonymous
;
return
(
<
Switch
>
<
Route
...
...
@@ -124,10 +127,10 @@ function App() {
<
Route
exact
path
=
"
/closed
"
component
=
{
ClosedDataPage
}
/
>
<
Route
exact
path
=
"
/beamline/:id
"
component
=
{
BeamlineDataPage
}
/
>
{
UI
.
s
ampleTracking
.
e
nabled
&&
(
{
isS
ampleTracking
E
nabled
&&
(
<
Route
exact
path
=
"
/parcels
"
component
=
{
MyParcelsPage
}
/
>
)}
{
UI
.
s
ampleTracking
.
e
nabled
&&
(
{
isS
ampleTracking
E
nabled
&&
(
<
Route
exact
path
=
"
/addresses
"
component
=
{
AddressesPage
}
/
>
)}
...
...
@@ -155,7 +158,7 @@ function App() {
path
=
"
/investigation/:investigationId/events
"
component
=
{
EventsPage
}
/
>
{
UI
.
s
ampleTracking
.
e
nabled
&&
(
{
isS
ampleTracking
E
nabled
&&
(
<
Route
exact
path
=
"
/investigation/:investigationId/shipping
"
...
...
src/components/Menu/Menu.js
View file @
9a2dabf7
...
...
@@ -131,7 +131,7 @@ function Menu() {
<
/LinkContainer
>
)}
{
UI
.
sampleTracking
.
enabled
&&
(
{
UI
.
sampleTracking
.
enabled
&&
!
user
.
isAnonymous
&&
(
<
NavDropdown
eventKey
=
{
3
}
title
=
"
Shipping
"
...
...
src/components/TabContainerMenu/TabContainerMenu.js
View file @
9a2dabf7
...
...
@@ -7,6 +7,7 @@ import UI from '../../config/ui/config';
function
TabContainerMenu
(
props
)
{
const
{
doi
}
=
props
;
const
{
isAnonymous
}
=
useSelector
((
state
)
=>
state
.
user
);
const
datasetCount
=
useSelector
((
state
)
=>
state
.
datasets
.
data
.
length
);
const
{
investigationId
}
=
useParams
();
...
...
@@ -33,7 +34,7 @@ function TabContainerMenu(props) {
<
/NavItem
>
<
/LinkContainer
>
{
UI
.
sampleTracking
.
enabled
&&
(
{
UI
.
sampleTracking
.
enabled
&&
!
isAnonymous
&&
(
<>
<
LinkContainer
to
=
{
`
${
routePrefix
}
/shipping`
}
>
<
NavItem
eventKey
=
"
shipping
"
href
=
""
>
...
...
src/reducers/login.js
View file @
9a2dabf7
...
...
@@ -13,6 +13,7 @@ const initialState = {
expirationTime
:
null
,
fullName
:
null
,
name
:
null
,
isAnonymous
:
false
,
isAdministrator
:
false
,
isAuthenticating
:
false
,
isSessionExpired
:
false
,
...
...
@@ -39,8 +40,9 @@ const user = (state = initialState, action) => {
expirationTime
:
moment
()
.
add
(
action
.
lifeTimeMinutes
,
'
minutes
'
)
.
format
(),
fullName
:
action
.
fullName
,
name
:
action
.
name
,
fullName
:
action
.
fullName
,
isAnonymous
:
action
.
fullName
===
'
Anonymous
'
,
isAdministrator
:
action
.
isAdministrator
,
};
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment