Browse Source

Merge pull request #8174 from miguelvazq/HPCC-13200

HPCC-13200 A better way to show a filter was set

Reviewed-By: Gordon Smith <gordon.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 years ago
parent
commit
bd7835ea8b

+ 18 - 3
esp/src/eclwatch/FilterDropDownWidget.js

@@ -22,6 +22,7 @@ define([
     "dojo/dom",
     "dojo/dom-form",
     "dojo/on",
+    "dojo/dom-style",
 
     "dijit/registry",
     "dijit/form/Select",
@@ -37,7 +38,7 @@ define([
 
     "hpcc/TableContainer"
 
-], function (declare, lang, i18n, nlsHPCC, arrayUtil, dom, domForm, on,
+], function (declare, lang, i18n, nlsHPCC, arrayUtil, dom, domForm, on, domStyle,
                 registry, Select,
                 _Widget,
                 template) {
@@ -50,11 +51,13 @@ define([
         iconFilter: null,
         filterDropDown: null,
         filterForm: null,
+        filterLabel: null,
 
         postCreate: function (args) {
             this.inherited(arguments);
             this.filterDropDown = registry.byId(this.id + "FilterDropDown");
             this.filterForm = registry.byId(this.id + "FilterForm");
+            this.filterLabel = registry.byId(this.id + "FilterLabel");
         },
 
         startup: function (args) {
@@ -118,13 +121,25 @@ define([
         close: function (event) {
             this.filterDropDown.closeDropDown();
         },
-        
+
         disable: function(disable) {
             this.filterDropDown.set("disabled", disable);
         },
 
         refreshState: function () {
-            this.iconFilter.src = this.exists() ? dojoConfig.getImageURL("filter.png") : dojoConfig.getImageURL("noFilter.png");
+            if (this.exists()) {
+                this.iconFilter.src = dojoConfig.getImageURL("filter1.png");
+                dom.byId(this.id + "FilterDropDown_label").innerHTML = this.i18n.FilterSet;
+                domStyle.set(this.id + "FilterDropDown_label", {
+                    "font-weight": "bold"
+                });
+            } else {
+                this.iconFilter.src = dojoConfig.getImageURL("noFilter1.png");
+                dom.byId(this.id + "FilterDropDown_label").innerHTML = this.i18n.Filter;
+                domStyle.set(this.id + "FilterDropDown_label", {
+                    "font-weight": "normal"
+                });
+            }
         }
     });
 });

BIN
esp/src/eclwatch/img/filter1.png


BIN
esp/src/eclwatch/img/noFilter1.png


+ 1 - 0
esp/src/eclwatch/nls/hpcc.js

@@ -169,6 +169,7 @@ define({root:
     FileUploader: "File Uploader",
     FileUploadStillInProgress: "File upload still in progress",
     Filter: "Filter",
+    FilterSet: "Filter Set",
     Find: "Find",
     Finished: "Finished",
     FindNext: "Find Next",

+ 2 - 2
esp/src/eclwatch/templates/FilterDropDownWidget.html

@@ -1,7 +1,7 @@
 <span class="${baseClass}">
-    <img id="${id}IconFilter" src="${dojoConfig.urlInfo.resourcePath}/img/noFilter.png" class="iconNoFilter" />
+    <img id="${id}IconFilter" src="${dojoConfig.urlInfo.resourcePath}/img/noFilter1.png" class="iconNoFilter" />
     <div id="${id}FilterDropDown" data-dojo-type="dijit.form.DropDownButton">
-        <span>${i18n.Filter}</span>
+        <span id="${id}FilterLabel">${i18n.Filter}</span>
         <div class="toolTip" data-dojo-type="dijit.TooltipDialog">
             <div id="${id}FilterForm" style="width:${_width}" onsubmit="return false;" data-dojo-type="dijit.form.Form">
                 <div id="${id}TableContainer" class="dijitDialogPaneContentArea" data-dojo-props="cols:2" data-dojo-type="hpcc.TableContainer">