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
nomad-lab
nomad-FAIR
Commits
93dd8040
Commit
93dd8040
authored
Oct 31, 2019
by
Markus Scheidgen
Browse files
Various smaller fixes.
parent
2307ef65
Pipeline
#62814
passed with stages
in 21 minutes and 26 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
gui/src/components/KeepState.js
View file @
93dd8040
import
React
from
'
react
'
import
PropTypes
,
{
instanceOf
}
from
'
prop-types
'
import
PropTypes
from
'
prop-types
'
/**
* This is a kinda-HOC that allows to keep a component alive while not being visible.
...
...
gui/src/components/api.js
View file @
93dd8040
...
...
@@ -120,11 +120,11 @@ function handleApiError(e) {
throw
e
}
let
error
=
null
if
(
e
.
response
)
{
const
body
=
e
.
response
.
body
const
message
=
(
body
&&
body
.
message
)
?
body
.
message
:
e
.
response
.
statusText
const
errorMessage
=
`
${
message
}
(
${
e
.
response
.
status
}
)`
let
error
=
null
if
(
e
.
response
.
status
===
404
)
{
error
=
new
DoesNotExist
(
errorMessage
)
}
else
if
(
e
.
response
.
status
===
401
)
{
...
...
@@ -135,11 +135,16 @@ function handleApiError(e) {
error
=
new
Error
(
errorMessage
)
}
error
.
status
=
e
.
response
.
status
throw
error
}
else
{
const
errorMessage
=
e
.
status
?
`
${
e
}
(
${
e
.
status
}
)`
:
''
+
e
throw
new
Error
(
errorMessage
)
if
(
e
.
message
===
'
Failed to fetch
'
)
{
error
=
new
ApiError
(
e
.
message
)
error
.
status
=
400
}
else
{
const
errorMessage
=
e
.
status
?
`
${
e
}
(
${
e
.
status
}
)`
:
''
+
e
error
=
new
Error
(
errorMessage
)
}
}
throw
error
}
class
Api
{
...
...
gui/src/components/entry/ArchiveEntryView.js
View file @
93dd8040
...
...
@@ -67,12 +67,14 @@ class ArchiveEntryView extends React.Component {
static
defaultState
=
{
data
:
null
,
metaInfo
:
null
,
showMetaInfo
:
false
,
doesNotExist
:
false
}
state
=
{...
ArchiveEntryView
.
defaultState
}
state
=
{
metaInfo
:
null
,
...
ArchiveEntryView
.
defaultState
}
constructor
(
props
)
{
super
(
props
)
...
...
@@ -90,7 +92,6 @@ class ArchiveEntryView extends React.Component {
componentDidUpdate
(
prevProps
)
{
if
(
prevProps
.
api
!==
this
.
props
.
api
||
prevProps
.
info
!==
this
.
props
.
info
)
{
this
.
setState
(
ArchiveEntryView
.
defaultState
)
this
.
updateMetaInfo
()
}
...
...
@@ -103,7 +104,7 @@ class ArchiveEntryView extends React.Component {
}
updateMetaInfo
()
{
if
(
this
.
props
.
api
&&
this
.
props
.
info
)
{
if
(
this
.
props
.
api
&&
this
.
props
.
info
&&
!
this
.
state
.
metaInfo
)
{
this
.
props
.
api
.
getMetaInfo
(
this
.
props
.
info
.
domain
.
metainfo
.
all_package
).
then
(
metaInfo
=>
{
if
(
!
this
.
unmounted
)
{
this
.
setState
({
metaInfo
:
metaInfo
})
...
...
gui/src/components/errors.js
View file @
93dd8040
...
...
@@ -44,7 +44,7 @@ class ErrorSnacksUnstyled extends React.Component {
let
errorStr
=
'
Unexpected error. Please try again and let us know, if this error keeps happening.
'
if
(
error
instanceof
Error
)
{
if
(
error
.
name
===
'
CannotReachApi
'
)
{
errorStr
=
'
Cannot reach the NOMAD
API
, please try again later.
'
errorStr
=
'
Cannot reach the NOMAD, please try again later.
'
}
else
if
(
error
.
name
===
'
DoesNotExist
'
)
{
errorStr
=
'
You are trying to access information that does not exist. Please try again and let us know, if this error keeps happening.
'
}
else
if
(
error
.
name
===
'
VersionMismatch
'
)
{
...
...
gui/src/components/metaInfoBrowser/util/cards.js
View file @
93dd8040
...
...
@@ -183,7 +183,8 @@ class CardCompartmentUnstyled extends React.Component {
},
minHeader
:
{
position
:
'
relative
'
,
minHeight
:
16
+
theme
.
spacing
.
unit
minHeight
:
16
+
theme
.
spacing
.
unit
,
overflowY
:
'
hidden
'
},
foldButton
:
{
position
:
'
absolute
'
,
...
...
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