You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2022/06/29 13:45:00 UTC

[solr] branch solr-paramset-impl updated (0ef04914730 -> 6b6dd974cc2)

This is an automated email from the ASF dual-hosted git repository.

epugh pushed a change to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git


    from 0ef04914730 colour coded json!
     new 40afce14ece prune some unused css
     new 954b3f37ac5 Fix up formatting of dropdown
     new a82b1061d7b rework the chosen dropdown, now logic working
     new f8957398743 give some space to the sample paramset
     new e2f6260e795 introduce a delete option
     new 6b6dd974cc2 cleanups

The 6 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 solr/webapp/web/css/angular/paramsets.css          | 57 +++++++++-------------
 .../webapp/web/js/angular/controllers/paramsets.js | 51 +++++++++++++++----
 solr/webapp/web/partials/paramsets.html            | 44 ++++++++++-------
 3 files changed, 90 insertions(+), 62 deletions(-)


[solr] 03/06: rework the chosen dropdown, now logic working

Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git

commit a82b1061d7b419f7a172997ad968314152080b18
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Wed Jun 29 07:21:26 2022 -0600

    rework the chosen dropdown, now logic working
---
 .../webapp/web/js/angular/controllers/paramsets.js | 24 +++++++++--------
 solr/webapp/web/partials/paramsets.html            | 30 +++++++++++-----------
 2 files changed, 29 insertions(+), 25 deletions(-)

