Commit bc872242 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Fixed issue with query syntax popup not showing and material name query not working.

parent 2e801e69
Pipeline #97478 skipped with stage
This diff is collapsed.
window.nomadEnv = {
//apiRoot: "https://nomad-lab.eu/dev/nomad/enc-search/api/encyclopedia/",
apiRoot: "https://nomad-lab.eu/dev/rae/enc-search/api/encyclopedia/",
//apiRoot: "https://nomad-lab.eu/prod/rae/beta/api/encyclopedia/",
//apiRoot: "https://nomad-lab.eu/prod/rae/api/encyclopedia/",
......
......@@ -399,8 +399,6 @@ div.title span.unfolded::before{
background-color: white;
border: 2px solid #E56400;
padding: 8px 6px;
overflow-y: hidden;
overflow-x: hidden;
box-sizing: border-box;
min-height: 50px;
}
......
......@@ -95,9 +95,8 @@ class MaterialList {
if (page) reqJson.search_by = { page: page}
// Add the restricted option from the checkbox
//let restrictedEl = document.getElementById('restricted-search');
//reqJson.search_by.restricted = (restrictedEl.checked ? '1' : '0');
reqJson.search_by.restricted = '0';
let restrictedEl = document.getElementById('restricted-search');
reqJson.search_by.restricted = (restrictedEl.checked ? '1' : '0');
console.log('SEARCHING: ', reqJson );
const timestamp = Date.now();
this.newestQuery = timestamp;
......@@ -124,6 +123,7 @@ class MaterialList {
}
})
.catch(error => {
console.log("Error")
document.querySelector('#syntax-error').style.visibility = 'visible';
})
.finally(() => {
......
......@@ -270,7 +270,11 @@ class NewSearchMod {
sendQuery() {
//**** The optimade query must be formed from the search box and the properties selected
const allowOtherElements = document.getElementById('allow-other-elements').checked;
const elementCheckbox = document.getElementById('allow-other-elements');
let allowOtherElements = true
if (elementCheckbox) {
allowOtherElements = elementCheckbox.checked
}
const searchBoxOptimadeQuery = this.searchBox.getOptimadeQuery(allowOtherElements);
const propsOptimadeQuery = getOptimadeQueryFromProps(this.filterPanel.getValues());
const sep = (searchBoxOptimadeQuery !== '' && propsOptimadeQuery !== '' ? ' AND ' : '');
......
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