From 2dc10ce891e149697f6d62d8861d4f9debc92db8 Mon Sep 17 00:00:00 2001
From: ghuhs <ghuhs@physik.hu-berlin.de>
Date: Sun, 28 Jul 2019 11:42:52 +0200
Subject: [PATCH] adaptations and some design fixes for production update

---
 client/bundle.js                            | 38 +++++++++------------
 client/css/styles.css                       |  4 +--
 client/src/search-mod/PropertiesBox.view.js | 33 ++++++++----------
 client/src/search-mod/SearchMod.js          |  5 +--
 4 files changed, 36 insertions(+), 44 deletions(-)

diff --git a/client/bundle.js b/client/bundle.js
index cd465eae..cb5b541c 100644
--- a/client/bundle.js
+++ b/client/bundle.js
@@ -8870,7 +8870,7 @@ class SearchMod {
           if (this.queryTypes[i] === 'F') queryObj.search_by.formula = item;
           else if (this.queryTypes[i] === 'E') elements.push(item);
           else if (this.queryTypes[i] !== 'S'){  // property
-            if (this.queryTypes[i].indexOf('band-gap') === 0){  // special case
+            /*if (this.queryTypes[i].indexOf('band-gap') === 0){  // special case
               let bandGapData = this.queryTypes[i].split(':');
               queryObj.band_gap = {"min": util.eV2J(bandGapData[1]),
                 "max": util.eV2J(bandGapData[2])};
@@ -8878,7 +8878,8 @@ class SearchMod {
             }else if (this.queryTypes[i].indexOf('mass-density') === 0){  // special case
               let massDensity = this.queryTypes[i].split(':');
               queryObj.mass_density = {"min": massDensity[1], "max": massDensity[2]};
-            }else if (this.queryTypes[i].indexOf('has') === 0){// boolean fields
+            }else */
+            if (this.queryTypes[i].indexOf('has') === 0){// boolean fields
               queryObj[replaceDashes(this.queryTypes[i])] = 'Yes';
             }else // general fields
               queryObj[replaceDashes(this.queryTypes[i])] = item.split(' | ');
@@ -9245,14 +9246,13 @@ class PropertiesBox {
             <input type="checkbox" class="system-type-field" value="1D"> 1D<br>
           </div>
 
+          <!--
           <div class="field">
             <div class="field-title"><span info-sys-data="mass-density">Mass density</span> <span style="font-weight: normal;">(kg/m<sup>3</sup>)</span></div>
-            <!-- <div class="test-slider">   </div> -->
-
             Min: <input type="text" class="mass-density-min-field">&nbsp;&nbsp;
             Max: <input type="text" class="mass-density-max-field">
-
           </div>
+          -->
 
         </div>
 
@@ -9290,18 +9290,13 @@ class PropertiesBox {
       </div>
 
       <div class="results-panel props-tab-panel" >
+        <!--
         <div style="float: left; width: 47%;">
-
           <div class="field">
             <div class="field-title"><span info-sys-data="band-gap">Band gap</span> <span style="font-weight: normal;">(eV)</span></div>
             Min: <input type="text" class="band-gap-min-field">&nbsp;&nbsp;
             Max: <input type="text" class="band-gap-max-field">
-            <!--
-            <input type="range" class="band-gap-slider" min="5" max="200" step="5" value="100"/>
-            <input type="range" class="band-gap-slider" min="5" max="200" step="5" value="100"/>
-            -->
           </div>
-
         </div>
 
         <div style="float: left; width: 5%;">  </div>
@@ -9312,20 +9307,21 @@ class PropertiesBox {
             <input type="radio" name="band-gap-type" value="i"> Indirect<br>
             <input type="radio" name="band-gap-type" value="d/i" checked> Both<br>
           </div>
-
-
         </div>
+        -->
         <div style="clear: both;"></div>
 
         <div class="field" style="background-color: #CCC; padding: 10px;">
           <div style="font-weight: bold; padding-bottom: 6px" >Results containing...</div>
           <div style="float: left; width: 47%;">
-          <input type="checkbox" class="has-band-structure-field" value="Band structure">
-            <span info-sys-data="has-band-structure">Band structure</span><br>
-          <input type="checkbox" class="has-dos-field" value="DOS">
-            <span info-sys-data="has-dos">DOS</span><br>
-          <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">
-            <span info-sys-data="has-fermi-surface">Fermi surface</span><br>
+            <input type="checkbox" class="has-band-structure-field" value="Band structure">
+              <span info-sys-data="has-band-structure">Band structure</span><br>
+            <input type="checkbox" class="has-dos-field" value="DOS">
+              <span info-sys-data="has-dos">DOS</span><br>
+              <!--
+            <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">
+              <span info-sys-data="has-fermi-surface">Fermi surface</span><br>
+            -->
           </div>
           <div style="float: right; width: 47%;">
           <input type="checkbox" class="has-thermal-properties-field" value="Thermal properties">
@@ -9485,9 +9481,9 @@ class PropertiesBox {
       this.addPropsFromTextFields(propsMap,['space-group-number'], reset);
       this.addPropsFromDropdownList(propsMap,['structure-type'], reset);
       this.addPropsFromCheckboxes(propsMap,['system-type','crystal-system'], reset);
-      this.addMassDensityProps(propsMap, reset);
+//      this.addMassDensityProps(propsMap, reset);
     }else if (tabString === 'results'){
-      this.addBandgapProps(propsMap, reset);
+//      this.addBandgapProps(propsMap, reset);
       this.addPropsFromCheckboxes(propsMap,['has-band-structure', 'has-dos',
         'has-fermi-surface', 'has-thermal-properties'], reset);
 
diff --git a/client/css/styles.css b/client/css/styles.css
index 03731ea3..d47c9226 100644
--- a/client/css/styles.css
+++ b/client/css/styles.css
@@ -423,7 +423,7 @@ div.title span.unfolded::before{
 #search-properties-box{
   background-color: #DDD;
   padding: 4px;
-  height: 370px;
+  height: 330px;
 }
 
 .props-box-tabs-wrapper{
@@ -482,7 +482,7 @@ input[type='range'] {
 background-image: -webkit-linear-gradient(top, #777, #AAA, #777);
 }
 
-.space-group-field{ width: 90%;}
+.space-group-number-field{ width: 90%;}
 
 .mass-density-min-field , .mass-density-max-field, .band-gap-min-field , .band-gap-max-field, .bulk-modulus-field{
   width: 54px;
diff --git a/client/src/search-mod/PropertiesBox.view.js b/client/src/search-mod/PropertiesBox.view.js
index 5c559ba1..6e37b08c 100644
--- a/client/src/search-mod/PropertiesBox.view.js
+++ b/client/src/search-mod/PropertiesBox.view.js
@@ -70,14 +70,13 @@ class PropertiesBox {
             <input type="checkbox" class="system-type-field" value="1D"> 1D<br>
           </div>
 
+          <!--
           <div class="field">
             <div class="field-title"><span info-sys-data="mass-density">Mass density</span> <span style="font-weight: normal;">(kg/m<sup>3</sup>)</span></div>
-            <!-- <div class="test-slider">   </div> -->
-
             Min: <input type="text" class="mass-density-min-field">&nbsp;&nbsp;
             Max: <input type="text" class="mass-density-max-field">
-
           </div>
+          -->
 
         </div>
 
@@ -115,18 +114,13 @@ class PropertiesBox {
       </div>
 
       <div class="results-panel props-tab-panel" >
+        <!--
         <div style="float: left; width: 47%;">
-
           <div class="field">
             <div class="field-title"><span info-sys-data="band-gap">Band gap</span> <span style="font-weight: normal;">(eV)</span></div>
             Min: <input type="text" class="band-gap-min-field">&nbsp;&nbsp;
             Max: <input type="text" class="band-gap-max-field">
-            <!--
-            <input type="range" class="band-gap-slider" min="5" max="200" step="5" value="100"/>
-            <input type="range" class="band-gap-slider" min="5" max="200" step="5" value="100"/>
-            -->
           </div>
-
         </div>
 
         <div style="float: left; width: 5%;">  </div>
@@ -137,20 +131,21 @@ class PropertiesBox {
             <input type="radio" name="band-gap-type" value="i"> Indirect<br>
             <input type="radio" name="band-gap-type" value="d/i" checked> Both<br>
           </div>
-
-
         </div>
+        -->
         <div style="clear: both;"></div>
 
         <div class="field" style="background-color: #CCC; padding: 10px;">
           <div style="font-weight: bold; padding-bottom: 6px" >Results containing...</div>
           <div style="float: left; width: 47%;">
-          <input type="checkbox" class="has-band-structure-field" value="Band structure">
-            <span info-sys-data="has-band-structure">Band structure</span><br>
-          <input type="checkbox" class="has-dos-field" value="DOS">
-            <span info-sys-data="has-dos">DOS</span><br>
-          <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">
-            <span info-sys-data="has-fermi-surface">Fermi surface</span><br>
+            <input type="checkbox" class="has-band-structure-field" value="Band structure">
+              <span info-sys-data="has-band-structure">Band structure</span><br>
+            <input type="checkbox" class="has-dos-field" value="DOS">
+              <span info-sys-data="has-dos">DOS</span><br>
+              <!--
+            <input type="checkbox" class="has-fermi-surface-field" value="Fermi surface">
+              <span info-sys-data="has-fermi-surface">Fermi surface</span><br>
+            -->
           </div>
           <div style="float: right; width: 47%;">
           <input type="checkbox" class="has-thermal-properties-field" value="Thermal properties">
@@ -310,9 +305,9 @@ class PropertiesBox {
       this.addPropsFromTextFields(propsMap,['space-group-number'], reset);
       this.addPropsFromDropdownList(propsMap,['structure-type'], reset);
       this.addPropsFromCheckboxes(propsMap,['system-type','crystal-system'], reset);
-      this.addMassDensityProps(propsMap, reset);
+//      this.addMassDensityProps(propsMap, reset);
     }else if (tabString === 'results'){
-      this.addBandgapProps(propsMap, reset);
+//      this.addBandgapProps(propsMap, reset);
       this.addPropsFromCheckboxes(propsMap,['has-band-structure', 'has-dos',
         'has-fermi-surface', 'has-thermal-properties'], reset);
 
diff --git a/client/src/search-mod/SearchMod.js b/client/src/search-mod/SearchMod.js
index f4f67aab..df309c60 100644
--- a/client/src/search-mod/SearchMod.js
+++ b/client/src/search-mod/SearchMod.js
@@ -181,7 +181,7 @@ class SearchMod {
           if (this.queryTypes[i] === 'F') queryObj.search_by.formula = item;
           else if (this.queryTypes[i] === 'E') elements.push(item);
           else if (this.queryTypes[i] !== 'S'){  // property
-            if (this.queryTypes[i].indexOf('band-gap') === 0){  // special case
+            /*if (this.queryTypes[i].indexOf('band-gap') === 0){  // special case
               let bandGapData = this.queryTypes[i].split(':');
               queryObj.band_gap = {"min": util.eV2J(bandGapData[1]),
                 "max": util.eV2J(bandGapData[2])};
@@ -189,7 +189,8 @@ class SearchMod {
             }else if (this.queryTypes[i].indexOf('mass-density') === 0){  // special case
               let massDensity = this.queryTypes[i].split(':');
               queryObj.mass_density = {"min": massDensity[1], "max": massDensity[2]};
-            }else if (this.queryTypes[i].indexOf('has') === 0){// boolean fields
+            }else */
+            if (this.queryTypes[i].indexOf('has') === 0){// boolean fields
               queryObj[replaceDashes(this.queryTypes[i])] = 'Yes';
             }else // general fields
               queryObj[replaceDashes(this.queryTypes[i])] = item.split(' | ');
-- 
GitLab