diff --git a/solr/webapp/web/js/angular/controllers/paramsets.js b/solr/webapp/web/js/angular/controllers/paramsets.js
index df25b72c094..9486073f18f 100644
--- a/solr/webapp/web/js/angular/controllers/paramsets.js
+++ b/solr/webapp/web/js/angular/controllers/paramsets.js
@@ -23,7 +23,7 @@ solrAdminApp.controller('ParamSetsController',
 
     $scope.resetMenu("paramsets", Constants.IS_COLLECTION_PAGE);
 
-    $scope.sampleCommand = {
+    $scope.sampleAPICommand = {
       "set": {
         "myQueries": {
           "defType": "edismax",
@@ -33,13 +33,9 @@ solrAdminApp.controller('ParamSetsController',
       }
     }
 
-    $scope.showHelp = function (id) {
-      if ($scope.helpId && ($scope.helpId === id || id === '')) {
-        delete $scope.helpId;
-      } else {
-        $scope.helpId = id;
-      }
-    };
+    $scope.selectParamset = function() {
+      $scope.getParamsets(true);
+    }
 
     $scope.getParamsets = function (isSelected) {
       $scope.refresh();
@@ -59,7 +55,14 @@ solrAdminApp.controller('ParamSetsController',
         delete success.$resolved;
         $scope.response = JSON.stringify(success, null, '  ');
         if (isSelected) {
-          $scope.selectedParamsetList = success.response.params ? Object.keys(success.response.params) : [];
+          var apiPayload = {
+            "set": success.response.params
+          };
+          // remove json key that is defined as "", it can't be submitted via the API.
+          var paramsetName = Object.keys(apiPayload.set)[0];
+          delete apiPayload.set[paramsetName][""]
+
+          $scope.paramsetContent = JSON.stringify(apiPayload, null, '  ');
         } else {
           $scope.paramsetList = success.response.params ? Object.keys(success.response.params) : [];
         }
@@ -70,9 +73,10 @@ solrAdminApp.controller('ParamSetsController',
       }
     }
     $scope.getParamsets();
+    
     $scope.refresh = function () {
       $scope.paramsetContent = "";
-      $scope.placeholder = JSON.stringify($scope.sampleCommand, null, '  ');
+      $scope.placeholder = JSON.stringify($scope.sampleAPICommand, null, '  ');
     };
     $scope.refresh();
 
diff --git a/solr/webapp/web/partials/paramsets.html b/solr/webapp/web/partials/paramsets.html
index b05707adc65..699dbaff032 100644
--- a/solr/webapp/web/partials/paramsets.html
+++ b/solr/webapp/web/partials/paramsets.html
@@ -20,21 +20,21 @@
 <div id="paramsets" class="clearfix">
     <div id="form">
         <form>
+
             <div id="paramset-name-container">
-                <label for="paramsetName">
-                    <a rel="help">Paramset Name</a>
-                </label>
-                <select ng-model="name"
-                        ng-options="item for item in paramsetList"
-                        name="paramsetName"
-                        chosen
-                        style="width:100%"
-                        id="paramsetName"
-                        title="ParamSetName"
-                        data-placeholder="Please select paramset"></select>
+
+              <label for="paramsetName">
+                  <a rel="help">Paramsets</a>
+              </label>
+              <select id="paramsetName"
+                      ng-model="name"
+                      chosen
+                      data-placeholder="Please select ..."
+                      ng-change="selectParamset()"
+                      ng-options="item for item in paramsetList"><option value=""></option></select>
+
             </div>
 
-            <button type="submit" ng-click="getParamsets(true)" id="get-paramset">Get Paramset</button>
 
             <div>
                 <form>
@@ -45,8 +45,8 @@
                     </label>
                 </form>
                 <div ng-switch="switch.showSample">
-                    <div ng-switch-when="true">
-                      <pre class="syntax language-json"><code ng-bind-html="placeholder | highlight:'json' | unsafe"></code></pre>                      
+                    <div id="sample-paramset" ng-switch-when="true">
+                      <pre class="syntax language-json"><code ng-bind-html="placeholder | highlight:'json' | unsafe"></code></pre>
                     </div>
                 </div>
 
@@ -56,7 +56,7 @@
                         <label for="paramset">
                             Paramset(s) JSON
                         </label>
-                        <textarea ng-model="paramsetContent" name="paramsets" id="paramset" title="The Paramset" rows="10"
+                        <textarea ng-model="paramsetContent" name="paramsets" id="paramset" title="Request Parameters API Payload" rows="10"
                                   cols="65"></textarea>
                         <p>
                           <a href="https://solr.apache.org/guide/solr/latest/configuration-guide/request-parameters-api.html" target="_out">syntax help</a>


[solr] 04/06: give some space to the sample paramset

Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git

commit f8957398743b24c6001935c811410bc11f557f53
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Wed Jun 29 07:21:37 2022 -0600

    give some space to the sample paramset
---
 solr/webapp/web/css/angular/paramsets.css | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/solr/webapp/web/css/angular/paramsets.css b/solr/webapp/web/css/angular/paramsets.css
index f31c0775368..1fdd423908b 100644
--- a/solr/webapp/web/css/angular/paramsets.css
+++ b/solr/webapp/web/css/angular/paramsets.css
@@ -28,6 +28,12 @@ limitations under the License.
 {
     float: left;
 }
+
+#content #paramsets #sample-paramset
+{
+    margin-top: 15px;
+}
+
 #content #paramsets #form fieldset legend, #content #paramsets #form .optional.expanded legend {
     display: block;
     margin-left: 10px;


[solr] 02/06: Fix up formatting of dropdown

Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 954b3f37ac54661afb5da753215e1adb4dcb2309
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Tue Jun 28 15:13:07 2022 -0600

    Fix up formatting of dropdown
---
 solr/webapp/web/css/angular/paramsets.css | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/solr/webapp/web/css/angular/paramsets.css b/solr/webapp/web/css/angular/paramsets.css
index cd13d0f95c1..f31c0775368 100644
--- a/solr/webapp/web/css/angular/paramsets.css
+++ b/solr/webapp/web/css/angular/paramsets.css
@@ -148,3 +148,17 @@ legend {
 .description{
     font-weight: bold;
 }
+
+#content #paramsets .chosen-container
+{
+  width: 71% !important;
+}
+
+#content #paramsets .chosen-container {
+  margin-left: 6px;
+  width: 100%;
+}
+#content #paramsets .chosen-drop input,
+#content #paramsets .chosen-results {
+  width: 100% !important;
+}


[solr] 06/06: cleanups

Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 6b6dd974cc299f71f88b05eace81b6c670ce026a
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Wed Jun 29 07:44:51 2022 -0600

    cleanups
---
 solr/webapp/web/partials/paramsets.html | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/solr/webapp/web/partials/paramsets.html b/solr/webapp/web/partials/paramsets.html
index 9f911f3394c..4874773db8e 100644
--- a/solr/webapp/web/partials/paramsets.html
+++ b/solr/webapp/web/partials/paramsets.html
@@ -21,7 +21,7 @@
     <div id="form">
         <form>
 
-          <fieldset class="Select Paramset">
+          <fieldset>
               <legend>Select Paramset</legend>
             <div id="paramset-name-container">
 
@@ -56,13 +56,17 @@
                     </div>
                 </div>
 
-                <fieldset class="Update Paramset">
+                <fieldset>
                     <legend>Update Paramset(s)</legend>
                     <div class="fieldset" id="paramsetContent-container">
                         <label for="paramset">
                             Paramset(s) JSON
                         </label>
-                        <textarea ng-model="paramsetContent" name="paramsets" id="paramset" title="Request Parameters API Payload" rows="10"
+                        <textarea ng-model="paramsetContent"
+                                  name="paramsetContent"
+                                  id="paramsetContent"
+                                  title="Request Parameters API Payload"
+                                  rows="10"
                                   cols="65"></textarea>
                         <p>
                           <a href="https://solr.apache.org/guide/solr/latest/configuration-guide/request-parameters-api.html" target="_out">syntax help</a>
@@ -80,7 +84,7 @@
 
             </div>
 
-            <button type="submit" ng-click="submit()" id="submit">Submit Paramset Updates</button>
+            <button type="submit" ng-click="submit()" id="submit">Submit Updates</button>
         </form>
     </div>
     <div id="result">


[solr] 05/06: introduce a delete option

Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git

commit e2f6260e795bc1c61436ce8a11742a4af5182ed2
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Wed Jun 29 07:41:14 2022 -0600

    introduce a delete option
---
 solr/webapp/web/css/angular/paramsets.css          |  7 ++++++
 .../webapp/web/js/angular/controllers/paramsets.js | 29 +++++++++++++++++++++-
 solr/webapp/web/partials/paramsets.html            |  8 +++++-
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/solr/webapp/web/css/angular/paramsets.css b/solr/webapp/web/css/angular/paramsets.css
index 1fdd423908b..704fe2eae61 100644
--- a/solr/webapp/web/css/angular/paramsets.css
+++ b/solr/webapp/web/css/angular/paramsets.css
@@ -34,6 +34,13 @@ limitations under the License.
     margin-top: 15px;
 }
 
+#content #paramsets #delete-paramset
+{
+    margin-top: 5px;
+    margin-bottom: 5px;
+}
+
+
 #content #paramsets #form fieldset legend, #content #paramsets #form .optional.expanded legend {
     display: block;
     margin-left: 10px;
diff --git a/solr/webapp/web/js/angular/controllers/paramsets.js b/solr/webapp/web/js/angular/controllers/paramsets.js
index 9486073f18f..869a8a4dce9 100644
--- a/solr/webapp/web/js/angular/controllers/paramsets.js
+++ b/solr/webapp/web/js/angular/controllers/paramsets.js
@@ -73,7 +73,7 @@ solrAdminApp.controller('ParamSetsController',
       }
     }
     $scope.getParamsets();
-    
+
     $scope.refresh = function () {
       $scope.paramsetContent = "";
       $scope.placeholder = JSON.stringify($scope.sampleAPICommand, null, '  ');
@@ -100,4 +100,31 @@ solrAdminApp.controller('ParamSetsController',
         $scope.responseStatus = failure;
       }
     }
+
+    $scope.deleteParamset = function () {
+      var params = {};
+
+      params.core = $routeParams.core;
+      params.wt = "json";
+      params.name = $scope.name;
+
+      var apiPayload = {
+        "delete": [$scope.name]
+      };
+
+      ParamSet.submit(params, apiPayload, callback, failure);
+
+      ///////
+      function callback(success) {
+        $scope.responseStatus = "success";
+        delete success.$promise;
+        delete success.$resolved;
+        $scope.response = JSON.stringify(success, null, '  ');
+        $scope.getParamsets();
+      }
+      function failure (failure) {
+        $scope.responseStatus = failure;
+      }
+    }
+
   });
