Skip to content
Snippets Groups Projects
Commit dba58f61 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Merge branch '2081-landing-entries-page-broken-for-users-not-logged-in' into 'develop'

Removed unnecessary access check on the GUI side.

Closes #2081

See merge request !1994
parents 065648f3 330396f7
Branches
Tags
1 merge request!1994Removed unnecessary access check on the GUI side.
Pipeline #214384 passed
...@@ -20,7 +20,6 @@ import PropTypes from 'prop-types' ...@@ -20,7 +20,6 @@ import PropTypes from 'prop-types'
import Quantity from '../Quantity' import Quantity from '../Quantity'
import { Formula } from './properties/MaterialCard' import { Formula } from './properties/MaterialCard'
import { Tooltip, IconButton, Box } from '@material-ui/core' import { Tooltip, IconButton, Box } from '@material-ui/core'
import { useApi } from '../api'
import { EntryButton } from '../nav/Routes' import { EntryButton } from '../nav/Routes'
import DetailsIcon from '@material-ui/icons/ArrowForward' import DetailsIcon from '@material-ui/icons/ArrowForward'
import { makeStyles } from '@material-ui/core/styles' import { makeStyles } from '@material-ui/core/styles'
...@@ -114,10 +113,9 @@ EntryIds.propTypes = { ...@@ -114,10 +113,9 @@ EntryIds.propTypes = {
data: PropTypes.object.isRequired data: PropTypes.object.isRequired
} }
export const VisitEntryAction = React.memo(function VisitEntryAction({data, ...props}) { export const VisitEntryAction = React.memo(({data, ...props}) => {
const {user} = useApi() // The visit button is hidden if the entry is still processing.
const hide = (data.with_embargo && !user && !data.viewers.find(viewer => viewer.user_id === user.sub)) || data.process_running if (data.process_running) {
if (hide) {
return null return null
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment