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
encyclopedia-gui
Commits
9d8f86f9
Commit
9d8f86f9
authored
Jul 21, 2020
by
Lauri Himanen
Browse files
Fixed issue with subpage dropdown.
parent
57bd7d76
Pipeline
#79030
skipped with stage
Changes
7
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
client/bundle.js
View file @
9d8f86f9
This source diff could not be displayed because it is too large. You can
view the blob
instead.
client/src/common/FlaggingFormPopup.js
View file @
9d8f86f9
...
...
@@ -133,8 +133,8 @@ function show(pageStatus){
overviewEStructCalcs
=
pageStatus
.
eStructCalcs
;
// Show/hide some dropdown list options
eStructOption
.
style
.
display
=
(
DataStore
.
hasElecStructureData
?
'
block
'
:
'
none
'
);
thermalOption
.
style
.
display
=
(
DataStore
.
hasThermalData
?
'
block
'
:
'
none
'
);
eStructOption
.
style
.
display
=
(
DataStore
.
hasElecStructureData
()
?
'
block
'
:
'
none
'
);
thermalOption
.
style
.
display
=
(
DataStore
.
hasThermalData
()
?
'
block
'
:
'
none
'
);
_setCurrentPage
(
pageStatus
.
pageId
);
...
...
client/src/main.js
View file @
9d8f86f9
...
...
@@ -104,10 +104,10 @@ class Breadcrumb {
let
self
=
this
;
function
adjustDropdownOptions
()
{
let
esOption
=
self
.
detailsDropDown
.
querySelector
(
'
option[value="electronicstruct"]
'
);
if
(
!
DataStore
.
hasElecStructureData
)
self
.
detailsDropDown
.
removeChild
(
esOption
);
if
(
!
DataStore
.
hasElecStructureData
()
)
self
.
detailsDropDown
.
removeChild
(
esOption
);
let
thOption
=
self
.
detailsDropDown
.
querySelector
(
'
option[value="thermalprops"]
'
);
if
(
!
DataStore
.
hasThermalData
)
self
.
detailsDropDown
.
removeChild
(
thOption
);
if
(
!
DataStore
.
hasThermalData
()
)
self
.
detailsDropDown
.
removeChild
(
thOption
);
// Remove because we want it's executed once
self
.
detailsDropDown
.
removeEventListener
(
'
focus
'
,
adjustDropdownOptions
);
}
...
...
client/src/material-mod/DataStore.js
View file @
9d8f86f9
...
...
@@ -31,7 +31,7 @@ let representatives;
let
idealizedStructure
;
let
calcMap
=
new
Map
();
let
ready
=
false
;
let
hasThermal
Data
,
hasElecStructure
Data
;
let
hasThermal
,
hasElecStructure
;
function
setMaterialData
(
dataFromAPI
){
materialData
=
dataFromAPI
;
...
...
@@ -64,6 +64,13 @@ function setCalculations(calcsFromAPI){
for
(
let
i
=
0
;
i
<
calcs
.
length
;
i
++
)
{
calcMap
.
set
(
calcs
[
i
].
calc_id
,
calcs
[
i
]);
}
// Check what type of information is available
let
calcWithBS
=
representatives
.
electronic_band_structure
;
let
calcWithDOS
=
representatives
.
electronic_dos
;
let
calcWithHeat
=
representatives
.
thermodynamical_properties
;
hasElecStructure
=
(
calcWithBS
!==
undefined
||
calcWithDOS
!==
undefined
);
hasThermal
=
calcWithHeat
!==
undefined
;
}
function
getRepresentatives
()
{
...
...
@@ -157,26 +164,14 @@ function getGroupLeafId(calcId){
return
leafId
;
}
/*
function
hasThermalData
(
bool
){
hasThermalData = bool;
}
function setHasThermalData(bool){
hasThermalData = bool;
return
hasThermal
;
}
function
hasElecStructureData
(
bool
){
hasThermalData = bool
;
return
hasElecStructure
;
}
function setHasElecStructureData(bool){
hasElecStructureData = bool;
}*/
// EXPORTS
module
.
exports
=
{
getRepresentatives
,
setMaterialData
,
getMaterialData
,
getCalculations
,
getCalc
,
...
...
client/src/material-mod/ElectronicStructDetails.view.js
View file @
9d8f86f9
...
...
@@ -400,7 +400,6 @@ class SummaryByFunctionalsComponent{
this
.
functionalTabs
.
querySelector
(
'
[data-tab="
'
+
this
.
functional
+
'
"]
'
)
.
className
=
'
tab
'
;
this
.
functional
=
e
.
target
.
getAttribute
(
'
data-tab
'
);
console
.
log
(
this
.
functional
);
this
.
functionalTabs
.
querySelector
(
'
[data-tab="
'
+
this
.
functional
+
'
"]
'
)
.
className
=
'
tab-selected
'
;
this
.
_setData
();
...
...
client/src/material-mod/NavTree.js
View file @
9d8f86f9
...
...
@@ -49,10 +49,12 @@ function buildCalcTree(calcs, calcsInGroups, view) {
}
else
// New code name
functionalMap
.
set
(
codeNameTrimed
,
[
prefix
+
groupId
]);
}
else
{
// New functional
let
newFunctionalMap
=
new
Map
();
newFunctionalMap
.
set
(
codeNameTrimed
,
[
prefix
+
groupId
]);
calcTree
.
set
(
functionalType
,
newFunctionalMap
);
}
else
{
// New functional, not build if value is unavailable
if
(
functionalType
!==
"
unavailable
"
)
{
let
newFunctionalMap
=
new
Map
();
newFunctionalMap
.
set
(
codeNameTrimed
,
[
prefix
+
groupId
]);
calcTree
.
set
(
functionalType
,
newFunctionalMap
);
}
}
}
});
...
...
client/src/material-mod/Overview.view.js
View file @
9d8f86f9
...
...
@@ -441,17 +441,13 @@ class Overview {
this
.
code
.
append
(
container2
);
InfoSys
.
addToInfoSystem
(
this
.
code
);
if
(
calcWithBS
===
undefined
&&
calcWithDOS
===
undefined
)
{
DataStore
.
hasElecStructureData
=
false
;
}
else
{
if
(
DataStore
.
hasElecStructureData
())
{
document
.
getElementById
(
'
e-structure-ov
'
).
style
.
display
=
'
block
'
;
let
isReady
=
()
=>
{
if
(
this
.
dosLoaded
&&
this
.
bsLoaded
)
{
document
.
getElementById
(
'
e-structure-ov
'
).
style
.
visibility
=
'
visible
'
;
}
};
DataStore
.
hasElecStructureData
=
true
;
if
(
this
.
bandPlotter
===
null
){
this
.
bandPlotter
=
new
BSPlotter
();
...
...
@@ -509,9 +505,8 @@ class Overview {
}
}
if
(
calcWithHeat
===
undefined
)
{
if
(
!
DataStore
.
hasThermalData
()
)
{
document
.
getElementById
(
'
thermal-props-ov
'
).
style
.
display
=
'
none
'
;
DataStore
.
hasThermalData
=
false
;
}
else
{
document
.
getElementById
(
'
thermal-props-ov
'
).
style
.
display
=
'
block
'
;
DataStore
.
hasThermalData
=
true
;
...
...
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