diff --git a/solr/webapp/web/partials/paramsets.html b/solr/webapp/web/partials/paramsets.html
index 699dbaff032..9f911f3394c 100644
--- a/solr/webapp/web/partials/paramsets.html
+++ b/solr/webapp/web/partials/paramsets.html
@@ -21,6 +21,8 @@
     <div id="form">
         <form>
 
+          <fieldset class="Select Paramset">
+              <legend>Select Paramset</legend>
             <div id="paramset-name-container">
 
               <label for="paramsetName">
@@ -35,6 +37,10 @@
 
             </div>
 
+            <div id="delete-paramset" ng-show="name">
+              <button id="delete-paramset" class="warn" ng-click="deleteParamset()">Delete Paramset</button>
+            <div>
+          </fieldset>
 
             <div>
                 <form>
@@ -74,7 +80,7 @@
 
             </div>
 
-            <button type="submit" ng-click="submit()" id="submit">Submit Paramset</button>
+            <button type="submit" ng-click="submit()" id="submit">Submit Paramset Updates</button>
         </form>
     </div>
     <div id="result">


[solr] 01/06: prune some unused css

Posted by ep...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git

commit 40afce14ecedf325392ae839ead3836d26b8ecd6
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Tue Jun 28 10:01:01 2022 -0600

    prune some unused css
