Commit 7d776daf authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Added fallback for missing section_system.

parent 8a54434e
Pipeline #93167 canceled with stages
in 1 minute and 26 seconds
......@@ -23,6 +23,7 @@ import ElectronicStructureOverview from '../visualization/ElectronicStructureOve
import VibrationalOverview from '../visualization/VibrationalOverview'
import { ApiDialog } from '../ApiDialogButton'
import { Structure } from '../visualization/Structure'
import NoData from '../visualization/NoData'
import Actions from '../Actions'
import Quantity from '../Quantity'
import { RecoilRoot } from 'recoil'
......@@ -337,6 +338,7 @@ export default function DFTEntryOverview({data}) {
// Get the representative system by looping over systems
let reprSys = null
const systems = section_run.section_system
if (systems) {
for (let i = systems.length - 1; i > -1; --i) {
const sys = systems[i]
if (!reprSys && sys.is_representative) {
......@@ -350,6 +352,7 @@ export default function DFTEntryOverview({data}) {
break
}
}
}
// Get the conventional (=normalized) system, if present
let idealSys = archive?.section_metadata?.encyclopedia?.material?.idealized_structure
......@@ -506,7 +509,10 @@ export default function DFTEntryOverview({data}) {
</Box>
</Grid>
<Grid item xs={7} style={{marginTop: '-2rem'}}>
<Structure systems={structures} materialType={data?.dft?.system} aspectRatio={1.5} />
{(loading || !_.isEmpty(structures))
? <Structure systems={structures} materialType={data?.dft?.system} aspectRatio={1.5}/>
: <NoData aspectRatio={1.5}/>
}
</Grid>
</Grid>
</PropertyCard>
......
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