Commit 987d6554 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Fixed repo link to encyclopedia.

parent 81de5d44
Pipeline #79461 passed with stages
in 26 minutes and 25 seconds
......@@ -12,5 +12,6 @@ window.nomadEnv = {
"isBeta": false,
"usesBetaData": false,
"officialUrl": "https://nomad-lab.eu/prod/rae/gui"
}
},
'encyclopediaEnabled': true
}
import React from 'react'
import PropTypes from 'prop-types'
import { Typography, Button, makeStyles, Tooltip } from '@material-ui/core'
import { Typography, Tooltip, Link } from '@material-ui/core'
import Quantity from '../Quantity'
import _ from 'lodash'
import {appBase} from '../../config'
const useStyles = makeStyles(theme => ({
actions: {
marginTop: theme.spacing(1),
textAlign: 'right',
margin: -theme.spacing(1)
}
}))
import {appBase, encyclopediaEnabled} from '../../config'
export default function DFTEntryOverview(props) {
const classes = useStyles()
const {data} = props
if (!data.dft) {
return <Typography color="error">No metadata available</Typography>
}
const material_name = entry => entry.encyclopedia.material.material_name
const material_name = entry => {
let name
try {
name = entry.encyclopedia.material.material_name
} catch {}
name = name || 'unnamed'
if (encyclopediaEnabled && data.encyclopedia && data.encyclopedia.material && data.published && !data.with_embargo) {
const url = `${appBase}/encyclopedia/#/material/${data.encyclopedia.material.material_id}`
return (
<Tooltip title="Show the material of this entry in the NOMAD Encyclopedia.">
<Link href={url}>{name}</Link>
</Tooltip>
)
} else {
return name
}
}
return <div>
<Quantity column>
<Quantity row>
<Quantity quantity="formula" label='formula' noWrap {...props} />
<Quantity quantity={material_name} label='material name' noWrap {...props} />
<Quantity quantity={material_name} label='material' noWrap {...props} />
</Quantity>
<Quantity row>
<Quantity quantity="dft.code_name" label='dft code' noWrap {...props} />
......@@ -46,15 +54,6 @@ export default function DFTEntryOverview(props) {
</Quantity>
</Quantity>
</Quantity>
{data.encyclopedia && data.encyclopedia.material &&
<div className={classes.actions}>
<Tooltip title="Show the material of this entry in the NOMAD Encyclopedia.">
<Button color="primary" href={`${appBase}/encyclopedia/#/material/${data.encyclopedia.material.material_id}`}>
material
</Button>
</Tooltip>
</div>
}
</div>
}
......
......@@ -14,6 +14,7 @@ export const keycloakRealm = window.nomadEnv.keycloakRealm
export const keycloakClientId = window.nomadEnv.keycloakClientId
export const debug = window.nomadEnv.debug || false
export const matomoEnabled = window.nomadEnv.matomoEnabled
export const encyclopediaEnabled = window.nomadEnv.encyclopediaEnabled
export const email = 'webmaster@nomad-coe.eu'
export const maxLogsToShow = 50
......
......@@ -99,7 +99,8 @@ data:
"isBeta": {{ .Values.version.isBeta }},
"usesBetaData": {{ .Values.version.usesBetaData }},
"officialUrl": "{{ .Values.version.officialUrl }}"
}
},
"encyclopediaEnabled": {{ .Values.gui.encyclopediaEnabled }}
};
---
apiVersion: v1
......
......@@ -86,6 +86,8 @@ gui:
matomoEnabled: false
## automatically gz based on header
gzip: true
## enable links to the 'new' encyclopedia
encyclopediaEnabled: false
## Everything concerning the nginx that serves the gui, proxies the api
# It is run via NodePort service
......
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