Commit 1bb21611 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Adapted metainfo browser to domain refactoring.

parent 815e5ec8
Pipeline #71287 passed with stages
in 13 minutes and 30 seconds
......@@ -91,10 +91,10 @@ class MetaInfoBrowser extends Component {
this.props.api.getInfo().then(info => {
const domain = info.domains.find(domain => domain.name === 'dft') // TODO deal with domains
this.props.api.getMetaInfo(pkg || domain.metainfo.all_package).then(metainfos => {
const metainfoName = this.props.metainfo || domain.metainfo.root_sections[0]
const metainfoName = this.props.metainfo || domain.metainfo.root_section
const definition = metainfos.get(metainfoName)
if (!definition) {
this.props.history.push(`/metainfo/${domain.metainfo.root_sections[0]}`)
this.props.history.push(`/metainfo/${domain.metainfo.root_section}`)
} else {
this.setState({loadedPackage: pkg, metainfos: metainfos})
}
......@@ -110,10 +110,10 @@ class MetaInfoBrowser extends Component {
this.props.api.getInfo().then(info => {
const domain = info.domains.find(domain => domain.name === 'dft') // TODO deal with domains
this.props.api.getMetaInfo(domain.metainfo.all_package).then(metainfos => {
const metainfoName = this.props.metainfo || domain.metainfo.root_sections[0]
const metainfoName = this.props.metainfo || domain.metainfo.root_section
const definition = metainfos.get(metainfoName)
this.setState({
domainRootSection: domain.metainfo.root_sections[0],
domainRootSection: domain.metainfo.root_section,
allMetainfos: metainfos,
selectedPackage: definition.package.name})
this.update(definition.package.name)
......
......@@ -34,7 +34,7 @@ domain_quantity_model = api.model('DomainQuantity', {
metainfo_model = api.model('Metainfo', {
'all_package': fields.String(description='Name of the metainfo package that references all available packages, i.e. the complete metainfo.'),
'root_sections': fields.List(fields.String, description='Name of the topmost section, e.g. section_run for computational material science data.')
'root_section': fields.String(description='Name of the topmost section, e.g. section_run for computational material science data.')
})
domain_model = api.model('Domain', {
......
Supports Markdown
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