---
 solr/webapp/web/css/angular/paramsets.css | 40 -------------------------------
 1 file changed, 40 deletions(-)

diff --git a/solr/webapp/web/css/angular/paramsets.css b/solr/webapp/web/css/angular/paramsets.css
index a5a39c74a1e..cd13d0f95c1 100644
--- a/solr/webapp/web/css/angular/paramsets.css
+++ b/solr/webapp/web/css/angular/paramsets.css
@@ -136,33 +136,6 @@ legend {
     width: 54%;
 }
 
-#content #paramsets #result #url
-{
-    margin-bottom: 10px;
-    background-image: url( ../../img/ico/ui-address-bar.png );
-    background-position: 5px 50%;
-    border: 1px solid #f0f0f0;
-    box-shadow: 1px 1px 0 #f0f0f0;
-    -moz-box-shadow: 1px 1px 0 #f0f0f0;
-    -webkit-box-shadow: 1px 1px 0 #f0f0f0;
-    color: #c0c0c0;
-    display: block;
-    overflow: hidden;
-    padding: 5px;
-    padding-left: 26px;
-    white-space: nowrap;
-}
-
-#content #paramsets #result #url:focus,
-#content #paramsets #result #url:hover
-{
-    border-color: #c0c0c0;
-    box-shadow: 1px 1px 0 #d8d8d8;
-    -moz-box-shadow: 1px 1px 0 #d8d8d8;
-    -webkit-box-shadow: 1px 1px 0 #d8d8d8;
-    color: #333;
-}
-
 #content #paramsets #result #response
 {
 }
@@ -175,16 +148,3 @@ legend {
 .description{
     font-weight: bold;
 }
-
-#document-type{
-    padding-bottom: 5px;
-}
-
-#wizard-fields div{
-    padding-top: 5px;
-    padding-bottom: 5px;
-}
-
-#wiz-field-data, #wiz-field-data span{
-    vertical-align: top;
-}