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
nomad-lab
nomad-FAIR
Commits
2ccd8a4f
Commit
2ccd8a4f
authored
Jul 02, 2020
by
Markus Scheidgen
Browse files
Added a beta info to GUI.
#365
parent
f339af36
Changes
5
Hide whitespace changes
Inline
Side-by-side
gui/public/env.js
View file @
2ccd8a4f
...
...
@@ -6,5 +6,11 @@ window.nomadEnv = {
'
debug
'
:
false
,
'
matomoEnabled
'
:
true
,
'
matomoUrl
'
:
'
https://repository.nomad-coe.eu/fairdi/stat
'
,
'
matomoSiteId
'
:
'
2
'
'
matomoSiteId
'
:
'
2
'
,
'
version
'
:
{
"
label
"
:
"
0.8.1
"
,
"
isBeta
"
:
true
,
"
usesBetaData
"
:
true
,
"
officialUrl
"
:
"
https://repository.nomad-coe.eu/app/gui
"
}
}
gui/src/components/App.js
View file @
2ccd8a4f
// trigger rebuild
import
React
,
{
useEffect
,
useState
,
useContext
,
useCallback
,
useRef
}
from
'
react
'
import
PropTypes
from
'
prop-types
'
import
{
compose
}
from
'
recompose
'
...
...
@@ -7,7 +5,7 @@ import classNames from 'classnames'
import
{
MuiThemeProvider
,
withStyles
,
makeStyles
}
from
'
@material-ui/core/styles
'
import
{
LinearProgress
,
MenuList
,
Typography
,
AppBar
,
Toolbar
,
Button
,
DialogContent
,
DialogTitle
,
DialogActions
,
Dialog
,
Tooltip
,
Snackbar
,
SnackbarContent
,
FormGroup
,
FormControlLabel
,
Switch
}
from
'
@material-ui/core
'
Snackbar
,
SnackbarContent
,
FormGroup
,
FormControlLabel
,
Switch
,
IconButton
}
from
'
@material-ui/core
'
import
{
Route
,
Link
,
withRouter
,
useLocation
}
from
'
react-router-dom
'
import
BackupIcon
from
'
@material-ui/icons/Backup
'
import
SearchIcon
from
'
@material-ui/icons/Search
'
...
...
@@ -18,6 +16,7 @@ import MetainfoIcon from '@material-ui/icons/Info'
import
DocIcon
from
'
@material-ui/icons/Help
'
import
CodeIcon
from
'
@material-ui/icons/Code
'
import
TermsIcon
from
'
@material-ui/icons/Assignment
'
import
UnderstoodIcon
from
'
@material-ui/icons/Check
'
import
{
help
as
searchHelp
,
default
as
SearchPage
}
from
'
./search/SearchPage
'
import
HelpDialog
from
'
./Help
'
import
{
ApiProvider
,
withApi
,
apiContext
}
from
'
./api
'
...
...
@@ -25,7 +24,7 @@ import { ErrorSnacks, withErrors } from './errors'
import
{
help
as
entryHelp
,
default
as
EntryPage
}
from
'
./entry/EntryPage
'
import
About
from
'
./About
'
import
LoginLogout
from
'
./LoginLogout
'
import
{
guiBase
,
consent
,
nomadTheme
,
appBase
}
from
'
../config
'
import
{
guiBase
,
consent
,
nomadTheme
,
appBase
,
version
}
from
'
../config
'
import
{
help
as
metainfoHelp
,
default
as
MetaInfoBrowser
}
from
'
./metaInfoBrowser/MetaInfoBrowser
'
import
packageJson
from
'
../../package.json
'
import
{
help
as
uploadHelp
,
default
as
UploadPage
}
from
'
./uploads/UploadPage
'
...
...
@@ -109,6 +108,48 @@ MainMenuItem.propTypes = {
'
icon
'
:
PropTypes
.
element
.
isRequired
}
const
useBetaSnackStyles
=
makeStyles
(
theme
=>
({
root
:
{},
snack
:
{
backgroundColor
:
amber
[
700
]
}
}))
function
BetaSnack
()
{
const
classes
=
useBetaSnackStyles
()
const
[
understood
,
setUnderstood
]
=
useState
(
false
)
if
(
!
version
)
{
console
.
log
.
warning
(
'
no version data available
'
)
return
''
}
if
(
!
version
.
isBeta
)
{
return
''
}
return
<
Snackbar
className
=
{
classes
.
root
}
anchorOrigin
=
{{
vertical
:
'
bottom
'
,
horizontal
:
'
left
'
}}
open
=
{
!
understood
}
>
<
SnackbarContent
className
=
{
classes
.
snack
}
message
=
{
<
span
style
=
{{
color
:
'
white
'
}}
>
You
are
using
a
beta
version
of
NOMAD
({
version
.
label
}).
{
version
.
usesBetaData
?
'
This version is not using the official data. Everything you upload here, might get lost.
'
:
''
}
Click
<
a
style
=
{{
color
:
'
white
'
}}
href
=
{
version
.
officialUrl
}
>
here
for
the
official
NOMAD
version
<
/a>
.
<
/span>
}
action
=
{[
<
IconButton
key
=
{
0
}
color
=
"
inherit
"
onClick
=
{()
=>
setUnderstood
(
true
)}
>
<
UnderstoodIcon
/>
<
/IconButton
>
]}
/
>
<
/Snackbar
>
}
function
Consent
()
{
const
[
cookies
,
setCookie
]
=
useCookies
()
const
[
accepted
,
setAccepted
]
=
useState
(
cookies
[
'
terms-accepted
'
])
...
...
@@ -505,6 +546,7 @@ class App extends React.PureComponent {
render
()
{
return
(
<
MuiThemeProvider
theme
=
{
nomadTheme
}
>
<
BetaSnack
/>
<
ErrorSnacks
>
<
ApiProvider
>
<
Navigation
>
...
...
gui/src/config.js
View file @
2ccd8a4f
import
{
createMuiTheme
}
from
'
@material-ui/core
'
window
.
nomadEnv
=
window
.
nomadEnv
||
{}
export
const
version
=
window
.
nomadEnv
.
version
export
const
appBase
=
window
.
nomadEnv
.
appBase
.
replace
(
/
\/
$/
,
''
)
// export const apiBase = 'http://repository.nomad-coe.eu/v0.8/api'
export
const
apiBase
=
`
${
appBase
}
/api`
...
...
ops/helm/nomad/templates/api-deployment.yaml
View file @
2ccd8a4f
...
...
@@ -93,7 +93,13 @@ data:
"matomoSiteId": {{ .Values.gui.matomoSiteId }},
"matomoUrl": "{{ .Values.gui.matomoUrl }}",
"matomoEnabled": {{ .Values.gui.matomoEnabled }},
"debug": {{ .Values.gui.debug }}
"debug": {{ .Values.gui.debug }},
"version": {
"label": "{{ .Values.version.label }}",
"isBeta": {{ .Values.version.isBeta }},
"usesBetaData": {{ .Values.version.usesBetaData }},
"officialUrl": "{{ .Values.version.officialUrl }}"
}
};
---
apiVersion
:
apps/v1
...
...
ops/helm/nomad/values.yaml
View file @
2ccd8a4f
## Default values for nomad@FAIRDI
version
:
label
:
"
0.8.1"
isBeta
:
false
usesBetaData
:
false
officialUrl
:
"
https://repository.nomad-coe.eu/app/gui"
## Everything concerning the container images to be used
image
:
...
...
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