Browse Source

HPCC-10725 Logical Files Filter Missing Fields

Added "File Type" to the filter.
Fixed some sorting options.
Enhanced filter to handle selects/
Enhanced filter to have configurable width.

Fixes HPCC-10725

Signed-off-by: Gordon Smith <gordon.smith@lexisnexis.com>
Gordon Smith 11 years ago
parent
commit
a48c2e83b3

+ 4 - 10
esp/files/scripts/DFUQueryWidget.js

@@ -270,12 +270,6 @@ define([
                 StartDate: this.getISOString("FromDate", "FromTime"),
                 EndDate: this.getISOString("ToDate", "ToTime")
             });
-            if (retVal.StartDate != "" && retVal.EndDate != "") {
-            } else if (retVal.FirstN) {
-                var now = new Date();
-                retVal.StartDate = date.add(now, "day", retVal.LastNDays * -1).toISOString();
-                retVal.EndDate = now.toISOString();
-            }
             return retVal;
         },
 
@@ -439,10 +433,10 @@ define([
                     Owner: { label: this.i18n.Owner, width: 72 },
                     Description: { label: this.i18n.Description, width: 153 },
                     ClusterName: { label: this.i18n.Cluster, width: 108 },
-                    RecordCount: { label: this.i18n.Records, width: 72, sortable: false },
-                    Totalsize: { label: this.i18n.Size, width: 72, sortable: false },
-                    Parts: { label: this.i18n.Parts, width: 45, sortable: false },
-                    Modified: { label: this.i18n.ModifiedUTCGMT, width: 155, sortable: false }
+                    RecordCount: { label: this.i18n.Records, width: 72},
+                    Totalsize: { label: this.i18n.Size, width: 72},
+                    Parts: { label: this.i18n.Parts, width: 45},
+                    Modified: { label: this.i18n.ModifiedUTCGMT, width: 155}
                 }
             }, this.id + "WorkunitsGrid");
             this.workunitsGrid.noDataMessage = "<span class='dojoxGridNoData'>" + this.i18n.noDataMessage + "</span>";

+ 13 - 0
esp/files/scripts/ESPLogicalFile.js

@@ -46,6 +46,19 @@ define([
                 Name: id
             });
         },
