Skip to content
GitLab
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
45be3f85
Commit
45be3f85
authored
Dec 21, 2020
by
Iker Hurtado
Browse files
Property modification event mechanism enabling to update the search
parent
54e1bf34
Pipeline
#89985
skipped with stage
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
client/src/search-mod/FilterPanel.view.js
View file @
45be3f85
...
...
@@ -91,6 +91,17 @@ class FilterPanel {
InfoSys
.
addToInfoSystem
(
this
.
element
);
// The value change event in fields is handled at container level (event delegation pattern)
this
.
element
.
addEventListener
(
'
change
'
,
e
=>
{
if
(
e
.
target
.
id
!==
'
space-group-dropdown-list
'
)
{
console
.
log
(
'
change event
'
,
e
);
this
.
addPropsChangeListener
(
this
.
getValues
())
}
})
/* code for the MaxMinSlider component testing
this.testSlider = this.element.querySelector('.test-slider');
console.log("TAB: ",this.testSlider);
...
...
@@ -129,8 +140,8 @@ class FilterPanel {
}
set
Add
Prop
erties
Listener
(
listener
)
{
this
.
addProp
erties
Listener
=
listener
;
setProp
sChange
Listener
(
listener
)
{
this
.
addProp
sChange
Listener
=
listener
;
}
...
...
client/src/search-mod/MaterialList.view.js
View file @
45be3f85
...
...
@@ -194,7 +194,7 @@ class MaterialList {
LoadingPopup
.
show
();
rootQueryObj
=
'
elements HAS
ONLY
"Si"
OR elements HAS ONLY "Ag
"
'
;
rootQueryObj
=
'
elements HAS
ALL
"Si"
, "Cl
"
'
;
console
.
log
(
'
SENDING:
'
,
rootQueryObj
);
let
bulkReq
=
util
.
serverReqPOST
(
util
.
getSearchURL
(),
JSON
.
stringify
({
query
:
rootQueryObj
})
,
bulke
=>
{
let
bulkData
=
JSON
.
parse
(
bulke
.
target
.
response
);
console
.
log
(
'
GETTING:
'
,
bulkData
);
...
...
client/src/search-mod/NewSearchMod.js
View file @
45be3f85
...
...
@@ -206,6 +206,11 @@ class NewSearchMod {
this
.
filterPanel
=
new
FilterPanel
();
this
.
filterSidePanel
.
appendChild
(
this
.
filterPanel
.
element
);
this
.
filterPanel
.
setPropsChangeListener
(
propsMap
=>
{
console
.
log
(
'
filterPanel.change Event propsMap:
'
,
propsMap
);
this
.
sendQuery
(
propsMap
);
})
this
.
materialList
=
new
MaterialList
();
this
.
resultsPage
=
this
.
element
.
querySelector
(
'
.results-panel
'
);
this
.
materialList
.
attachAndSetEvents
(
this
.
resultsPage
);
...
...
@@ -224,6 +229,8 @@ class NewSearchMod {
this
.
mainButton
.
addEventListener
(
"
click
"
,
(
e
)
=>
{
//console.log("this.labels: "+JSON.stringify(this.labels));
/*
if (this.searchQuery.lenght === 0){
util.showUserMsg('No query');
}else{
...
...
@@ -243,7 +250,7 @@ class NewSearchMod {
this.materialList.initSearch(searchExpressionQuery);//this._addFiltersInSearchQuery( this.filterPanel.getValues(), searchExpressionQuery));
/*
if (this.element.querySelector('#allow-other-elements').checked)
searchExpressionQuery = this._getESQueryFromSearchQuery_otherElements(
this.searchQuery, this.queryTypes);
...
...
@@ -258,10 +265,10 @@ class NewSearchMod {
//TODO: why not identifying by ID???
this.element.querySelector('.add-box').style.display = 'none';
*/
}
}
}
*/
});
...
...
@@ -363,6 +370,14 @@ class NewSearchMod {
}
sendQuery
(){
console
.
log
(
'
sendQuery
'
);
let
searchQuery
=
this
.
getOptimadeQueryFromSearchQuery
(
this
.
searchQuery
,
this
.
queryTypes
);
this
.
materialList
.
initSearch
(
searchQuery
);
}
getOptimadeQueryFromSearchQuery
(
searchQuery
,
queryTypes
){
let
optimadeQuery
=
''
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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