Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ICAT
Datahub
Commits
08fb2f45
Commit
08fb2f45
authored
Jul 22, 2021
by
Alejandro De Maria Antolinos
Browse files
Add link to jupyter
It fixes
#519
parent
ac453f01
Pipeline
#51135
passed with stage
in 2 minutes and 57 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/components/Investigation/InvestigationDateFilter.js
View file @
08fb2f45
...
...
@@ -2,6 +2,7 @@ import React from 'react';
import
{
Glyphicon
,
Button
}
from
'
react-bootstrap
'
;
import
DayPickerInput
from
'
react-day-picker/DayPickerInput
'
;
import
{
formatDate
,
parseDate
}
from
'
react-day-picker/moment
'
;
import
UI
from
'
../../config/ui
'
;
import
{
INVESTIGATION_DATE_FORMAT
}
from
'
../../constants
'
;
import
styles
from
'
./InvestigationDateFilter.module.css
'
;
...
...
@@ -25,6 +26,7 @@ function InvestigationDateFilter(props) {
onClear
,
instrumentName
,
showStatisticsMenu
,
withJupyter
,
}
=
props
;
return
(
...
...
@@ -51,11 +53,26 @@ function InvestigationDateFilter(props) {
<
/Button
>
{
showStatisticsMenu
&&
(
<
Button
href
=
{
getHrefByInstrument
(
instrumentName
)}
bsStyle
=
"
default
"
>
<
Button
href
=
{
getHrefByInstrument
(
instrumentName
)}
bsStyle
=
"
primary
"
>
<
Glyphicon
glyph
=
"
signal
"
style
=
{{
margin
:
5
}}
/
>
Data
Statistics
<
/Button
>
)}
{
withJupyter
&&
(
<
Button
style
=
{{
width
:
200
,
textAlign
:
'
left
'
,
margin
:
5
}}
bsSize
=
"
default
"
>
<
a
href
=
{
UI
.
analysis
.
jupyter
.
link
}
target
=
"
_blank
"
rel
=
"
noopener noreferrer
"
>
<
Glyphicon
glyph
=
"
play-circle
"
style
=
{{
margin
:
5
}}
/
>
<
span
style
=
{{
marginLeft
:
2
}}
>
Open
Jupyter
Notebook
<
/span
>
<
/a
>
<
/Button
>
)}
<
/div
>
);
}
...
...
src/components/Investigation/InvestigationTable.js
View file @
08fb2f45
...
...
@@ -20,6 +20,7 @@ import { useHistory, useLocation } from 'react-router';
import
{
useQuery
}
from
'
../../helpers/hooks
'
;
import
{
useSelector
}
from
'
react-redux
'
;
import
{
INVESTIGATION_DATE_FORMAT
}
from
'
../../constants
'
;
import
UI
from
'
../../config/ui
'
;
function
getLgHeaderStyle
(
width
,
hidden
)
{
return
{
...
...
@@ -170,6 +171,7 @@ function InvestigationTable(props) {
showStatisticsMenu
=
false
,
instrumentName
,
withUserPortalLink
=
false
,
withJupyter
=
false
,
}
=
props
;
const
user
=
useSelector
((
state
)
=>
state
.
user
);
...
...
@@ -258,6 +260,7 @@ function InvestigationTable(props) {
onClear
=
{
handleDateClear
}
showStatisticsMenu
=
{
showStatisticsMenu
}
instrumentName
=
{
instrumentName
}
withJupyter
=
{
withJupyter
}
/
>
<
/div
>
<
ResponsiveTable
...
...
@@ -274,7 +277,9 @@ function InvestigationTable(props) {
showProposalLinks
:
withProposalLinks
||
isAdministrator
,
showInvestigationStats
:
withInvestigationStats
||
isAdministrator
,
showFiles
:
isAdministrator
,
withUserPortalLink
:
withUserPortalLink
||
isAdministrator
,
withUserPortalLink
:
withUserPortalLink
||
(
UI
.
userPortal
.
isLinkEnabled
&&
isAdministrator
),
})}
expandRow
=
{
expandRow
}
/
>
...
...
src/components/Investigation/utils.js
View file @
08fb2f45
...
...
@@ -123,7 +123,11 @@ export function nameFormatter(investigation, showLink, section = 'datasets') {
return
(
<
Link
to
=
{
`/investigation/
${
id
}
/
${
section
}
`
}
>
<
Button
bsSize
=
"
xsmall
"
style
=
{{
width
:
120
,
textAlign
:
'
left
'
}}
>
<
Button
bsSize
=
"
xsmall
"
style
=
{{
width
:
120
,
textAlign
:
'
left
'
}}
bsStyle
=
"
primary
"
>
<
Glyphicon
glyph
=
"
circle-arrow-right
"
/>
<
span
style
=
{{
marginLeft
:
10
}}
>
{
name
}
<
/span
>
<
/Button
>
...
...
src/config/ui.js
View file @
08fb2f45
...
...
@@ -30,6 +30,12 @@ const UI = {
link
:
'
https://smis.esrf.fr/misapps/SMISWebClient/protected/aform/manageAForm.do?action=view&expSessionVO.pk=
'
,
},
analysis
:
{
jupyter
:
{
isLinkEnabled
:
true
,
link
:
'
https://jupyter-slurm.esrf.fr/hub/spawn?partition=jupyter-nice
'
,
},
},
investigationContainer
:
{
isDatasetListVisible
:
true
,
},
...
...
src/containers/BeamlineData/BeamlineDataTable.js
View file @
08fb2f45
...
...
@@ -3,6 +3,7 @@ import InvestigationTable from '../../components/Investigation/InvestigationTabl
import
{
useResource
}
from
'
rest-hooks
'
;
import
InvestigationResource
from
'
../../resources/investigation
'
;
import
{
useParams
}
from
'
react-router
'
;
import
UI
from
'
../../config/ui
'
;
function
BeamlineDataTable
(
props
)
{
const
{
name
}
=
useParams
();
...
...
@@ -19,6 +20,7 @@ function BeamlineDataTable(props) {
showStatisticsMenu
=
{
showStatisticsMenu
}
instrumentName
=
{
name
}
withUserPortalLink
=
{
true
}
withJupyter
=
{
UI
.
analysis
.
jupyter
.
isLinkEnabled
}
/
>
);
}
...
...
src/containers/MyData/MyInvestigationsTable.js
View file @
08fb2f45
...
...
@@ -2,6 +2,7 @@ import React from 'react';
import
{
useResource
}
from
'
rest-hooks
'
;
import
InvestigationResource
from
'
../../resources/investigation
'
;
import
InvestigationTable
from
'
../../components/Investigation/InvestigationTable
'
;
import
UI
from
'
../../config/ui
'
;
function
MyInvestigationsTable
()
{
const
myInvestigations
=
useResource
(
InvestigationResource
.
listShape
(),
{
...
...
@@ -18,7 +19,8 @@ function MyInvestigationsTable() {
investigations
=
{
mySessions
}
withInvestigationStats
withProposalLinks
withUserPortalLink
=
{
true
}
withUserPortalLink
=
{
UI
.
userPortal
.
isLinkEnabled
}
withJupyter
=
{
UI
.
analysis
.
jupyter
.
isLinkEnabled
}
/
>
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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