+        preRequest: function (request) {
+            switch (request.Sortby) {
+                case "ClusterName":
+                    request.Sortby = "Cluster";
+                    break;
+                case "RecordCount":
+                    request.Sortby = "Records";
+                    break;
+                case "Totalsize":
+                    request.Sortby = "Size";
+                    break;
+            }
+        },
         update: function (id, item) {
             var storeItem = this.get(id);
             storeItem.updateData(item);

+ 8 - 2
esp/files/scripts/FilterDropDownWidget.js

@@ -25,6 +25,7 @@ define([
     "dojo/on",
 
     "dijit/registry",
+    "dijit/form/Select",
 
     "hpcc/_Widget",
 
@@ -38,7 +39,7 @@ define([
     "hpcc/TableContainer"
 
 ], function (declare, lang, i18n, nlsCommon, nlsSpecific, arrayUtil, dom, domForm, on,
-                registry,
+                registry, Select,
                 _Widget,
                 template) {
     return declare("FilterDropDownWidget", [_Widget], {
@@ -46,6 +47,7 @@ define([
         baseClass: "FilterDropDownWidget",
         i18n: lang.mixin(nlsCommon, nlsSpecific),
 
+        _width:"460px",
         iconFilter: null,
         filterDropDown: null,
         filterForm: null,
@@ -78,7 +80,11 @@ define([
         //  Implementation  ---
         clear: function () {
             arrayUtil.forEach(this.filterForm.getDescendants(), function (item, idx) {
-                item.set("value", null);
+                if (item instanceof Select) {
+                    item.set("value", "");
+                } else {
+                    item.set("value", null);
+                }
             });
         },
 

+ 10 - 1
esp/files/scripts/nls/DFUQueryWidget.js

@@ -7,8 +7,8 @@ define({ root:
     AddToSuperfile: "Add To Superfile",
     Append: "Append",
     Cluster: "Cluster",
-    Copy: "Copy",
     Compress: "Compress",
+    Copy: "Copy",
     Dali: "Dali",
     DeleteSelectedFiles: "Delete Selected Files?",
     Delimited: "Delimited",
@@ -16,6 +16,7 @@ define({ root:
     Despray: "Despray",
     DropZone: "Drop Zone",
     Escape: "Escape",
+    FileType: "File Type",
     Fixed: "Fixed",
     Format: "Format",
     FromDate: "From Date",
@@ -26,18 +27,24 @@ define({ root:
     IPAddress: "IP Address",
     JSmith: "JSmit*",
     Label: "Label",
+    Largest: "Largest",
     LastNDays: "Last N Days",
     LineTerminators: "Line Terminators",
     LogicalFile: "Logical File",
+    LogicalFilesAndSuperfiles: "Logical Files and Superfiles",
+    LogicalFilesOnly: "Logical Files Only",
     LogicalName: "Logical Name",
     Mask: "Mask",
     MaxRecordLength: "Max Record Length",
     ModifiedUTCGMT: "Modified (UTC/GMT)",
     NA: "N/A",
     Name: "Name",
+    Newest: "Newest",
     NoFilterCriteriaSpecified: "No filter criteria specified.",
     NoSplit: "No Split",
     NoSplit: "No Split",
+    NotInSuperfiles: "Not in Superfiles",
+    Oldest: "Oldest",
     OmitSeparator: "Omit Separator",
     Options: "Options",
     Overwrite: "Overwrite",
@@ -55,12 +62,14 @@ define({ root:
     RowTag: "Row Tag",
     Seperators: "Seperators",
     Size: "Size",
+    Smallest: "Smallest",
     SomeDescription: "Some*Description",
     somefile: "*::somefile*",
     Source: "Source",
     SplitPrefix: "Split Prefix",
     Spray: "Spray",
     SuperFile: "Super File",
+    SuperfilesOnly: "Superfiles Only",
     tag: "tag",
     Target: "Target",
     TargetName: "Target Name",

+ 6 - 1
esp/files/templates/DFUQueryWidget.html

@@ -155,11 +155,16 @@
                         <input id="${id}ClusterTargetSelect" title="${i18n.Cluster}:" name="ClusterName" colspan="2" style="display: inline-block; vertical-align: middle" data-dojo-type="TargetSelectWidget" />
                         <input id="${id}FromSize" title="${i18n.FromSizes}:" name="FileSizeFrom" colspan="2" data-dojo-props="trim: true, placeHolder:'4096'" data-dojo-type="dijit.form.TextBox" />
                         <input id="${id}ToSize" title="${i18n.ToSizes}:" name="FileSizeTo" colspan="2" data-dojo-props="trim: true, placeHolder:'16777216'" data-dojo-type="dijit.form.TextBox" />
+                        <select id="${id}FileType" title="${i18n.FileType}:" name="FileType" colspan="2" data-dojo-type="dijit.form.Select">
+                            <option value="" selected="selected">${i18n.LogicalFilesAndSuperfiles}</option>
+                            <option value="Logical Files Only">${i18n.LogicalFilesOnly}</option>
+                            <option value="Superfiles Only">${i18n.SuperfilesOnly}</option>
+                            <option value="Not in Superfiles">${i18n.NotInSuperfiles}</option>
+                        </select>
                         <input id="${id}FromDate" title="${i18n.FromDate}:" name="StartDate" data-dojo-props="trim: true, placeHolder:'7/28/2013'" data-dojo-type="dijit.form.DateTextBox" />
                         <input id="${id}FromTime" title="" name="FromTime" data-dojo-props="trim: true, placeHolder:'7:30 AM'" data-dojo-type="dijit.form.TimeTextBox" />
                         <input id="${id}ToDate" title="${i18n.ToDate}:" name="EndDate" data-dojo-props="trim: true, placeHolder:'7/28/2013'" data-dojo-type="dijit.form.DateTextBox" />
                         <input id="${id}ToTime" title="" name="ToTime" data-dojo-props="trim: true, placeHolder:'7:30 PM'" data-dojo-type="dijit.form.TimeTextBox" />
-                        <input id="${id}LastNDays" title="${i18n.LastNDays}:" name="FirstN" colspan="2" data-dojo-props="dtrim: true, placeHolder:'2'" data-dojo-type="dijit.form.TextBox" />
                     </div>
                     <span data-dojo-type="dijit.ToolbarSeparator"></span>
                     <div id="${id}NewPage" class="right" data-dojo-attach-event="onClick:_onNewPage" data-dojo-props="iconClass:'iconNewPage', showLabel:false" data-dojo-type="dijit.form.Button">${i18n.OpenInNewPage}</div>

+ 1 - 1
esp/files/templates/FilterDropDownWidget.html

@@ -3,7 +3,7 @@
     <div id="${id}FilterDropDown" data-dojo-type="dijit.form.DropDownButton">
         <span>${i18n.Filter}</span>
         <div class="toolTip" data-dojo-type="dijit.TooltipDialog">
-            <div id="${id}FilterForm" style="width:460px" onsubmit="return false;" data-dojo-type="dijit.form.Form">
+            <div id="${id}FilterForm" style="width:${_width}" onsubmit="return false;" data-dojo-type="dijit.form.Form">
                 <div class="dijitDialogPaneContentArea" data-dojo-props="cols:2" data-dojo-type="hpcc.TableContainer">
                     <span data-dojo-attach-point="containerNode"></span>
                 </div>