Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Website
Commits
786f6a91
Commit
786f6a91
authored
Jan 31, 2019
by
Viacheslav Pavlov
Browse files
URL for accessions with DOI
parent
f1cba03a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/accessions/ui/DisplayPage.tsx
View file @
786f6a91
...
@@ -7,6 +7,7 @@ import { withStyles } from '@material-ui/core/styles';
...
@@ -7,6 +7,7 @@ import { withStyles } from '@material-ui/core/styles';
// Actions
// Actions
import
{
loadAccession
,
applyFilters
,
loadAccessionAuditLog
}
from
'
accessions/actions/public
'
;
import
{
loadAccession
,
applyFilters
,
loadAccessionAuditLog
}
from
'
accessions/actions/public
'
;
import
{
addAccessionToMyList
,
removeAccessionFromMyList
}
from
'
list/actions/public
'
;
import
{
addAccessionToMyList
,
removeAccessionFromMyList
}
from
'
list/actions/public
'
;
import
navigateTo
from
'
actions/navigation
'
;
// Constants
// Constants
import
{
ROLE_USER
}
from
'
constants/userRoles
'
;
import
{
ROLE_USER
}
from
'
constants/userRoles
'
;
...
@@ -72,6 +73,7 @@ interface IBrowsePageProps {
...
@@ -72,6 +73,7 @@ interface IBrowsePageProps {
addAccessionToMyList
:
any
;
addAccessionToMyList
:
any
;
removeAccessionFromMyList
:
any
;
removeAccessionFromMyList
:
any
;
applyFilters
:
any
;
applyFilters
:
any
;
navigateTo
:
(
location
:
string
)
=>
void
;
}
}
class
BrowsePage
extends
React
.
Component
<
IBrowsePageProps
,
any
>
{
class
BrowsePage
extends
React
.
Component
<
IBrowsePageProps
,
any
>
{
...
@@ -99,6 +101,15 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
...
@@ -99,6 +101,15 @@ class BrowsePage extends React.Component<IBrowsePageProps, any> {
}
}
}
}
public
componentWillReceiveProps
(
nextProps
):
void
{
const
{
uuid
,
doi
,
navigateTo
}
=
this
.
props
;
const
accession
=
this
.
props
.
accession
?
this
.
props
.
accession
.
details
:
null
;
if
(
accession
&&
accession
.
doi
&&
!
doi
&&
accession
.
uuid
===
uuid
)
{
navigateTo
(
`/
${
accession
.
doi
}
`
);
}
}
private
loadAuditLog
=
()
=>
{
private
loadAuditLog
=
()
=>
{
const
{
doi
,
uuid
,
loadAccessionAuditLog
}
=
this
.
props
;
const
{
doi
,
uuid
,
loadAccessionAuditLog
}
=
this
.
props
;
...
@@ -508,6 +519,7 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
...
@@ -508,6 +519,7 @@ const mapDispatchToProps = (dispatch) => bindActionCreators({
loadAccession
,
loadAccession
,
loadAccessionAuditLog
,
loadAccessionAuditLog
,
applyFilters
,
applyFilters
,
navigateTo
,
},
dispatch
);
},
dispatch
);
...
...
Write
Preview
Supports
Markdown
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