Commit 239a3bce authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Merge branch 'v0.8.9' into 'master'

V0.8.9

See merge request !172
parents 8e89ceff 9148e425
Pipeline #82148 passed with stages
in 8 seconds
......@@ -77,7 +77,7 @@ RUN \
find /usr/local/lib/python3.7/site-packages/ -name '*.so' -print -exec sh -c 'file "{}" | grep -q "not stripped" && strip -s "{}"' \;
# Built the GUI in the gui build image
FROM node:latest as gui_build
FROM node:14.8 as gui_build
RUN mkdir -p /app
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
......
{
"name": "nomad-fair-gui",
"version": "0.8.8",
"version": "0.8.9",
"commit": "e98694e",
"private": true,
"dependencies": {
......@@ -19,7 +19,7 @@
"fetch": "^1.1.0",
"file-saver": "^2.0.0",
"html-to-react": "^1.3.3",
"keycloak-js": "^6.0.0",
"keycloak-js": "^7.0.1",
"lodash": "^4.17.15",
"material-ui-chip-input": "^1.0.0-beta.14",
"material-ui-flat-pagination": "^4.0.0",
......@@ -38,7 +38,7 @@
"react-highlight": "^0.12.0",
"react-infinite-scroller": "^1.2.4",
"react-json-view": "^1.19.1",
"react-keycloak": "^6.1.0",
"react-keycloak": "^7.0.1-191016",
"react-markdown": "^4.3.1",
"react-mathjax": "^1.0.1",
"react-router-dom": "^5.1.2",
......
......@@ -7,13 +7,14 @@ import {
DFTSystemVisualizations, DFTPropertyVisualizations, DFTMethodVisualizations
} from './dft/DFTVisualizations'
import EMSVisualizations from './ems/EMSVisualizations'
import { Link } from '@material-ui/core'
/* eslint-disable react/display-name */
export const domains = ({
dft: {
name: 'CMS',
label: 'Computational material science data (CMS)',
name: 'Computational data',
label: 'Computational material science data',
key: 'dft',
about: 'This include data from many computational material science codes',
entryLabel: 'entry',
......@@ -160,9 +161,9 @@ export const domains = ({
searchTabs: ['entries', 'materials', 'datasets', 'groups', 'uploads']
},
ems: {
name: 'EMS',
name: 'Experimental data',
key: 'ems',
label: 'Material science experiment data (EMS)',
label: 'Experimental material science data',
about: 'This is metadata from material science experiments',
entryLabel: 'entry',
entryLabelPlural: 'entries',
......@@ -199,20 +200,29 @@ export const domains = ({
*/
searchResultColumns: {
'formula': {
label: 'Formula'
label: 'Formula',
supportsSort: true
},
'ems.chemical': {
label: 'Material name'
},
'ems.method': {
label: 'Method'
label: 'Method',
supportsSort: true
},
'ems.data_type': {
label: 'Data'
},
'ems.experiment_location': {
label: 'Location'
'ems.origin_time': {
label: 'Date',
render: entry => (entry.ems && entry.ems.origin_time && new Date(entry.ems.origin_time).toLocaleDateString()) || 'unavailable'
},
'ems.experiment_time': {
label: 'Date/Time',
render: entry => (entry.ems && entry.ems.experiment_time !== 'unavailable') ? new Date(entry.ems.experiment_time * 1000).toLocaleString() : 'unavailable'
'ems.repository_url': {
label: 'Source',
render: entry => <Link target="external" href={entry.ems.entry_repository_url}>{entry.ems.repository_url}</Link>
}
},
defaultSearchResultColumns: ['formula', 'ems.method', 'ems.experiment_location', 'ems.experiment_time'],
defaultSearchResultColumns: ['formula', 'ems.chemical', 'ems.method', 'ems.data_type', 'ems.origin_time', 'ems.repository_url'],
/**
* A component to render the domain specific quantities in the metadata card of
* the entry view. Needs to work with props: data (the entry data from the API),
......
......@@ -27,7 +27,7 @@ class EMSEntryCards extends React.Component {
<CardContent classes={{root: classes.cardContent}}>
<Markdown classes={{root: classes.description}}>{`
The data for this experiment is externally stored and managed. Download the raw experiment data:
[${data.ems.repository_url}](${data.ems.repository_url}).
[${data.ems && data.ems.repository_url}](${data.ems && data.ems.entry_repository_url}).
The meta data describing this experiment in its original format, can be
downloaded here directly:
......
import React from 'react'
import PropTypes from 'prop-types'
import Quantity from '../Quantity'
import { Typography } from '@material-ui/core'
import { Typography, Link } from '@material-ui/core'
import { apiBase } from '../../config'
export default class EMSEntryOverview extends React.Component {
......@@ -45,7 +45,16 @@ export default class EMSEntryOverview extends React.Component {
return (
<Quantity column>
<Quantity quantity="ems.experiment_summary" label="summary" {...this.props} />
{data.ems.experiment_summary && <Quantity quantity="ems.experiment_summary" label="summary" {...this.props} />}
{this.state.previewBroken
? data.ems.entry_repository_url && <Quantity label="preview" {...this.props}>
<Typography noWrap>
<a target="external" href={ems.entry_repository_url}>visit this entry on the external database</a>
</Typography>
</Quantity>
: <Quantity label="preview" {...this.props}>
<img alt="preview" style={{maxWidth: '100%', height: 'auto'}} src={relative_preview_url} onError={this.handleBrokenPreview}></img>
</Quantity>}
<Quantity row>
<Quantity column>
<Quantity row>
......@@ -55,27 +64,18 @@ export default class EMSEntryOverview extends React.Component {
: ''}
</Quantity>
<Quantity quantity="ems.method" label="experimental method" noWrap {...this.props} />
<Quantity quantity="ems.experiment_location" label="experiment location" noWrap {...this.props} />
<Quantity label="experiment time" {...this.props}>
{data.ems.experiment_location && <Quantity quantity="ems.experiment_location" label="experiment location" noWrap {...this.props} />}
<Quantity label="experiment or experiment publish date" {...this.props}>
<Typography noWrap>{
data.ems.experiment_time && data.ems.experiment_time !== 'unavailable' ? new Date(data.ems.experiment_time * 1000).toLocaleString() : 'unavailable'
(ems && ems.origin_time && new Date(ems.origin_time).toLocaleDateString()) || 'unavailable'
}</Typography>
</Quantity>
<Quantity label="data" {...this.props}>
<Quantity label="data source" {...this.props}>
<Typography noWrap>
<a target="external" href={data.ems.repository_url}>{data.ems.repository_name}</a>
<Link target="external" href={ems.entry_repository_url}>{ems.repository_url}</Link>
</Typography>
</Quantity>
</Quantity>
{this.state.previewBroken
? data.ems.entry_repository_url && <Quantity label="preview" {...this.props}>
<Typography noWrap>
<a target="external" href={data.ems.entry_repository_url}>visit this entry on the external database</a>
</Typography>
</Quantity>
: <Quantity label="preview" {...this.props}>
<img alt="preview" style={{maxWidth: '100%', height: 'auto'}} src={relative_preview_url} onError={this.handleBrokenPreview}></img>
</Quantity>}
</Quantity>
</Quantity>
)
......
import React from 'react'
import PropTypes from 'prop-types'
import { withStyles, Typography } from '@material-ui/core'
import { withStyles, Typography, Link } from '@material-ui/core'
import { compose } from 'recompose'
import { withApi, DoesNotExist } from '../api'
import { withRouter } from 'react-router'
......@@ -22,7 +22,8 @@ class EntryQuery extends React.Component {
}
static defaultState = {
doesNotExist: false
doesNotExist: false,
queryParams: null
}
state = {...EntryQuery.defaultState}
......@@ -43,7 +44,7 @@ class EntryQuery extends React.Component {
}
}).catch(error => {
if (error.name === 'DoesNotExist') {
this.setState({doesNotExist: true})
this.setState({doesNotExist: true, queryParams: queryParams})
} else {
this.props.raiseError(error)
}
......@@ -63,12 +64,19 @@ class EntryQuery extends React.Component {
render() {
const { classes, api } = this.props
const { doesNotExist } = this.state
const { doesNotExist, queryParams } = this.state
let message = 'loading ...'
if (doesNotExist) {
if (api.isLoggedIn) {
console.log(queryParams)
if (queryParams && queryParams['external_id'] && queryParams['external_id'].startsWith('mp-')) {
message = <React.Fragment>
This particular calculation <Link href={`https://materialsproject.org/tasks/${queryParams['external_id']}#`}>
{queryParams['external_id']}
</Link> has not yet been provided to NOMAD by the Materials Project.
</React.Fragment>
} else if (api.isLoggedIn) {
message = `
This URL points to an entry that either does not exist, or that you are not
authorized to see.`
......
......@@ -410,12 +410,12 @@ DomainSelect.propTypes = {
}
const ownerLabel = {
all: 'All entries',
visible: 'Include your private entries',
public: 'Only public entries',
user: 'Only your entries',
shared: 'Incl. shared data',
staging: 'Staging area only'
all: 'All',
visible: 'Include private',
public: 'Only public',
user: 'Only yours',
shared: 'Shared',
staging: 'Unpublished'
}
const ownerTooltips = {
......
......@@ -29,7 +29,7 @@ const keycloak = Keycloak({
// matomo.push('requireConsent')
ReactDOM.render(
<KeycloakProvider keycloak={keycloak} initConfig={{onLoad: 'check-sso'}} LoadingComponent={<div />}>
<KeycloakProvider keycloak={keycloak} initConfig={{onLoad: 'check-sso', 'checkLoginIframe': false}} LoadingComponent={<div />}>
<Router history={matomoEnabled ? matomo.connectToHistory(history) : history}>
<QueryParamProvider ReactRouterRoute={Route}>
<App />
......
......@@ -2580,7 +2580,7 @@ base16@^1.0.0:
resolved "https://registry.yarnpkg.com/base16/-/base16-1.0.0.tgz#e297f60d7ec1014a7a971a39ebc8a98c0b681e70"
integrity sha1-4pf2DX7BAUp6lxo568ipjAtoHnA=
 
base64-js@^1.0.2:
base64-js@1.3.1, base64-js@^1.0.2:
version "1.3.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.1.tgz#58ece8cb75dd07e71ed08c736abc5fac4dbf8df1"
integrity sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==
......@@ -4222,11 +4222,6 @@ decode-uri-component@^0.2.0:
resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=
 
deep-compare@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/deep-compare/-/deep-compare-0.0.5.tgz#c38a8f6a834c27dab427dcc496d9d6e1e1b40b67"
integrity sha1-w4qPaoNMJ9q0J9zEltnW4eG0C2c=
deep-equal@^1.0.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a"
......@@ -7190,6 +7185,11 @@ jest@24.9.0:
import-local "^2.0.0"
jest-cli "^24.9.0"
 
js-sha256@0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966"
integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==
"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
......@@ -7484,10 +7484,13 @@ jsx-ast-utils@^2.4.1:
array-includes "^3.1.1"
object.assign "^4.1.0"
 
keycloak-js@^6.0.0:
version "6.0.1"
resolved "https://registry.yarnpkg.com/keycloak-js/-/keycloak-js-6.0.1.tgz#329a5e77210dfc4a7d4acf96f95dd0132455bea3"
integrity sha512-p02dBCA9pSH1xvTmRIEMdeMz00eCGKmZF+rjMeqrkiQD4xhXkzu50J9sQjaANolMlLhazOtfql70+N5QWm8Upg==
keycloak-js@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/keycloak-js/-/keycloak-js-7.0.1.tgz#490971a2cf404bdbbee87804211f2b4f6561e858"
integrity sha512-gefTlb6DjvqH2wTbXCs3o2d54Ot6lvFb0ynF4aU75ucUq9qQ1p1+lm+1OcRRC34nPCG16joPz2QNxNVXi8Bmng==
dependencies:
base64-js "1.3.1"
js-sha256 "0.9.0"
 
keycode@^2.1.7:
version "2.2.0"
......@@ -10115,6 +10118,11 @@ react-event-listener@^0.6.0:
prop-types "^15.6.0"
warning "^4.0.1"
 
react-fast-compare@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-2.0.4.tgz#e84b4d455b0fec113e0402c329352715196f81f9"
integrity sha512-suNP+J1VU1MWFKcyt7RtjiSWUjvidmQSlqu+eHslq+342xCbGTYmC0mEhPCOHxlW0CywylOC1u2DFAT+bv4dBw==
react-highlight@^0.12.0:
version "0.12.0"
resolved "https://registry.yarnpkg.com/react-highlight/-/react-highlight-0.12.0.tgz#34de986a0bfdf228904d0c269b69538d95b35802"
......@@ -10144,14 +10152,14 @@ react-json-view@^1.19.1:
react-lifecycles-compat "^3.0.4"
react-textarea-autosize "^6.1.0"
 
react-keycloak@^6.1.0:
version "6.1.2"
resolved "https://registry.yarnpkg.com/react-keycloak/-/react-keycloak-6.1.2.tgz#7049af20d4229e91c1380a819883ba5f802ae0f7"
integrity sha512-KYrB7d1VUmXFSG3hbrwmqr2Jh6mk/hKaMAw1jGB6KSB3BlWe0VPO9tVxbaC5P5JQrQ46aGJnyZXuvn9EqLTQ1Q==
react-keycloak@^7.0.1-191016:
version "7.0.1-191016"
resolved "https://registry.yarnpkg.com/react-keycloak/-/react-keycloak-7.0.1-191016.tgz#51236ca71fabeeeaad7970c6fc4ed7717dd9b380"
integrity sha512-H0kxrY/klARf09FvcGtGv0pZkaZM8IkUA/43Ie6/jnvpm7oIszeWWnsh2LlsN6nDXv/GTJUs6h7Xt5UZUEsP1w==
dependencies:
deep-compare "^0.0.5"
hoist-non-react-statics "^3.3.0"
prop-types "^15.7.2"
react-fast-compare "^2.0.4"
 
react-lifecycles-compat@^3.0.2, react-lifecycles-compat@^3.0.4:
version "3.0.4"
......
......@@ -266,7 +266,7 @@ datacite = NomadConfig(
)
meta = NomadConfig(
version='0.8.8',
version='0.8.9',
commit=gitinfo.commit,
release='devel',
default_domain='dft',
......
......@@ -156,7 +156,9 @@ class DFTMetadata(MSection):
xc_functional = Quantity(
type=str, default='not processed',
description='The libXC based xc functional classification used in the simulation.',
a_search=Search(statistic_values=list(xc_treatments.values()) + ['unavailable', 'not processed']))
a_search=Search(
statistic_values=list(xc_treatments.values()) + ['unavailable', 'not processed'],
statistic_size=100))
system = Quantity(
type=str, default='not processed',
......
......@@ -190,5 +190,6 @@ class Search(Elastic):
def statistic_values(self, values):
self._statistic_values = values
if self._statistic_values is not None:
self.statistic_size = len(self._statistic_values)
if self.statistic_fixed_size is None:
self.statistic_size = len(self._statistic_values)
self.statistic_fixed_size = len(self._statistic_values)
apiVersion: v1
appVersion: "0.8.8"
appVersion: "0.8.9"
description: A Helm chart for Kubernetes that only runs nomad services and uses externally hosted databases.
name: nomad
version: 0.8.8
version: 0.8.9
## Default values for nomad@FAIRDI
version:
label: "0.8.8"
label: "0.8.9"
isBeta: false
usesBetaData: false
officialUrl: "https://nomad-lab.eu/prod/rae/gui"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment