فهرست منبع

HPCC-23278 Add TSLint to build process

Fixed linting issues

Signed-off-by: Gordon Smith <gordonjsmith@gmail.com>
Gordon Smith 5 سال پیش
والد
کامیت
c5128ca8a2
56فایلهای تغییر یافته به همراه1994 افزوده شده و 1829 حذف شده
  1. 161 29
      esp/src/package-lock.json
  2. 4 1
      esp/src/package.json
  3. 2 2
      esp/src/src/Clippy.ts
  4. 4 4
      esp/src/src/DataPatterns/AttributeDesc.ts
  5. 1 1
      esp/src/src/DataPatterns/Cardinality.ts
  6. 5 5
      esp/src/src/DataPatterns/DGridHeaderHook.ts
  7. 4 4
      esp/src/src/DataPatterns/DPWorkunit.ts
  8. 1 1
      esp/src/src/DataPatterns/NAWidget.ts
  9. 1 1
      esp/src/src/DataPatterns/PopularPatterns.ts
  10. 6 6
      esp/src/src/DataPatterns/Report.ts
  11. 5 5
      esp/src/src/DataPatterns/StatChart.ts
  12. 16 16
      esp/src/src/DataPatternsWidget.ts
  13. 4 4
      esp/src/src/DeclareDecorator.ts
  14. 5 5
      esp/src/src/DiskUsage.ts
  15. 41 41
      esp/src/src/ESPActivity.ts
  16. 17 17
      esp/src/src/ESPBase.ts
  17. 49 49
      esp/src/src/ESPDFUWorkunit.ts
  18. 130 131
      esp/src/src/ESPGraph.ts
  19. 84 85
      esp/src/src/ESPLogicalFile.ts
  20. 5 5
      esp/src/src/ESPPackageProcess.ts
  21. 71 71
      esp/src/src/ESPPreflight.ts
  22. 44 45
      esp/src/src/ESPQuery.ts
  23. 60 60
      esp/src/src/ESPQueue.ts
  24. 72 71
      esp/src/src/ESPRequest.ts
  25. 29 29
      esp/src/src/ESPResource.ts
  26. 132 131
      esp/src/src/ESPResult.ts
  27. 120 121
      esp/src/src/ESPTopology.ts
  28. 33 33
      esp/src/src/ESPTree.ts
  29. 96 97
      esp/src/src/ESPUtil.ts
  30. 158 159
      esp/src/src/ESPWorkunit.ts
  31. 46 47
      esp/src/src/FileSpray.ts
  32. 5 5
      esp/src/src/Graph7Widget.ts
  33. 16 14
      esp/src/src/GraphStore.ts
  34. 46 46
      esp/src/src/GraphTree7Widget.ts
  35. 88 89
      esp/src/src/GraphTreeWidget.ts
  36. 6 6
      esp/src/src/KeyValStore.ts
  37. 6 6
      esp/src/src/Pagination.ts
  38. 3 3
      esp/src/src/Session.ts
  39. 11 11
      esp/src/src/Timings.ts
  40. 19 20
      esp/src/src/UserPreferences/EnvironmentTheme.ts
  41. 113 97
      esp/src/src/Utility.ts
  42. 1 1
      esp/src/src/WUGraphLegend.ts
  43. 2 1
      esp/src/src/WUScopeController.ts
  44. 18 18
      esp/src/src/WsDFUXref.ts
  45. 26 26
      esp/src/src/WsDfu.ts
  46. 2 5
      esp/src/src/WsESDLConfig.ts
  47. 29 29
      esp/src/src/WsEcl.ts
  48. 12 12
      esp/src/src/WsPackageMaps.ts
  49. 2 2
      esp/src/src/WsSMC.ts
  50. 25 25
      esp/src/src/WsTopology.ts
  51. 29 29
      esp/src/src/WsWorkunits.ts
  52. 7 8
      esp/src/src/dojoLib.ts
  53. 77 77
      esp/src/src/ws_access.ts
  54. 3 4
      esp/src/src/ws_account.ts
  55. 7 7
      esp/src/src/ws_machine.ts
  56. 35 12
      esp/src/tslint.json

+ 161 - 29
esp/src/package-lock.json

@@ -4,6 +4,26 @@
   "lockfileVersion": 1,
   "requires": true,
   "dependencies": {
+    "@babel/code-frame": {
+      "version": "7.5.5",
+      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
+      "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
+      "dev": true,
+      "requires": {
+        "@babel/highlight": "^7.0.0"
+      }
+    },
+    "@babel/highlight": {
+      "version": "7.5.0",
+      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz",
+      "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==",
+      "dev": true,
+      "requires": {
+        "chalk": "^2.0.0",
+        "esutils": "^2.0.2",
+        "js-tokens": "^4.0.0"
+      }
+    },
     "@hpcc-js/api": {
       "version": "2.8.6",
       "resolved": "https://registry.npmjs.org/@hpcc-js/api/-/api-2.8.6.tgz",
@@ -673,6 +693,15 @@
       "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
       "dev": true
     },
+    "argparse": {
+      "version": "1.0.10",
+      "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+      "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+      "dev": true,
+      "requires": {
+        "sprintf-js": "~1.0.2"
+      }
+    },
     "arr-diff": {
       "version": "2.0.0",
       "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
@@ -919,6 +948,16 @@
       "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=",
       "dev": true
     },
+    "bindings": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+      "dev": true,
+      "optional": true,
+      "requires": {
+        "file-uri-to-path": "1.0.0"
+      }
+    },
     "bluebird": {
       "version": "3.7.2",
       "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
@@ -1060,6 +1099,12 @@
       "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=",
       "dev": true
     },
+    "builtin-modules": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+      "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
+      "dev": true
+    },
     "builtin-status-codes": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
@@ -1901,6 +1946,12 @@
       "integrity": "sha1-8NZtA2cqglyxtzvbP+YjEMjlUrc=",
       "dev": true
     },
+    "diff": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.1.tgz",
+      "integrity": "sha512-s2+XdvhPCOF01LRQBC8hf4vhbVmI2CGS5aZnxLJlT5FtdhPCDFq80q++zK2KlrVorVDdL5BOGZ/VfLrVtYNF+Q==",
+      "dev": true
+    },
     "diffie-hellman": {
       "version": "5.0.3",
       "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
@@ -2214,6 +2265,12 @@
         "estraverse": "^4.1.1"
       }
     },
+    "esprima": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+      "dev": true
+    },
     "esrecurse": {
       "version": "4.2.1",
       "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz",
@@ -2229,6 +2286,12 @@
       "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
       "dev": true
     },
+    "esutils": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+      "dev": true
+    },
     "etag": {
       "version": "1.8.1",
       "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
@@ -2367,6 +2430,13 @@
         }
       }
     },
+    "file-uri-to-path": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+      "dev": true,
+      "optional": true
+    },
     "filename-regex": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz",
@@ -2815,14 +2885,15 @@
       "dev": true
     },
     "fsevents": {
-      "version": "1.2.9",
-      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz",
-      "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==",
+      "version": "1.2.11",
+      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz",
+      "integrity": "sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw==",
       "dev": true,
       "optional": true,
       "requires": {
+        "bindings": "^1.5.0",
         "nan": "^2.12.1",
-        "node-pre-gyp": "^0.12.0"
+        "node-pre-gyp": "*"
       },
       "dependencies": {
         "abbrev": {
@@ -2870,7 +2941,7 @@
           }
         },
         "chownr": {
-          "version": "1.1.1",
+          "version": "1.1.3",
           "bundled": true,
           "dev": true,
           "optional": true
@@ -2900,7 +2971,7 @@
           "optional": true
         },
         "debug": {
-          "version": "4.1.1",
+          "version": "3.2.6",
           "bundled": true,
           "dev": true,
           "optional": true,
@@ -2927,12 +2998,12 @@
           "optional": true
         },
         "fs-minipass": {
-          "version": "1.2.5",
+          "version": "1.2.7",
           "bundled": true,
           "dev": true,
           "optional": true,
           "requires": {
-            "minipass": "^2.2.1"
+            "minipass": "^2.6.0"
           }
         },
         "fs.realpath": {
@@ -2958,7 +3029,7 @@
           }
         },
         "glob": {
-          "version": "7.1.3",
+          "version": "7.1.6",
           "bundled": true,
           "dev": true,
           "optional": true,
@@ -2987,7 +3058,7 @@
           }
         },
         "ignore-walk": {
-          "version": "3.0.1",
+          "version": "3.0.3",
           "bundled": true,
           "dev": true,
           "optional": true,
@@ -3006,7 +3077,7 @@
           }
         },
         "inherits": {
-          "version": "2.0.3",
+          "version": "2.0.4",
           "bundled": true,
           "dev": true,
           "optional": true
@@ -3048,7 +3119,7 @@
           "optional": true
         },
         "minipass": {
-          "version": "2.3.5",
+          "version": "2.9.0",
           "bundled": true,
           "dev": true,
           "optional": true,
@@ -3058,12 +3129,12 @@
           }
         },
         "minizlib": {
-          "version": "1.2.1",
+          "version": "1.3.3",
           "bundled": true,
           "dev": true,
           "optional": true,
           "requires": {
-            "minipass": "^2.2.1"
+            "minipass": "^2.9.0"
           }
         },
         "mkdirp": {
@@ -3076,24 +3147,24 @@
           }
         },
         "ms": {
-          "version": "2.1.1",
+          "version": "2.1.2",
           "bundled": true,
           "dev": true,
           "optional": true
         },
         "needle": {
-          "version": "2.3.0",
+          "version": "2.4.0",
           "bundled": true,
           "dev": true,
           "optional": true,
           "requires": {
-            "debug": "^4.1.0",
+            "debug": "^3.2.6",
             "iconv-lite": "^0.4.4",
             "sax": "^1.2.4"
           }
         },
         "node-pre-gyp": {
-          "version": "0.12.0",
+          "version": "0.14.0",
           "bundled": true,
           "dev": true,
           "optional": true,
@@ -3107,7 +3178,7 @@
             "rc": "^1.2.7",
             "rimraf": "^2.6.1",
             "semver": "^5.3.0",
-            "tar": "^4"
+            "tar": "^4.4.2"
           }
         },
         "nopt": {
@@ -3121,13 +3192,22 @@
           }
         },
         "npm-bundled": {
-          "version": "1.0.6",
+          "version": "1.1.1",
+          "bundled": true,
+          "dev": true,
+          "optional": true,
+          "requires": {
+            "npm-normalize-package-bin": "^1.0.1"
+          }
+        },
+        "npm-normalize-package-bin": {
+          "version": "1.0.1",
           "bundled": true,
           "dev": true,
           "optional": true
         },
         "npm-packlist": {
-          "version": "1.4.1",
+          "version": "1.4.7",
           "bundled": true,
           "dev": true,
           "optional": true,
@@ -3198,7 +3278,7 @@
           "optional": true
         },
         "process-nextick-args": {
-          "version": "2.0.0",
+          "version": "2.0.1",
           "bundled": true,
           "dev": true,
           "optional": true
@@ -3239,7 +3319,7 @@
           }
         },
         "rimraf": {
-          "version": "2.6.3",
+          "version": "2.7.1",
           "bundled": true,
           "dev": true,
           "optional": true,
@@ -3266,7 +3346,7 @@
           "optional": true
         },
         "semver": {
-          "version": "5.7.0",
+          "version": "5.7.1",
           "bundled": true,
           "dev": true,
           "optional": true
@@ -3319,18 +3399,18 @@
           "optional": true
         },
         "tar": {
-          "version": "4.4.8",
+          "version": "4.4.13",
           "bundled": true,
           "dev": true,
           "optional": true,
           "requires": {
             "chownr": "^1.1.1",
             "fs-minipass": "^1.2.5",
-            "minipass": "^2.3.4",
-            "minizlib": "^1.1.1",
+            "minipass": "^2.8.6",
+            "minizlib": "^1.2.1",
             "mkdirp": "^0.5.0",
             "safe-buffer": "^5.1.2",
-            "yallist": "^3.0.2"
+            "yallist": "^3.0.3"
           }
         },
         "util-deprecate": {
@@ -3355,7 +3435,7 @@
           "optional": true
         },
         "yallist": {
-          "version": "3.0.3",
+          "version": "3.1.1",
           "bundled": true,
           "dev": true,
           "optional": true
@@ -4040,6 +4120,22 @@
         "isarray": "1.0.0"
       }
     },
+    "js-tokens": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+      "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+      "dev": true
+    },
+    "js-yaml": {
+      "version": "3.13.1",
+      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz",
+      "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==",
+      "dev": true,
+      "requires": {
+        "argparse": "^1.0.7",
+        "esprima": "^4.0.0"
+      }
+    },
     "jshint": {
       "version": "2.10.2",
       "resolved": "https://registry.npmjs.org/jshint/-/jshint-2.10.2.tgz",
@@ -6411,6 +6507,12 @@
         "extend-shallow": "^3.0.0"
       }
     },
+    "sprintf-js": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+      "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
+      "dev": true
+    },
     "ssri": {
       "version": "6.0.1",
       "resolved": "https://registry.npmjs.org/ssri/-/ssri-6.0.1.tgz",
@@ -6846,6 +6948,36 @@
       "integrity": "sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==",
       "dev": true
     },
+    "tslint": {
+      "version": "5.20.1",
+      "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz",
+      "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==",
+      "dev": true,
+      "requires": {
+        "@babel/code-frame": "^7.0.0",
+        "builtin-modules": "^1.1.1",
+        "chalk": "^2.3.0",
+        "commander": "^2.12.1",
+        "diff": "^4.0.1",
+        "glob": "^7.1.1",
+        "js-yaml": "^3.13.1",
+        "minimatch": "^3.0.4",
+        "mkdirp": "^0.5.1",
+        "resolve": "^1.3.2",
+        "semver": "^5.3.0",
+        "tslib": "^1.8.0",
+        "tsutils": "^2.29.0"
+      }
+    },
+    "tsutils": {
+      "version": "2.29.0",
+      "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
+      "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
+      "dev": true,
+      "requires": {
+        "tslib": "^1.8.1"
+      }
+    },
     "tty-browserify": {
       "version": "0.0.0",
       "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz",

+ 4 - 1
esp/src/package.json

@@ -5,7 +5,9 @@
   "scripts": {
     "preinstall-tmp": "rimraf ./node_modules/@hpcc-js || true",
     "clean": "rimraf ./build && rimraf ./lib",
-    "lint": "jshint --config ./.jshintrc ./eclwatch",
+    "jslint": "jshint --config ./.jshintrc ./eclwatch",
+    "tslint": "tslint --project . src/**/*.ts",
+    "lint": "run-s jslint tslint",
     "copy-res-es6-promise": "cpx \"./node_modules/es6-promise/dist/es6-promise.auto.min.js\" ./build/node_modules/es6-promise/dist/",
     "copy-res-eclwatch-img": "cpx \"./eclwatch/img/**/*.{png,jpg,gif}\" ./build/eclwatch/img/",
     "copy-res-eclwatch-ecl": "cpx \"./eclwatch/ecl/**/*.*\" ./build/eclwatch/ecl/",
@@ -61,6 +63,7 @@
     "rimraf": "3.0.0",
     "style-loader": "1.1.2",
     "tslib": "1.10.0",
+    "tslint": "5.20.1",
     "typescript": "3.7.4",
     "url-loader": "3.0.0",
     "webpack": "4.41.5",

+ 2 - 2
esp/src/src/Clippy.ts

@@ -1,11 +1,11 @@
 import * as Clipboard from "clipboard";
 import * as Tooltip from "dijit/Tooltip";
 import * as dom from "dojo/dom";
-import * as mouse from "dojo/mouse";
-import * as on from "dojo/on";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
+import * as mouse from "dojo/mouse";
+import * as on from "dojo/on";
 
 export function attach(domID: string): void {
     const clipboard: Clipboard = new Clipboard(`#${domID}`);

+ 4 - 4
esp/src/src/DataPatterns/AttributeDesc.ts

@@ -1,6 +1,6 @@
+import { StyledTable } from "@hpcc-js/html";
 import { Grid } from "@hpcc-js/layout";
 import { Html } from "@hpcc-js/other";
-import { StyledTable } from "@hpcc-js/html";
 import { config } from "./config";
 
 class AttributeTitle extends Html {
@@ -60,16 +60,16 @@ class AttributeSummary extends StyledTable {
 
     constructor(row) {
         super();
-        let fillRate = row.fill_rate === 100 || row.fill_rate === 0 ? row.fill_rate : row.fill_rate.toFixed(1);
+        const fillRate = row.fill_rate === 100 || row.fill_rate === 0 ? row.fill_rate : row.fill_rate.toFixed(1);
         this
             .data([
                 ["Cardinality", row.cardinality, "(~" + (row.cardinality / row.fill_count * 100).toFixed(0) + "%)"],
-                ["Filled", row.fill_count, fillRate <= config.fillRateRedThreshold ? `(<b style="color:${config.redColor}">` + fillRate + "%</b>)" : "(" + fillRate + "%)"],
+                ["Filled", row.fill_count, fillRate <= config.fillRateRedThreshold ? `(<b style="color:${config.redColor}">` + fillRate + "%</b>)" : "(" + fillRate + "%)"]
             ])
             .tbodyColumnStyles([
                 { "font-weight": "bold", "font-size": config.secondaryFontSize + "px", "width": "1%" },
                 { "font-weight": "normal", "font-size": config.secondaryFontSize + "px", "text-align": "right", "width": "auto" },
-                { "font-weight": "normal", "font-size": config.secondaryFontSize + "px", "text-align": "left", "width": "1%" },
+                { "font-weight": "normal", "font-size": config.secondaryFontSize + "px", "text-align": "left", "width": "1%" }
             ])
             ;
     }

+ 1 - 1
esp/src/src/DataPatterns/Cardinality.ts

@@ -19,7 +19,7 @@ export class Cardinality extends BreakdownTable {
                 "max-width": "60px",
                 "overflow": "hidden",
                 "text-overflow": "ellipsis",
-                "white-space": "nowrap",
+                "white-space": "nowrap"
             }, {
                 "font-size": config.secondaryFontSize + "px",
                 "font-weight": "normal",

+ 5 - 5
esp/src/src/DataPatterns/DGridHeaderHook.ts

@@ -1,8 +1,8 @@
 import { HTMLWidget, select as d3Select, selectAll as d3SelectAll } from "@hpcc-js/common";
 import { Workunit } from "@hpcc-js/comms";
+import { Cardinality } from "./Cardinality";
+import { PopularPatterns } from "./PopularPatterns";
 import { StatChart } from "./StatChart";
-import { Cardinality } from './Cardinality';
-import { PopularPatterns } from './PopularPatterns';
 
 export class DGridHeaderHook {
 
@@ -30,7 +30,7 @@ export class DGridHeaderHook {
             return wu.watchUntilComplete().then(wu => {
                 return wu.fetchResults();
             }).then(results => {
-                return results.length ? results[0].fetchRows() : []
+                return results.length ? results[0].fetchRows() : [];
             }).then(fields => {
                 fields.forEach(field => {
                     if (field.is_numeric) {
@@ -67,7 +67,7 @@ export class DGridHeaderHook {
                             .lazyRender()
                             ;
                     }
-                })
+                });
             });
         }
         return Promise.resolve();
@@ -75,7 +75,7 @@ export class DGridHeaderHook {
 
     resize(columnId: string) {
         const headerElement = d3Select<HTMLElement, HTMLWidget>(`#${this._gridID} tr:not(.dgrid-spacer-row) th.dgrid-column-${columnId} > .dgrid-resize-header-container`);
-        const element = headerElement.select(`.common_HTMLWidget`);
+        const element = headerElement.select(".common_HTMLWidget");
         if (!element.empty()) {
             const widget = element.datum();
             if (widget) {

+ 4 - 4
esp/src/src/DataPatterns/DPWorkunit.ts

@@ -56,7 +56,7 @@ export class DPWorkunit {
     resolveWU(): Promise<Workunit | undefined> {
         return this._store.get(this._storeWuidID).then(wuid => {
             if (this._wu && this._wu.Wuid === wuid) {
-                return this._wu
+                return this._wu;
             }
             this.clearCache();
             return wuid && Workunit.attach({ baseUrl: "" }, wuid);
@@ -97,7 +97,7 @@ export class DPWorkunit {
             }
             this.clearCache();
             return this._store.delete(this._storeWuidID);
-        })
+        });
     }
 
     create(target: string): Promise<Workunit> {
@@ -139,8 +139,8 @@ export class DPWorkunit {
             rows.forEach(row => {
                 if (fields.length) fields += "\n";
                 if (transformFields.length) transformFields += "\n";
-                fields += `    ${row.best_attribute_type} ${row.attribute};`
-                transformFields += `    SELF.${row.attribute} := (${row.best_attribute_type})L.${row.attribute};`
+                fields += `    ${row.best_attribute_type} ${row.attribute};`;
+                transformFields += `    SELF.${row.attribute} := (${row.best_attribute_type})L.${row.attribute};`;
             }, "");
             return Workunit.submit({ baseUrl: "" }, target, optimizeECL(this._lf.Name, this._lf.ContentType, fields, transformFields, name, overwrite));
         });

+ 1 - 1
esp/src/src/DataPatterns/NAWidget.ts

@@ -15,4 +15,4 @@ export class NAWidget extends Html {
             ;
 
     }
-}
+}

+ 1 - 1
esp/src/src/DataPatterns/PopularPatterns.ts

@@ -18,7 +18,7 @@ export class PopularPatterns extends BreakdownTable {
                 "max-width": "60px",
                 "overflow": "hidden",
                 "text-overflow": "ellipsis",
-                "white-space": "nowrap",
+                "white-space": "nowrap"
             }, {
                 "font-size": config.secondaryFontSize + "px",
                 "font-weight": "normal",

+ 6 - 6
esp/src/src/DataPatterns/Report.ts

@@ -1,12 +1,12 @@
 import { Widget } from "@hpcc-js/common";
 import { Grid } from "@hpcc-js/layout";
-import { StatChart, NumericStatsWidget, StringStatsWidget } from "./StatChart";
+import { AttributeDesc } from "./AttributeDesc";
+import { Cardinality } from "./Cardinality";
 import { config } from "./config";
 import { DPWorkunit } from "./DPWorkunit";
-import { PopularPatterns } from "./PopularPatterns";
-import { AttributeDesc } from "./AttributeDesc";
 import { NAWidget } from "./NAWidget";
-import { Cardinality } from './Cardinality';
+import { PopularPatterns } from "./PopularPatterns";
+import { NumericStatsWidget, StatChart, StringStatsWidget } from "./StatChart";
 
 export class Report extends Grid {
 
@@ -59,7 +59,7 @@ export class Report extends Grid {
 
         let c = 2;
         let cPos = 0;
-        let cStep = 12;
+        const cStep = 12;
         this.setContent(y, cPos, new AttributeDesc(row), undefined, config.rowHeight, cStep * config.colRatios.attributeDesc);
         cPos += cStep * config.colRatios.attributeDesc;
         this.setContent(y, cPos, getStatsWidget(row, ext.statsDataWidth), undefined, config.rowHeight, cStep * config.colRatios.statsData);
@@ -106,7 +106,7 @@ export class Report extends Grid {
         function getQuartileWidget(row) {
             if (row.is_numeric) {
                 return new StatChart()
-                    //.columns(["Min", "25%", "50%", "75%", "Max"])
+                    // .columns(["Min", "25%", "50%", "75%", "Max"])
                     .mean(row.numeric_mean)
                     .standardDeviation(row.numeric_std_dev)
                     .quartiles([

+ 5 - 5
esp/src/src/DataPatterns/StatChart.ts

@@ -25,7 +25,7 @@ function myFormatter(format: string): (num: number) => string {
         const strVal = (Math.round(num * 100) / 100).toString();
         if (strVal.length <= 4) return strVal;
         return formatter(num);
-    }
+    };
 }
 
 export class StatChart extends HTMLWidget {
@@ -80,7 +80,7 @@ export class StatChart extends HTMLWidget {
     private domain(mode: Mode): [number, number] {
         switch (mode) {
             case "25_75":
-                return [this.quartile(1), this.quartile(3)]
+                return [this.quartile(1), this.quartile(3)];
             case "normal":
                 return [this.stdDev(-4), this.stdDev(4)];
             case "min_max":
@@ -127,7 +127,7 @@ export class StatChart extends HTMLWidget {
                     { label: "+1σ", value: this.stdDev(1) },
                     { label: "+2σ", value: this.stdDev(2) },
                     { label: "+3σ", value: this.stdDev(3) },
-                    { label: this.formatStdDev(4), value: this.stdDev(4) },
+                    { label: this.formatStdDev(4), value: this.stdDev(4) }
                 ];
                 break;
             case "min_max":
@@ -215,7 +215,7 @@ export class NumericStatsWidget extends StyledTable {
             .tbodyColumnStyles([
                 { "font-weight": "bold", "text-align": "right", "width": "100px" },
                 { "font-weight": "normal", "width": dataWidth + "px" },
-                { "font-weight": "normal", "width": "auto" },
+                { "font-weight": "normal", "width": "auto" }
             ])
             .data([
                 ["Mean", row.numeric_mean, ""],
@@ -237,7 +237,7 @@ export class StringStatsWidget extends StyledTable {
         return new StyledTable()
             .tbodyColumnStyles([
                 { "font-weight": "bold", "text-align": "right", "width": "100px" },
-                { "font-weight": "normal", "width": "auto" },
+                { "font-weight": "normal", "width": "auto" }
             ])
             .data([
                 ["Min Length", row.min_length],

+ 16 - 16
esp/src/src/DataPatternsWidget.ts

@@ -1,9 +1,9 @@
-import "dojo/i18n";
-// @ts-ignore
-import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
 import * as dom from "dojo/dom";
 import * as domClass from "dojo/dom-class";
 import * as domForm from "dojo/dom-form";
+import "dojo/i18n";
+// @ts-ignore
+import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
 
 import * as registry from "dijit/registry";
 
@@ -21,22 +21,22 @@ import * as DelayLoadWidget from "hpcc/DelayLoadWidget";
 // @ts-ignore
 import * as template from "dojo/text!hpcc/templates/DataPatternsWidget.html";
 
+import "dijit/Fieldset";
+import "dijit/form/Button";
+import "dijit/form/CheckBox";
+import "dijit/form/DropDownButton";
+import "dijit/form/Form";
 import "dijit/layout/BorderContainer";
-import "dijit/layout/TabContainer";
 import "dijit/layout/ContentPane";
+import "dijit/layout/TabContainer";
 import "dijit/Toolbar";
 import "dijit/ToolbarSeparator";
-import "hpcc/TargetSelectWidget";
 import "dijit/TooltipDialog";
-import "dijit/form/Form";
-import "dijit/form/Button";
-import "dijit/form/DropDownButton";
-import "dijit/Fieldset";
-import "dijit/form/CheckBox";
 import "hpcc/TableContainer";
+import "hpcc/TargetSelectWidget";
 
-import { declareDecorator } from './DeclareDecorator';
-import { WUStatus } from './WUStatus';
+import { declareDecorator } from "./DeclareDecorator";
+import { WUStatus } from "./WUStatus";
 
 type _TabContainerWidget = {
     id: string;
@@ -109,7 +109,7 @@ export class DataPatternsWidget {
                     .lazyRender()
                     ;
             }
-        }
+        };
 
         this.wuStatus = new WUStatus()
             .baseUrl("")
@@ -180,7 +180,7 @@ export class DataPatternsWidget {
     }
 
     initTab() {
-        var currSel = this.getSelectedChild();
+        const currSel = this.getSelectedChild();
         if (currSel && !currSel.initalized) {
             if (currSel.id === this.summaryWidget.id) {
             } else if (this.rawDataWidget && currSel.id === this.rawDataWidget.id) {
@@ -204,10 +204,10 @@ export class DataPatternsWidget {
 
     ensureWUPane(wuid: string) {
         const id = this.createChildTabID(wuid);
-        var retVal = registry.byId(id);
+        let retVal = registry.byId(id);
         if (!retVal) {
             retVal = new DelayLoadWidget({
-                id: id,
+                id,
                 title: wuid,
                 closable: true,
                 delayWidget: "WUDetailsWidget",

+ 4 - 4
esp/src/src/DeclareDecorator.ts

@@ -5,8 +5,8 @@ import * as declare from "dojo/_base/declare";
  * This allows declare constructors to be defined as classes, which nicely
  * hides away the `declare([], {})` boilerplate.
  */
-export function declareDecorator(classID: string, ...mixins: Object[]) {
-	return function (target: Function) {
-		return declare(classID, mixins, target.prototype);
-	};
+export function declareDecorator(classID: string, ...mixins: object[]) {
+    return function (target) {
+        return declare(classID, mixins, target.prototype);
+    };
 }

+ 5 - 5
esp/src/src/DiskUsage.ts

@@ -1,8 +1,8 @@
-import { Palette } from "@hpcc-js/common";
 import { Gauge } from "@hpcc-js/chart";
+import { Palette } from "@hpcc-js/common";
 import { GetTargetClusterUsageEx, MachineService } from "@hpcc-js/comms";
-import { FlexGrid } from "@hpcc-js/layout";
 import { ColumnFormat, Table } from "@hpcc-js/dgrid";
+import { FlexGrid } from "@hpcc-js/layout";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
@@ -21,7 +21,7 @@ export class Summary extends FlexGrid {
             .itemMinHeight(100)
             .itemMinWidth(100)
             .forceYScroll(true)
-            .widgetsFlexGrow([1, 1, 1])
+            .widgetsFlexGrow([1, 1, 1]);
     }
 
     enter(domNode, element) {
@@ -44,7 +44,7 @@ export class Summary extends FlexGrid {
         this
             .widgets(widgets)
             .flexBasis(`${100 / widgets.length}%`)
-            .flexBasis(`100px`)
+            .flexBasis("100px")
             ;
 
         super.update(domNode, element);
@@ -67,7 +67,7 @@ export class Summary extends FlexGrid {
         }
         this._connection.GetTargetClusterUsageEx(undefined, bypassCachedResult).then(response => {
             this._loadingMsg && this._loadingMsg
-                .html(`<i class="fa fa-database"></i>`)
+                .html('<i class="fa fa-database"></i>')
                 ;
             response.forEach(details => {
                 if (!this._usage[details.Name]) {

+ 41 - 41
esp/src/src/ESPActivity.ts

@@ -1,56 +1,56 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as lang from "dojo/_base/lang";
 import * as Memory from "dojo/store/Memory";
 import * as Observable from "dojo/store/Observable";
 
-import * as WsSMC from "./WsSMC";
-import * as ESPUtil from "./ESPUtil";
+import * as ESPDFUWorkunit from "./ESPDFUWorkunit";
 import * as ESPQueue from "./ESPQueue";
+import * as ESPUtil from "./ESPUtil";
 import * as ESPWorkunit from "./ESPWorkunit";
-import * as ESPDFUWorkunit from "./ESPDFUWorkunit";
+import * as WsSMC from "./WsSMC";
 import * as WsWorkunits from "./WsWorkunits";
 
-var Store = declare([Memory], {
+const Store = declare([Memory], {
     idProperty: "__hpcc_id",
-    mayHaveChildren: function (item) {
+    mayHaveChildren(item) {
         return (item.getChildCount && item.getChildCount());
     },
-    getChildren: function (parent, options) {
+    getChildren(parent, options) {
         return parent.queryChildren();
     }
 });
 
-var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
+const Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
     //  Asserts  ---
-    _assertHasWuid: function () {
+    _assertHasWuid() {
         if (!this.Wuid) {
             throw new Error("Wuid cannot be empty.");
         }
     },
     //  Attributes  ---
-    _StateIDSetter: function (StateID) {
+    _StateIDSetter(StateID) {
         this.StateID = StateID;
-        var actionEx = lang.exists("ActionEx", this) ? this.ActionEx : null;
+        const actionEx = lang.exists("ActionEx", this) ? this.ActionEx : null;
         this.set("hasCompleted", WsWorkunits.isComplete(this.StateID, actionEx));
     },
 
     //  ---  ---  ---
-    constructor: function (args) {
+    constructor(args) {
         this._watched = [];
         this.store = new Store();
-        this.observableStore = new Observable(this.store)
+        this.observableStore = new Observable(this.store);
     },
 
-    isInstanceOfQueue: function (obj) {
+    isInstanceOfQueue(obj) {
         return ESPQueue.isInstanceOfQueue(obj);
     },
 
-    isInstanceOfWorkunit: function (obj) {
+    isInstanceOfWorkunit(obj) {
         return ESPWorkunit.isInstanceOfWorkunit(obj) || ESPDFUWorkunit.isInstanceOfWorkunit(obj);
     },
 
-    setBanner: function (request) {
+    setBanner(request) {
         lang.mixin(request, {
             FromSubmitBtn: true,
             BannerAction: request.BannerAction ? 1 : 0,
@@ -59,13 +59,13 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         this.getActivity(request);
     },
 
-    resolve: function (id) {
-        var queue = this.observableStore.get(id);
+    resolve(id) {
+        let queue = this.observableStore.get(id);
         if (queue) {
             return queue;
         }
 
-        var wu = id[0] === "D" ? ESPDFUWorkunit.Get(id) : ESPWorkunit.Get(id);
+        const wu = id[0] === "D" ? ESPDFUWorkunit.Get(id) : ESPWorkunit.Get(id);
         if (wu) {
             //  is wu still in a queue?
             queue = wu.get("ESPQueue");
@@ -76,12 +76,12 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         return null;
     },
 
-    monitor: function (callback) {
+    monitor(callback) {
         if (callback && this.__hpcc_changedCount) {
             callback(this);
         }
         if (!this.hasCompleted) {
-            var context = this;
+            const context = this;
             this.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue && newValue) {
                     if (callback) {
@@ -92,14 +92,14 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         }
     },
 
-    getActivity: function (request) {
-        var context = this;
+    getActivity(request) {
+        const context = this;
         return WsSMC.Activity({
-            request: request
+            request
         }).then(function (response) {
             if (lang.exists("ActivityResponse", response)) {
-                var targetClusters = [];
-                var targetClusterMap = {};
+                const targetClusters = [];
+                const targetClusterMap = {};
                 context.refreshTargetClusters(lang.getObject("ActivityResponse.HThorClusterList.TargetCluster", false, response), targetClusters, targetClusterMap);
                 context.refreshTargetClusters(lang.getObject("ActivityResponse.ThorClusterList.TargetCluster", false, response), targetClusters, targetClusterMap);
                 context.refreshTargetClusters(lang.getObject("ActivityResponse.RoxieClusterList.TargetCluster", false, response), targetClusters, targetClusterMap);
@@ -112,8 +112,8 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    refreshTargetClusters: function (responseTargetClusters, targetClusters, targetClusterMap) {
-        var context = this;
+    refreshTargetClusters(responseTargetClusters, targetClusters, targetClusterMap) {
+        const context = this;
         if (responseTargetClusters) {
             arrayUtil.forEach(responseTargetClusters, function (item, idx) {
                 if (lang.exists("Queues.ServerJobQueue", item)) {
@@ -127,8 +127,8 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         }
     },
 
-    refreshTargetCluster: function (item, queueItem, targetClusters, targetClusterMap) {
-        var queue = null;
+    refreshTargetCluster(item, queueItem, targetClusters, targetClusterMap) {
+        let queue = null;
         if (item.ClusterName) {
             queue = ESPQueue.GetTargetCluster(item.ClusterName, true);
         } else {
@@ -142,7 +142,7 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         queue.clearChildren();
         targetClusters.push(queue);
         targetClusterMap[queue.__hpcc_id] = queue;
-        var context = this;
+        const context = this;
         if (!this._watched[queue.__hpcc_id]) {
             this._watched[queue.__hpcc_id] = queue.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue) {
@@ -154,11 +154,11 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         }
     },
 
-    refreshActiveWorkunits: function (responseActiveWorkunits, targetClusters, targetClusterMap) {
+    refreshActiveWorkunits(responseActiveWorkunits, targetClusters, targetClusterMap) {
         if (responseActiveWorkunits) {
             arrayUtil.forEach(responseActiveWorkunits, function (item, idx) {
                 item["__hpcc_id"] = item.Wuid;
-                var queue = null;
+                let queue = null;
                 if (item.QueueName) {
                     queue = ESPQueue.GetServerJobQueue(item.QueueName);
                 }
@@ -169,7 +169,7 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
                         queue = ESPQueue.GetServerJobQueue(item.ServerName);
                     }
                 }
-                var wu = item.Server === "DFUserver" ? ESPDFUWorkunit.Get(item.Wuid) : ESPWorkunit.Get(item.Wuid);
+                const wu = item.Server === "DFUserver" ? ESPDFUWorkunit.Get(item.Wuid) : ESPWorkunit.Get(item.Wuid);
                 wu.updateData(lang.mixin({
                     __hpcc_id: item.Wuid,
                     component: "ActivityWidget"
@@ -182,8 +182,8 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
     },
 
     inRefresh: false,
-    refresh: function (full) {
-        var context = this;
+    refresh(full) {
+        const context = this;
         if (this.inRefresh) {
             return;
         }
@@ -196,15 +196,15 @@ var Activity = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    getStore: function () {
+    getStore() {
         return this.observableStore;
     }
 });
-var globalActivity = null;
+let globalActivity = null;
 
 export function Get() {
     if (!globalActivity) {
-        globalActivity = new Activity;
+        globalActivity = new Activity();
         globalActivity.startMonitor();
         globalActivity.refresh();
     }
@@ -212,6 +212,6 @@ export function Get() {
 }
 
 export function CreateActivityStore(options) {
-    var store = new Store(options);
+    const store = new Store(options);
     return Observable(store);
 }

+ 17 - 17
esp/src/src/ESPBase.ts

@@ -1,9 +1,9 @@
-import * as declare from "dojo/_base/declare";
-import * as config from "dojo/_base/config";
+import * as config from "dojo/_base/config";
+import * as declare from "dojo/_base/declare";
 
 declare const dojo;
 
-export default class ESPBase {
+export class ESPBase {
 
     constructor(args?) {
         if (args) {
@@ -12,7 +12,7 @@ export default class ESPBase {
     }
 
     getParam(key) {
-        var value = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) === "?" ? 1 : 0)))[key];
+        const value = dojo.queryToObject(dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) === "?" ? 1 : 0)))[key];
 
         if (value)
             return value;
@@ -23,14 +23,14 @@ export default class ESPBase {
         if (!service) {
             service = "WsWorkunits";
         }
-        var serverIP = this.getParam("serverIP");
+        const serverIP = this.getParam("serverIP");
         if (serverIP)
             return "http://" + serverIP + ":8010/" + service;
         return "/" + service;
     }
 
     getValue(domXml, tagName, knownObjectArrays) {
-        var retVal = this.getValues(domXml, tagName, knownObjectArrays);
+        const retVal = this.getValues(domXml, tagName, knownObjectArrays);
         if (retVal.length === 0) {
             return null;
         } else if (retVal.length !== 1) {
@@ -40,10 +40,10 @@ export default class ESPBase {
     }
 
     getValues(domXml, tagName, knownObjectArrays) {
-        var retVal = [];
-        var items = domXml.getElementsByTagName(tagName);
-        var parentNode = items.length ? items[0].parentNode : null; //  Prevent <Dataset><row><field><row> scenario
-        for (var i = 0; i < items.length; ++i) {
+        const retVal = [];
+        const items = domXml.getElementsByTagName(tagName);
+        const parentNode = items.length ? items[0].parentNode : null; //  Prevent <Dataset><row><field><row> scenario
+        for (let i = 0; i < items.length; ++i) {
             if (items[i].parentNode === parentNode)
                 retVal.push(this.flattenXml(items[i], knownObjectArrays));
         }
@@ -51,11 +51,11 @@ export default class ESPBase {
     }
 
     flattenXml(domXml, knownObjectArrays) {
-        var retValArr = [];
-        var retValStr = "";
-        var retVal = {};
-        for (var i = 0; i < domXml.childNodes.length; ++i) {
-            var childNode = domXml.childNodes[i];
+        const retValArr = [];
+        let retValStr = "";
+        const retVal = {};
+        for (let i = 0; i < domXml.childNodes.length; ++i) {
+            const childNode = domXml.childNodes[i];
             if (childNode.childNodes) {
                 if (childNode.nodeName && knownObjectArrays != null && dojo.indexOf(knownObjectArrays, childNode.nodeName) >= 0) {
                     retValArr.push(this.flattenXml(childNode, knownObjectArrays));
@@ -64,13 +64,13 @@ export default class ESPBase {
                 } else if (childNode.childNodes.length === 0) {
                     retVal[childNode.nodeName] = null;
                 } else {
-                    var value = this.flattenXml(childNode, knownObjectArrays);
+                    const value = this.flattenXml(childNode, knownObjectArrays);
                     if (retVal[childNode.nodeName] == null) {
                         retVal[childNode.nodeName] = value;
                     } else if (dojo.isArray(retVal[childNode.nodeName])) {
                         retVal[childNode.nodeName].push(value);
                     } else if (dojo.isObject(retVal[childNode.nodeName])) {
-                        var tmp = retVal[childNode.nodeName];
+                        const tmp = retVal[childNode.nodeName];
                         retVal[childNode.nodeName] = [];
                         retVal[childNode.nodeName].push(tmp);
                         retVal[childNode.nodeName].push(value);

+ 49 - 49
esp/src/src/ESPDFUWorkunit.ts

@@ -6,14 +6,14 @@ import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
 import * as Observable from "dojo/store/Observable";
 import * as topic from "dojo/topic";
 
-import * as FileSpray from "./FileSpray";
-import * as ESPUtil from "./ESPUtil";
 import * as ESPRequest from "./ESPRequest";
+import * as ESPUtil from "./ESPUtil";
+import * as FileSpray from "./FileSpray";
 import * as Utility from "./Utility";
 
-var i18n = nlsHPCC;
+const i18n = nlsHPCC;
 
-var Store = declare([ESPRequest.Store], {
+const Store = declare([ESPRequest.Store], {
     service: "FileSpray",
     action: "GetDFUWorkunits",
     responseQualifier: "GetDFUWorkunitsResponse.results.DFUWorkunit",
@@ -23,7 +23,7 @@ var Store = declare([ESPRequest.Store], {
     countProperty: "PageSize",
 
     _watched: [],
-    preRequest: function (request) {
+    preRequest(request) {
         switch (request.Sortby) {
             case "ClusterName":
                 request.Sortby = "Cluster";
@@ -39,17 +39,17 @@ var Store = declare([ESPRequest.Store], {
                 break;
         }
     },
-    create: function (id) {
+    create(id) {
         return new Workunit({
             ID: id,
             Wuid: id
         });
     },
-    update: function (id, item) {
-        var storeItem = this.get(id);
+    update(id, item) {
+        const storeItem = this.get(id);
         storeItem.updateData(item);
         if (!this._watched[id]) {
-            var context = this;
+            const context = this;
             this._watched[id] = storeItem.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue) {
                     context.notify(storeItem, id);
@@ -59,9 +59,9 @@ var Store = declare([ESPRequest.Store], {
     }
 });
 
-var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:line
+const Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:line
     //  Asserts  ---
-    _assertHasWuid: function () {
+    _assertHasWuid() {
         if (!this.Wuid) {
             throw new Error(i18n.Wuidcannotbeempty);
         }
@@ -79,20 +79,20 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
     exceptions: [],
     timers: [],
 
-    _StateSetter: function (state) {
+    _StateSetter(state) {
         this.State = state;
         this.set("hasCompleted", FileSpray.isComplete(this.State));
     },
 
-    _hasCompletedSetter: function (completed) {
-        var justCompleted = lang.exists("hasCompleted", this) && !this.hasCompleted && completed;
+    _hasCompletedSetter(completed) {
+        const justCompleted = lang.exists("hasCompleted", this) && !this.hasCompleted && completed;
         this.hasCompleted = completed;
         if (justCompleted) {
             topic.publish("hpcc/dfu_wu_completed", this);
         }
     },
 
-    _CommandSetter: function (command) {
+    _CommandSetter(command) {
         this.Command = command;
         if (command in FileSpray.CommandMessages) {
             this.set("CommandMessage", FileSpray.CommandMessages[command]);
@@ -101,7 +101,7 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
         }
     },
 
-    _SourceFormatSetter: function (format) {
+    _SourceFormatSetter(format) {
         this.SourceFormat = format;
         if (format in FileSpray.FormatMessages) {
             this.set("SourceFormatMessage", FileSpray.FormatMessages[format]);
@@ -110,7 +110,7 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
         }
     },
 
-    _DestFormatSetter: function (format) {
+    _DestFormatSetter(format) {
         this.DestFormat = format;
         if (format in FileSpray.FormatMessages) {
             this.set("DestFormatMessage", FileSpray.FormatMessages[format]);
@@ -119,11 +119,11 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
         }
     },
 
-    onCreate: function () {
+    onCreate() {
     },
-    onUpdate: function () {
+    onUpdate() {
     },
-    onSubmit: function () {
+    onSubmit() {
     },
     constructor: ESPUtil.override(function (inherited, args) {
         inherited(arguments);
@@ -132,18 +132,18 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
         }
         this.wu = this;
     }),
-    isComplete: function () {
+    isComplete() {
         return this.hasCompleted;
     },
-    isDeleted: function () {
+    isDeleted() {
         return this.State === 999;
     },
-    monitor: function (callback) {
+    monitor(callback) {
         if (callback) {
             callback(this);
         }
         if (!this.hasCompleted) {
-            var context = this;
+            const context = this;
             this.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue && newValue) {
                     if (callback) {
@@ -153,32 +153,32 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
             });
         }
     },
-    create: function (ecl) {
+    create(ecl) {
     },
-    update: function (request) {
+    update(request) {
         this._assertHasWuid();
         lang.mixin(request, {
             ID: this.Wuid
         });
 
-        var outerRequest = {
+        const outerRequest = {
             "wu.ID": request.ID,
             "wu.isProtected": request.isProtected,
             "wu.JobName": request.JobName,
-            isProtectedOrig: this.isProtected,
-            JobNameOrig: this.JobName
+            "isProtectedOrig": this.isProtected,
+            "JobNameOrig": this.JobName
         };
 
-        var context = this;
+        const context = this;
         FileSpray.UpdateDFUWorkunit({
             request: outerRequest
         }).then(function (response) {
             context.refresh();
         });
     },
-    submit: function (target) {
+    submit(target) {
     },
-    fetchXML: function (onFetchXML) {
+    fetchXML(onFetchXML) {
         FileSpray.DFUWUFile({
             request: {
                 Wuid: this.Wuid
@@ -187,36 +187,36 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
             onFetchXML(response);
         });
     },
-    _resubmit: function (clone, resetWorkflow, callback) {
+    _resubmit(clone, resetWorkflow, callback) {
     },
-    resubmit: function (callback) {
+    resubmit(callback) {
     },
-    _action: function (action) {
-        var context = this;
+    _action(action) {
+        const context = this;
         return FileSpray.DFUWorkunitsAction([this], action, {
         }).then(function (response) {
             context.refresh();
         });
     },
-    abort: function () {
+    abort() {
         return FileSpray.AbortDFUWorkunit({
             request: {
                 wuid: this.Wuid
             }
         });
     },
-    doDelete: function (callback) {
+    doDelete(callback) {
         return this._action("Delete");
     },
-    refresh: function (full) {
+    refresh(full) {
         this.getInfo({
-            onAfterSend: function () {
+            onAfterSend() {
             }
         });
     },
-    getInfo: function (args) {
+    getInfo(args) {
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         FileSpray.GetDFUWorkunit({
             request: {
                 wuid: this.Wuid
@@ -231,16 +231,16 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
             }
         });
     },
-    getState: function () {
+    getState() {
         return this.State;
     },
-    getProtectedImage: function () {
+    getProtectedImage() {
         if (this.isProtected) {
             return Utility.getImageURL("locked.png");
         }
         return Utility.getImageURL("unlocked.png");
     },
-    getStateIconClass: function () {
+    getStateIconClass() {
         switch (this.State) {
             case 1:
                 return "iconWarning";
@@ -263,7 +263,7 @@ var Workunit = declare([ESPUtil.Singleton, ESPUtil.Monitor], { // jshint ignore:
         }
         return "iconWorkunit";
     },
-    getStateImage: function () {
+    getStateImage() {
         switch (this.State) {
             case 1:
                 return Utility.getImageURL("workunit_warning.png");
@@ -293,8 +293,8 @@ export function isInstanceOfWorkunit(obj) {
 }
 
 export function Get(wuid, data?) {
-    var store = new Store();
-    var retVal = store.get(wuid);
+    const store = new Store();
+    const retVal = store.get(wuid);
     if (data) {
         retVal.updateData(data);
     }
@@ -302,7 +302,7 @@ export function Get(wuid, data?) {
 }
 
 export function CreateWUQueryStore(options) {
-    var store = new Store(options);
+    let store = new Store(options);
     store = Observable(store);
     return store;
 }

+ 130 - 131
esp/src/src/ESPGraph.ts

@@ -1,11 +1,11 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 
 import * as parser from "dojox/xml/parser";
 
 import * as Utility from "./Utility";
 
-var GRAPH_TYPE = {
+const GRAPH_TYPE = {
     UNKNOWN: 0,
     GRAPH: 1,
     SUBGRAPH: 2,
@@ -14,7 +14,7 @@ var GRAPH_TYPE = {
     LAST: 5
 };
 
-var GRAPH_TYPE_STRING = {
+const GRAPH_TYPE_STRING = {
     UNKNOWN: "Unknown",
     GRAPH: "Graph",
     SUBGRAPH: "Cluster",
@@ -23,8 +23,8 @@ var GRAPH_TYPE_STRING = {
     LAST: "Last"
 };
 
-var LocalisedXGMMLWriter = declare([], {
-    constructor: function (graph) {
+const LocalisedXGMMLWriter = declare([], {
+    constructor(graph) {
         this.graph = graph;
 
         this.m_xgmml = "";
@@ -34,7 +34,7 @@ var LocalisedXGMMLWriter = declare([], {
         this.m_visibleEdges = {};
     },
 
-    calcVisibility: function (items, localisationDepth, localisationDistance, noSpills) {
+    calcVisibility(items, localisationDepth, localisationDistance, noSpills) {
         this.noSpills = noSpills;
         arrayUtil.forEach(items, function (item) {
             switch (this.graph.getGlobalType(item)) {
@@ -55,7 +55,7 @@ var LocalisedXGMMLWriter = declare([], {
         this.calcVisibility2();
     },
 
-    calcInVertexVisibility: function (vertex, localisationDistance) {
+    calcInVertexVisibility(vertex, localisationDistance) {
         if (this.noSpills && vertex.isSpill()) {
             localisationDistance++;
         }
@@ -67,7 +67,7 @@ var LocalisedXGMMLWriter = declare([], {
         }
     },
 
-    calcOutVertexVisibility: function (vertex, localisationDistance) {
+    calcOutVertexVisibility(vertex, localisationDistance) {
         if (this.noSpills && vertex.isSpill()) {
             localisationDistance++;
         }
@@ -79,7 +79,7 @@ var LocalisedXGMMLWriter = declare([], {
         }
     },
 
-    calcSubgraphVisibility: function (subgraph, localisationDepth) {
+    calcSubgraphVisibility(subgraph, localisationDepth) {
         if (localisationDepth < 0) {
             return;
         }
@@ -98,7 +98,7 @@ var LocalisedXGMMLWriter = declare([], {
         }, this);
 
         //  Calculate edges that pass through the subgraph  ---
-        var dedupEdges = {};
+        const dedupEdges = {};
         arrayUtil.forEach(this.graph.edges, function (edge, idx) {
             if (edge.getSource().__hpcc_parent !== edge.getTarget().__hpcc_parent && subgraph === this.getCommonAncestor(edge)) {
                 //  Only include one unique edge between subgraphs  ---
@@ -110,11 +110,11 @@ var LocalisedXGMMLWriter = declare([], {
         }, this);
     },
 
-    buildVertexString: function (vertex, isPoint) {
-        var attrStr = "";
-        var propsStr = "";
-        var props = vertex.getProperties();
-        for (var key in props) {
+    buildVertexString(vertex, isPoint) {
+        let attrStr = "";
+        let propsStr = "";
+        const props = vertex.getProperties();
+        for (const key in props) {
             if (isPoint && key.indexOf("_kind") >= 0) {
                 propsStr += "<att name=\"_kind\" value=\"point\"/>";
             } else if (key === "id" || key === "label") {
@@ -126,11 +126,11 @@ var LocalisedXGMMLWriter = declare([], {
         return "<node" + attrStr + ">" + propsStr + "</node>";
     },
 
-    buildEdgeString: function (edge) {
-        var attrStr = "";
-        var propsStr = "";
-        var props = edge.getProperties();
-        for (var key in props) {
+    buildEdgeString(edge) {
+        let attrStr = "";
+        let propsStr = "";
+        const props = edge.getProperties();
+        for (const key in props) {
             if (key.toLowerCase() === "id" ||
                 key.toLowerCase() === "label" ||
                 key.toLowerCase() === "source" ||
@@ -143,22 +143,22 @@ var LocalisedXGMMLWriter = declare([], {
         return "<edge" + attrStr + ">" + propsStr + "</edge>";
     },
 
-    getAncestors: function (v, ancestors) {
-        var parent = v.__hpcc_parent;
+    getAncestors(v, ancestors) {
+        let parent = v.__hpcc_parent;
         while (parent) {
             ancestors.push(parent);
             parent = parent.__hpcc_parent;
         }
     },
 
-    getCommonAncestorV: function (v1, v2) {
-        var v1_ancestors = [];
-        var v2_ancestors = [];
+    getCommonAncestorV(v1, v2) {
+        const v1_ancestors = [];
+        const v2_ancestors = [];
         this.getAncestors(v1, v1_ancestors);
         this.getAncestors(v2, v2_ancestors);
-        var finger1 = v1_ancestors.length - 1;
-        var finger2 = v2_ancestors.length - 1;
-        var retVal = null;
+        let finger1 = v1_ancestors.length - 1;
+        let finger2 = v2_ancestors.length - 1;
+        let retVal = null;
         while (finger1 >= 0 && finger2 >= 0 && v1_ancestors[finger1] === v2_ancestors[finger2]) {
             retVal = v1_ancestors[finger1];
             --finger1;
@@ -167,21 +167,21 @@ var LocalisedXGMMLWriter = declare([], {
         return retVal;
     },
 
-    getCommonAncestor: function (e) {
+    getCommonAncestor(e) {
         return this.getCommonAncestorV(e.getSource(), e.getTarget());
     },
 
-    calcAncestorVisibility: function (vertex) {
-        var ancestors = [];
+    calcAncestorVisibility(vertex) {
+        const ancestors = [];
         this.getAncestors(vertex, ancestors);
         arrayUtil.forEach(ancestors, function (item, idx) {
             this.m_visibleSubgraphs[item.__hpcc_id] = item;
         }, this);
     },
 
-    calcVisibility2: function () {
-        for (var key in this.m_visibleVertices) {
-            var vertex = this.m_visibleVertices[key];
+    calcVisibility2() {
+        for (const key in this.m_visibleVertices) {
+            const vertex = this.m_visibleVertices[key];
             arrayUtil.forEach(vertex.getInEdges(), function (edge, idx) {
                 this.m_visibleEdges[edge.__hpcc_id] = edge;
             }, this);
@@ -193,26 +193,26 @@ var LocalisedXGMMLWriter = declare([], {
         this.calcSemiVisibleVertices();
     },
 
-    addSemiVisibleEdge: function (edge) {
+    addSemiVisibleEdge(edge) {
         if (edge && !this.m_visibleEdges[edge.__hpcc_id]) {
             this.m_visibleEdges[edge.__hpcc_id] = edge;
         }
     },
 
-    addSemiVisibleVertex: function (vertex) {
+    addSemiVisibleVertex(vertex) {
         if (!this.m_visibleVertices[vertex.__hpcc_id]) {
             this.m_semiVisibleVertices[vertex.__hpcc_id] = vertex;
             this.calcAncestorVisibility(vertex);
         }
     },
 
-    calcSemiVisibleVertices: function () {
-        for (var key in this.m_visibleEdges) {
-            var edge = this.m_visibleEdges[key];
-            var source = edge.getSource();
+    calcSemiVisibleVertices() {
+        for (const key in this.m_visibleEdges) {
+            const edge = this.m_visibleEdges[key];
+            let source = edge.getSource();
             this.addSemiVisibleVertex(source);
             while (this.noSpills && source.isSpill()) {
-                var inEdges = source.getInEdges();
+                const inEdges = source.getInEdges();
                 if (inEdges.length) {
                     this.addSemiVisibleEdge(inEdges[0]);
                     source = inEdges[0].getSource();
@@ -221,10 +221,10 @@ var LocalisedXGMMLWriter = declare([], {
                     break;
                 }
             }
-            var target = edge.getTarget();
+            let target = edge.getTarget();
             this.addSemiVisibleVertex(target);
             while (this.noSpills && target.isSpill()) {
-                var outEdges = target.getOutEdges();
+                const outEdges = target.getOutEdges();
                 if (outEdges.length) {
                     this.addSemiVisibleEdge(outEdges[0]);
                     target = outEdges[0].getTarget();
@@ -236,30 +236,30 @@ var LocalisedXGMMLWriter = declare([], {
         }
     },
 
-    writeXgmml: function () {
+    writeXgmml() {
         this.subgraphVisited(this.graph.subgraphs[0], true);
         arrayUtil.forEach(this.graph.edges, function (edge, idx) {
             this.edgeVisited(edge);
         }, this);
     },
 
-    subgraphVisited: function (subgraph, root) {
+    subgraphVisited(subgraph, root) {
         if (this.m_visibleSubgraphs[subgraph.__hpcc_id]) {
-            var propsStr = "";
+            let propsStr = "";
             this.m_xgmml += root ? "" : "<node id=\"" + subgraph.__hpcc_id + "\"><att><graph>";
-            var xgmmlLen = this.m_xgmml.length;
+            const xgmmlLen = this.m_xgmml.length;
             subgraph.walkSubgraphs(this);
             subgraph.walkVertices(this);
             if (xgmmlLen === this.m_xgmml.length) {
                 //  Add at least one child otherwise subgraphs will render as a vertex  ---
-                var vertex = subgraph.__hpcc_vertices[0];
+                const vertex = subgraph.__hpcc_vertices[0];
                 if (vertex) {
                     this.m_xgmml += this.buildVertexString(vertex, true);
                 }
             }
 
-            var props = subgraph.getProperties();
-            for (var key in props) {
+            const props = subgraph.getProperties();
+            for (const key in props) {
                 propsStr += "<att name=\"" + key + "\" value=\"" + Utility.xmlEncode(props[key]) + "\"/>";
             }
             this.m_xgmml += root ? "" : "</graph></att>" + propsStr + "</node>";
@@ -267,31 +267,30 @@ var LocalisedXGMMLWriter = declare([], {
         return false;
     },
 
-    vertexVisited: function (vertex) {
+    vertexVisited(vertex) {
         if (this.m_visibleVertices[vertex.__hpcc_id]) {
             this.m_xgmml += this.buildVertexString(vertex, false);
-        }
-        else if (this.m_semiVisibleVertices[vertex.__hpcc_id]) {
+        } else if (this.m_semiVisibleVertices[vertex.__hpcc_id]) {
             this.m_xgmml += this.buildVertexString(vertex, true);
         }
     },
 
-    edgeVisited: function (edge) {
+    edgeVisited(edge) {
         if (this.m_visibleEdges[edge.__hpcc_id]) {
             this.m_xgmml += this.buildEdgeString(edge);
         }
     }
 });
 
-var GraphItem = declare([], {
-    constructor: function (graph, id) {
+const GraphItem = declare([], {
+    constructor(graph, id) {
         this.__hpcc_graph = graph;
         this.__hpcc_id = id;
         this._globalID = id;
     },
-    getProperties: function () {
-        var retVal = {};
-        for (var key in this) {
+    getProperties() {
+        const retVal = {};
+        for (const key in this) {
             if (key.indexOf("__") !== 0 && this.hasOwnProperty(key)) {
                 retVal[key] = this[key];
             }
@@ -300,8 +299,8 @@ var GraphItem = declare([], {
     }
 });
 
-var Subgraph = declare([GraphItem], {
-    constructor: function (graph, id) {
+const Subgraph = declare([GraphItem], {
+    constructor(graph, id) {
         this._globalType = id === "0" ? "Graph" : "Cluster";
         this.__hpcc_subgraphs = [];
         this.__hpcc_vertices = [];
@@ -309,7 +308,7 @@ var Subgraph = declare([GraphItem], {
         this.id = id;
     },
 
-    addSubgraph: function (subgraph) {
+    addSubgraph(subgraph) {
         subgraph.__hpcc_parent = this;
         if (!arrayUtil.some(this.__hpcc_subgraphs, function (subgraph2) {
             return subgraph === subgraph2;
@@ -318,7 +317,7 @@ var Subgraph = declare([GraphItem], {
         }
     },
 
-    addVertex: function (vertex) {
+    addVertex(vertex) {
         vertex.__hpcc_parent = this;
         if (!arrayUtil.some(this.__hpcc_vertices, function (vertex2) {
             return vertex === vertex2;
@@ -327,13 +326,13 @@ var Subgraph = declare([GraphItem], {
         }
     },
 
-    removeVertex: function (vertex) {
+    removeVertex(vertex) {
         this.__hpcc_vertices = arrayUtil.filter(this.__hpcc_vertices, function (vertex2) {
             return vertex !== vertex2;
         }, this);
     },
 
-    addEdge: function (edge) {
+    addEdge(edge) {
         edge.__hpcc_parent = this;
         if (!arrayUtil.some(this.__hpcc_edges, function (edge2) {
             return edge === edge2;
@@ -342,13 +341,13 @@ var Subgraph = declare([GraphItem], {
         }
     },
 
-    removeEdge: function (edge) {
+    removeEdge(edge) {
         this.__hpcc_edges = arrayUtil.filter(this.__hpcc_edges, function (edge2) {
             return edge !== edge2;
         }, this);
     },
 
-    remove: function () {
+    remove() {
         arrayUtil.forEach(this.__hpcc_subgraphs, function (subgraph) {
             subgraph.__hpcc_parent = this.__hpcc_parent;
         }, this);
@@ -362,7 +361,7 @@ var Subgraph = declare([GraphItem], {
         this.__hpcc_graph.removeItem(this);
     },
 
-    walkSubgraphs: function (visitor) {
+    walkSubgraphs(visitor) {
         arrayUtil.forEach(this.__hpcc_subgraphs, function (subgraph, idx) {
             if (visitor.subgraphVisited(subgraph)) {
                 subgraph.walkSubgraphs(visitor);
@@ -370,24 +369,24 @@ var Subgraph = declare([GraphItem], {
         }, this);
     },
 
-    walkVertices: function (visitor) {
+    walkVertices(visitor) {
         arrayUtil.forEach(this.__hpcc_vertices, function (vertex, idx) {
             visitor.vertexVisited(vertex);
         }, this);
     }
 });
 
-var Vertex = declare([GraphItem], {
-    constructor: function () {
+const Vertex = declare([GraphItem], {
+    constructor() {
         this._globalType = "Vertex";
     },
 
-    isSpill: function () {
+    isSpill() {
         return this._isSpill;
     },
 
-    remove: function () {
-        var inVertices = this.getInVertices();
+    remove() {
+        const inVertices = this.getInVertices();
         if (inVertices.length <= 1) {
             console.log(this.__hpcc_id + ":  remove only supports single or zero inputs activities...");
         }
@@ -403,48 +402,48 @@ var Vertex = declare([GraphItem], {
         this.__hpcc_graph.removeItem(this);
     },
 
-    getInVertices: function () {
+    getInVertices() {
         return arrayUtil.map(this.getInEdges(), function (edge) {
             return edge.getSource();
         }, this);
     },
 
-    getInEdges: function () {
+    getInEdges() {
         return arrayUtil.filter(this.__hpcc_graph.edges, function (edge) {
             return edge.getTarget() === this;
         }, this);
     },
 
-    getOutVertices: function () {
+    getOutVertices() {
         return arrayUtil.map(this.getOutEdges(), function (edge) {
             return edge.getTarget();
         }, this);
     },
 
-    getOutEdges: function () {
+    getOutEdges() {
         return arrayUtil.filter(this.__hpcc_graph.edges, function (edge) {
             return edge.getSource() === this;
         }, this);
     }
 });
 
-var Edge = declare([GraphItem], {
-    constructor: function (graph, id) {
+const Edge = declare([GraphItem], {
+    constructor(graph, id) {
         this._globalType = "Edge";
     },
 
-    remove: function () {
+    remove() {
         arrayUtil.forEach(this.__hpcc_graph.subgraphs, function (subgraph) {
             subgraph.removeEdge(this);
         }, this);
         this.__hpcc_graph.removeItem(this);
     },
 
-    getSource: function () {
+    getSource() {
         return this.__hpcc_graph.idx[this._sourceActivity || this.source];
     },
 
-    setSource: function (source) {
+    setSource(source) {
         if (this._sourceActivity) {
             this._sourceActivity = source.__hpcc_id;
         } else if (this.source) {
@@ -455,17 +454,17 @@ var Edge = declare([GraphItem], {
         }
     },
 
-    getTarget: function () {
+    getTarget() {
         return this.__hpcc_graph.idx[this._targetActivity || this.target];
     }
 });
 
-export var Graph = declare([], {
-    constructor: function () {
+export let Graph = declare([], {
+    constructor() {
         this.clear();
     },
 
-    clear: function () {
+    clear() {
         this.xgmml = "";
 
         this.idx = {};
@@ -474,18 +473,18 @@ export var Graph = declare([], {
         this.edges = [];
     },
 
-    load: function (xgmml) {
+    load(xgmml) {
         this.clear();
         this.merge(xgmml);
     },
 
-    merge: function (xgmml) {
+    merge(xgmml) {
         this.xgmml = xgmml;
-        var dom = parser.parse(xgmml);
+        const dom = parser.parse(xgmml);
         this.walkDocument(dom.documentElement, "0");
     },
 
-    getGlobalType: function (item) {
+    getGlobalType(item) {
         if (item instanceof Vertex) {
             return GRAPH_TYPE.VERTEX;
         } else if (item instanceof Edge) {
@@ -498,7 +497,7 @@ export var Graph = declare([], {
         return GRAPH_TYPE.UNKNOWN;
     },
 
-    getGlobalTypeString: function (item) {
+    getGlobalTypeString(item) {
         if (item instanceof Vertex) {
             return GRAPH_TYPE_STRING.VERTEX;
         } else if (item instanceof Edge) {
@@ -511,21 +510,21 @@ export var Graph = declare([], {
         return GRAPH_TYPE_STRING.UNKNOWN;
     },
 
-    getItem: function (docNode, id) {
+    getItem(docNode, id) {
         if (!this.idx[id]) {
             switch (docNode.tagName) {
                 case "graph":
-                    var subgraph = new Subgraph(this, id);
+                    const subgraph = new Subgraph(this, id);
                     this.subgraphs.push(subgraph);
                     this.idx[id] = subgraph;
                     break;
                 case "node":
-                    var vertex = new Vertex(this, id);
+                    const vertex = new Vertex(this, id);
                     this.vertices.push(vertex);
                     this.idx[id] = vertex;
                     break;
                 case "edge":
-                    var edge = new Edge(this, id);
+                    const edge = new Edge(this, id);
                     this.edges.push(edge);
                     this.idx[id] = edge;
                     break;
@@ -534,14 +533,14 @@ export var Graph = declare([], {
                     break;
             }
         }
-        var retVal = this.idx[id];
+        const retVal = this.idx[id];
         arrayUtil.forEach(docNode.attributes, function (attr, idx) {
             retVal[attr.name] = attr.value;
         }, this);
         return retVal;
     },
 
-    removeItem: function (item) {
+    removeItem(item) {
         delete this.idx[item.__hpcc_id];
         if (item instanceof Subgraph) {
             this.subgraphs = arrayUtil.filter(this.subgraphs, function (subgraph) {
@@ -558,8 +557,8 @@ export var Graph = declare([], {
         }
     },
 
-    getChildByTagName: function (docNode, tagName) {
-        var retVal = null;
+    getChildByTagName(docNode, tagName) {
+        let retVal = null;
         arrayUtil.some(docNode.childNodes, function (childNode, idx) {
             if (childNode.tagName === tagName) {
                 retVal = childNode;
@@ -569,33 +568,33 @@ export var Graph = declare([], {
         return retVal;
     },
 
-    walkDocument: function (docNode, id) {
-        var retVal = this.getItem(docNode, id);
+    walkDocument(docNode, id) {
+        const retVal = this.getItem(docNode, id);
         arrayUtil.forEach(docNode.childNodes, function (childNode, idx) {
             switch (childNode.nodeType) {
-                case 1:     //	ELEMENT_NODE
+                case 1:     // 	ELEMENT_NODE
                     switch (childNode.tagName) {
                         case "graph":
                             break;
                         case "node":
-                            var isSubgraph = false;
-                            var attNode = this.getChildByTagName(childNode, "att");
+                            let isSubgraph = false;
+                            const attNode = this.getChildByTagName(childNode, "att");
                             if (attNode) {
-                                var graphNode = this.getChildByTagName(attNode, "graph");
+                                const graphNode = this.getChildByTagName(attNode, "graph");
                                 if (graphNode) {
                                     isSubgraph = true;
-                                    var subgraph = this.walkDocument(graphNode, childNode.getAttribute("id"));
+                                    const subgraph = this.walkDocument(graphNode, childNode.getAttribute("id"));
                                     retVal.addSubgraph(subgraph);
                                 }
                             }
                             if (!isSubgraph) {
-                                var vertex = this.walkDocument(childNode, childNode.getAttribute("id"));
+                                const vertex = this.walkDocument(childNode, childNode.getAttribute("id"));
                                 retVal.addVertex(vertex);
                             }
                             break;
                         case "att":
-                            var name = childNode.getAttribute("name");
-                            var value = childNode.getAttribute("value");
+                            const name = childNode.getAttribute("name");
+                            const value = childNode.getAttribute("value");
                             if (name.indexOf("Time") === 0) {
                                 retVal["_" + name] = value;
                                 retVal[name] = "" + Utility.espTime2Seconds(value);
@@ -610,7 +609,7 @@ export var Graph = declare([], {
                             }
                             break;
                         case "edge":
-                            var edge = this.walkDocument(childNode, childNode.getAttribute("id"));
+                            const edge = this.walkDocument(childNode, childNode.getAttribute("id"));
                             if (edge.NumRowsProcessed !== undefined) {
                                 edge._eclwatchCount = edge.NumRowsProcessed.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                             } else if (edge.Count !== undefined) {
@@ -628,9 +627,9 @@ export var Graph = declare([], {
                             } else if (edge._childGraph) {
                             } else if (edge._sourceActivity || edge._targetActivity) {
                                 edge._isSpill = true;
-                                var source = edge.getSource();
+                                const source = edge.getSource();
                                 source._isSpill = true;
-                                var target = edge.getTarget();
+                                const target = edge.getTarget();
                                 target._isSpill = true;
                             }
                             retVal.addEdge(edge);
@@ -639,17 +638,17 @@ export var Graph = declare([], {
                             break;
                     }
                     break;
-                case 2:     //	ATTRIBUTE_NODE
-                case 3:     //	TEXT_NODE
-                case 4:     //	CDATA_SECTION_NODE
-                case 5:     //	ENTITY_REFERENCE_NODE
-                case 6:     //	ENTITY_NODE
-                case 7:     //	PROCESSING_INSTRUCTION_NODE
-                case 8:     //	COMMENT_NODE
-                case 9:     //	DOCUMENT_NODE
-                case 10:    //	DOCUMENT_TYPE_NODE
-                case 11:    //	DOCUMENT_FRAGMENT_NODE
-                case 12:    //	NOTATION_NODE
+                case 2:     // 	ATTRIBUTE_NODE
+                case 3:     // 	TEXT_NODE
+                case 4:     // 	CDATA_SECTION_NODE
+                case 5:     // 	ENTITY_REFERENCE_NODE
+                case 6:     // 	ENTITY_NODE
+                case 7:     // 	PROCESSING_INSTRUCTION_NODE
+                case 8:     // 	COMMENT_NODE
+                case 9:     // 	DOCUMENT_NODE
+                case 10:    // 	DOCUMENT_TYPE_NODE
+                case 11:    // 	DOCUMENT_FRAGMENT_NODE
+                case 12:    // 	NOTATION_NODE
                     break;
                 default:
                     break;
@@ -658,8 +657,8 @@ export var Graph = declare([], {
         return retVal;
     },
 
-    removeSubgraphs: function () {
-        var subgraphs = arrayUtil.map(this.subgraphs, function (subgraph) { return subgraph; });
+    removeSubgraphs() {
+        const subgraphs = arrayUtil.map(this.subgraphs, function (subgraph) { return subgraph; });
         arrayUtil.forEach(subgraphs, function (subgraph) {
             if (subgraph.__hpcc_parent instanceof Subgraph) {
                 subgraph.remove();
@@ -667,8 +666,8 @@ export var Graph = declare([], {
         }, this);
     },
 
-    removeSpillVertices: function () {
-        var vertices = arrayUtil.map(this.vertices, function (vertex) { return vertex; });
+    removeSpillVertices() {
+        const vertices = arrayUtil.map(this.vertices, function (vertex) { return vertex; });
         arrayUtil.forEach(vertices, function (vertex) {
             if (vertex.isSpill()) {
                 vertex.remove();
@@ -676,8 +675,8 @@ export var Graph = declare([], {
         }, this);
     },
 
-    getLocalisedXGMML: function (items, localisationDepth, localisationDistance, noSpills) {
-        var xgmmlWriter = new LocalisedXGMMLWriter(this);
+    getLocalisedXGMML(items, localisationDepth, localisationDistance, noSpills) {
+        const xgmmlWriter = new LocalisedXGMMLWriter(this);
         xgmmlWriter.calcVisibility(items, localisationDepth, localisationDistance, noSpills);
         xgmmlWriter.writeXgmml();
         return "<graph>" + xgmmlWriter.m_xgmml + "</graph>";

+ 84 - 85
esp/src/src/ESPLogicalFile.ts

@@ -1,27 +1,26 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
-import * as lang from "dojo/_base/lang";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as Deferred from "dojo/_base/Deferred";
-import * as QueryResults from "dojo/store/util/QueryResults";
+import * as lang from "dojo/_base/lang";
 import * as Observable from "dojo/store/Observable";
-
-import * as WsDfu from "./WsDfu";
-import * as FileSpray from "./FileSpray";
+import * as QueryResults from "dojo/store/util/QueryResults";
+import { DPWorkunit } from "./DataPatterns/DPWorkunit";
 import * as ESPRequest from "./ESPRequest";
-import * as ESPUtil from "./ESPUtil";
 import * as ESPResult from "./ESPResult";
+import * as ESPUtil from "./ESPUtil";
+import * as FileSpray from "./FileSpray";
 import * as Utility from "./Utility";
-import { DPWorkunit } from "./DataPatterns/DPWorkunit";
+import * as WsDfu from "./WsDfu";
 
-var _logicalFiles = {};
+const _logicalFiles = {};
 
-var createID = function (Cluster, Name) {
+const createID = function (Cluster, Name) {
     return (Cluster ? Cluster : "") + "--" + Name;
 };
 
-var create = function (id) {
+const create = function (id) {
     if (!lang.exists(id, _logicalFiles)) {
-        var idParts = id.split("--");
+        const idParts = id.split("--");
         _logicalFiles[id] = new LogicalFile({
             Cluster: idParts[0] ? idParts[0] : "",
             NodeGroup: idParts[0] ? idParts[0] : "",
@@ -31,7 +30,7 @@ var create = function (id) {
     return _logicalFiles[id];
 };
 
-var Store = declare([ESPRequest.Store], {
+const Store = declare([ESPRequest.Store], {
     service: "WsDfu",
     action: "DFUQuery",
     responseQualifier: "DFUQueryResponse.DFULogicalFiles.DFULogicalFile",
@@ -41,10 +40,10 @@ var Store = declare([ESPRequest.Store], {
     countProperty: "PageSize",
 
     _watched: [],
-    create: function (id) {
+    create(id) {
         return create(id);
     },
-    preRequest: function (request) {
+    preRequest(request) {
         switch (request.Sortby) {
             case "RecordCount":
                 request.Sortby = "Records";
@@ -58,11 +57,11 @@ var Store = declare([ESPRequest.Store], {
             IncludeSuperOwner: 1
         });
     },
-    update: function (id, item) {
-        var storeItem = this.get(id);
+    update(id, item) {
+        const storeItem = this.get(id);
         storeItem.updateData(item);
         if (!this._watched[id]) {
-            var context = this;
+            const context = this;
             this._watched[id] = storeItem.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue) {
                     context.notify(storeItem, id);
@@ -70,7 +69,7 @@ var Store = declare([ESPRequest.Store], {
             });
         }
     },
-    preProcessRow: function (item, request, query, options) {
+    preProcessRow(item, request, query, options) {
         lang.mixin(item, {
             __hpcc_id: createID(item.NodeGroup, item.Name),
             __hpcc_isDir: false,
@@ -79,44 +78,44 @@ var Store = declare([ESPRequest.Store], {
             State: ""
         });
     },
-    mayHaveChildren: function (object) {
+    mayHaveChildren(object) {
         return object.__hpcc_isDir;
     }
 });
 
-var TreeStore = declare(null, {
+const TreeStore = declare(null, {
     idProperty: "__hpcc_id",
     cache: null,
     _watched: [],
 
-    constructor: function (options) {
+    constructor(options) {
         this.cache = {};
     },
 
-    _fetchFiles: function (scope) {
-        var deferredResults = new Deferred();
+    _fetchFiles(scope) {
+        const deferredResults = new Deferred();
         deferredResults.total = new Deferred();
 
-        var context = this;
+        const context = this;
         WsDfu.DFUFileView({
             request: {
                 Scope: scope
             }
         }).then(function (response) {
-            var retVal = [];
+            const retVal = [];
             if (lang.exists("DFUFileViewResponse.DFULogicalFiles.DFULogicalFile", response)) {
                 arrayUtil.forEach(response.DFUFileViewResponse.DFULogicalFiles.DFULogicalFile, function (item, idx) {
-                    var isDir = !(item.Name);
+                    const isDir = !(item.Name);
 
-                    var childScope = "";
-                    var leafName = "";
+                    let childScope = "";
+                    let leafName = "";
                     if (isDir) {
                         childScope = scope;
                         if (childScope)
                             childScope += "::";
                         childScope += item.Directory;
                     } else {
-                        var parts = item.Name.split("::");
+                        const parts = item.Name.split("::");
                         if (parts.length) {
                             leafName = parts[parts.length - 1];
                         }
@@ -129,7 +128,7 @@ var TreeStore = declare(null, {
                         __hpcc_displayName: isDir ? item.Directory : leafName
                     });
 
-                    var storeItem = null;
+                    let storeItem = null;
                     if (isDir) {
                         storeItem = item;
                     } else {
@@ -165,45 +164,45 @@ var TreeStore = declare(null, {
     },
 
     //  Store API ---
-    get: function (id) {
+    get(id) {
         return this.cache[id];
     },
-    getIdentity: function (object) {
+    getIdentity(object) {
         return object[this.idProperty];
     },
-    put: function (object, directives) {
+    put(object, directives) {
     },
-    add: function (object, directives) {
+    add(object, directives) {
     },
-    remove: function (id) {
+    remove(id) {
     },
-    query: function (query, options) {
+    query(query, options) {
         return QueryResults(this._fetchFiles(""));
     },
-    transaction: function () {
+    transaction() {
     },
-    mayHaveChildren: function (object) {
+    mayHaveChildren(object) {
         return object.__hpcc_isDir;
     },
-    getChildren: function (parent, options) {
+    getChildren(parent, options) {
         return QueryResults(this._fetchFiles(parent.__hpcc_childScope));
     },
-    getMetadata: function (object) {
+    getMetadata(object) {
     }
 });
 
-var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
+const LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
     _dpWU: DPWorkunit,
 
-    _FileDetailSetter: function (FileDetail) {
+    _FileDetailSetter(FileDetail) {
         this.FileDetail = FileDetail;
         this.result = ESPResult.Get(FileDetail);
     },
-    _DirSetter: function (Dir) {
+    _DirSetter(Dir) {
         this.set("Directory", Dir);
     },
-    _DFUFilePartsOnClustersSetter: function (DFUFilePartsOnClusters) {
-        var DFUFileParts = {
+    _DFUFilePartsOnClustersSetter(DFUFilePartsOnClusters) {
+        const DFUFileParts = {
             DFUPart: []
         };
         if (lang.exists("DFUFilePartsOnCluster", DFUFilePartsOnClusters)) {
@@ -224,28 +223,28 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
         }
         this.set("DFUFileParts", DFUFileParts);
     },
-    _CompressedFileSizeSetter: function (CompressedFileSize) {
+    _CompressedFileSizeSetter(CompressedFileSize) {
         this.CompressedFileSize = "";
         if (CompressedFileSize) {
             this.CompressedFileSize = CompressedFileSize.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
         }
     },
-    _StatSetter: function (Stat) {
+    _StatSetter(Stat) {
         this.set("MinSkew", Stat.MinSkew);
         this.set("MaxSkew", Stat.MaxSkew);
         this.set("MinSkewPart", Stat.MinSkewPart);
         this.set("MaxSkewPart", Stat.MaxSkewPart);
     },
-    constructor: function (args) {
+    constructor(args) {
         if (args) {
             declare.safeMixin(this, args);
         }
         this.logicalFile = this;
         this._dpWU = new DPWorkunit(this.Cluster, this.Name);
     },
-    save: function (request, args) {
-        //WsDfu/DFUInfo?FileName=progguide%3A%3Aexampledata%3A%3Akeys%3A%3Apeople.lastname.firstname&UpdateDescription=true&FileDesc=%C2%A0123&Save+Description=Save+Description
-        var context = this;
+    save(request, args) {
+        // WsDfu/DFUInfo?FileName=progguide%3A%3Aexampledata%3A%3Akeys%3A%3Apeople.lastname.firstname&UpdateDescription=true&FileDesc=%C2%A0123&Save+Description=Save+Description
+        const context = this;
         WsDfu.DFUInfo({
             request: {
                 Name: this.Name,
@@ -264,54 +263,54 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
             }
         });
     },
-    doDelete: function (params) {
-        var context = this;
+    doDelete(params) {
+        const context = this;
         WsDfu.DFUArrayAction([this], "Delete").then(function (response) {
             if (lang.exists("DFUArrayActionResponse.ActionResults.DFUActionInfo", response) &&
                 response.DFUArrayActionResponse.ActionResults.DFUActionInfo.length &&
                 !response.DFUArrayActionResponse.ActionResults.DFUActionInfo[0].Failed) {
-                context.updateData({ StateID: 999, State: "deleted" })
+                context.updateData({ StateID: 999, State: "deleted" });
             } else {
                 context.refresh();
             }
         });
     },
-    despray: function (params) {
+    despray(params) {
         lang.mixin(params.request, {
             sourceLogicalName: this.Name
         });
         return FileSpray.Despray(params);
     },
-    copy: function (params) {
+    copy(params) {
         lang.mixin(params.request, {
             sourceLogicalName: this.Name
         });
         return FileSpray.Copy(params);
     },
-    rename: function (params) {
-        var context = this;
+    rename(params) {
+        const context = this;
         lang.mixin(params.request, {
             srcname: this.Name
         });
         return FileSpray.Rename(params).then(function (response) {
-            context.set("Name", params.request.dstname);  //TODO - need to monitor DFUWorkunit for success (After ESPDFUWorkunit has been updated to proper singleton).
+            context.set("Name", params.request.dstname);  // TODO - need to monitor DFUWorkunit for success (After ESPDFUWorkunit has been updated to proper singleton).
             context.refresh();
             return response;
         });
     },
-    removeSubfiles: function (subfiles, removeSuperfile) {
-        var context = this;
+    removeSubfiles(subfiles, removeSuperfile) {
+        const context = this;
         return WsDfu.SuperfileAction("remove", this.Name, subfiles, removeSuperfile).then(function (response) {
             context.refresh();
             return response;
         });
     },
-    refresh: function (full) {
+    refresh(full) {
         return this.getInfo();
     },
-    getInfo: function (args) {
-        //WsDfu/DFUInfo?Name=progguide::exampledata::keys::people.state.city.zip.lastname.firstname.payload&Cluster=hthor__myeclagent HTTP/1.1
-        var context = this;
+    getInfo(args) {
+        // WsDfu/DFUInfo?Name=progguide::exampledata::keys::people.state.city.zip.lastname.firstname.payload&Cluster=hthor__myeclagent HTTP/1.1
+        const context = this;
         return WsDfu.DFUInfo({
             request: {
                 Name: this.Name,
@@ -326,8 +325,8 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
             }
         });
     },
-    getInfo2: function (args) {
-        var context = this;
+    getInfo2(args) {
+        const context = this;
         return WsDfu.DFUQuery({
             request: {
                 LogicalName: this.Name
@@ -341,8 +340,8 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
             }
         });
     },
-    getLeaf: function () {
-        var nameParts = this.Name.split("::");
+    getLeaf() {
+        const nameParts = this.Name.split("::");
         return nameParts.length ? nameParts[nameParts.length - 1] : "";
     },
     updateData: ESPUtil.override(function (inherited, data) {
@@ -351,7 +350,7 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
             this.result = ESPResult.Get(data);
         }
     }),
-    fetchStructure: function (format, onFetchStructure) {
+    fetchStructure(format, onFetchStructure) {
         WsDfu.DFUDefFile({
             request: {
                 Name: this.Name,
@@ -361,13 +360,13 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
             onFetchStructure(response);
         });
     },
-    fetchDEF: function (onFetchXML) {
+    fetchDEF(onFetchXML) {
         this.fetchStructure("def", onFetchXML);
     },
-    fetchXML: function (onFetchXML) {
+    fetchXML(onFetchXML) {
         this.fetchStructure("xml", onFetchXML);
     },
-    getStateIconClass: function () {
+    getStateIconClass() {
         if (this.isSuperfile) {
             switch (this.StateID) {
                 case 999:
@@ -382,11 +381,11 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
             return "iconLogicalFile";
         }
     },
-    getStateImageName: function () {
+    getStateImageName() {
         if (this.isSuperfile) {
             switch (this.StateID) {
                 case 999:
-                    return "superfile_deleted.png"
+                    return "superfile_deleted.png";
             }
             return "superfile.png";
         } else {
@@ -397,22 +396,22 @@ var LogicalFile = declare([ESPUtil.Singleton], {    // jshint ignore:line
             return "logicalfile.png";
         }
     },
-    getStateImageHTML: function () {
+    getStateImageHTML() {
         return Utility.getImageHTML(this.getStateImageName());
     },
-    getProtectedImage: function () {
+    getProtectedImage() {
         if (this.ProtectList.DFUFileProtect.length > 0) {
             return Utility.getImageURL("locked.png");
         }
         return Utility.getImageURL("unlocked.png");
     },
-    getCompressedImage: function () {
+    getCompressedImage() {
         if (this.IsCompressed) {
             return Utility.getImageURL("compressed.png");
         }
         return "";
     },
-    isDeleted: function () {
+    isDeleted() {
         return this.StateID === 999;
     },
     fetchDataPatternsWU() {
@@ -424,8 +423,8 @@ export function Get(Cluster, Name, data) {
     if (!Name) {
         throw new Error("Invalid Logical File ID");
     }
-    var store = new Store();
-    var retVal = store.get(createID(Cluster, Name));
+    const store = new Store();
+    const retVal = store.get(createID(Cluster, Name));
     if (data) {
         lang.mixin(data, {
             __hpcc_id: createID(data.NodeGroup, data.Name),
@@ -438,11 +437,11 @@ export function Get(Cluster, Name, data) {
 }
 
 export function CreateLFQueryStore(options) {
-    var store = new Store(options);
+    const store = new Store(options);
     return Observable(store);
 }
 
 export function CreateLFQueryTreeStore(options) {
-    var store = new TreeStore(options);
+    const store = new TreeStore(options);
     return Observable(store);
 }

+ 5 - 5
esp/src/src/ESPPackageProcess.ts

@@ -1,11 +1,11 @@
 import * as declare from "dojo/_base/declare";
-import * as Observable from "dojo/store/Observable";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
+import * as Observable from "dojo/store/Observable";
 import * as ESPRequest from "./ESPRequest";
 
-var Store = declare([ESPRequest.Store], {
+const Store = declare([ESPRequest.Store], {
     i18n: nlsHPCC,
     service: "WsPackageProcess",
     action: "ListPackages",
@@ -13,10 +13,10 @@ var Store = declare([ESPRequest.Store], {
     idProperty: "Id",
     startProperty: "PageStartFrom",
     countProperty: "PageSize",
-    SortbyProperty: 'SortBy'
+    SortbyProperty: "SortBy"
 });
 
 export function CreatePackageMapQueryObjectStore(options) {
-    var store = new Store(options);
+    const store = new Store(options);
     return Observable(store);
-}
+}

+ 71 - 71
esp/src/src/ESPPreflight.ts

@@ -1,27 +1,27 @@
+import * as arrayUtil from "dojo/_base/array";
 import * as declare from "dojo/_base/declare";
 import * as lang from "dojo/_base/lang";
-import * as arrayUtil from "dojo/_base/array";
-import * as QueryResults from "dojo/store/util/QueryResults";
 import * as Observable from "dojo/store/Observable";
+import * as QueryResults from "dojo/store/util/QueryResults";
 import * as ESPRequest from "./ESPRequest";
 
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
 
-var i18n = nlsHPCC;
+const i18n = nlsHPCC;
 
-var SystemServersStore = declare([ESPRequest.Store], {
+const SystemServersStore = declare([ESPRequest.Store], {
     service: "WsTopology",
     action: "TpServiceQuery",
     responseQualifier: "TpServiceQueryResponse.ServiceList",
     idProperty: "hpcc_id",
-    constructor: function (options) {
+    constructor(options) {
         if (options) {
             declare.safeMixin(this, options);
         }
     },
-    preProcessRow: function (row) {
+    preProcessRow(row) {
         lang.mixin(row, {
             Name: row.parent,
             childName: row.Name,
@@ -30,13 +30,13 @@ var SystemServersStore = declare([ESPRequest.Store], {
         });
     },
 
-    preProcessResponse: function (response, request) {
-        var results = [];
-        for (var key in response.ServiceList) {
-            for (var i in response.ServiceList[key]) {
+    preProcessResponse(response, request) {
+        const results = [];
+        for (const key in response.ServiceList) {
+            for (const i in response.ServiceList[key]) {
                 if (key !== "TpEclServers") {
-                    response.ServiceList[key][i].map(function(item) {
-                        var cleanKey = key.replace('Tp', '');
+                    response.ServiceList[key][i].map(function (item) {
+                        const cleanKey = key.replace("Tp", "");
                         results.push(item);
                         lang.mixin(item, {
                             parent: cleanKey
@@ -48,28 +48,28 @@ var SystemServersStore = declare([ESPRequest.Store], {
         response.ServiceList = results;
     },
 
-    mayHaveChildren: function (item) {
-        return item.TpMachines
+    mayHaveChildren(item) {
+        return item.TpMachines;
     },
 
-    getMachineIP: function (item) {
+    getMachineIP(item) {
         if (item.TpMachines) {
-            return item.TpMachines.TpMachine[0].Netaddress
+            return item.TpMachines.TpMachine[0].Netaddress;
         } else {
-            return ""
+            return "";
         }
     },
 
-    getMachinePort: function (port) {
+    getMachinePort(port) {
         if (port > 0) {
-            return ":" + port
+            return ":" + port;
         }
-        return ""
+        return "";
     },
 
-    getChildren: function (parent, options) {
-        var children = [];
-        var context = this;
+    getChildren(parent, options) {
+        const children = [];
+        const context = this;
 
         arrayUtil.forEach(parent.TpMachines.TpMachine, function (item, idx) {
             children.push({
@@ -94,17 +94,17 @@ var SystemServersStore = declare([ESPRequest.Store], {
     }
 });
 
-var ClusterTargetStore = declare([ESPRequest.Store], {
+const ClusterTargetStore = declare([ESPRequest.Store], {
     service: "WsTopology",
     action: "TpTargetClusterQuery",
     responseQualifier: "TpTargetClusterQueryResponse.TpTargetClusters.TpTargetCluster",
     idProperty: "hpcc_id",
-    constructor: function (options) {
+    constructor(options) {
         if (options) {
             declare.safeMixin(this, options);
         }
     },
-    preProcessRow: function (row) {
+    preProcessRow(row) {
         lang.mixin(row, {
             hpcc_id: row.Name,
             displayName: row.Name,
@@ -113,19 +113,19 @@ var ClusterTargetStore = declare([ESPRequest.Store], {
             Configuration: false
         });
     },
-    mayHaveChildren: function (item) {
+    mayHaveChildren(item) {
         return item.type === "targetClusterProcess";
     },
-    getChildren: function (parent, options) {
-        var context = this;
-        var children = [];
-        var tempArr = [];
-        for (var key in parent) {
+    getChildren(parent, options) {
+        const context = this;
+        const children = [];
+        const tempArr = [];
+        for (const key in parent) {
             if (typeof parent[key] === "object") {
-                for (var i in parent[key]) {
+                for (const i in parent[key]) {
                     if (key !== "TpEclServers") {
-                        parent[key][i].map(function(item){
-                            tempArr.push(item)
+                        parent[key][i].map(function (item) {
+                            tempArr.push(item);
                         });
                     }
                 }
@@ -135,7 +135,7 @@ var ClusterTargetStore = declare([ESPRequest.Store], {
         arrayUtil.forEach(tempArr, function (item, idx) {
             children.push({
                 hpcc_id: parent.Name + "_" + item.Name,
-                Name: item.Type + " - " +  item.Name,
+                Name: item.Type + " - " + item.Name,
                 Type: item.Type,
                 DaliServer: item.DaliServer ? true : false,
                 Directory: item.TpMachines ? item.TpMachines.TpMachine[0].Directory : "",
@@ -153,40 +153,40 @@ var ClusterTargetStore = declare([ESPRequest.Store], {
         return QueryResults(children);
     },
 
-    getMachineType: function (type) {
+    getMachineType(type) {
         switch (type) {
             case "RoxieCluster":
-                return "ROXIEMACHINES"
+                return "ROXIEMACHINES";
             case "ThorCluster":
-                return "THORMACHINES"
+                return "THORMACHINES";
         }
     },
 
-    getOS: function (int) {
+    getOS(int) {
         switch (int) {
             case 0:
-                return "Windows"
+                return "Windows";
             case 1:
-                return "Solaris"
+                return "Solaris";
             case 2:
-                return "Linux"
+                return "Linux";
             default:
-                return "Linux"
+                return "Linux";
         }
     }
-})
+});
 
-var ClusterProcessStore = declare([ESPRequest.Store], {
+const ClusterProcessStore = declare([ESPRequest.Store], {
     service: "WsTopology",
     action: "TpClusterQuery",
     responseQualifier: "TpClusterQueryResponse.TpClusters.TpCluster",
     idProperty: "hpcc_id",
-    constructor: function (options) {
+    constructor(options) {
         if (options) {
             declare.safeMixin(this, options);
         }
     },
-    preProcessRow: function (row) {
+    preProcessRow(row) {
         lang.mixin(row, {
             Platform: this.getOS(row.OS),
             hpcc_id: row.Name,
@@ -196,12 +196,12 @@ var ClusterProcessStore = declare([ESPRequest.Store], {
             Configuration: true
         });
     },
-    mayHaveChildren: function (item) {
+    mayHaveChildren(item) {
         return item.type === "clusterProcess";
     },
-    getChildren: function (parent, options) {
-        var store = Observable(new ClusterProcessesList({
-            parent: parent
+    getChildren(parent, options) {
+        const store = Observable(new ClusterProcessesList({
+            parent
         }));
         return store.query({
             Type: this.getMachineType(parent.Type),
@@ -213,35 +213,35 @@ var ClusterProcessStore = declare([ESPRequest.Store], {
         });
     },
 
-    getMachineType: function (type) {
+    getMachineType(type) {
         switch (type) {
             case "RoxieCluster":
-                return "ROXIEMACHINES"
+                return "ROXIEMACHINES";
             case "ThorCluster":
-                return "THORMACHINES"
+                return "THORMACHINES";
         }
     },
 
-    getOS: function (int) {
+    getOS(int) {
         switch (int) {
             case 0:
-                return "Windows"
+                return "Windows";
             case 1:
-                return "Solaris"
+                return "Solaris";
             case 2:
             default:
-                return "Linux"
+                return "Linux";
         }
     }
 });
 
-var ClusterProcessesList = declare([ESPRequest.Store], {
+const ClusterProcessesList = declare([ESPRequest.Store], {
     service: "WsTopology",
     action: "TpMachineQuery",
     responseQualifier: "TpMachineQueryResponse.TpMachines.TpMachine",
     idProperty: "hpcc_id",
 
-    preProcessRow: function (row) {
+    preProcessRow(row) {
         lang.mixin(row, {
             Platform: this.getOS(row.OS),
             hpcc_id: row.Name + "_" + row.Netaddress + "_" + row.Directory,
@@ -255,20 +255,20 @@ var ClusterProcessesList = declare([ESPRequest.Store], {
         });
     },
 
-    getOS: function (int) {
+    getOS(int) {
         switch (int) {
             case 0:
-                return "Windows"
+                return "Windows";
             case 1:
-                return "Solaris"
+                return "Solaris";
             case 2:
             default:
-                return "Linux"
+                return "Linux";
         }
     }
 });
 
-export function getCondition (int) {
+export function getCondition(int) {
     switch (int) {
         case 1:
             return i18n.Normal;
@@ -287,7 +287,7 @@ export function getCondition (int) {
     }
 }
 
-export function getState (int) {
+export function getState(int) {
     switch (int) {
         case 0:
             return i18n.Unknown;
@@ -309,17 +309,17 @@ export function getState (int) {
 }
 
 export function CreateTargetClusterStore(options) {
-    var store = new ClusterTargetStore(options);
+    const store = new ClusterTargetStore(options);
     return Observable(store);
 }
 
 export function CreateClusterProcessStore(options) {
-    var store = new ClusterProcessStore(options);
+    const store = new ClusterProcessStore(options);
     return Observable(store);
 }
 
 export function CreateSystemServersStore(options) {
-    var store = new SystemServersStore(options);
+    const store = new SystemServersStore(options);
     return Observable(store);
 }
 
@@ -329,4 +329,4 @@ export function MachineQuery(params) {
 
 export function GetConfiguration(params) {
     return ESPRequest.send("WsTopology", "TpGetComponentFile", params);
-}
+}

+ 44 - 45
esp/src/src/ESPQuery.ts

@@ -1,22 +1,22 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
+import * as Deferred from "dojo/_base/Deferred";
 import * as lang from "dojo/_base/lang";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
-import * as Deferred from "dojo/_base/Deferred";
 import * as Observable from "dojo/store/Observable";
 import * as topic from "dojo/topic";
 
 import * as parser from "dojox/xml/parser";
 
-import * as WsWorkunits from "./WsWorkunits";
-import * as WsEcl from "./WsEcl";
 import * as ESPRequest from "./ESPRequest";
 import * as ESPUtil from "./ESPUtil";
 import * as ESPWorkunit from "./ESPWorkunit";
+import * as WsEcl from "./WsEcl";
+import * as WsWorkunits from "./WsWorkunits";
 
-var Store = declare([ESPRequest.Store], {
+const Store = declare([ESPRequest.Store], {
     i18n: nlsHPCC,
     service: "WsWorkunits",
     action: "WUListQueries",
@@ -28,19 +28,19 @@ var Store = declare([ESPRequest.Store], {
 
     _watched: [],
 
-    create: function (__hpcc_id) {
-        var tmp = __hpcc_id.split(":");
+    create(__hpcc_id) {
+        const tmp = __hpcc_id.split(":");
         return new Query({
-            __hpcc_id: __hpcc_id,
+            __hpcc_id,
             QuerySetId: tmp[0],
             Id: tmp[1]
         });
     },
-    update: function (id, item) {
-        var storeItem = this.get(id);
+    update(id, item) {
+        const storeItem = this.get(id);
         storeItem.updateData(item);
         if (!this._watched[id]) {
-            var context = this;
+            const context = this;
             this._watched[id] = storeItem.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue) {
                     context.notify(storeItem, id);
@@ -49,11 +49,11 @@ var Store = declare([ESPRequest.Store], {
         }
     },
 
-    preProcessRow: function (item, request, query, options) {
-        var context = this;
-        var ErrorCount = 0;
-        var StatusMessage;
-        var MixedNodeStates;
+    preProcessRow(item, request, query, options) {
+        const context = this;
+        let ErrorCount = 0;
+        let StatusMessage;
+        let MixedNodeStates;
         item[this.idProperty] = item.QuerySetId + ":" + item.Id;
         if (lang.exists("Clusters", item)) {
             arrayUtil.some(item.Clusters.ClusterQueryState, function (cqs, idx) {
@@ -73,14 +73,14 @@ var Store = declare([ESPRequest.Store], {
         }
 
         lang.mixin(item, {
-            ErrorCount: ErrorCount,
+            ErrorCount,
             Status: StatusMessage,
-            MixedNodeStates: MixedNodeStates
+            MixedNodeStates
         });
     }
 });
 
-var Query = declare([ESPUtil.Singleton], {  // jshint ignore:line
+const Query = declare([ESPUtil.Singleton], {  // jshint ignore:line
     i18n: nlsHPCC,
     constructor: ESPUtil.override(function (inherited, args) {
         inherited(arguments);
@@ -89,11 +89,11 @@ var Query = declare([ESPUtil.Singleton], {  // jshint ignore:line
         }
         this.queries = {};
     }),
-    refresh: function (full) {
+    refresh(full) {
         return this.getDetails();
     },
-    getDetails: function (args) {
-        var context = this;
+    getDetails(args) {
+        const context = this;
         return WsWorkunits.WUQueryDetails({
             request: {
                 QueryId: this.Id,
@@ -108,22 +108,22 @@ var Query = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return response;
         });
     },
-    getWorkunit: function () {
+    getWorkunit() {
         return ESPWorkunit.Get(this.Wuid);
     },
-    SubmitXML: function (xml) {
-        var deferred = new Deferred();
+    SubmitXML(xml) {
+        const deferred = new Deferred();
         if (this.queries[xml]) {
             deferred.resolve(this.queries[xml]);
         } else {
-            var domXml = parser.parse(xml);
-            var query = {};
+            const domXml = parser.parse(xml);
+            const query = {};
             arrayUtil.forEach(domXml.firstChild.childNodes, function (item, idx) {
                 if (item.tagName) {
                     query[item.tagName] = item.textContent;
                 }
             });
-            var context = this;
+            const context = this;
             WsEcl.Submit(this.QuerySetId, this.Id, query).then(function (response) {
                 context.queries[xml] = response;
                 deferred.resolve(response);
@@ -132,15 +132,14 @@ var Query = declare([ESPUtil.Singleton], {  // jshint ignore:line
         }
         return deferred.promise;
     },
-    showResetQueryStatsResponse: function (responses) {
-        var sv = "Error";
-        var msg = "Invalid response";
+    showResetQueryStatsResponse(responses) {
+        let sv = "Error";
+        let msg = "Invalid response";
         if (lang.exists("WUQuerySetQueryActionResponse.Results", responses[0])) {
-            var result = responses[0].WUQuerySetQueryActionResponse.Results.Result[0];
+            const result = responses[0].WUQuerySetQueryActionResponse.Results.Result[0];
             if (result.Success === 0) {
                 msg = this.i18n.Exception + ": code=" + result.Code + " message=" + result.Message;
-            }
-            else {
+            } else {
                 sv = "Message";
                 msg = result.Message;
             }
@@ -151,8 +150,8 @@ var Query = declare([ESPUtil.Singleton], {  // jshint ignore:line
             Exceptions: [{ Source: "ResetQueryStats", Message: msg }]
         });
     },
-    doAction: function (action) {
-        var context = this;
+    doAction(action) {
+        const context = this;
         return WsWorkunits.WUQuerysetQueryAction([{
             QuerySetId: this.QuerySetId,
             Id: this.Id,
@@ -164,23 +163,23 @@ var Query = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return responses;
         });
     },
-    setSuspended: function (suspended) {
+    setSuspended(suspended) {
         return this.doAction(suspended ? "Suspend" : "Unsuspend");
     },
-    setActivated: function (activated) {
+    setActivated(activated) {
         return this.doAction(activated ? "Activate" : "Deactivate");
     },
-    doReset: function () {
+    doReset() {
         return this.doAction("ResetQueryStats");
     },
-    doDelete: function () {
+    doDelete() {
         return this.doAction("Delete");
     }
 });
 
 export function Get(QuerySetId, Id, data?) {
-    var store = new Store();
-    var retVal = store.get(QuerySetId + ":" + Id);
+    const store = new Store();
+    const retVal = store.get(QuerySetId + ":" + Id);
     if (data) {
         retVal.updateData(data);
     }
@@ -189,7 +188,7 @@ export function Get(QuerySetId, Id, data?) {
 
 export function GetFromRequestXML(QuerySetId, requestXml) {
     try {
-        var domXml = parser.parse(requestXml);
+        const domXml = parser.parse(requestXml);
         //  Not all XML is a "Request"  ---
         if (lang.exists("firstChild.tagName", domXml) && domXml.firstChild.tagName.indexOf("Request") === domXml.firstChild.tagName.length - 7) {
             return this.Get(QuerySetId, domXml.firstChild.tagName.slice(0, -7));
@@ -200,6 +199,6 @@ export function GetFromRequestXML(QuerySetId, requestXml) {
 }
 
 export function CreateQueryStore(options) {
-    var store = new Store(options);
+    const store = new Store(options);
     return new Observable(store);
 }

+ 60 - 60
esp/src/src/ESPQueue.ts

@@ -1,19 +1,19 @@
-import * as declare from "dojo/_base/declare";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as lang from "dojo/_base/lang";
-import * as arrayUtil from "dojo/_base/array";
 import * as Memory from "dojo/store/Memory";
 
-import * as WsSMC from "./WsSMC";
 import * as ESPUtil from "./ESPUtil";
 import * as Utility from "./Utility";
+import * as WsSMC from "./WsSMC";
 
-var Store = declare([Memory], {
+const Store = declare([Memory], {
     idProperty: "__hpcc_id"
 });
 
-var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
+const Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
 
-    constructor: function (id) {
+    constructor(id) {
         this.__hpcc_id = id;
 
         this._watched = [];
@@ -24,8 +24,8 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    pause: function () {
-        var context = this;
+    pause() {
+        const context = this;
         return WsSMC.PauseQueue({
             request: {
                 ClusterType: this.ServerType,
@@ -39,8 +39,8 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    resume: function () {
-        var context = this;
+    resume() {
+        const context = this;
         return WsSMC.ResumeQueue({
             request: {
                 ClusterType: this.ServerType,
@@ -54,8 +54,8 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    clear: function () {
-        var context = this;
+    clear() {
+        const context = this;
         return WsSMC.ClearQueue({
             request: {
                 QueueName: this.QueueName,
@@ -69,7 +69,7 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    setPriority: function (wuid, priority) {    //  high, normal, low
+    setPriority(wuid, priority) {    //  high, normal, low
         return WsSMC.SetJobPriority({
             request: {
                 QueueName: this.QueueName,
@@ -79,7 +79,7 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    moveTop: function (wuid) {
+    moveTop(wuid) {
         return WsSMC.MoveJobFront({
             request: {
                 QueueName: this.QueueName,
@@ -88,7 +88,7 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    moveUp: function (wuid) {
+    moveUp(wuid) {
         return WsSMC.MoveJobUp({
             request: {
                 QueueName: this.QueueName,
@@ -97,7 +97,7 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    moveDown: function (wuid) {
+    moveDown(wuid) {
         return WsSMC.MoveJobDown({
             request: {
                 QueueName: this.QueueName,
@@ -106,7 +106,7 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    moveBottom: function (wuid) {
+    moveBottom(wuid) {
         return WsSMC.MoveJobBack({
             request: {
                 QueueName: this.QueueName,
@@ -115,27 +115,27 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         });
     },
 
-    canChildMoveUp: function (id) {
+    canChildMoveUp(id) {
         return (this.getChildIndex(id) > 0);
     },
 
-    canChildMoveDown: function (id) {
+    canChildMoveDown(id) {
         return (this.getChildIndex(id) < this.getChildCount() - 1);
     },
 
-    clearChildren: function () {
+    clearChildren() {
         this.children.setData([]);
         this.set("DisplaySize", "");
     },
 
     tmp: 0,
-    addChild: function (wu) {
+    addChild(wu) {
         wu.set("ESPQueue", this);
         if (!this.children.get(wu.__hpcc_id)) {
             this.children.add(wu);
         }
         if (!this._watched[wu.__hpcc_id]) {
-            var context = this;
+            const context = this;
             this._watched[wu.__hpcc_id] = wu.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue) {
                     //  If child changes force the parent to refresh...
@@ -148,29 +148,29 @@ var Queue = declare([ESPUtil.Singleton, ESPUtil.Monitor], {
         this.set("DisplaySize", this.getChildCount());
     },
 
-    getChild: function (id) {
+    getChild(id) {
         return this.children.get(id);
     },
 
-    getChildIndex: function (id) {
+    getChildIndex(id) {
         return this.children.index[id];
     },
 
-    getChildCount: function () {
+    getChildCount() {
         return this.children.data.length;
     },
 
-    queryChildren: function () {
+    queryChildren() {
         return this.children.query();
     }
 });
 
-var TargetCluster = declare([Queue], {
-    _QueueNameSetter: function (QueueName) {
+const TargetCluster = declare([Queue], {
+    _QueueNameSetter(QueueName) {
         this.QueueName = QueueName;
         this.ServerName = QueueName;
     },
-    _ClusterTypeSetter: function (ClusterType) {
+    _ClusterTypeSetter(ClusterType) {
         this.ClusterType = ClusterType;
         switch (this.ClusterType) {
             case 1:
@@ -180,15 +180,15 @@ var TargetCluster = declare([Queue], {
                 this.ServerType = "RoxieServer";
                 break;
             case 3:
-                this.ServerType = "ThorMaster"
+                this.ServerType = "ThorMaster";
                 break;
             default:
-                this.ServerType = ""
+                this.ServerType = "";
         }
     },
 
-    refresh: function () {
-        var context = this;
+    refresh() {
+        const context = this;
         return WsSMC.GetStatusServerInfo({
             request: {
                 ServerName: this.ClusterName,
@@ -203,15 +203,15 @@ var TargetCluster = declare([Queue], {
         });
     },
 
-    getDisplayName: function () {
+    getDisplayName() {
         return this.ServerType + (this.ClusterName ? " - " + this.ClusterName : "");
     },
 
-    isNormal: function () {
+    isNormal() {
         return this.ClusterStatus === 0;
     },
 
-    isPaused: function () {
+    isPaused() {
         switch (this.ClusterStatus) {
             case 1:
             case 2:
@@ -221,7 +221,7 @@ var TargetCluster = declare([Queue], {
     },
 
     pause: ESPUtil.override(function (inherited) {
-        var context = this;
+        const context = this;
         return inherited(arguments).then(function (response) {
             context.updateData({
                 ClusterStatus: 2
@@ -231,7 +231,7 @@ var TargetCluster = declare([Queue], {
     }),
 
     resume: ESPUtil.override(function (inherited) {
-        var context = this;
+        const context = this;
         return inherited(arguments).then(function (response) {
             context.updateData({
                 ClusterStatus: 0
@@ -240,7 +240,7 @@ var TargetCluster = declare([Queue], {
         });
     }),
 
-    getStateImageName: function () {
+    getStateImageName() {
         switch (this.ClusterStatus) {
             case 1:
             case 2:
@@ -252,19 +252,19 @@ var TargetCluster = declare([Queue], {
         return "server.png";
     },
 
-    getStateImage: function () {
+    getStateImage() {
         return Utility.getImageURL(this.getStateImageName());
     }
 });
 
-var ServerJobQueue = declare([Queue], {
-    _ServerNameSetter: function (ServerName) {
+const ServerJobQueue = declare([Queue], {
+    _ServerNameSetter(ServerName) {
         this.ServerName = ServerName;
         this.ClusterName = ServerName;
     },
 
-    refresh: function () {
-        var context = this;
+    refresh() {
+        const context = this;
         return WsSMC.GetStatusServerInfo({
             request: {
                 ServerName: this.ServerName,
@@ -284,15 +284,15 @@ var ServerJobQueue = declare([Queue], {
         });
     },
 
-    getDisplayName: function () {
+    getDisplayName() {
         return this.ServerName + (this.QueueName ? " - " + this.QueueName : "");
     },
 
-    isNormal: function () {
+    isNormal() {
         return this.QueueStatus === "running";
     },
 
-    isPaused: function () {
+    isPaused() {
         if (this.QueueStatus === "paused") {
             return true;
         }
@@ -300,7 +300,7 @@ var ServerJobQueue = declare([Queue], {
     },
 
     pause: ESPUtil.override(function (inherited) {
-        var context = this;
+        const context = this;
         return inherited(arguments).then(function (response) {
             context.updateData({
                 QueueStatus: "paused"
@@ -310,7 +310,7 @@ var ServerJobQueue = declare([Queue], {
     }),
 
     resume: ESPUtil.override(function (inherited) {
-        var context = this;
+        const context = this;
         return inherited(arguments).then(function (response) {
             context.updateData({
                 QueueStatus: null
@@ -319,7 +319,7 @@ var ServerJobQueue = declare([Queue], {
         });
     }),
 
-    getStateImageName: function () {
+    getStateImageName() {
         switch (this.QueueStatus) {
             case "running":
                 return "server.png";
@@ -331,28 +331,28 @@ var ServerJobQueue = declare([Queue], {
         return "server.png";
     },
 
-    getStateImage: function () {
+    getStateImage() {
         return Utility.getImageURL(this.getStateImageName());
     }
 
 });
 
-var globalQueueStore = null;
-var GetGlobalQueueStore = function () {
+let globalQueueStore = null;
+const GetGlobalQueueStore = function () {
     if (!globalQueueStore) {
         globalQueueStore = new Store();
     }
     return globalQueueStore;
-}
+};
 
 export function isInstanceOfQueue(obj) {
     return obj && obj.isInstanceOf && obj.isInstanceOf(Queue);
 }
 
 export function GetTargetCluster(name, createIfMissing = false) {
-    var store = GetGlobalQueueStore();
-    var id = "TargetCluster::" + name;
-    var retVal = store.get(id);
+    const store = GetGlobalQueueStore();
+    const id = "TargetCluster::" + name;
+    let retVal = store.get(id);
     if (!retVal && createIfMissing) {
         retVal = new TargetCluster(id);
         store.put(retVal);
@@ -361,9 +361,9 @@ export function GetTargetCluster(name, createIfMissing = false) {
 }
 
 export function GetServerJobQueue(name, createIfMissing = false) {
-    var store = GetGlobalQueueStore();
-    var id = "ServerJobQueue::" + name;
-    var retVal = store.get(id);
+    const store = GetGlobalQueueStore();
+    const id = "ServerJobQueue::" + name;
+    let retVal = store.get(id);
     if (!retVal && createIfMissing) {
         retVal = new ServerJobQueue(id);
         store.put(retVal);

+ 72 - 71
esp/src/src/ESPRequest.ts

@@ -1,11 +1,11 @@
-import * as declare from "dojo/_base/declare";
 import * as arrayUtil from "dojo/_base/array";
-import * as lang from "dojo/_base/lang";
 import * as config from "dojo/_base/config";
+import * as declare from "dojo/_base/declare";
 import * as Deferred from "dojo/_base/Deferred";
+import * as lang from "dojo/_base/lang";
+import * as cookie from "dojo/cookie";
 import * as QueryResults from "dojo/store/util/QueryResults";
 import * as topic from "dojo/topic";
-import * as cookie from "dojo/cookie";
 import * as ESPUtil from "./ESPUtil";
 
 import * as hpccComms from "@hpcc-js/comms";
@@ -24,9 +24,9 @@ class RequestHelper {
     }
 
     getParamFromURL(key) {
-        var value = "";
+        let value = "";
         if (dojo.doc.location.search) {
-            var searchStr = dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) === "?" ? 1 : 0));
+            const searchStr = dojo.doc.location.search.substr((dojo.doc.location.search.substr(0, 1) === "?" ? 1 : 0));
             value = searchStr ? dojo.queryToObject(searchStr)[key] : "";
         }
 
@@ -82,32 +82,32 @@ class RequestHelper {
     }
 
     _send(service, action, _params) {
-        var params = lang.mixin({
+        const params = lang.mixin({
             request: {},
-            load: function (response) {
+            load(response) {
             },
-            error: function (error) {
+            error(error) {
             },
-            event: function (evt) {
+            event(evt) {
             }
         }, _params);
         lang.mixin(params.request, {
             rawxml_: true
         });
 
-        var handleAs = params.handleAs ? params.handleAs : "json";
-        var postfix = "";
+        const handleAs = params.handleAs ? params.handleAs : "json";
+        let postfix = "";
         if (handleAs === "json") {
             postfix = ".json";
         }
         // var method = params.method ? params.method : "get";
 
-        var retVal = null;
+        let retVal = null;
         if (this.isCrossSite()) {
-            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service), timeoutSecs: params.request.timeOutSeconds || this.timeOutSeconds, type: "jsonp" });
+            const transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service), timeoutSecs: params.request.timeOutSeconds || this.timeOutSeconds, type: "jsonp" });
             retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
         } else {
-            var transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service), timeoutSecs: params.request.timeOutSeconds || this.timeOutSeconds});
+            const transport = new hpccComms.Connection({ baseUrl: this.getBaseURL(service), timeoutSecs: params.request.timeOutSeconds || this.timeOutSeconds });
             retVal = transport.send(action + postfix, params.request, handleAs === "text" ? "text" : "json");
         }
 
@@ -133,6 +133,7 @@ class RequestHelper {
 
     send(service, action, params?) {
         if (!this.isSessionCall(service, action) && (!this.hasServerSetCookie() || (this.hasAuthentication() && !this.isAuthenticated()))) {
+            // tslint:disable-next-line: deprecation
             window.location.reload(true);
             return new Promise((resolve, reject) => { });
         }
@@ -149,12 +150,12 @@ class RequestHelper {
         if (!params)
             params = {};
 
-        var handleAs = params.handleAs ? params.handleAs : "json";
+        const handleAs = params.handleAs ? params.handleAs : "json";
         return this._send(service, action, params).then(function (response) {
             if (handleAs === "json") {
                 if (lang.exists("Exceptions.Source", response) && !params.skipExceptions) {
-                    var severity = params.suppressExceptionToaster ? "Info" : "Error";
-                    var source = service + "." + action;
+                    let severity = params.suppressExceptionToaster ? "Info" : "Error";
+                    const source = service + "." + action;
                     if (lang.exists("Exceptions.Exception", response) && response.Exceptions.Exception.length === 1) {
                         switch (source) {
                             case "WsWorkunits.WUInfo":
@@ -199,7 +200,7 @@ class RequestHelper {
             return response;
         },
             function (error) {
-                var message = "Unknown Error";
+                let message = "Unknown Error";
                 if (lang.exists("response.text", error)) {
                     message = error.response.text;
                 } else if (error.message && error.stack) {
@@ -218,7 +219,7 @@ class RequestHelper {
 
     //  XML to JSON helpers  ---
     getValue(domXml, tagName, knownObjectArrays) {
-        var retVal = this.getValues(domXml, tagName, knownObjectArrays);
+        const retVal = this.getValues(domXml, tagName, knownObjectArrays);
         if (retVal.length === 0) {
             return null;
         } else if (retVal.length !== 1) {
@@ -228,10 +229,10 @@ class RequestHelper {
     }
 
     getValues(domXml, tagName, knownObjectArrays) {
-        var retVal = [];
-        var items = domXml.getElementsByTagName(tagName);
-        var parentNode = items.length ? items[0].parentNode : null; //  Prevent <Dataset><row><field><row> scenario
-        for (var i = 0; i < items.length; ++i) {
+        const retVal = [];
+        const items = domXml.getElementsByTagName(tagName);
+        const parentNode = items.length ? items[0].parentNode : null; //  Prevent <Dataset><row><field><row> scenario
+        for (let i = 0; i < items.length; ++i) {
             if (items[i].parentNode === parentNode)
                 retVal.push(this.flattenXml(items[i], knownObjectArrays));
         }
@@ -239,11 +240,11 @@ class RequestHelper {
     }
 
     flattenXml(domXml, knownObjectArrays) {
-        var retValArr = [];
-        var retValStr = "";
-        var retVal = {};
-        for (var i = 0; i < domXml.childNodes.length; ++i) {
-            var childNode = domXml.childNodes[i];
+        const retValArr = [];
+        let retValStr = "";
+        const retVal = {};
+        for (let i = 0; i < domXml.childNodes.length; ++i) {
+            const childNode = domXml.childNodes[i];
             if (childNode.childNodes) {
                 if (childNode.nodeName && knownObjectArrays != null && dojo.indexOf(knownObjectArrays, childNode.nodeName) >= 0) {
                     retValArr.push(this.flattenXml(childNode, knownObjectArrays));
@@ -252,13 +253,13 @@ class RequestHelper {
                 } else if (childNode.childNodes.length === 0) {
                     retVal[childNode.nodeName] = null;
                 } else {
-                    var value = this.flattenXml(childNode, knownObjectArrays);
+                    const value = this.flattenXml(childNode, knownObjectArrays);
                     if (retVal[childNode.nodeName] == null) {
                         retVal[childNode.nodeName] = value;
                     } else if (dojo.isArray(retVal[childNode.nodeName])) {
                         retVal[childNode.nodeName].push(value);
                     } else if (dojo.isObject(retVal[childNode.nodeName])) {
-                        var tmp = retVal[childNode.nodeName];
+                        const tmp = retVal[childNode.nodeName];
                         retVal[childNode.nodeName] = [];
                         retVal[childNode.nodeName].push(tmp);
                         retVal[childNode.nodeName].push(value);
@@ -274,10 +275,10 @@ class RequestHelper {
     }
 }
 
-var _StoreSingletons = [];
+const _StoreSingletons = [];
 export function getURL(_params) {
-    var requestHelper = new RequestHelper();
-    var params = lang.mixin({
+    const requestHelper = new RequestHelper();
+    const params = lang.mixin({
         protocol: location.protocol,
         hostname: requestHelper.serverIP ? requestHelper.serverIP : location.hostname,
         port: location.port,
@@ -288,8 +289,8 @@ export function getURL(_params) {
 
 export function flattenArray(target, arrayName, arrayID) {
     if (lang.exists(arrayName + ".length", target)) {
-        var tmp = {};
-        for (var i = 0; i < target[arrayName].length; ++i) {
+        const tmp = {};
+        for (let i = 0; i < target[arrayName].length; ++i) {
             tmp[arrayName + "_i" + i] = target[arrayName][i][arrayID];
         }
         delete target[arrayName];
@@ -300,19 +301,19 @@ export function flattenArray(target, arrayName, arrayID) {
 
 export function flattenMap(target, arrayName, _singularName?, supressAppName?, excludeEmptyValues?) {
     if (lang.exists(arrayName, target)) {
-        var appData = target[arrayName];
+        const appData = target[arrayName];
         delete target[arrayName];
-        var singularName = _singularName ? _singularName : arrayName.substr(0, arrayName.length - 1);
-        var i = 0;
-        for (var key in appData) {
+        const singularName = _singularName ? _singularName : arrayName.substr(0, arrayName.length - 1);
+        let i = 0;
+        for (const key in appData) {
             if (excludeEmptyValues && (!appData[key] || appData[key] === "")) {
                 continue;
             }
             if (!supressAppName) {
-                target[arrayName + "." + singularName + "." + i + '.Application'] = "ESPRequest.js";
+                target[arrayName + "." + singularName + "." + i + ".Application"] = "ESPRequest.js";
             }
-            target[arrayName + "." + singularName + "." + i + '.Name'] = key;
-            target[arrayName + "." + singularName + "." + i + '.Value'] = appData[key];
+            target[arrayName + "." + singularName + "." + i + ".Name"] = key;
+            target[arrayName + "." + singularName + "." + i + ".Value"] = appData[key];
             ++i;
         }
         target[arrayName + "." + singularName + ".itemcount"] = i;
@@ -321,21 +322,21 @@ export function flattenMap(target, arrayName, _singularName?, supressAppName?, e
 }
 
 export function getBaseURL(service) {
-    var helper = new RequestHelper();
+    const helper = new RequestHelper();
     return helper.getBaseURL(service);
 }
 
 export function send(service, action, params?) {
-    var helper = new RequestHelper();
+    const helper = new RequestHelper();
     return helper.send(service, action, params);
 }
 
 export const Store = declare(null, {
-    SortbyProperty: 'Sortby',
-    DescendingProperty: 'Descending',
+    SortbyProperty: "Sortby",
+    DescendingProperty: "Descending",
     useSingletons: true,
 
-    constructor: function (options) {
+    constructor(options) {
         this.cachedArray = {};
 
         if (!this.service) {
@@ -355,64 +356,64 @@ export const Store = declare(null, {
         }
     },
 
-    endsWith: function (str, suffix) {
+    endsWith(str, suffix) {
         return str.indexOf(suffix, str.length - suffix.length) !== -1;
     },
 
-    getIdentity: function (item) {
+    getIdentity(item) {
         return item[this.idProperty];
     },
 
-    getCachedArray: function (create) {
+    getCachedArray(create) {
         return this.useSingletons ? lang.getObject(this.service + "." + this.action, create, _StoreSingletons) : this.cachedArray;
     },
 
-    exists: function (id) {
-        var cachedArray = this.getCachedArray(false);
+    exists(id) {
+        const cachedArray = this.getCachedArray(false);
         if (cachedArray) {
             return cachedArray[id] !== undefined;
         }
         return false;
     },
 
-    get: function (id, item) {
+    get(id, item) {
         if (!this.exists(id)) {
-            var cachedArray = this.getCachedArray(true);
+            const cachedArray = this.getCachedArray(true);
             cachedArray[id] = this.create(id, item);
             return cachedArray[id];
         }
-        var cachedArray = this.getCachedArray(false);
+        const cachedArray = this.getCachedArray(false);
         return cachedArray[id];
     },
 
-    create: function (id, item) {
-        var retVal = {
+    create(id, item) {
+        const retVal = {
         };
         retVal[this.idProperty] = id;
         return retVal;
     },
 
-    update: function (id, item) {
+    update(id, item) {
         lang.mixin(this.get(id), item);
     },
 
-    remove: function (id) {
-        var cachedArray = this.getCachedArray(false);
+    remove(id) {
+        const cachedArray = this.getCachedArray(false);
         if (cachedArray) {
             delete cachedArray[id];
         }
     },
 
-    _hasResponseContent: function (response) {
+    _hasResponseContent(response) {
         return lang.exists(this.responseQualifier, response);
     },
 
-    _getResponseContent: function (response) {
+    _getResponseContent(response) {
         return lang.getObject(this.responseQualifier, false, response);
     },
 
-    query: function (query, options) {
-        var request = query;
+    query(query, options) {
+        const request = query;
         if (options !== undefined && options.start !== undefined && options.count !== undefined) {
             if (this.startProperty) {
                 request[this.startProperty] = options.start;
@@ -428,27 +429,27 @@ export const Store = declare(null, {
         if (this.preRequest) {
             this.preRequest(request);
         }
-        var deferredResults = new Deferred();
+        const deferredResults = new Deferred();
         deferredResults.total = new Deferred();
-        var helper = new RequestHelper();
-        var context = this;
+        const helper = new RequestHelper();
+        const context = this;
         helper.send(this.service, this.action, {
-            request: request
+            request
         }).then(function (response) {
             if (context.preProcessFullResponse) {
                 context.preProcessFullResponse(response, request, query, options);
             }
-            var items = [];
+            const items = [];
             if (context._hasResponseContent(response)) {
                 if (context.preProcessResponse) {
-                    var responseQualiferArray = context.responseQualifier.split(".");
+                    const responseQualiferArray = context.responseQualifier.split(".");
                     context.preProcessResponse(lang.getObject(responseQualiferArray[0], false, response), request, query, options);
                 }
                 arrayUtil.forEach(context._getResponseContent(response), function (item, index) {
                     if (context.preProcessRow) {
                         context.preProcessRow(item, request, query, options);
                     }
-                    var storeItem = context.get(context.getIdentity(item), item);
+                    const storeItem = context.get(context.getIdentity(item), item);
                     context.update(context.getIdentity(item), item);
                     items.push(storeItem);
                 });

+ 29 - 29
esp/src/src/ESPResource.ts

@@ -1,31 +1,31 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as Deferred from "dojo/Deferred";
 import * as dom from "dojo/dom";
 import * as domConstruct from "dojo/dom-construct";
 
-import * as ESPWorkunit from "./ESPWorkunit";
 import * as ESPQuery from "./ESPQuery";
-import * as WsEcl from "./WsEcl";
+import * as ESPWorkunit from "./ESPWorkunit";
 import * as Utility from "./Utility";
+import * as WsEcl from "./WsEcl";
 
 declare const debugConfig;
 
-var DebugBase = declare(null, {
-    showDebugRow: function (node, key, value) {
-        var domNode = dom.byId(node);
+const DebugBase = declare(null, {
+    showDebugRow(node, key, value) {
+        const domNode = dom.byId(node);
         domConstruct.create("li", {
             innerHTML: "<b>" + Utility.xmlEncode(key) + "</b>:  " + Utility.xmlEncode(value)
         }, domNode);
     },
 
-    showDebugInfo: function (/*DOMNode|String*/ node, obj) {
-        var domNode = dom.byId(node);
+    showDebugInfo(/*DOMNode|String*/ node, obj) {
+        const domNode = dom.byId(node);
         if (!obj) {
             obj = this;
         }
-        var ulNode = domConstruct.create("ul", {}, domNode);
-        for (var key in obj) {
+        const ulNode = domConstruct.create("ul", {}, domNode);
+        for (const key in obj) {
             if (obj.hasOwnProperty(key)) {
                 this.showDebugRow(ulNode, key, obj[key]);
             }
@@ -33,11 +33,11 @@ var DebugBase = declare(null, {
     }
 });
 
-var PageInfo = declare(DebugBase, {
+const PageInfo = declare(DebugBase, {
 
-    constructor: function () {
-        var pathname = (typeof debugConfig !== "undefined") ? debugConfig.pathname : location.pathname;
-        var pathnodes = pathname.split("/");
+    constructor() {
+        const pathname = (typeof debugConfig !== "undefined") ? debugConfig.pathname : location.pathname;
+        const pathnodes = pathname.split("/");
         pathnodes.pop();
         this.pathfolder = pathnodes.join("/");
 
@@ -46,7 +46,7 @@ var PageInfo = declare(DebugBase, {
         } else if (pathname.indexOf("/WsEcl/res/") === 0) {
             this.querySet = pathnodes[4];
             this.queryID = pathnodes[5];
-            var queryIDParts = pathnodes[5].split(".");
+            const queryIDParts = pathnodes[5].split(".");
             this.queryDefaultID = queryIDParts[0];
             if (queryIDParts.length > 1) {
                 this.queryVersion = queryIDParts[1];
@@ -56,11 +56,11 @@ var PageInfo = declare(DebugBase, {
         }
     },
 
-    isWorkunit: function () {
+    isWorkunit() {
         return (this.wuid);
     },
 
-    isQuery: function () {
+    isQuery() {
         return (this.querySet && this.queryID);
     }
 });
@@ -70,7 +70,7 @@ export function getPageInfo() {
 }
 
 export function callExt(querySet, queryID, query) {
-    var deferred = new Deferred();
+    const deferred = new Deferred();
     WsEcl.Call(querySet, queryID, query).then(function (response) {
         deferred.resolve(response);
         return response;
@@ -79,15 +79,15 @@ export function callExt(querySet, queryID, query) {
 }
 
 export function call(query) {
-    var deferred = new Deferred();
-    var pageInfo = this.getPageInfo();
+    const deferred = new Deferred();
+    const pageInfo = this.getPageInfo();
     if (pageInfo.isQuery()) {
         this.callExt(pageInfo.querySet, pageInfo.queryID, query).then(function (response) {
             deferred.resolve(response);
             return response;
         });
     } else if (pageInfo.isWorkunit()) {
-        var wu = ESPWorkunit.Get(pageInfo.wuid);
+        const wu = ESPWorkunit.Get(pageInfo.wuid);
         wu.fetchAllNamedResults(0, 10).then(function (response) {
             deferred.resolve(response);
             return response;
@@ -99,7 +99,7 @@ export function call(query) {
 }
 
 export function arrayToMap(arr, keyField) {
-    var retVal = {};
+    const retVal = {};
     arrayUtil.forEach(arr, function (item, idx) {
         retVal[item[keyField]] = item;
         delete retVal[item[keyField]][keyField];
@@ -108,10 +108,10 @@ export function arrayToMap(arr, keyField) {
 }
 
 export function fetchQuery() {
-    var deferred = new Deferred();
-    var pageInfo = this.getPageInfo();
+    const deferred = new Deferred();
+    const pageInfo = this.getPageInfo();
     if (pageInfo.isQuery()) {
-        var query = ESPQuery.Get(pageInfo.querySet, pageInfo.queryID);
+        const query = ESPQuery.Get(pageInfo.querySet, pageInfo.queryID);
         query.refresh().then(function (response) {
             deferred.resolve(query);
         });
@@ -122,10 +122,10 @@ export function fetchQuery() {
 }
 
 export function fetchWorkunit() {
-    var deferred = new Deferred();
-    var pageInfo = this.getPageInfo();
+    const deferred = new Deferred();
+    const pageInfo = this.getPageInfo();
     if (pageInfo.isWorkunit()) {
-        var wu = ESPWorkunit.Get(pageInfo.wuid);
+        const wu = ESPWorkunit.Get(pageInfo.wuid);
         wu.refresh(true).then(function (response) {
             deferred.resolve(wu);
         });

+ 132 - 131
esp/src/src/ESPResult.ts

@@ -1,21 +1,21 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
-import "dojo/i18n";
-// @ts-ignore
-import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as Deferred from "dojo/_base/Deferred";
 import * as lang from "dojo/_base/lang";
 import * as domConstruct from "dojo/dom-construct";
+import "dojo/i18n";
+// @ts-ignore
+import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
 
-import * as parser from "dojox/xml/parser";
 import * as entities from "dojox/html/entities";
+import * as parser from "dojox/xml/parser";
 
 import * as ESPBase from "./ESPBase";
 import * as ESPRequest from "./ESPRequest";
-import * as WsWorkunits from "./WsWorkunits";
 import * as Utility from "./Utility";
+import * as WsWorkunits from "./WsWorkunits";
 
-var safeEncode = function (item) {
+const safeEncode = function (item) {
     switch (Object.prototype.toString.call(item)) {
         case "[object Boolean]":
         case "[object Number]":
@@ -25,10 +25,10 @@ var safeEncode = function (item) {
         case "[object Undefined]":
             return "";
         default:
-            console.log("Unknown cell type:  " + Object.prototype.toString.call(item))
+            console.log("Unknown cell type:  " + Object.prototype.toString.call(item));
     }
     return item;
-}
+};
 
 function RowFormatter(columns, row) {
     this._columns = [];
@@ -41,7 +41,7 @@ function RowFormatter(columns, row) {
 }
 
 RowFormatter.prototype.flattenColumns = function (columns) {
-    var context = this;
+    const context = this;
     arrayUtil.forEach(columns, function (column) {
         context.flattenColumn(column);
     });
@@ -49,7 +49,7 @@ RowFormatter.prototype.flattenColumns = function (columns) {
 
 RowFormatter.prototype.flattenColumn = function (column) {
     if (column.children) {
-        var context = this;
+        const context = this;
         arrayUtil.forEach(column.children, function (column) {
             context.flattenColumn(column);
         });
@@ -59,32 +59,32 @@ RowFormatter.prototype.flattenColumn = function (column) {
     }
 };
 
-var LINE_SPLITTER = "<br><hr style='border: 0px; border-bottom: 1px solid rgb(238, 221, 204);'>";
-var LINE_SPLITTER2 = "<br><hr style='visibility: hidden; border: 0px; border-bottom: 1px solid rgb(238, 221, 204);'>";
+const LINE_SPLITTER = "<br><hr style='border: 0px; border-bottom: 1px solid rgb(238, 221, 204);'>";
+const LINE_SPLITTER2 = "<br><hr style='visibility: hidden; border: 0px; border-bottom: 1px solid rgb(238, 221, 204);'>";
 RowFormatter.prototype.formatRow = function (columns, row, rowIdx) {
     rowIdx = rowIdx || 0;
     row = row || {};
-    var context = this;
-    var maxChildLen = 0;
-    var colLenBefore = {};
+    const context = this;
+    let maxChildLen = 0;
+    const colLenBefore = {};
     arrayUtil.forEach(columns, function (column) {
         if (!column.children && context._formattedRow[column.field] !== undefined) {
             colLenBefore[column.field] = ("" + context._formattedRow[column.field]).split(LINE_SPLITTER).length;
         }
-        var rowArr = row instanceof Array ? row : [row];
-        for (var colIdx = 0; colIdx < rowArr.length; ++colIdx) {
-            var r = rowArr[colIdx];
+        const rowArr = row instanceof Array ? row : [row];
+        for (let colIdx = 0; colIdx < rowArr.length; ++colIdx) {
+            const r = rowArr[colIdx];
             maxChildLen = Math.max(maxChildLen, context.formatCell(column, column.isRawHTML ? r[column.leafID] : safeEncode(r[column.leafID]), rowIdx));
         }
     });
     arrayUtil.forEach(columns, function (column) {
         if (!column.children) {
-            var cellLength = ("" + context._formattedRow[column.field]).split(LINE_SPLITTER).length - (colLenBefore[column.field] || 0);
-            var delta = maxChildLen - cellLength;
+            const cellLength = ("" + context._formattedRow[column.field]).split(LINE_SPLITTER).length - (colLenBefore[column.field] || 0);
+            const delta = maxChildLen - cellLength;
             if (delta > 0) {
-                var paddingArr = [];
+                const paddingArr = [];
                 paddingArr.length = delta + 1;
-                var padding = paddingArr.join(LINE_SPLITTER2);
+                const padding = paddingArr.join(LINE_SPLITTER2);
                 context._formattedRow[column.field] += padding;
             }
         }
@@ -93,13 +93,13 @@ RowFormatter.prototype.formatRow = function (columns, row, rowIdx) {
 };
 
 RowFormatter.prototype.formatCell = function (column, cell, rowIdx) {
-    var internalRows = 0;
+    let internalRows = 0;
     if (column.children) {
-        var children = cell && cell.Row ? cell.Row : [cell]
+        const children = cell && cell.Row ? cell.Row : [cell];
         if (children.length === 0) {
             children.push({});
         }
-        var context = this;
+        const context = this;
         arrayUtil.forEach(children, function (row, idx) {
             internalRows += context.formatRow(column.children, row, rowIdx + idx) + 1;
         });
@@ -110,25 +110,25 @@ RowFormatter.prototype.formatCell = function (column, cell, rowIdx) {
         ++internalRows;
     } else {
         this._formattedRow[column.field] += LINE_SPLITTER + (cell === undefined ? "" : cell);
-        ++internalRows
+        ++internalRows;
     }
     if (!this._grid[rowIdx]) {
-        this._grid[rowIdx] = {}
+        this._grid[rowIdx] = {};
     }
     this._grid[rowIdx][column.field] = cell;
     return internalRows;
 };
 
 RowFormatter.prototype.row = function (column) {
-    var retVal = {};
-    var context = this;
+    const retVal = {};
+    const context = this;
     arrayUtil.forEach(this._columns, function (column) {
         retVal[column] = context._formattedRow[column];
     });
     return retVal;
 };
 
-var Store = declare([ESPRequest.Store, ESPBase.default], {
+const Store = declare([ESPRequest.Store, ESPBase], {
     service: "WsWorkunits",
     action: "WUResult",
     responseQualifier: "WUResultResponse.Result",
@@ -137,35 +137,35 @@ var Store = declare([ESPRequest.Store, ESPBase.default], {
     startProperty: "Start",
     countProperty: "Count",
     useSingletons: false,
-    preRequest: function (request) {
+    preRequest(request) {
         if (request.FilterBy) {
             ESPRequest.flattenMap(request, "FilterBy", "NamedValue", true, true);
         }
         if (this.name && this.cluster) {
             this.idPrefix = this.name + "_" + this.cluster;
-            request['LogicalName'] = this.name;
-            request['Cluster'] = this.cluster;
+            request["LogicalName"] = this.name;
+            request["Cluster"] = this.cluster;
         } else if (this.name) {
             this.idPrefix = this.name;
-            request['LogicalName'] = this.name;
+            request["LogicalName"] = this.name;
         } else {
             this.idPrefix = this.wuid + "_" + this.sequence;
-            request['Wuid'] = this.wuid;
-            request['Sequence'] = this.sequence;
+            request["Wuid"] = this.wuid;
+            request["Sequence"] = this.sequence;
         }
         if (request.includeXmlSchema) {
-            request['SuppressXmlSchema'] = false;
+            request["SuppressXmlSchema"] = false;
         } else {
-            request['SuppressXmlSchema'] = true;
+            request["SuppressXmlSchema"] = true;
         }
     },
-    preProcessResponse: function (response, request) {
+    preProcessResponse(response, request) {
         if (response.Total === -1 || response.Total === 9223372036854776000 || response.Total === Number.MAX_VALUE) {
             response.Total = response.Start + response.Count + 1000;
         }
         if (lang.exists("Result.Row", response)) {
-            var context = this;
-            var retVal = context._structure ? this.formatRows(context._structure, response.Result.Row) : response.Result.Row;
+            const context = this;
+            const retVal = context._structure ? this.formatRows(context._structure, response.Result.Row) : response.Result.Row;
             arrayUtil.forEach(retVal, function (item, index) {
                 item.__hpcc_rowNum = request.Start + index + 1;
                 item.__hpcc_id = context.idPrefix + "_" + item.__hpcc_rowNum;
@@ -173,9 +173,9 @@ var Store = declare([ESPRequest.Store, ESPBase.default], {
             response.Result = retVal;
         }
     },
-    formatRows: function (columns, rows) {
+    formatRows(columns, rows) {
         return arrayUtil.map(rows, function (row) {
-            var rowFormatter = new RowFormatter(columns, row);
+            const rowFormatter = new RowFormatter(columns, row);
             return rowFormatter.row();
         });
     }
@@ -257,8 +257,8 @@ class Result {
                 return node;
             }
         }
-        for (var i = 0; i < node.childNodes.length; ++i) {
-            var retVal = this.getFirstSchemaNode(node.childNodes[i], name);
+        for (let i = 0; i < node.childNodes.length; ++i) {
+            const retVal = this.getFirstSchemaNode(node.childNodes[i], name);
             if (retVal) {
                 return retVal;
             }
@@ -267,10 +267,10 @@ class Result {
     }
 
     getFirstSequenceNode(schemaNode) {
-        var row = this.getFirstSchemaNode(schemaNode, "Row");
+        let row = this.getFirstSchemaNode(schemaNode, "Row");
         if (!row)
             row = schemaNode;
-        var complexType = this.getFirstSchemaNode(row, "complexType");
+        const complexType = this.getFirstSchemaNode(row, "complexType");
         if (!complexType)
             return null;
         return this.getFirstSchemaNode(complexType, "sequence");
@@ -280,9 +280,9 @@ class Result {
         if (Object.prototype.toString.call(cell) !== "[object Object]") {
             return false;
         }
-        var propCount = 0;
-        var firstPropType = null;
-        for (var key in cell) {
+        let propCount = 0;
+        let firstPropType = null;
+        for (const key in cell) {
             if (!firstPropType) {
                 firstPropType = Object.prototype.toString.call(cell[key]);
             }
@@ -293,21 +293,21 @@ class Result {
 
     rowToTable(cell, __row, node) {
         if (this.isChildDataset(cell)) {  //  Don't display "Row" as a header  ---
-            for (var key in cell) {
+            for (const key in cell) {
                 this.rowToTable(cell[key], __row, node);
             }
             return;
         }
 
-        var table = domConstruct.create("table", { border: 1, cellspacing: 0, width: "100%" }, node);
+        const table = domConstruct.create("table", { border: 1, cellspacing: 0, width: "100%" }, node);
         switch (Object.prototype.toString.call(cell)) {
             case "[object Object]":
-                var tr = domConstruct.create("tr", null, table);
-                for (var key in cell) {
+                let tr = domConstruct.create("tr", null, table);
+                for (const key in cell) {
                     domConstruct.create("th", { innerHTML: safeEncode(key) }, tr);
                 }
                 tr = domConstruct.create("tr", null, table);
-                for (var key in cell) {
+                for (const key in cell) {
                     switch (Object.prototype.toString.call(cell[key])) {
                         case "[object Object]":
                         case "[object Array]":
@@ -320,40 +320,40 @@ class Result {
                 }
                 break;
             case "[object Array]":
-                for (var i = 0; i < cell.length; ++i) {
+                for (let i = 0; i < cell.length; ++i) {
                     switch (Object.prototype.toString.call(cell[i])) {
                         case "[object Boolean]":
                         case "[object Number]":
                         case "[object String]":
                             //  Item in Scalar  ---
-                            var tr = domConstruct.create("tr", null, table);
-                            domConstruct.create("td", { innerHTML: safeEncode(cell[i]) }, tr);
+                            const tr2 = domConstruct.create("tr", null, table);
+                            domConstruct.create("td", { innerHTML: safeEncode(cell[i]) }, tr2);
                             break;
                         default:
                             //  Child Dataset  ---
                             if (i === 0) {
-                                var tr = domConstruct.create("tr", null, table);
-                                for (var key in cell[i]) {
+                                const tr = domConstruct.create("tr", null, table);
+                                for (const key in cell[i]) {
                                     domConstruct.create("th", { innerHTML: safeEncode(key) }, tr);
                                 }
                             }
-                            var tr = domConstruct.create("tr", null, table);
-                            for (var key in cell[i]) {
+                            const tr = domConstruct.create("tr", null, table);
+                            for (const key in cell[i]) {
                                 if (cell[i][key]) {
-                                    if (Object.prototype.toString.call(cell[i][key]) === '[object Object]' || Object.prototype.toString.call(cell[i][key]) === '[object Array]') {
-                                        var td = domConstruct.create("td", null, tr);
+                                    if (Object.prototype.toString.call(cell[i][key]) === "[object Object]" || Object.prototype.toString.call(cell[i][key]) === "[object Array]") {
+                                        const td = domConstruct.create("td", null, tr);
                                         this.rowToTable(cell[i][key], cell[i], td);
                                     } else if (key.indexOf("__html", key.length - "__html".length) !== -1) {
-                                        var td = domConstruct.create("td", { innerHTML: cell[i][key] }, tr);
+                                        domConstruct.create("td", { innerHTML: cell[i][key] }, tr);
                                     } else if (key.indexOf("__javascript", key.length - "__javascript".length) !== -1) {
-                                        var td = domConstruct.create("td", null, tr);
+                                        const td = domConstruct.create("td", null, tr);
                                         this.injectJavascript(cell[i][key], cell[i], td);
                                     } else {
-                                        var val = cell[i][key];
-                                        var td = domConstruct.create("td", { innerHTML: safeEncode(val) }, tr);
+                                        const val = cell[i][key];
+                                        domConstruct.create("td", { innerHTML: safeEncode(val) }, tr);
                                     }
                                 } else {
-                                    var td = domConstruct.create("td", { innerHTML: "" }, tr);
+                                    domConstruct.create("td", { innerHTML: "" }, tr);
                                 }
                             }
                     }
@@ -371,6 +371,7 @@ class Result {
             innerHTML: "&nbsp;"
         }, __cell);
         try {
+            // tslint:disable-next-line: no-eval
             eval(__cellContent);
         } catch (e) {
             __cell.innerHTML = "<b>Error:</b>&nbsp;&nbsp;" + safeEncode(e.message) + "<br>" + safeEncode(__cellContent);
@@ -379,9 +380,9 @@ class Result {
 
     parseName(nameObj) {
         nameObj.width = 500;
-        var titleParts = nameObj.name.split("__");
+        let titleParts = nameObj.name.split("__");
         if (titleParts.length >= 3) {
-            var specifiedWidth = parseInt(titleParts[titleParts.length - 2]);
+            const specifiedWidth = parseInt(titleParts[titleParts.length - 2]);
             if (!isNaN(specifiedWidth)) {
                 nameObj.width = specifiedWidth;
                 titleParts = titleParts.slice(0, titleParts.length - 1);
@@ -392,29 +393,29 @@ class Result {
     }
 
     getRowStructureFromSchema(parentNode, prefix) {
-        var sequence = this.getFirstSequenceNode(parentNode);
+        const sequence = this.getFirstSequenceNode(parentNode);
         if (!sequence)
             return null;
 
-        var retVal = [];
-        for (var i = 0; i < sequence.childNodes.length; ++i) {
-            var node = sequence.childNodes[i];
+        const retVal = [];
+        for (let i = 0; i < sequence.childNodes.length; ++i) {
+            const node = sequence.childNodes[i];
             if (typeof (node.getAttribute) !== "undefined") {
-                var name = node.getAttribute("name");
-                var type = node.getAttribute("type");
-                var children = this.getRowStructureFromSchema(node, prefix + name + "_");
-                var keyed = null;
-                var appInfo = this.getFirstSchemaNode(node, "appinfo");
+                const name = node.getAttribute("name");
+                const type = node.getAttribute("type");
+                const children = this.getRowStructureFromSchema(node, prefix + name + "_");
+                let keyed = null;
+                const appInfo = this.getFirstSchemaNode(node, "appinfo");
                 if (appInfo) {
                     keyed = appInfo.getAttribute("hpcc:keyed");
                 }
-                var column = null;
-                var context = this;
+                let column = null;
+                const context = this;
                 if (name && name.indexOf("__hidden", name.length - "__hidden".length) !== -1) {
                 } else if (name && type) {
                     if (name.indexOf("__html", name.length - "__html".length) !== -1) {
-                        var nameObj: any = {
-                            name: name
+                        const nameObj: any = {
+                            name
                         };
                         this.parseName(nameObj);
                         column = {
@@ -423,13 +424,13 @@ class Result {
                             leafID: name,
                             field: prefix + name,
                             width: nameObj.width,
-                            formatter: function (cell, row) {
+                            formatter(cell, row) {
                                 return cell;
                             }
                         };
                     } else if (name.indexOf("__javascript", name.length - "__javascript".length) !== -1) {
-                        var nameObj: any = {
-                            name: name
+                        const nameObj: any = {
+                            name
                         };
                         this.parseName(nameObj);
                         column = {
@@ -438,7 +439,7 @@ class Result {
                             leafID: name,
                             field: prefix + name,
                             width: nameObj.width,
-                            renderCell: function (row, cell, node, options) {
+                            renderCell(row, cell, node, options) {
                                 context.injectJavascript(cell, row, node);
                             }
                         };
@@ -448,7 +449,7 @@ class Result {
                             leafID: name,
                             field: prefix + name,
                             width: this.extractWidth(type, name) * 9,
-                            formatter: function (cell, row) {
+                            formatter(cell, row) {
                                 switch (typeof cell) {
                                     case "string":
                                         return cell.replace("\t", "&nbsp;&nbsp;&nbsp;&nbsp;");
@@ -458,7 +459,7 @@ class Result {
                         };
                     }
                 } else if (children) {
-                    var childWidth = 10;  //  Allow for html table
+                    let childWidth = 10;  //  Allow for html table
                     arrayUtil.forEach(children, function (item, idx) {
                         childWidth += item.width;
                     });
@@ -466,7 +467,7 @@ class Result {
                         label: name,
                         field: prefix + name,
                         leafID: name,
-                        renderCell: function (row, cell, node, options) {
+                        renderCell(row, cell, node, options) {
                             context.rowToTable(cell, row, node);
                         },
                         width: childWidth
@@ -491,16 +492,16 @@ class Result {
     }
 
     getRowStructureFromData(rows) {
-        var retVal = [];
-        for (var key in rows[0]) {
+        const retVal = [];
+        for (const key in rows[0]) {
             if (key !== "myInjectedRowNum") {
-                var context = this;
+                const context = this;
                 retVal.push({
                     label: key,
                     field: key,
-                    formatter: function (cell, row, grid) {
-                        if (Object.prototype.toString.call(cell) === '[object Object]' || Object.prototype.toString.call(cell) === '[object Array]') {
-                            var div = document.createElement("div");
+                    formatter(cell, row, grid) {
+                        if (Object.prototype.toString.call(cell) === "[object Object]" || Object.prototype.toString.call(cell) === "[object Array]") {
+                            const div = document.createElement("div");
                             context.rowToTable(cell, row, div);
                             return div.innerHTML;
                         }
@@ -515,7 +516,7 @@ class Result {
     }
 
     getStructure() {
-        var structure = [
+        const structure = [
             {
                 cells: [
                     [
@@ -527,10 +528,10 @@ class Result {
             }
         ];
 
-        var dom = parser.parse(this.XmlSchema);
-        var dataset = this.getFirstSchemaNode(dom, "Dataset");
-        var innerStruct = this.getRowStructureFromSchema(dataset, "");
-        for (var i = 0; i < innerStruct.length; ++i) {
+        const dom = parser.parse(this.XmlSchema);
+        const dataset = this.getFirstSchemaNode(dom, "Dataset");
+        const innerStruct = this.getRowStructureFromSchema(dataset, "");
+        for (let i = 0; i < innerStruct.length; ++i) {
             structure[0].cells[structure[0].cells.length - 1].push(innerStruct[i]);
         }
         this.store._structure = structure[0].cells[0];
@@ -541,23 +542,23 @@ class Result {
         if (this.XmlSchema) {
             callback(this.getStructure());
         } else {
-            var context = this;
+            const context = this;
 
-            var request = {};
+            const request = {};
             if (this.Wuid && lang.exists("Sequence", this)) {
-                request['Wuid'] = this.Wuid;
-                request['Sequence'] = this.Sequence;
+                request["Wuid"] = this.Wuid;
+                request["Sequence"] = this.Sequence;
             } else if (this.Name && this.NodeGroup) {
-                request['LogicalName'] = this.Name;
-                request['Cluster'] = this.NodeGroup;
+                request["LogicalName"] = this.Name;
+                request["Cluster"] = this.NodeGroup;
             } else if (this.Name) {
-                request['LogicalName'] = this.Name;
+                request["LogicalName"] = this.Name;
             }
-            request['Start'] = 0;
-            request['Count'] = 1;
+            request["Start"] = 0;
+            request["Count"] = 1;
             WsWorkunits.WUResult({
-                request: request,
-                load: function (response) {
+                request,
+                load(response) {
                     if (lang.exists("WUResultResponse.Result.XmlSchema.xml", response)) {
                         context.XmlSchema = "<Result>" + response.WUResultResponse.Result.XmlSchema.xml + "</Result>";
                         callback(context.getStructure());
@@ -576,16 +577,16 @@ class Result {
     }
 
     getRowWidth(parentNode) {
-        var retVal = 0;
-        var sequence = this.getFirstSequenceNode(parentNode);
+        let retVal = 0;
+        const sequence = this.getFirstSequenceNode(parentNode);
         if (!sequence)
             return retVal;
 
-        for (var i = 0; i < sequence.childNodes.length; ++i) {
-            var node = sequence.childNodes[i];
+        for (let i = 0; i < sequence.childNodes.length; ++i) {
+            const node = sequence.childNodes[i];
             if (typeof (node.getAttribute) !== "undefined") {
-                var name = node.getAttribute("name");
-                var type = node.getAttribute("type");
+                const name = node.getAttribute("name");
+                const type = node.getAttribute("type");
                 if (name && type) {
                     retVal += this.extractWidth(type, name);
                 } else if (node.hasChildNodes()) {
@@ -597,7 +598,7 @@ class Result {
     }
 
     extractWidth(type, name) {
-        var retVal = -1;
+        let retVal = -1;
 
         switch (type) {
             case "xs:boolean":
@@ -616,10 +617,10 @@ class Result {
                 retVal = 32;
                 break;
             default:
-                var numStr = "0123456789";
-                var underbarPos = type.lastIndexOf("_");
-                var length = underbarPos > 0 ? underbarPos : type.length;
-                var i = length - 1;
+                const numStr = "0123456789";
+                const underbarPos = type.lastIndexOf("_");
+                const length = underbarPos > 0 ? underbarPos : type.length;
+                let i = length - 1;
                 for (; i >= 0; --i) {
                     if (numStr.indexOf(type.charAt(i)) === -1)
                         break;
@@ -643,7 +644,7 @@ class Result {
     }
 
     fetchNRows(start, count) {
-        var deferred = new Deferred()
+        const deferred = new Deferred();
         this.store.query({
             Start: start,
             Count: count
@@ -654,8 +655,8 @@ class Result {
     }
 
     fetchContent() {
-        var deferred = new Deferred()
-        var context = this;
+        const deferred = new Deferred();
+        const context = this;
         this.store.query({
             Start: 0,
             Count: 1
@@ -675,8 +676,8 @@ class Result {
     }
 
     getECLRecord() {
-        var retVal = "RECORD\n";
-        for (var i = 0; i < this.ECLSchemas.ECLSchemaItem.length; ++i) {
+        let retVal = "RECORD\n";
+        for (let i = 0; i < this.ECLSchemas.ECLSchemaItem.length; ++i) {
             retVal += "\t" + this.ECLSchemas.ECLSchemaItem[i].ColumnType + "\t" + this.ECLSchemas.ECLSchemaItem[i].ColumnName + ";\n";
         }
         retVal += "END;\n";

+ 120 - 121
esp/src/src/ESPTopology.ts

@@ -1,24 +1,24 @@
-import * as declare from "dojo/_base/declare";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as lang from "dojo/_base/lang";
-import * as arrayUtil from "dojo/_base/array";
 import * as all from "dojo/promise/all";
 import * as QueryResults from "dojo/store/util/QueryResults";
 
-import * as WsTopology from "./WsTopology";
-import * as ESPUtil from "./ESPUtil";
 import * as ESPTree from "./ESPTree";
+import * as ESPUtil from "./ESPUtil";
+import * as WsTopology from "./WsTopology";
 
-var ThorCache = {
+const ThorCache = {
 };
-var Thor = declare([ESPUtil.Singleton], {
-    constructor: function (args) {
+const Thor = declare([ESPUtil.Singleton], {
+    constructor(args) {
         if (args) {
             declare.safeMixin(this, args);
         }
     },
 
-    refresh: function () {
-        var context = this;
+    refresh() {
+        const context = this;
         return WsTopology.TpThorStatus({
             request: {
                 Name: this.Name
@@ -33,45 +33,44 @@ var Thor = declare([ESPUtil.Singleton], {
                 }
             }
             return response;
-        })
+        });
     }
 });
 
-var createTreeItem = function (Type, id, espParent?, data?) {
+const createTreeItem = function (Type, id, espParent?, data?) {
     if (!(espParent instanceof TopologyItem)) {
         if (!espParent && id !== "root") {
             // var d = 0;
         }
     }
-    var retVal = new Type({ __hpcc_id: id, __hpcc_parent: espParent });
+    const retVal = new Type({ __hpcc_id: id, __hpcc_parent: espParent });
     if (data) {
         retVal.updateData(data);
     }
     return retVal;
 };
 
-
-var TopologyItem = declare([ESPTree.Item], {    // jshint ignore:line
-    constructor: function (args) {
+const TopologyItem = declare([ESPTree.Item], {    // jshint ignore:line
+    constructor(args) {
         this.__hpcc_children = [];
     },
 
-    appendChild: function (child) {
+    appendChild(child) {
         this.__hpcc_children.push(child);
     },
 
-    appendChildren: function (children) {
+    appendChildren(children) {
         arrayUtil.forEach(children, function (child) {
             this.appendChild(child);
         }, this);
     },
 
-    getLabel: function () {
+    getLabel() {
         return this.__hpcc_displayName;
     },
 
     //  Helpers  ---
-    getCompType: function () {
+    getCompType() {
         if (this.__hpcc_parent && this.__hpcc_parent.Type) {
             return this.__hpcc_parent.Type;
         } else {
@@ -79,7 +78,7 @@ var TopologyItem = declare([ESPTree.Item], {    // jshint ignore:line
         }
     },
 
-    getCompName: function () {
+    getCompName() {
         if (this.__hpcc_parent && this.__hpcc_parent.Name) {
             return this.__hpcc_parent.Name;
         } else {
@@ -87,7 +86,7 @@ var TopologyItem = declare([ESPTree.Item], {    // jshint ignore:line
         }
     },
 
-    getNetaddress: function () {
+    getNetaddress() {
         if (this.Netaddress) {
             return this.Netaddress;
         } else if (this.__hpcc_parent) {
@@ -98,7 +97,7 @@ var TopologyItem = declare([ESPTree.Item], {    // jshint ignore:line
         return "";
     },
 
-    getLogDirectory: function () {
+    getLogDirectory() {
         if (this.LogDirectory) {
             return this.LogDirectory;
         } else if (this.__hpcc_parent) {
@@ -112,11 +111,11 @@ var TopologyItem = declare([ESPTree.Item], {    // jshint ignore:line
     }
 });
 
-var TpMachine = declare([TopologyItem], {
+const TpMachine = declare([TopologyItem], {
     __hpcc_type: "TpMachine",
-    constructor: function (args) {
+    constructor(args) {
     },
-    getIcon: function () {
+    getIcon() {
         return "machine.png";
     },
     updateData: ESPUtil.override(function (inherited, data) {
@@ -125,11 +124,11 @@ var TpMachine = declare([TopologyItem], {
     })
 });
 
-var TpCommon = declare([TopologyItem], {
-    _TpMachinesSetter: function (TpMachines) {
+const TpCommon = declare([TopologyItem], {
+    _TpMachinesSetter(TpMachines) {
         if (lang.exists("TpMachine", TpMachines)) {
             arrayUtil.forEach(TpMachines.TpMachine, function (item, idx) {
-                var newMachine = createTreeItem(TpMachine, item.Type + "_" + item.Netaddress + "_" + item.ProcessNumber + "_" + item.Directory, this, item)
+                const newMachine = createTreeItem(TpMachine, item.Type + "_" + item.Netaddress + "_" + item.ProcessNumber + "_" + item.Directory, this, item);
                 this.appendChild(newMachine);
             }, this);
         }
@@ -140,66 +139,66 @@ var TpCommon = declare([TopologyItem], {
     })
 });
 
-var TpService = declare([TpCommon], {
+const TpService = declare([TpCommon], {
     __hpcc_type: "TpService",
-    constructor: function (args) {
+    constructor(args) {
     },
-    getLabel: function () {
+    getLabel() {
         return "[" + this.Type + "] " + this.Name;
     }
 });
 
-var TpEclAgent = declare([TpService], {
+const TpEclAgent = declare([TpService], {
     __hpcc_type: "TpEclAgent",
-    constructor: function (args) {
+    constructor(args) {
     }
 });
 
-var TpEclServer = declare([TpService], {
+const TpEclServer = declare([TpService], {
     __hpcc_type: "TpEclServer",
-    constructor: function (args) {
+    constructor(args) {
     }
 });
 
-var TpEclCCServer = declare([TpService], {
+const TpEclCCServer = declare([TpService], {
     __hpcc_type: "TpEclCCServer",
-    constructor: function (args) {
+    constructor(args) {
     }
 });
 
-var TpEclScheduler = declare([TpService], {
+const TpEclScheduler = declare([TpService], {
     __hpcc_type: "TpEclScheduler",
-    constructor: function (args) {
+    constructor(args) {
     }
 });
 
-var TpBinding = declare([TpCommon], {
+const TpBinding = declare([TpCommon], {
     __hpcc_type: "TpBinding",
-    constructor: function (args) {
+    constructor(args) {
     },
 
-    getLabel: function () {
+    getLabel() {
         return this.Service;
     }
 });
 
-var Cluster = declare([TpCommon], {
+const Cluster = declare([TpCommon], {
     __hpcc_type: "Cluster",
-    constructor: function (args) {
+    constructor(args) {
     },
-    getIcon: function () {
+    getIcon() {
         return "cluster.png";
     },
-    getLabel: function () {
+    getLabel() {
         return this.Name;
     }
 });
 
-var Service = declare([TpCommon], {
+const Service = declare([TpCommon], {
     __hpcc_type: "Service",
-    constructor: function (args) {
+    constructor(args) {
     },
-    _TpBindingsSetter: function (TpBindings) {
+    _TpBindingsSetter(TpBindings) {
         if (lang.exists("TpBinding", TpBindings)) {
             arrayUtil.forEach(TpBindings.TpBinding, function (item, idx) {
                 this.appendChild(createTreeItem(TpBinding, item.Service + "::" + item.Port, this, item));
@@ -208,14 +207,14 @@ var Service = declare([TpCommon], {
     }
 });
 
-var ServiceType = declare([TpCommon], {
+const ServiceType = declare([TpCommon], {
     __hpcc_type: "ServiceType",
-    constructor: function (args) {
+    constructor(args) {
     },
-    getIcon: function () {
+    getIcon() {
         return "folder.png";
     },
-    getLabel: function () {
+    getLabel() {
         switch (this.__hpcc_id) {
             case "ServiceType::TpDali":
                 return "Dali";
@@ -241,7 +240,7 @@ var ServiceType = declare([TpCommon], {
         return "Unknown";
     },
 
-    addServices: function (items) {
+    addServices(items) {
         arrayUtil.forEach(items, function (item) {
             this.appendChild(createTreeItem(Service, item.Name, this, item));
         }, this);
@@ -249,73 +248,73 @@ var ServiceType = declare([TpCommon], {
     }
 });
 
-var Services = declare([TpCommon], {
+const Services = declare([TpCommon], {
     __hpcc_type: "Services",
-    constructor: function (args) {
+    constructor(args) {
         args.__hpcc_displayName = "Services";
     },
 
-    getIcon: function () {
+    getIcon() {
         return "folder.png";
     },
 
-    getLabel: function () {
+    getLabel() {
         return "Services";
     },
 
-    appendServiceType: function (property, data) {
+    appendServiceType(property, data) {
         if (lang.exists(property, data)) {
-            var newServiceType = createTreeItem(ServiceType, property, this);
+            const newServiceType = createTreeItem(ServiceType, property, this);
             newServiceType.addServices(data[property]);
             this.appendChild(newServiceType);
         } else {
-            throw "GJS";
+            throw new Error("GJS");
         }
     },
 
-    _TpDalisSetter: function (TpDalis) {
+    _TpDalisSetter(TpDalis) {
         this.appendServiceType("TpDali", TpDalis);
     },
-    _TpDfuServersSetter: function (TpDfuServers) {
+    _TpDfuServersSetter(TpDfuServers) {
         this.appendServiceType("TpDfuServer", TpDfuServers);
     },
-    _TpDropZonesSetter: function (TpDropZones) {
+    _TpDropZonesSetter(TpDropZones) {
         this.appendServiceType("TpDropZone", TpDropZones);
     },
-    _TpEclAgentsSetter: function (TpEclAgents) {
+    _TpEclAgentsSetter(TpEclAgents) {
         this.appendServiceType("TpEclAgent", TpEclAgents);
     },
-    _TpEclServersSetter: function (TpEclServers) {
+    _TpEclServersSetter(TpEclServers) {
         this.appendServiceType("TpEclServer", TpEclServers);
     },
-    _TpEclCCServersSetter: function (TpEclCCServers) {
+    _TpEclCCServersSetter(TpEclCCServers) {
         this.appendServiceType("TpEclServer", TpEclCCServers);
     },
-    _TpEclSchedulersSetter: function (TpEclSchedulers) {
+    _TpEclSchedulersSetter(TpEclSchedulers) {
         this.appendServiceType("TpEclScheduler", TpEclSchedulers);
     },
-    _TpEspServersSetter: function (TpEspServers) {
+    _TpEspServersSetter(TpEspServers) {
         this.appendServiceType("TpEspServer", TpEspServers);
     },
-    _TpFTSlavesSetter: function (TpFTSlaves) {
+    _TpFTSlavesSetter(TpFTSlaves) {
         this.appendServiceType("TpFTSlave", TpFTSlaves);
     },
-    _TpSashaServersSetter: function (TpSashaServers) {
+    _TpSashaServersSetter(TpSashaServers) {
         this.appendServiceType("TpSashaServer", TpSashaServers);
     }
 });
 
-var TargetCluster = declare([TpCommon], {
+const TargetCluster = declare([TpCommon], {
     __hpcc_type: "TargetCluster",
-    constructor: function (args) {
+    constructor(args) {
     },
-    getIcon: function () {
+    getIcon() {
         return "server.png";
     },
-    getLabel: function () {
+    getLabel() {
         return this.Name;
     },
-    _TpEclAgentsSetter: function (TpEclAgents) {
+    _TpEclAgentsSetter(TpEclAgents) {
         if (lang.exists("TpEclAgent", TpEclAgents)) {
             arrayUtil.forEach(TpEclAgents.TpEclAgent, function (item, idx) {
                 this.appendChild(createTreeItem(TpEclAgent, item.Name, this, item));
@@ -323,7 +322,7 @@ var TargetCluster = declare([TpCommon], {
         }
     },
 
-    _TpEclCCServersSetter: function (TpEclCCServers) {
+    _TpEclCCServersSetter(TpEclCCServers) {
         if (lang.exists("TpEclServer", TpEclCCServers)) {
             arrayUtil.forEach(TpEclCCServers.TpEclServer, function (item, idx) {
                 this.appendChild(createTreeItem(TpEclCCServer, item.Name, this, item));
@@ -331,7 +330,7 @@ var TargetCluster = declare([TpCommon], {
         }
     },
 
-    _TpEclServersSetter: function (TpEclServers) {
+    _TpEclServersSetter(TpEclServers) {
         if (lang.exists("TpEclServer", TpEclServers)) {
             arrayUtil.forEach(TpEclServers.TpEclServer, function (item, idx) {
                 this.appendChild(createTreeItem(TpEclServer, item.Name, this, item));
@@ -339,7 +338,7 @@ var TargetCluster = declare([TpCommon], {
         }
     },
 
-    _TpEclSchedulersSetter: function (TpEclSchedulers) {
+    _TpEclSchedulersSetter(TpEclSchedulers) {
         if (lang.exists("TpEclScheduler", TpEclSchedulers)) {
             arrayUtil.forEach(TpEclSchedulers.TpEclScheduler, function (item, idx) {
                 this.appendChild(createTreeItem(TpEclScheduler, item.Name, this, item));
@@ -347,7 +346,7 @@ var TargetCluster = declare([TpCommon], {
         }
     },
 
-    _TpClustersSetter: function (TpClusters) {
+    _TpClustersSetter(TpClusters) {
         if (lang.exists("TpCluster", TpClusters)) {
             arrayUtil.forEach(TpClusters.TpCluster, function (item, idx) {
                 this.appendChild(createTreeItem(Cluster, item.Name, this, item));
@@ -356,40 +355,40 @@ var TargetCluster = declare([TpCommon], {
     }
 });
 
-var TargetClusterType = declare([TpCommon], {
+const TargetClusterType = declare([TpCommon], {
     __hpcc_type: "TargetClusterType",
-    constructor: function (args) {
+    constructor(args) {
         args.__hpcc_displayName = "TargetClusterType";
     },
 
-    getIcon: function () {
+    getIcon() {
         return "folder.png";
     },
 
-    getLabel: function () {
+    getLabel() {
         return this.Name;
     }
 });
 
-var TopologyRoot = declare([TopologyItem], {
+const TopologyRoot = declare([TopologyItem], {
     __hpcc_type: "TopologyRoot",
-    getIcon: function () {
+    getIcon() {
         return "workunit.png";
     },
-    getLabel: function () {
+    getLabel() {
         return "Topology";
     }
 });
 
-var TopologyTreeStore = declare([ESPTree.Store], {
-    constructor: function () {
+const TopologyTreeStore = declare([ESPTree.Store], {
+    constructor() {
         this.viewMode("Debug");
         this.cachedTreeItems = {};
         this.cachedRelations = {};
         this.cachedRelationsPC = {};
     },
     createTreeNode: ESPUtil.override(function (inherited, parentNode, treeItem) {
-        var retVal = inherited(parentNode, treeItem);
+        const retVal = inherited(parentNode, treeItem);
         retVal.hasConfig = function () {
             return this.__hpcc_treeItem.Netaddress && this.__hpcc_treeItem.Directory;
         };
@@ -412,7 +411,7 @@ var TopologyTreeStore = declare([ESPTree.Store], {
             return this.__hpcc_treeItem.OS;
         };
         retVal.getNetaddress = function () {
-            var retVal = null;
+            let retVal = null;
             if (this.__hpcc_treeItem.getNetaddress) {
                 retVal = this.__hpcc_treeItem.getNetaddress();
             }
@@ -422,7 +421,7 @@ var TopologyTreeStore = declare([ESPTree.Store], {
             return retVal;
         };
         retVal.getLogDirectory = function () {
-            var retVal = null;
+            let retVal = null;
             if (this.__hpcc_treeItem.getLogDirectory) {
                 retVal = this.__hpcc_treeItem.getLogDirectory();
             }
@@ -436,19 +435,19 @@ var TopologyTreeStore = declare([ESPTree.Store], {
         this.cachedRelations = {};
         this.cachedRelationsPC = {};
     }),
-    viewMode: function (mode) {
+    viewMode(mode) {
         this._viewMode = mode;
     },
-    createTreeItemXXX: function (Type, id, data) {
-        var newItem = new Type({ __hpcc_store: this, __hpcc_id: id });
-        var retVal = this.cachedTreeItems[newItem.getUniqueID()];
+    createTreeItemXXX(Type, id, data) {
+        const newItem = new Type({ __hpcc_store: this, __hpcc_id: id });
+        let retVal = this.cachedTreeItems[newItem.getUniqueID()];
         if (!retVal) {
             retVal = newItem;
             this.cachedTreeItems[newItem.getUniqueID()] = retVal;
             this.cachedRelationsPC[newItem.getUniqueID()] = [];
         } else {
             //  Sanity Checking  ---
-            for (var key in data) {
+            for (const key in data) {
                 if (!(data[key] instanceof Object)) {
                     if (retVal.get(key) !== data[key] && key !== "HasThorSpareProcess") {
                         // var d = 0;//throw "Duplicate ID";
@@ -461,16 +460,16 @@ var TopologyTreeStore = declare([ESPTree.Store], {
         }
         return retVal;
     },
-    query: function (query, options) {
-        var data = [];
-        var instance = {};
-        var machines = {};
-        var context = this;
+    query(query, options) {
+        const data = [];
+        let instance = {};
+        let machines = {};
+        const context = this;
 
         function getMachines(treeItem, parentTreeItem?) {
             if (treeItem instanceof TpMachine) {
                 if (!machines[treeItem.Netaddress]) {
-                    var machineNode = context.createTreeNode(null, treeItem);
+                    const machineNode = context.createTreeNode(null, treeItem);
                     machines[treeItem.Netaddress] = machineNode;
                     data.push(machineNode);
                 }
@@ -514,10 +513,10 @@ var TopologyTreeStore = declare([ESPTree.Store], {
                     machines = {};
                     getMachines(this.rootItem);
                     data.sort(function (a, b) {
-                        var aa = a.__hpcc_treeItem.Netaddress.split(".");
-                        var bb = b.__hpcc_treeItem.Netaddress.split(".");
-                        var resulta = aa[0] * 0x1000000 + aa[1] * 0x10000 + aa[2] * 0x100 + aa[3] * 1;
-                        var resultb = bb[0] * 0x1000000 + bb[1] * 0x10000 + bb[2] * 0x100 + bb[3] * 1;
+                        const aa = a.__hpcc_treeItem.Netaddress.split(".");
+                        const bb = b.__hpcc_treeItem.Netaddress.split(".");
+                        const resulta = aa[0] * 0x1000000 + aa[1] * 0x10000 + aa[2] * 0x100 + aa[3] * 1;
+                        const resultb = bb[0] * 0x1000000 + bb[1] * 0x10000 + bb[2] * 0x100 + bb[3] * 1;
                         return resulta - resultb;
                     });
                     break;
@@ -526,12 +525,12 @@ var TopologyTreeStore = declare([ESPTree.Store], {
         return QueryResults(this.queryEngine({}, {})(data));
     },
 
-    mayHaveChildren: function (treeNode) {
+    mayHaveChildren(treeNode) {
         return this.getChildren(treeNode, {}).length > 0;
     },
 
-    getChildren: function (treeNode, options) {
-        var data = [];
+    getChildren(treeNode, options) {
+        let data = [];
         if (treeNode.__hpcc_children.length) {
             data = treeNode.__hpcc_children;
         } else {
@@ -544,9 +543,9 @@ var TopologyTreeStore = declare([ESPTree.Store], {
                 case "Services":
                     if (!treeNode.__hpcc_parentNode) {
                         arrayUtil.forEach(treeNode.__hpcc_treeItem.__hpcc_children, function (child) {
-                            var serviceNode = this.createTreeNode(treeNode, child);
-                            var machines = [];
-                            var bindings = [];
+                            const serviceNode = this.createTreeNode(treeNode, child);
+                            const machines = [];
+                            const bindings = [];
                             arrayUtil.forEach(child.__hpcc_children, function (gchild) {
                                 if (gchild instanceof TpMachine) {
                                     machines.push(gchild);
@@ -555,13 +554,13 @@ var TopologyTreeStore = declare([ESPTree.Store], {
                                 }
                             }, this);
                             arrayUtil.forEach(bindings, function (binding) {
-                                var bindingNode = this.createTreeNode(serviceNode, binding);
+                                const bindingNode = this.createTreeNode(serviceNode, binding);
                                 arrayUtil.forEach(machines, function (machine) {
                                     this.createTreeNode(bindingNode, machine);
                                 }, this);
                             }, this);
                             arrayUtil.forEach(machines, function (machine) {
-                                var machineNode = this.createTreeNode(serviceNode, machine);
+                                const machineNode = this.createTreeNode(serviceNode, machine);
                                 arrayUtil.forEach(bindings, function (binding) {
                                     this.createTreeNode(machineNode, binding);
                                 }, this);
@@ -582,23 +581,23 @@ var TopologyTreeStore = declare([ESPTree.Store], {
         return QueryResults(this.queryEngine({}, {})(data));
     },
 
-    refresh: function (callback) {
+    refresh(callback) {
         this.clear();
         this.rootItem = createTreeItem(TopologyRoot, "root");
 
-        var context = this;
+        const context = this;
         return all({
             targetClusterQuery: WsTopology.TpTargetClusterQuery({
                 request: {
                     Type: "ROOT"
                 }
             }).then(function (response) {
-                var clusterTypes = {};
-                var retVal = [];
+                const clusterTypes = {};
+                const retVal = [];
                 if (lang.exists("TpTargetClusterQueryResponse.TpTargetClusters", response)) {
                     arrayUtil.forEach(response.TpTargetClusterQueryResponse.TpTargetClusters.TpTargetCluster, function (item, idx) {
                         if (!clusterTypes[item.Type]) {
-                            clusterTypes[item.Type] = createTreeItem(TargetClusterType, item.Type, context.rootItem, { Name: item.Type })
+                            clusterTypes[item.Type] = createTreeItem(TargetClusterType, item.Type, context.rootItem, { Name: item.Type });
                             retVal.push(clusterTypes[item.Type]);
                         }
                         clusterTypes[item.Type].appendChild(createTreeItem(TargetCluster, item.Name, context.rootItem, item));
@@ -611,7 +610,7 @@ var TopologyTreeStore = declare([ESPTree.Store], {
                     Type: "ALLSERVICES"
                 }
             }).then(function (response) {
-                var retVal = [];
+                const retVal = [];
                 if (lang.exists("TpServiceQueryResponse.ServiceList", response)) {
                     retVal.push(createTreeItem(Services, "Services", context.rootItem, response.TpServiceQueryResponse.ServiceList));
                 }

+ 33 - 33
esp/src/src/ESPTree.ts

@@ -1,35 +1,35 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as Memory from "dojo/store/Memory";
 
 import * as ESPUtil from "./ESPUtil";
 
-var TreeItem = declare([ESPUtil.Singleton], {
+const TreeItem = declare([ESPUtil.Singleton], {
     __hpcc_type: "none",
 
-    constructor: function (args) {
+    constructor(args) {
         args.__hpcc_id = this.__hpcc_type + "::" + args.__hpcc_id;  //  args get set to "this" in base class Stateful ---
     },
 
-    getUniqueID: function () {
+    getUniqueID() {
         return this.__hpcc_id;
     },
 
-    getIcon: function () {
+    getIcon() {
         return "file.png";
     },
 
-    getLabel: function () {
+    getLabel() {
         return "TODO";
     }
 });
 
-var TreeNode = declare(null, {
+const TreeNode = declare(null, {
     treeSeparator: "->",
-    constructor: function (store, parentNode, treeItem) {
+    constructor(store, parentNode, treeItem) {
         this.__hpcc_store = store;
         if (!(parentNode === null || parentNode instanceof TreeNode)) {
-            throw "Invalid Parent Node"
+            throw new Error("Invalid Parent Node");
         }
         if (parentNode) {
             parentNode.appendChild(this);
@@ -38,92 +38,92 @@ var TreeNode = declare(null, {
         this.__hpcc_id = (this.__hpcc_parentNode ? (this.__hpcc_parentNode.getUniqueID() + this.treeSeparator) : "") + this.__hpcc_treeItem.getUniqueID();
         this.__hpcc_children = [];
     },
-    getUniqueID: function () {
+    getUniqueID() {
         return this.__hpcc_id;
     },
-    mayHaveChildren: function () {
+    mayHaveChildren() {
         return this.__hpcc_children.length;
     },
-    appendChild: function (child) {
+    appendChild(child) {
         if (!(child instanceof TreeNode)) {
-            throw "Invalid Child Node"
+            throw new Error("Invalid Child Node");
         }
         child.__hpcc_parentNode = this;
         this.__hpcc_children.push(child);
     },
-    appendChildren: function (children) {
+    appendChildren(children) {
         arrayUtil.forEach(children, function (child) {
             this.appendChild(child);
         }, this);
     },
-    getChildren: function (options) {
+    getChildren(options) {
         return this.__hpcc_children;
     },
-    getIcon: function () {
+    getIcon() {
         return this.__hpcc_treeItem.getIcon();
     },
-    getLabel: function () {
+    getLabel() {
         return this.__hpcc_treeItem.getLabel();
     }
 });
 
-var TreeStore = declare([Memory], {
+const TreeStore = declare([Memory], {
     idProperty: "__hpcc_id",
     treeSeparator: "->",
 
-    constructor: function (args) {
+    constructor(args) {
         this.clear();
     },
 
-    clear: function () {
+    clear() {
         this.cachedTreeNodes = {};
     },
 
-    setRootNode: function (rootItem) {
-        var rootNode = this.createTreeNode(null, rootItem);
+    setRootNode(rootItem) {
+        const rootNode = this.createTreeNode(null, rootItem);
         this.setData([rootNode]);
         return rootNode;
     },
 
-    createTreeNode: function (parentNode, treeItem) {
-        var retVal = new TreeNode(this, parentNode, treeItem);
+    createTreeNode(parentNode, treeItem) {
+        const retVal = new TreeNode(this, parentNode, treeItem);
         if (this.cachedTreeNodes[retVal.getUniqueID()]) {
-            //throw retVal.getUniqueID() + " already exists.";
+            // throw retVal.getUniqueID() + " already exists.";
         }
         this.cachedTreeNodes[retVal.getUniqueID()] = retVal;
         return retVal;
     },
 
-    addItem: function (treeItem) {
+    addItem(treeItem) {
         if (this.cacheTreeItems[treeItem.getUniqueID()]) {
-            throw treeItem.getUniqueID() + " already exists.";
+            throw new Error(treeItem.getUniqueID() + " already exists.");
         }
         treeItem.__hpcc_store = this;
         this.cacheTreeItems[treeItem.getUniqueID()] = treeItem;
         return treeItem;
     },
 
-    addChild: function (source, target) {
+    addChild(source, target) {
         this.out_edges[source.getUniqueID()].put(this.createTreeNode(source, target));
         this.in_edges[target.getUniqueID()].put(this.createTreeNode(target, source));
         return target;
     },
 
-    addChildren: function (source, targets) {
+    addChildren(source, targets) {
         arrayUtil.forEach(targets, function (target) {
             this.addChild(source, target);
         }, this);
     },
 
-    mayHaveChildren: function (treeNode) {
+    mayHaveChildren(treeNode) {
         return treeNode.mayHaveChildren && treeNode.mayHaveChildren();
     },
 
-    get: function (id) {
+    get(id) {
         return this.cachedTreeNodes[id];
     },
 
-    getChildren: function (parent, options) {
+    getChildren(parent, options) {
         return parent.getChildren(options);
     }
 });

+ 96 - 97
esp/src/src/ESPUtil.ts

@@ -1,50 +1,46 @@
-import * as declare from "dojo/_base/declare";
+import { select as d3Select } from "@hpcc-js/common";
+import * as registry from "dijit/registry";
+import * as Tooltip from "dijit/Tooltip";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as lang from "dojo/_base/lang";
+import * as aspect from "dojo/aspect";
+import * as domClass from "dojo/dom-class";
+import * as domStyle from "dojo/dom-style";
+import * as Evented from "dojo/Evented";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
-import * as arrayUtil from "dojo/_base/array";
-import * as domClass from "dojo/dom-class";
-import * as domStyle from "dojo/dom-style";
-import * as Stateful from "dojo/Stateful";
-import * as query from "dojo/query";
 import * as json from "dojo/json";
-import * as aspect from "dojo/aspect";
-import * as Evented from "dojo/Evented";
 import * as on from "dojo/on";
+import * as query from "dojo/query";
+import * as Stateful from "dojo/Stateful";
 import * as Memory from "dojo/store/Memory";
 
-import * as registry from "dijit/registry";
-import * as Tooltip from "dijit/Tooltip";
-
-// @ts-ignore
-import * as DGrid from "dgrid/Grid";
 // @ts-ignore
-import * as OnDemandGrid from "dgrid/OnDemandGrid";
+import * as ColumnResizer from "dgrid/extensions/ColumnResizer";
 // @ts-ignore
-import * as CompoundColumns from 'dgrid/extensions/CompoundColumns';
+import * as CompoundColumns from "dgrid/extensions/CompoundColumns";
 // @ts-ignore
-import * as Keyboard from "dgrid/Keyboard";
+import * as DijitRegistry from "dgrid/extensions/DijitRegistry";
 // @ts-ignore
-import * as Selection from "dgrid/Selection";
+import * as DGrid from "dgrid/Grid";
 // @ts-ignore
-import * as ColumnResizer from "dgrid/extensions/ColumnResizer";
+import * as Keyboard from "dgrid/Keyboard";
 // @ts-ignore
-import * as ColumnHider from "dgrid/extensions/ColumnHider";
+import * as OnDemandGrid from "dgrid/OnDemandGrid";
 // @ts-ignore
-import * as DijitRegistry from "dgrid/extensions/DijitRegistry";
-
-import { select as d3Select } from "@hpcc-js/common";
-import { Pagination } from "./Pagination";
+import * as Selection from "dgrid/Selection";
 
-import { declareDecorator } from './DeclareDecorator';
+import { declareDecorator } from "./DeclareDecorator";
 import { userKeyValStore } from "./KeyValStore";
+import { Pagination } from "./Pagination";
 
 declare const dojo;
 
-var SingletonData = declare([Stateful], {
+const SingletonData = declare([Stateful], {
     //  Attributes  ---
-    _hasCompletedSetter: function (hasCompleted) {
+    _hasCompletedSetter(hasCompleted) {
         if (this.hasCompleted !== hasCompleted) {
             this.hasCompleted = hasCompleted;
             if (!this.hasCompleted) {
@@ -60,21 +56,21 @@ var SingletonData = declare([Stateful], {
     },
 
     //  Methods  ---
-    constructor: function (args) {
+    constructor(args) {
         this.__hpcc_changedCount = 0;
         this.__hpcc_changedCache = {};
     },
-    getData: function () {
+    getData() {
         if (this instanceof SingletonData) {
             return (SingletonData)(this);
         }
         return this;
     },
-    updateData: function (response) {
-        var changed = false;
-        for (var key in response) {
+    updateData(response) {
+        let changed = false;
+        for (const key in response) {
             if (response[key] !== undefined && response[key] !== null) {
-                var jsonStr = json.stringify(response[key]);
+                const jsonStr = json.stringify(response[key]);
                 if (this.__hpcc_changedCache[key] !== jsonStr) {
                     this.__hpcc_changedCache[key] = jsonStr;
                     this.set(key, response[key]);
@@ -86,7 +82,7 @@ var SingletonData = declare([Stateful], {
             try {
                 this.set("__hpcc_changedCount", this.get("__hpcc_changedCount") + 1);
             } catch (e) {
-                /*  __hpcc_changedCount can notify a dgrid instance that a row has changed.  
+                /*  __hpcc_changedCount can notify a dgrid instance that a row has changed.
                 *   There is an issue (TODO check issue number) with dgrid which can cause an exception to be thrown during the notify.
                 *   By catching these exceptions here normal execution can continue.
                 */
@@ -95,18 +91,18 @@ var SingletonData = declare([Stateful], {
     }
 });
 
-export var Monitor = declare(null, {
-    isMonitoring: function () {
+export let Monitor = declare(null, {
+    isMonitoring() {
         return this._timer && this._timer > 0;
     },
-    disableMonitor: function (disableMonitor) {
+    disableMonitor(disableMonitor) {
         this._disableMonitor = disableMonitor;
         if (!this._disableMonitor) {
             this.refresh();
             this.onMonitor();
         }
     },
-    startMonitor: function (aggressive) {
+    startMonitor(aggressive) {
         if (this.isMonitoring())
             return;
 
@@ -114,11 +110,11 @@ export var Monitor = declare(null, {
         this._timer = 1000;
         this.onMonitor();
     },
-    stopMonitor: function () {
+    stopMonitor() {
         this._timerTickCount = 0;
         this._timer = 0;
     },
-    onMonitor: function () {
+    onMonitor() {
         if (this._disableMonitor) {
             return;
         }
@@ -143,7 +139,7 @@ export var Monitor = declare(null, {
             }
         }
 
-        var context = this;
+        const context = this;
         if (this._timer) {
             setTimeout(function () {
                 context.onMonitor();
@@ -154,7 +150,7 @@ export var Monitor = declare(null, {
     }
 });
 
-var GridHelper = declare(null, {
+const GridHelper = declare(null, {
     allowTextSelection: true,
     noDataMessage: "<span class='dojoxGridNoData'>" + nlsHPCC.noDataMessage + "</span>",
     loadingMessage: "<span class='dojoxGridNoData'>" + nlsHPCC.loadingMessage + "</span>",
@@ -210,7 +206,7 @@ var GridHelper = declare(null, {
         }
     }),
 
-    onSelectionChanged: function (callback) {
+    onSelectionChanged(callback) {
         this.onSelectedChangedCallback = callback;
         this.on("dgrid-select, dgrid-deselect, dgrid-refresh-complete", function (event) {
             callback(event);
@@ -225,12 +221,12 @@ var GridHelper = declare(null, {
         });
     }),
 
-    setSelection: function (arrayOfIDs) {
+    setSelection(arrayOfIDs) {
         this.clearSelection();
-        var context = this;
+        const context = this;
         arrayUtil.forEach(arrayOfIDs, function (item, idx) {
             if (idx === 0) {
-                var row = context.row(item);
+                const row = context.row(item);
                 if (row.element) {
                     row.element.scrollIntoView();
                 }
@@ -239,12 +235,12 @@ var GridHelper = declare(null, {
         });
     },
 
-    setSelected: function (items) {
+    setSelected(items) {
         this.clearSelection();
-        var context = this;
+        const context = this;
         arrayUtil.forEach(items, function (item, idx) {
             if (idx === 0) {
-                var row = context.row(item);
+                const row = context.row(item);
                 if (row.element) {
                     row.element.scrollIntoView();
                 }
@@ -253,12 +249,12 @@ var GridHelper = declare(null, {
         });
     },
 
-    getSelected: function (store) {
+    getSelected(store) {
         if (!store) {
             store = this.store;
         }
-        var retVal = [];
-        for (var id in this.selection) {
+        const retVal = [];
+        for (const id in this.selection) {
             if (this.selection[id]) {
                 const rowItem = this.row(id);
                 const storeItem = store.get(id);
@@ -271,36 +267,36 @@ var GridHelper = declare(null, {
     }
 });
 
-export var LocalStorage = dojo.declare([Evented], {
-    constructor: function () {
-        var context = this;
+export let LocalStorage = dojo.declare([Evented], {
+    constructor() {
+        const context = this;
         if (typeof Storage !== void (0)) {
-            window.addEventListener('storage', function (event) {
-                context.emit('storageUpdate', { event });
+            window.addEventListener("storage", function (event) {
+                context.emit("storageUpdate", { event });
             });
         } else {
             console.log("Browser doesn't support multi-tab communication");
-        };
+        }
     },
 
-    setItem: function (key, value) {
+    setItem(key, value) {
         localStorage.setItem(key, value);
     },
-    removeItem: function (key) {
+    removeItem(key) {
         localStorage.removeItem(key);
     },
-    getItem: function (key, type) {
+    getItem(key, type) {
         return type === "Number" ? Number(localStorage.getItem(key)) : localStorage.getItem(key);
     },
-    clear: function () {
+    clear() {
         localStorage.clear();
     }
 });
 
 export function goToPageUserPreference(gridName, key) {
-    var store = userKeyValStore();
-    var defaultValue = 50;
-    var retVal = store.get(key).then(function(count){
+    const store = userKeyValStore();
+    let defaultValue = 50;
+    const retVal = store.get(key).then(function (count) {
         if (count) {
             defaultValue = +count;
             gridName.rowsPerPage = defaultValue;
@@ -308,9 +304,9 @@ export function goToPageUserPreference(gridName, key) {
         }
     });
 
-    aspect.after(gridName, 'gotoPage', function (deferred, args) {
+    aspect.after(gridName, "gotoPage", function (deferred, args) {
         return deferred.then(function () {
-            var currentGridValue = gridName.rowsPerPage;
+            const currentGridValue = gridName.rowsPerPage;
             if (defaultValue !== currentGridValue) {
                 store.set(key, currentGridValue);
             }
@@ -319,28 +315,28 @@ export function goToPageUserPreference(gridName, key) {
     return retVal;
 }
 
-export var MonitorLockClick = dojo.declare([Evented], {
-    unlocked: function () {
+export let MonitorLockClick = dojo.declare([Evented], {
+    unlocked() {
         this.emit("unlocked", {});
     },
-    locked: function () {
+    locked() {
         this.emit("locked", {});
     }
 });
 
-export var IdleWatcher = dojo.declare([Evented], {
-    constructor: function (idleDuration) {
+export let IdleWatcher = dojo.declare([Evented], {
+    constructor(idleDuration) {
         idleDuration = idleDuration || 30 * 1000;
         this._idleDuration = idleDuration;
     },
 
-    fireIdle: function () {
+    fireIdle() {
         this.emit("idle", { status: "firedIdle" });
     },
 
-    start: function () {
+    start() {
         this.stop();
-        var context = this;
+        const context = this;
         this._keydownHandle = on(document, "keydown", function (item, index, array) {
             context.emit("active", {});
             context.stop();
@@ -356,7 +352,7 @@ export var IdleWatcher = dojo.declare([Evented], {
         }, this._idleDuration);
     },
 
-    stop: function () {
+    stop() {
         if (this._intervalHandle) {
             clearInterval(this._intervalHandle);
             delete this._intervalHandle;
@@ -375,9 +371,9 @@ export var IdleWatcher = dojo.declare([Evented], {
 export const Singleton = SingletonData;
 
 export const FormHelper = declare(null, {
-    getISOString: function (dateField, timeField) {
-        var d = registry.byId(this.id + dateField).attr("value");
-        var t = registry.byId(this.id + timeField).attr("value");
+    getISOString(dateField, timeField) {
+        const d = registry.byId(this.id + dateField).attr("value");
+        const t = registry.byId(this.id + timeField).attr("value");
         if (d) {
             if (t) {
                 d.setHours(t.getHours() - d.getTimezoneOffset() / 60);
@@ -412,22 +408,25 @@ export class UndefinedMemory extends UndefinedMemoryBase {
     query(query: any, options: any) {
         if (options.sort !== undefined) {
             if (options.sort.length > 0) {
-                var sortSet = options.sort;
+                const sortSet = options.sort;
                 options.sort = function (a, b) {
-                    for (var sort, i = 0; sort = sortSet[i]; i++) {
-                        var aValue = a[sort.attribute];
-                        var bValue = b[sort.attribute];
+                    // tslint:disable-next-line: no-conditional-assignment
+                    for (let sort, i = 0; sort = sortSet[i]; i++) {
+                        let aValue = a[sort.attribute];
+                        let bValue = b[sort.attribute];
                         // valueOf enables proper comparison of dates
                         aValue = aValue != null ? aValue.valueOf() : aValue;
                         bValue = bValue != null ? bValue.valueOf() : bValue;
+                        // tslint:disable-next-line: triple-equals
                         if (aValue != bValue) {
                             if (aValue === undefined) return 1;     // Force "undefined" to bottom always
                             if (bValue === undefined) return -1;    // Force "undefined" to bottom always
+                            // tslint:disable-next-line: triple-equals
                             return !!sort.descending == (aValue == null || aValue > bValue) ? -1 : 1;
                         }
                     }
                     return 0;
-                }
+                };
             }
         }
         return super.query(query, options);
@@ -435,8 +434,8 @@ export class UndefinedMemory extends UndefinedMemoryBase {
 }
 
 export function Grid(pagination?, selection?, overrides?, compoundColumns?) {
-    var baseClass = [];
-    var params = {};
+    let baseClass = [];
+    const params = {};
     if (pagination) {
         baseClass = [DGrid, Pagination, ColumnResizer, Keyboard, DijitRegistry, CompoundColumns];
         lang.mixin(params, {
@@ -464,9 +463,9 @@ export function Grid(pagination?, selection?, overrides?, compoundColumns?) {
 }
 
 export function MonitorVisibility(widget, callback) {
-    //  There are many places that may cause the widget to be hidden, the possible places are calculated by walking the DOM hierarchy upwards. 
-    var watchList = {};
-    var domNode = widget.domNode;
+    //  There are many places that may cause the widget to be hidden, the possible places are calculated by walking the DOM hierarchy upwards.
+    const watchList = {};
+    let domNode = widget.domNode;
     while (domNode) {
         if (domNode.id) {
             watchList[domNode.id] = false;
@@ -475,7 +474,7 @@ export function MonitorVisibility(widget, callback) {
     }
 
     function isHidden() {
-        for (var key in watchList) {
+        for (const key in watchList) {
             if (watchList[key] === true) {
                 return true;
             }
@@ -483,7 +482,7 @@ export function MonitorVisibility(widget, callback) {
         return false;
     }
 
-    //  Hijack the dojo style class replacement call and monitor for elements in our watchList. 
+    //  Hijack the dojo style class replacement call and monitor for elements in our watchList.
     aspect.around(domClass, "replace", function (origFunc) {
         return function (node, addStyle, removeStyle) {
             if (node.firstChild && (node.firstChild.id in watchList)) {
@@ -506,18 +505,18 @@ export function MonitorVisibility(widget, callback) {
                 }
             }
             return origFunc(node, addStyle, removeStyle);
-        }
+        };
     });
 }
 
-var slice = Array.prototype.slice;
+const slice = Array.prototype.slice;
 export function override(method) {
-    var proxy;
+    let proxy;
 
     /** @this target object */
     proxy = function () {
-        var me = this;
-        var inherited = (this.getInherited && this.getInherited({
+        const me = this;
+        const inherited = (this.getInherited && this.getInherited({
             // emulating empty arguments
             callee: proxy,
             length: 0
@@ -542,10 +541,10 @@ export interface IMaximizeState {
     widgetResize: (size?: { l: number, t: number, w: number, h: number }) => void;
 }
 export function maximizeWidget(widget: any, max: boolean, prev?: IMaximizeState): IMaximizeState | undefined {
-    var stub = registry.byId("stub");
+    const stub = registry.byId("stub");
     if (stub.domNode !== widget.domNode) {
         if (max) {
-            var retVal: IMaximizeState = {
+            const retVal: IMaximizeState = {
                 parentNode: widget.domNode.parentNode,
                 nextElementSibling: widget.domNode.nextElementSibling,
                 stylePosition: domStyle.get(widget.domNode, "position"),

+ 158 - 159
esp/src/src/ESPWorkunit.ts

@@ -1,10 +1,10 @@
-import * as declare from "dojo/_base/declare";
-import * as arrayUtil from "dojo/_base/array";
+import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
+import * as Deferred from "dojo/_base/Deferred";
 import * as lang from "dojo/_base/lang";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
-import * as Deferred from "dojo/_base/Deferred";
 import * as all from "dojo/promise/all";
 import * as Observable from "dojo/store/Observable";
 import * as topic from "dojo/topic";
@@ -12,16 +12,16 @@ import * as topic from "dojo/topic";
 import { Workunit as HPCCWorkunit } from "@hpcc-js/comms";
 import { IEvent } from "@hpcc-js/util";
 
-import * as Utility from "./Utility";
-import * as WsWorkunits from "./WsWorkunits";
-import * as WsTopology from "./WsTopology";
-import * as ESPUtil from "./ESPUtil";
 import * as ESPRequest from "./ESPRequest";
 import * as ESPResult from "./ESPResult";
+import * as ESPUtil from "./ESPUtil";
+import * as Utility from "./Utility";
+import * as WsTopology from "./WsTopology";
+import * as WsWorkunits from "./WsWorkunits";
 
 declare const dojo;
 
-var _workunits = {};
+const _workunits = {};
 
 export function getStateIconClass(stateID: number, complete: boolean, archived: boolean): string {
     if (archived) {
@@ -113,7 +113,7 @@ export function getStateImageHTML(stateID: number, complete: boolean, archived:
     return Utility.getImageHTML(getStateImageName(stateID, complete, archived));
 }
 
-var Store = declare([ESPRequest.Store], {
+const Store = declare([ESPRequest.Store], {
     service: "WsWorkunits",
     action: "WUQuery",
     responseQualifier: "WUQueryResponse.Workunits.ECLWorkunit",
@@ -122,29 +122,29 @@ var Store = declare([ESPRequest.Store], {
     startProperty: "PageStartFrom",
     countProperty: "Count",
 
-    constructor: function () {
+    constructor() {
         this._watched = {};
     },
-    preRequest: function (request) {
+    preRequest(request) {
         if (request.Sortby && request.Sortby === "TotalClusterTime") {
             request.Sortby = "ClusterTime";
         }
         this.busy = true;
     },
-    preProcessFullResponse: function (response, request, query, options) {
+    preProcessFullResponse(response, request, query, options) {
         this.busy = false;
         this._toUnwatch = lang.mixin({}, this._watched);
     },
-    create: function (id) {
+    create(id) {
         return new Workunit({
             Wuid: id
         });
     },
-    update: function (id, item) {
-        var storeItem = this.get(id);
+    update(id, item) {
+        const storeItem = this.get(id);
         storeItem.updateData(item);
         if (!this._watched[id]) {
-            var context = this;
+            const context = this;
             this._watched[id] = storeItem.watch("__hpcc_changedCount", function (name, oldValue, newValue) {
                 if (oldValue !== newValue) {
                     context.notify(storeItem, id);
@@ -154,8 +154,8 @@ var Store = declare([ESPRequest.Store], {
             delete this._toUnwatch[id];
         }
     },
-    postProcessResults: function () {
-        for (var key in this._toUnwatch) {
+    postProcessResults() {
+        for (const key in this._toUnwatch) {
             this._toUnwatch[key].unwatch();
             delete this._watched[key];
         }
@@ -163,29 +163,29 @@ var Store = declare([ESPRequest.Store], {
     }
 });
 
-var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
+const Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
     i18n: nlsHPCC,
 
     //  Asserts  ---
-    _assertHasWuid: function () {
+    _assertHasWuid() {
         if (!this.Wuid) {
             throw new Error("Wuid cannot be empty.");
         }
     },
     //  Attributes  ---
-    _StateIDSetter: function (StateID) {
+    _StateIDSetter(StateID) {
         this.StateID = StateID;
-        var actionEx = lang.exists("ActionEx", this) ? this.ActionEx : null;
+        const actionEx = lang.exists("ActionEx", this) ? this.ActionEx : null;
         this.set("hasCompleted", WsWorkunits.isComplete(this.StateID, actionEx));
     },
-    _ActionExSetter: function (ActionEx) {
+    _ActionExSetter(ActionEx) {
         if (this.StateID) {
             this.ActionEx = ActionEx;
             this.set("hasCompleted", WsWorkunits.isComplete(this.StateID, this.ActionEx));
         }
     },
-    _hasCompletedSetter: function (completed) {
-        var justCompleted = !this.hasCompleted && completed;
+    _hasCompletedSetter(completed) {
+        const justCompleted = !this.hasCompleted && completed;
         this.hasCompleted = completed;
         if (justCompleted) {
             topic.publish("hpcc/ecl_wu_completed", this);
@@ -194,15 +194,15 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             this.startMonitor();
         }
     },
-    _VariablesSetter: function (Variables) {
+    _VariablesSetter(Variables) {
         this.set("variables", Variables.ECLResult);
     },
-    _ResultsSetter: function (Results) {
-        var results = [];
-        var sequenceResults = [];
-        var namedResults = {};
-        for (var i = 0; i < Results.ECLResult.length; ++i) {
-            var espResult = ESPResult.Get(lang.mixin({
+    _ResultsSetter(Results) {
+        const results = [];
+        const sequenceResults = [];
+        const namedResults = {};
+        for (let i = 0; i < Results.ECLResult.length; ++i) {
+            const espResult = ESPResult.Get(lang.mixin({
                 wu: this.wu,
                 Wuid: this.Wuid,
                 ResultViews: lang.exists("ResultViews.View", Results) ? Results.ResultViews.View : []
@@ -217,22 +217,22 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         this.set("sequenceResults", sequenceResults);
         this.set("namedResults", namedResults);
     },
-    _SourceFilesSetter: function (SourceFiles) {
-        var sourceFiles = [];
-        for (var i = 0; i < SourceFiles.ECLSourceFile.length; ++i) {
+    _SourceFilesSetter(SourceFiles) {
+        const sourceFiles = [];
+        for (let i = 0; i < SourceFiles.ECLSourceFile.length; ++i) {
             sourceFiles.push(ESPResult.Get(lang.mixin({ wu: this.wu, Wuid: this.Wuid, __hpcc_parentName: "" }, SourceFiles.ECLSourceFile[i])));
             if (lang.exists("ECLSourceFiles.ECLSourceFile", SourceFiles.ECLSourceFile[i])) {
-                for (var j = 0; j < SourceFiles.ECLSourceFile[i].ECLSourceFiles.ECLSourceFile.length; ++j) {
+                for (let j = 0; j < SourceFiles.ECLSourceFile[i].ECLSourceFiles.ECLSourceFile.length; ++j) {
                     sourceFiles.push(ESPResult.Get(lang.mixin({ wu: this.wu, Wuid: this.Wuid, __hpcc_parentName: SourceFiles.ECLSourceFile[i].Name }, SourceFiles.ECLSourceFile[i].ECLSourceFiles.ECLSourceFile[j])));
                 }
             }
         }
         this.set("sourceFiles", sourceFiles);
     },
-    _TimersSetter: function (Timers) {
-        var timers = [];
-        for (var i = 0; i < Timers.ECLTimer.length; ++i) {
-            var secs = Utility.espTime2Seconds(Timers.ECLTimer[i].Value);
+    _TimersSetter(Timers) {
+        const timers = [];
+        for (let i = 0; i < Timers.ECLTimer.length; ++i) {
+            const secs = Utility.espTime2Seconds(Timers.ECLTimer[i].Value);
             timers.push(lang.mixin(Timers.ECLTimer[i], {
                 __hpcc_id: i + 1,
                 Seconds: Math.round(secs * 1000) / 1000,
@@ -241,16 +241,16 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         }
         this.set("timers", timers);
     },
-    _ResourceURLsSetter: function (resourceURLs) {
-        var data = [];
+    _ResourceURLsSetter(resourceURLs) {
+        const data = [];
         arrayUtil.forEach(resourceURLs.URL, function (url, idx) {
-            var cleanedURL = url.split("\\").join("/");
-            var urlParts = cleanedURL.split("/");
-            var matchStr = "res/" + this.wu.Wuid + "/";
+            const cleanedURL = url.split("\\").join("/");
+            const urlParts = cleanedURL.split("/");
+            const matchStr = "res/" + this.wu.Wuid + "/";
             if (cleanedURL.indexOf(matchStr) === 0) {
-                var displayPath = cleanedURL.substr(matchStr.length);
-                var displayName = urlParts[urlParts.length - 1];
-                var row = {
+                const displayPath = cleanedURL.substr(matchStr.length);
+                const displayName = urlParts[urlParts.length - 1];
+                const row = {
                     __hpcc_id: idx,
                     DisplayName: displayName,
                     DisplayPath: displayPath,
@@ -262,26 +262,26 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         this.set("resourceURLs", data);
         this.set("resourceURLCount", data.length);
     },
-    _GraphsSetter: function (Graphs) {
+    _GraphsSetter(Graphs) {
         this.set("graphs", Graphs.ECLGraph);
     },
 
     //  Calculated "Helpers"  ---
-    _HelpersSetter: function (Helpers) {
+    _HelpersSetter(Helpers) {
         this.set("helpers", Helpers.ECLHelpFile);
         this.refreshHelpersCount();
     },
-    _ThorLogListSetter: function (ThorLogList) {
+    _ThorLogListSetter(ThorLogList) {
         this.set("thorLogInfo", ThorLogList.ThorLogInfo);
         this.getThorLogStatus(ThorLogList);
         this.refreshHelpersCount();
     },
-    _HasArchiveQuerySetter: function (HasArchiveQuery) {
+    _HasArchiveQuerySetter(HasArchiveQuery) {
         this.set("hasArchiveQuery", HasArchiveQuery);
         this.refreshHelpersCount();
     },
-    refreshHelpersCount: function () {
-        var eclwatchHelpersCount = 2;   //  ECL + Workunit XML are also helpers...
+    refreshHelpersCount() {
+        let eclwatchHelpersCount = 2;   //  ECL + Workunit XML are also helpers...
         if (this.helpers) {
             eclwatchHelpersCount += this.helpers.length;
         }
@@ -295,11 +295,11 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
     },
 
     //  ---  ---  ---
-    onCreate: function () {
+    onCreate() {
     },
-    onUpdate: function () {
+    onUpdate() {
     },
-    onSubmit: function () {
+    onSubmit() {
     },
     constructor: ESPUtil.override(function (inherited, args) {
         inherited(arguments);
@@ -309,53 +309,53 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         this.wu = this;
         this._hpccWU = HPCCWorkunit.attach({ baseUrl: "" }, this.Wuid);
     }),
-    isComplete: function () {
+    isComplete() {
         return this.hasCompleted;
     },
-    isFailed: function () {
+    isFailed() {
         return this.StateID === 4;
     },
-    isDeleted: function () {
+    isDeleted() {
         return this.StateID === 999;
     },
-    isBlocked: function () {
+    isBlocked() {
         return this.StateID === 8;
     },
-    isAbleToDeschedule: function () {
+    isAbleToDeschedule() {
         return this.EventSchedule === 2;
     },
-    isAbleToReschedule: function () {
+    isAbleToReschedule() {
         return this.EventSchedule === 1;
     },
-    isMonitoring: function (): boolean {
+    isMonitoring(): boolean {
         return !!this._hpccWatchHandle;
     },
-    disableMonitor: function (disableMonitor: boolean) {
+    disableMonitor(disableMonitor: boolean) {
         if (disableMonitor) {
             this.stopMonitor();
         } else {
             this.startMonitor();
         }
     },
-    startMonitor: function () {
+    startMonitor() {
         if (this.isMonitoring())
             return;
         this._hpccWatchHandle = this._hpccWU.watch((changes: IEvent[]) => {
             this.updateData(this._hpccWU.properties);
         }, true);
     },
-    stopMonitor: function () {
+    stopMonitor() {
         if (this._hpccWatchHandle) {
             this._hpccWatchHandle.release();
             delete this._hpccWatchHandle;
         }
     },
-    monitor: function (callback) {
+    monitor(callback) {
         if (callback) {
             callback(this);
         }
         if (!this.hasCompleted) {
-            var context = this;
+            const context = this;
             if (this._watchHandle) {
                 this._watchHandle.unwatch();
             }
@@ -368,18 +368,18 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             });
         }
     },
-    doDeschedule: function () {
+    doDeschedule() {
         return this._action("Deschedule").then(function (response) {
         });
     },
-    doReschedule: function () {
+    doReschedule() {
         return this._action("Reschedule").then(function (response) {
         });
     },
-    create: function (ecl) {
-        var context = this;
+    create(ecl) {
+        const context = this;
         WsWorkunits.WUCreate({
-            load: function (response) {
+            load(response) {
                 if (lang.exists("Exceptions.Exception", response)) {
                     dojo.publish("hpcc/brToaster", {
                         message: "<h4>" + response.Exceptions.Source + "</h4>" + "<p>" + response.Exceptions.Exception[0].Message + "</p>",
@@ -397,7 +397,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             }
         });
     },
-    update: function (request, appData) {
+    update(request, appData) {
         this._assertHasWuid();
         lang.mixin(request, {
             Wuid: this.Wuid
@@ -412,10 +412,10 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             ApplicationValues: appData
         });
 
-        var context = this;
+        const context = this;
         WsWorkunits.WUUpdate({
-            request: request,
-            load: function (response) {
+            request,
+            load(response) {
                 if (lang.exists("Exceptions.Exception", response)) {
                     dojo.publish("hpcc/brToaster", {
                         message: "<h4>" + response.Exceptions.Source + "</h4>" + "<p>" + response.Exceptions.Exception[0].Message + "</p>",
@@ -429,17 +429,17 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             }
         });
     },
-    submit: function (target) {
+    submit(target) {
         this._assertHasWuid();
-        var context = this;
-        var deferred = new Deferred()
+        const context = this;
+        const deferred = new Deferred();
         deferred.promise.then(function (target) {
             WsWorkunits.WUSubmit({
                 request: {
                     Wuid: context.Wuid,
                     Cluster: target
                 },
-                load: function (response) {
+                load(response) {
                     context.onSubmit();
                 }
             });
@@ -455,9 +455,9 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             });
         }
     },
-    _resubmit: function (clone, resetWorkflow) {
+    _resubmit(clone, resetWorkflow) {
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         return WsWorkunits.WUResubmit({
             request: {
                 Wuids: this.Wuid,
@@ -469,11 +469,11 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return response;
         });
     },
-    clone: function () {
-        var context = this;
+    clone() {
+        const context = this;
         this._resubmit(true, false).then(function (response) {
             if (!lang.exists("Exceptions.Source", response)) {
-                var msg = "";
+                let msg = "";
                 if (lang.exists("WUResubmitResponse.WUs.WU", response) && response.WUResubmitResponse.WUs.WU.length) {
                     msg = context.i18n.ClonedWUID + ":  " + response.WUResubmitResponse.WUs.WU[0].WUID;
                     topic.publish("hpcc/ecl_wu_created", {
@@ -489,8 +489,8 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return response;
         });
     },
-    resubmit: function () {
-        var context = this;
+    resubmit() {
+        const context = this;
         this._resubmit(false, true).then(function (response) {
             if (!lang.exists("Exceptions.Source", response)) {
                 dojo.publish("hpcc/brToaster", {
@@ -504,8 +504,8 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return response;
         });
     },
-    recover: function () {
-        var context = this;
+    recover() {
+        const context = this;
         this._resubmit(false, false).then(function (response) {
             if (!lang.exists("Exceptions.Source", response)) {
                 dojo.publish("hpcc/brToaster", {
@@ -519,42 +519,42 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return response;
         });
     },
-    _action: function (action) {
+    _action(action) {
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         return WsWorkunits.WUAction([{ Wuid: this.Wuid }], action, {
-            load: function (response) {
+            load(response) {
                 context.refresh();
             }
         });
     },
-    setToFailed: function () {
+    setToFailed() {
         return this._action("setToFailed");
     },
-    pause: function () {
+    pause() {
         return this._action("Pause");
     },
-    pauseNow: function () {
+    pauseNow() {
         return this._action("PauseNow");
     },
-    resume: function () {
+    resume() {
         return this._action("Resume");
     },
-    abort: function () {
+    abort() {
         return this._action("Abort");
     },
-    doDelete: function () {
+    doDelete() {
         return this._action("Delete").then(function (response) {
         });
     },
 
-    restore: function () {
+    restore() {
         return this._action("Restore");
     },
 
-    publish: function (jobName, remoteDali, sourceProcess, priority, comment, allowForeign, updateSupers) {
+    publish(jobName, remoteDali, sourceProcess, priority, comment, allowForeign, updateSupers) {
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         WsWorkunits.WUPublishWorkunit({
             request: {
                 Wuid: this.Wuid,
@@ -569,20 +569,20 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
                 UpdateWorkUnitName: 1,
                 Wait: 5000
             },
-            load: function (response) {
+            load(response) {
                 context.updateData(response.WUPublishWorkunitResponse);
             }
         });
     },
-    refresh: function (full) {
+    refresh(full) {
         return this._hpccWU.refresh(full || this.Archived || this.__hpcc_changedCount === 0).then(wu => {
             this.updateData(wu.properties);
             return wu.properties;
         });
     },
-    getQuery: function () {
+    getQuery() {
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         return WsWorkunits.WUQuery({
             request: {
                 Wuid: this.Wuid
@@ -596,9 +596,9 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return response;
         });
     },
-    getInfo: function (args) {
+    getInfo(args) {
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         return WsWorkunits.WUInfo({
             request: {
                 Wuid: this.Wuid,
@@ -633,7 +633,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
                         Exceptions: {
                             ECLException: []
                         }
-                    })
+                    });
                 }
                 context.updateData(response.WUInfoResponse.Workunit);
 
@@ -669,10 +669,10 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
                 }
                 if (args.onGetGraphs && lang.exists("graphs", context)) {
                     if (context.timers || lang.exists("ApplicationValues.ApplicationValue", context)) {
-                        for (var i = 0; i < context.graphs.length; ++i) {
+                        for (let i = 0; i < context.graphs.length; ++i) {
                             if (context.timers) {
                                 context.graphs[i].Time = 0;
-                                for (var j = 0; j < context.timers.length; ++j) {
+                                for (let j = 0; j < context.timers.length; ++j) {
                                     if (context.timers[j].GraphName === context.graphs[i].Name && !context.timers[j].HasSubGraphId) {
                                         context.graphs[i].Time = context.timers[j].Seconds;
                                         break;
@@ -681,7 +681,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
                                 context.graphs[i].Time = Math.round(context.graphs[i].Time * 1000) / 1000;
                             }
                             if (lang.exists("ApplicationValues.ApplicationValue", context)) {
-                                var idx = context.getApplicationValueIndex("ESPWorkunit.js", context.graphs[i].Name + "_SVG");
+                                const idx = context.getApplicationValueIndex("ESPWorkunit.js", context.graphs[i].Name + "_SVG");
                                 if (idx >= 0) {
                                     context.graphs[i].svg = context.ApplicationValues.ApplicationValue[idx].Value;
                                 }
@@ -702,9 +702,9 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             return response;
         });
     },
-    getGraphIndex: function (name) {
+    getGraphIndex(name) {
         if (this.graphs) {
-            for (var i = 0; i < this.graphs.length; ++i) {
+            for (let i = 0; i < this.graphs.length; ++i) {
                 if (this.graphs[i].Name === name) {
                     return i;
                 }
@@ -712,8 +712,8 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         }
         return -1;
     },
-    getGraphTimers: function (name) {
-        var retVal = [];
+    getGraphTimers(name) {
+        const retVal = [];
         arrayUtil.forEach(this.timers, function (timer, idx) {
             if (timer.HasSubGraphId && timer.GraphName === name) {
                 retVal.push(timer);
@@ -721,9 +721,9 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         }, this);
         return retVal;
     },
-    getApplicationValueIndex: function (application, name) {
+    getApplicationValueIndex(application, name) {
         if (lang.exists("ApplicationValues.ApplicationValue", this)) {
-            for (var i = 0; i < this.ApplicationValues.ApplicationValue.length; ++i) {
+            for (let i = 0; i < this.ApplicationValues.ApplicationValue.length; ++i) {
                 if (this.ApplicationValues.ApplicationValue[i].Application === application && this.ApplicationValues.ApplicationValue[i].Name === name) {
                     return i;
                 }
@@ -731,38 +731,38 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         }
         return -1;
     },
-    getThorLogStatus: function (ThorLogList) {
+    getThorLogStatus(ThorLogList) {
         return ThorLogList.ThorLogInfo.length > 0 ? true : false;
     },
-    getState: function () {
+    getState() {
         return this.State;
     },
-    getStateIconClass: function () {
+    getStateIconClass() {
         return getStateIconClass(this.StateID, this.isComplete(), this.Archived);
     },
-    getStateImageName: function () {
+    getStateImageName() {
         return getStateImageName(this.StateID, this.isComplete(), this.Archived);
     },
-    getStateImage: function () {
+    getStateImage() {
         return getStateImage(this.StateID, this.isComplete(), this.Archived);
     },
-    getStateImageHTML: function () {
+    getStateImageHTML() {
         return getStateImageHTML(this.StateID, this.isComplete(), this.Archived);
     },
-    getProtectedImageName: function () {
+    getProtectedImageName() {
         if (this.Protected) {
             return "locked.png";
         }
         return "unlocked.png";
     },
-    getProtectedImage: function () {
+    getProtectedImage() {
         return Utility.getImageURL(this.getProtectedImageName());
     },
-    getProtectedHTML: function () {
+    getProtectedHTML() {
         return Utility.getImageHTML(this.getProtectedImageName());
     },
-    fetchText: function (onFetchText) {
-        var context = this;
+    fetchText(onFetchText) {
+        const context = this;
         if (lang.exists("Query.Text", context)) {
             onFetchText(this.Query.Text);
             return;
@@ -772,26 +772,26 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onGetText: onFetchText
         });
     },
-    fetchXML: function (onFetchXML) {
+    fetchXML(onFetchXML) {
         if (this.xml) {
             onFetchXML(this.xml);
             return;
         }
 
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         WsWorkunits.WUFile({
             request: {
                 Wuid: this.Wuid,
                 Type: "XML"
             },
-            load: function (response) {
+            load(response) {
                 context.xml = response;
                 onFetchXML(response);
             }
         });
     },
-    fetchResults: function (onFetchResults) {
+    fetchResults(onFetchResults) {
         if (this.results && this.results.length) {
             onFetchResults(this.results);
             return;
@@ -801,16 +801,16 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onGetResults: onFetchResults
         });
     },
-    fetchNamedResults: function (resultNames, row, count) {
-        var deferred = new Deferred();
-        var context = this;
+    fetchNamedResults(resultNames, row, count) {
+        const deferred = new Deferred();
+        const context = this;
         this.fetchResults(function (results) {
-            var resultContents = [];
+            const resultContents = [];
             arrayUtil.forEach(resultNames, function (item, idx) {
                 resultContents.push(context.namedResults[item].fetchContent(row, count));
             });
             all(resultContents).then(function (resultContents) {
-                var results = [];
+                const results = [];
                 arrayUtil.forEach(resultContents, function (item, idx) {
                     results[resultNames[idx]] = item;
                 });
@@ -819,11 +819,11 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         });
         return deferred.promise;
     },
-    fetchAllNamedResults: function (row, count) {
-        var deferred = new Deferred();
-        var context = this;
+    fetchAllNamedResults(row, count) {
+        const deferred = new Deferred();
+        const context = this;
         this.fetchResults(function (results) {
-            var resultNames = [];
+            const resultNames = [];
             arrayUtil.forEach(results, function (item, idx) {
                 resultNames.push(item.Name);
             });
@@ -833,7 +833,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         });
         return deferred.promise;
     },
-    fetchSequenceResults: function (onFetchSequenceResults) {
+    fetchSequenceResults(onFetchSequenceResults) {
         if (this.sequenceResults && this.sequenceResults.length) {
             onFetchSequenceResults(this.sequenceResults);
             return;
@@ -843,7 +843,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onGetSequenceResults: onFetchSequenceResults
         });
     },
-    fetchSourceFiles: function (onFetchSourceFiles) {
+    fetchSourceFiles(onFetchSourceFiles) {
         if (this.sourceFiles && this.sourceFiles.length) {
             onFetchSourceFiles(this.sourceFiles);
             return;
@@ -853,7 +853,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onGetSourceFiles: onFetchSourceFiles
         });
     },
-    fetchTimers: function (onFetchTimers) {
+    fetchTimers(onFetchTimers) {
         if (this.timers && this.timers.length) {
             onFetchTimers(this.timers);
             return;
@@ -863,7 +863,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onGetTimers: onFetchTimers
         });
     },
-    fetchGraphs: function (onFetchGraphs) {
+    fetchGraphs(onFetchGraphs) {
         if (this.graphs && this.graphs.length) {
             onFetchGraphs(this.graphs);
             return;
@@ -873,8 +873,8 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onGetGraphs: onFetchGraphs
         });
     },
-    fetchGraphXgmmlByName: function (name, subGraphId, onFetchGraphXgmml, force) {
-        var idx = this.getGraphIndex(name);
+    fetchGraphXgmmlByName(name, subGraphId, onFetchGraphXgmml, force) {
+        const idx = this.getGraphIndex(name);
         if (idx >= 0) {
             this.fetchGraphXgmml(idx, subGraphId, onFetchGraphXgmml, force);
         } else {
@@ -888,7 +888,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             onFetchGraphXgmml("", "");
         }
     },
-    fetchGraphXgmml: function (idx, subGraphId, onFetchGraphXgmml, force) {
+    fetchGraphXgmml(idx, subGraphId, onFetchGraphXgmml, force) {
         if (!force && !subGraphId && this.graphs && this.graphs[idx] && this.graphs[idx].xgmml) {
             onFetchGraphXgmml(this.graphs[idx].xgmml, this.graphs[idx].svg);
             return;
@@ -898,7 +898,7 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
         }
 
         this._assertHasWuid();
-        var context = this;
+        const context = this;
         WsWorkunits.WUGetGraph({
             request: {
                 Wuid: this.Wuid,
@@ -932,31 +932,30 @@ var Workunit = declare([ESPUtil.Singleton], {  // jshint ignore:line
             }
         });
     },
-    setGraphSvg: function (graphName, svg) {
-        var idx = this.getGraphIndex(graphName);
+    setGraphSvg(graphName, svg) {
+        const idx = this.getGraphIndex(graphName);
         if (idx >= 0) {
             this.graphs[idx].svg = svg;
-            var appData = [];
+            const appData = [];
             appData[graphName + "_SVG"] = svg;
             this.update({}, appData);
         }
     }
 });
 
-
 export function isInstanceOfWorkunit(obj) {
     return obj && obj.isInstanceOf && obj.isInstanceOf(Workunit);
 }
 
 export function Create(params) {
-    var retVal = new Workunit(params);
+    const retVal = new Workunit(params);
     retVal.create();
     return retVal;
 }
 
 export function Get(wuid, data?) {
-    var store = new Store();
-    var retVal = store.get(wuid);
+    const store = new Store();
+    const retVal = store.get(wuid);
     if (data) {
         retVal.updateData(data);
     }
@@ -964,6 +963,6 @@ export function Get(wuid, data?) {
 }
 
 export function CreateWUQueryStore(options) {
-    var store = new Store(options);
+    const store = new Store(options);
     return Observable(store);
 }

+ 46 - 47
esp/src/src/FileSpray.ts

@@ -1,24 +1,24 @@
+import * as arrayUtil from "dojo/_base/array";
 import * as declare from "dojo/_base/declare";
 import * as lang from "dojo/_base/lang";
-import * as arrayUtil from "dojo/_base/array";
-import * as QueryResults from "dojo/store/util/QueryResults";
 import * as Observable from "dojo/store/Observable";
+import * as QueryResults from "dojo/store/util/QueryResults";
 
 import * as ESPRequest from "./ESPRequest";
 import * as ESPUtil from "./ESPUtil";
 
 declare const dojo;
 
-var FileListStore = declare([ESPRequest.Store], {
+const FileListStore = declare([ESPRequest.Store], {
     service: "FileSpray",
     action: "FileList",
     responseQualifier: "FileListResponse.files.PhysicalFileStruct",
     idProperty: "calculatedID",
-    create: function (id) {
-        var retVal = {
-            lfEncode: function (path) {
-                var retVal = "";
-                for (var i = 0; i < path.length; ++i) {
+    create(id) {
+        const retVal = {
+            lfEncode(path) {
+                let retVal = "";
+                for (let i = 0; i < path.length; ++i) {
                     switch (path[i]) {
                         case "/":
                         case "\\":
@@ -58,29 +58,29 @@ var FileListStore = declare([ESPRequest.Store], {
                 }
                 return retVal;
             },
-            getLogicalFile: function () {
+            getLogicalFile() {
                 return "~file::" + this.NetAddress + this.lfEncode(this.fullPath);
             }
         };
         retVal[this.idProperty] = id;
         return retVal;
     },
-    preProcessRow: function (row) {
-        var fullPath = this.parent.fullPath + row.name + (row.isDir ? "/" : "");
-        var fullFolderPathParts = fullPath.split("/");
+    preProcessRow(row) {
+        const fullPath = this.parent.fullPath + row.name + (row.isDir ? "/" : "");
+        const fullFolderPathParts = fullPath.split("/");
         fullFolderPathParts.pop();
         lang.mixin(row, {
             calculatedID: this.parent.NetAddress + fullPath,
             NetAddress: this.parent.NetAddress,
             OS: this.parent.OS,
-            fullPath: fullPath,
+            fullPath,
             fullFolderPath: fullFolderPathParts.join("/"),
             DropZone: this.parent.DropZone,
             displayName: row.name,
             type: row.isDir ? "folder" : "file"
         });
     },
-    postProcessResults: function (items) {
+    postProcessResults(items) {
         items.sort(function (l, r) {
             if (l.isDir === r.isDir) {
                 if (l.displayName === r.displayName)
@@ -96,18 +96,18 @@ var FileListStore = declare([ESPRequest.Store], {
     }
 });
 
-var LandingZonesFilterStore = declare([ESPRequest.Store], {
+const LandingZonesFilterStore = declare([ESPRequest.Store], {
     service: "FileSpray",
     action: "DropZoneFileSearch",
     responseQualifier: "DropZoneFileSearchResponse.Files.PhysicalFileStruct",
     idProperty: "calculatedID",
-    constructor: function (options) {
+    constructor(options) {
         if (options) {
             declare.safeMixin(this, options);
         }
     },
-    preProcessRow: function (row) {
-        var fullPath = this.dropZone.machine.Directory + "/" + (row.Path === null ? "" : (row.Path + "/"));
+    preProcessRow(row) {
+        const fullPath = this.dropZone.machine.Directory + "/" + (row.Path === null ? "" : (row.Path + "/"));
         lang.mixin(row, {
             NetAddress: this.dropZone.machine.Netaddress,
             Directory: this.dropZone.machine.Directory,
@@ -120,12 +120,12 @@ var LandingZonesFilterStore = declare([ESPRequest.Store], {
     }
 });
 
-var LandingZonesStore = declare([ESPRequest.Store], {
+const LandingZonesStore = declare([ESPRequest.Store], {
     service: "WsTopology",
     action: "TpDropZoneQuery",
     responseQualifier: "TpDropZoneQueryResponse.TpDropZones.TpDropZone",
     idProperty: "calculatedID",
-    constructor: function (options) {
+    constructor(options) {
         if (options) {
             declare.safeMixin(this, options);
         }
@@ -135,36 +135,36 @@ var LandingZonesStore = declare([ESPRequest.Store], {
         if (!query.filter) {
             return inherited(query, options);
         }
-        var landingZonesFilterStore = new LandingZonesFilterStore({ dropZone: query.filter.__dropZone, server: query.filter.Server });
+        const landingZonesFilterStore = new LandingZonesFilterStore({ dropZone: query.filter.__dropZone, server: query.filter.Server });
         delete query.filter.__dropZone;
         return landingZonesFilterStore.query(query.filter, options);
     }),
-    addUserFile: function (_file) {
+    addUserFile(_file) {
         //  Just add a file "reference" so it can be remotely sprayed etc.
-        var fileListStore = new FileListStore({
+        const fileListStore = new FileListStore({
             parent: null
         });
         _file._isUserFile = true;
-        var file = fileListStore.get(_file.calculatedID);
+        const file = fileListStore.get(_file.calculatedID);
         fileListStore.update(_file.calculatedID, _file);
         this.userAddedFiles[file.calculatedID] = file;
     },
-    removeUserFile: function (_file) {
-        var fileListStore = new FileListStore({
+    removeUserFile(_file) {
+        const fileListStore = new FileListStore({
             parent: null
         });
         fileListStore.remove(_file.calculatedID);
         delete this.userAddedFiles[_file.calculatedID];
     },
-    postProcessResults: function (items) {
-        for (var key in this.userAddedFiles) {
+    postProcessResults(items) {
+        for (const key in this.userAddedFiles) {
             items.push(this.userAddedFiles[key]);
         }
     },
-    preRequest: function (request) {
-        request.ECLWatchVisibleOnly = true
+    preRequest(request) {
+        request.ECLWatchVisibleOnly = true;
     },
-    preProcessRow: function (row) {
+    preProcessRow(row) {
         lang.mixin(row, {
             OS: row.Linux === "true" ? 2 : 0
         });
@@ -176,7 +176,7 @@ var LandingZonesStore = declare([ESPRequest.Store], {
             DropZone: row
         });
     },
-    mayHaveChildren: function (item) {
+    mayHaveChildren(item) {
         switch (item.type) {
             case "dropzone":
             case "folder":
@@ -185,8 +185,8 @@ var LandingZonesStore = declare([ESPRequest.Store], {
         }
         return false;
     },
-    getChildren: function (parent, options) {
-        var children = [];
+    getChildren(parent, options) {
+        const children = [];
         if (parent.TpMachines) {
             arrayUtil.forEach(parent.TpMachines.TpMachine, function (item, idx) {
                 children.push({
@@ -204,8 +204,8 @@ var LandingZonesStore = declare([ESPRequest.Store], {
             });
             return QueryResults(children);
         } else if (parent.isMachine || parent.isDir) {
-            var store = Observable(new FileListStore({
-                parent: parent
+            const store = Observable(new FileListStore({
+                parent
             }));
             return store.query({
                 Netaddr: parent.NetAddress,
@@ -217,14 +217,13 @@ var LandingZonesStore = declare([ESPRequest.Store], {
     }
 });
 
-export var LogFileStore = declare([ESPRequest.Store], {
+export let LogFileStore = declare([ESPRequest.Store], {
     service: "FileSpray",
     action: "FileList",
     responseQualifier: "FileListResponse.files.PhysicalFileStruct",
     idProperty: ""
 });
 
-
 export const States = {
     0: "unknown",
     1: "scheduled",
@@ -291,17 +290,17 @@ export const FormatMessages = {
 };
 
 export function CreateLandingZonesStore(options) {
-    var store = new LandingZonesStore(options);
+    const store = new LandingZonesStore(options);
     return Observable(store);
 }
 
 export function CreateFileListStore(options) {
-    var store = new FileListStore(options);
+    const store = new FileListStore(options);
     return Observable(store);
 }
 
 export function CreateLandingZonesFilterStore(options) {
-    var store = new LandingZonesFilterStore(options);
+    const store = new LandingZonesFilterStore(options);
     return Observable(store);
 }
 
@@ -310,15 +309,15 @@ export function GetDFUWorkunits(params) {
 }
 
 export function DFUWorkunitsAction(workunits, actionType, callback) {
-    var request = {
+    const request = {
         wuids: workunits,
         Type: actionType
     };
     ESPRequest.flattenArray(request, "wuids", "ID");
 
     return ESPRequest.send("FileSpray", "DFUWorkunitsAction", {
-        request: request,
-        load: function (response) {
+        request,
+        load(response) {
             arrayUtil.forEach(workunits, function (item, index) {
                 item.refresh();
             });
@@ -344,7 +343,7 @@ export function DFUWorkunitsAction(workunits, actionType, callback) {
                 callback.load(response);
             }
         },
-        error: function (err) {
+        error(err) {
             if (callback && callback.error) {
                 callback.error(err);
             }
@@ -411,8 +410,8 @@ export function DeleteDropZoneFile(params) {
     // Single File Only
     return ESPRequest.send("FileSpray", "DeleteDropZoneFiles", params).then(function (response) {
         if (lang.exists("DFUWorkunitsActionResponse.DFUActionResults.DFUActionResult", response)) {
-            var resultID = response.DFUWorkunitsActionResponse.DFUActionResults.DFUActionResult[0].ID;
-            var resultMessage = response.DFUWorkunitsActionResponse.DFUActionResults.DFUActionResult[0].Result;
+            const resultID = response.DFUWorkunitsActionResponse.DFUActionResults.DFUActionResult[0].ID;
+            const resultMessage = response.DFUWorkunitsActionResponse.DFUActionResults.DFUActionResult[0].Result;
             if (resultMessage.indexOf("Success") === 0) {
                 dojo.publish("hpcc/brToaster", {
                     Severity: "Message",

+ 5 - 5
esp/src/src/Graph7Widget.ts

@@ -1,15 +1,15 @@
 import * as lang from "dojo/_base/lang";
+import * as aspect from "dojo/aspect";
+import * as dom from "dojo/dom";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
-import * as aspect from "dojo/aspect";
-import * as dom from "dojo/dom";
 
 import * as registry from "dijit/registry";
 
-import { hashSum } from "@hpcc-js/util";
 import { ScopeGraph, Workunit } from "@hpcc-js/comms";
 import { Graph as GraphWidget, Subgraph, Vertex } from "@hpcc-js/graph";
+import { hashSum } from "@hpcc-js/util";
 
 // @ts-ignore
 import * as _Widget from "hpcc/_Widget";
@@ -22,7 +22,7 @@ import "dijit/layout/ContentPane";
 import "dijit/Toolbar";
 import "dijit/ToolbarSeparator";
 
-import { declareDecorator } from './DeclareDecorator';
+import { declareDecorator } from "./DeclareDecorator";
 import { WUScopeController } from "./WUScopeController";
 
 type _Widget = {
@@ -239,7 +239,7 @@ export class Graph7Widget {
                         break;
                 }
             });
-        ;
+
         this._graph.tooltipHTML((v: Vertex) => {
             return this._gc.calcGraphTooltip2(v);
         });

+ 16 - 14
esp/src/src/GraphStore.ts

@@ -1,7 +1,7 @@
-import * as lang from "dojo/_base/lang";
 import * as arrayUtil from "dojo/_base/array";
+import * as lang from "dojo/_base/lang";
 import * as QueryResults from "dojo/store/util/QueryResults";
-import {UndefinedMemory} from "./ESPUtil";
+import { UndefinedMemory } from "./ESPUtil";
 
 export class GraphStore extends UndefinedMemory {
     idProperty: string;
@@ -19,17 +19,19 @@ export class GraphStore extends UndefinedMemory {
     }
 
     query(query, options) {
-        var retVal = super.query(query, options);
-        var sortSet = options && options.sort;
+        const retVal = super.query(query, options);
+        const sortSet = options && options.sort;
         if (sortSet) {
             retVal.sort(typeof sortSet === "function" ? sortSet : function (a, b) {
-                for (var sort, i = 0; sort = sortSet[i]; i++) {
-                    var aValue = a[sort.attribute];
-                    var bValue = b[sort.attribute];
+                // tslint:disable-next-line: no-conditional-assignment
+                for (let sort, i = 0; sort = sortSet[i]; i++) {
+                    let aValue = a[sort.attribute];
+                    let bValue = b[sort.attribute];
                     // valueOf enables proper comparison of dates
                     aValue = aValue != null ? aValue.valueOf() : aValue;
                     bValue = bValue != null ? bValue.valueOf() : bValue;
                     if (aValue !== bValue) {
+                        // tslint:disable-next-line: triple-equals
                         return !!sort.descending == (bValue == null || aValue > bValue) ? -1 : 1;   // jshint ignore:line
                     }
                 }
@@ -46,7 +48,7 @@ export class GraphStore extends UndefinedMemory {
 
     calcColumns() {
         arrayUtil.forEach(this.data, function (item, idx) {
-            for (var key in item) {
+            for (const key in item) {
                 if (key !== "id" && key.substring(0, 1) !== "_") {
                     if (!this.cacheColumns[key]) {
                         this.cacheColumns[key] = item[key].length;
@@ -62,7 +64,7 @@ export class GraphStore extends UndefinedMemory {
     }
 
     getColumnWidth(key) {
-        var width = this.cacheColumns[key] * 9;
+        let width = this.cacheColumns[key] * 9;
         if (width < 27) {
             width = 27;
         } else if (width > 300) {
@@ -78,7 +80,7 @@ export class GraphStore extends UndefinedMemory {
         if (!lowPriority) {
             lowPriority = [];
         }
-        var skip = skip || [];
+        skip = skip || [];
         arrayUtil.forEach(target, function (item, idx) {
             skip.push(item.field);
         });
@@ -89,7 +91,7 @@ export class GraphStore extends UndefinedMemory {
                 });
             }
         }, this);
-        for (var key in this.cacheColumns) {
+        for (const key in this.cacheColumns) {
             if (skip.indexOf(key) === -1 && highPriority.indexOf(key) === -1 && lowPriority.indexOf(key) === -1 && key.substring(0, 1) !== "_") {
                 target.push({
                     field: key, label: key, width: this.getColumnWidth(key)
@@ -108,7 +110,7 @@ export class GraphStore extends UndefinedMemory {
                 if (column.label.indexOf("Time") === 0 || column.label.indexOf("Size") === 0 || column.label.indexOf("Skew") === 0) {
                     column.formatter = function (_id, row) {
                         return row["_" + column.field] || "";
-                    }
+                    };
                 }
             });
         }
@@ -146,7 +148,7 @@ export class GraphTreeStore extends GraphStore {
             }
             this.add(item);
 
-            for (var key in item) {
+            for (const key in item) {
                 if (key !== "id" && key.substring(0, 1) !== "_") {
                     if (!this.cacheColumns[key]) {
                         this.cacheColumns[key] = item[key].length;
@@ -167,7 +169,7 @@ export class GraphTreeStore extends GraphStore {
     }
 
     getChildren(parent, options) {
-        var filter = {};
+        let filter = {};
         if (options.originalQuery.__hpcc_notActivity) {
             filter = {
                 __hpcc_notActivity: true

+ 46 - 46
esp/src/src/GraphTree7Widget.ts

@@ -1,48 +1,48 @@
+import * as arrayUtil from "dojo/_base/array";
 import * as declare from "dojo/_base/declare";
 import * as lang from "dojo/_base/lang";
+import * as aspect from "dojo/aspect";
+import * as dom from "dojo/dom";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
-import * as arrayUtil from "dojo/_base/array";
-import * as aspect from "dojo/aspect";
-import * as dom from "dojo/dom";
 import * as topic from "dojo/topic";
 
 import * as registry from "dijit/registry";
 
-import { hashSum } from "@hpcc-js/util";
 import { ScopeGraph, Workunit } from "@hpcc-js/comms";
 import { Graph as GraphWidget, Subgraph, Vertex } from "@hpcc-js/graph";
+import { hashSum } from "@hpcc-js/util";
 
 // @ts-ignore
 import * as _Widget from "hpcc/_Widget";
+import { declareDecorator } from "./DeclareDecorator";
 import { Grid, maximizeWidget } from "./ESPUtil";
-import * as WsWorkunits from "./WsWorkunits";
-import { debounce, getImageURL, Persist } from "./Utility";
-import { declareDecorator } from './DeclareDecorator';
-import { WUScopeController } from "./WUScopeController";
 import { GraphStore, GraphTreeStore } from "./GraphStore";
+import { debounce, getImageURL, Persist } from "./Utility";
+import * as WsWorkunits from "./WsWorkunits";
 import { WUGraphLegend } from "./WUGraphLegend";
+import { WUScopeController } from "./WUScopeController";
 
 // @ts-ignore
 import * as template from "dojo/text!hpcc/templates/GraphTree7Widget.html";
 
-import "dijit/layout/BorderContainer";
-import "dijit/layout/ContentPane";
+import "dijit/Fieldset";
 import "dijit/form/Button";
-import "dijit/form/ToggleButton";
-import "dijit/ToolbarSeparator";
-import "dijit/form/TextBox";
+import "dijit/form/CheckBox";
 import "dijit/form/DropDownButton";
-import "dijit/TooltipDialog";
 import "dijit/form/Form";
-import "hpcc/TableContainer";
-import "dijit/form/CheckBox";
-import "dijit/Fieldset";
-import "dijit/Toolbar";
-import "dijit/layout/StackController";
+import "dijit/form/TextBox";
+import "dijit/form/ToggleButton";
+import "dijit/layout/BorderContainer";
+import "dijit/layout/ContentPane";
 import "dijit/layout/StackContainer";
+import "dijit/layout/StackController";
 import "dijit/layout/TabContainer";
+import "dijit/Toolbar";
+import "dijit/ToolbarSeparator";
+import "dijit/TooltipDialog";
+import "hpcc/TableContainer";
 
 type _Widget = {
     id: string;
@@ -109,7 +109,7 @@ export class GraphTree7Widget {
     //  Options ---
 
     _onOptionsApply() {
-        var optionsValues = this.optionsForm.getValues();
+        const optionsValues = this.optionsForm.getValues();
         this.persist.setObj("options", optionsValues);
         this.optionsDropDown.closeDropDown();
         this.loadGraph();
@@ -162,7 +162,7 @@ export class GraphTree7Widget {
     postCreate(args) {
         this.inherited(arguments);
         this._initGraphControls();
-        var context = this;
+        const context = this;
         topic.subscribe(this.id + "OverviewTabContainer-selectChild", function (topic) {
             context.refreshActionState();
         });
@@ -205,13 +205,13 @@ export class GraphTree7Widget {
     }
 
     _initItemGrid(grid) {
-        var context = this;
+        const context = this;
         grid.on("dgrid-select, dgrid-deselect", function (event) {
             context.syncSelectionFrom(grid);
         });
         grid.on(".dgrid-row:dblclick", function (evt) {
-            var item = grid.row(evt).data;
-            context.centerOn(item.Id)
+            const item = grid.row(evt).data;
+            context.centerOn(item.Id);
         });
     }
 
@@ -394,7 +394,7 @@ export class GraphTree7Widget {
                         break;
                 }
             });
-        ;
+
         this._graph.tooltipHTML((v: Vertex) => {
             return this._gc.calcGraphTooltip2(v);
         });
@@ -441,9 +441,9 @@ export class GraphTree7Widget {
                 column.formatter = function (cell, row) {
                     const retVal = (row.__formatted && row.__formatted[`${column.field}`]) ? row.__formatted[`${column.field}`] : cell;
                     return retVal !== undefined ? retVal : "";
-                }
+                };
             }
-        })
+        });
     }
 
     initSubgraphs() {
@@ -452,7 +452,7 @@ export class GraphTree7Widget {
         }, this.id + "SubgraphsGrid");
         const context = this;
         this.subgraphsGrid.on(".dgrid-row-url:click", function (evt) {
-            var row = context.subgraphsGrid.row(evt).data;
+            const row = context.subgraphsGrid.row(evt).data;
             context._hostPage.openGraph(context.graphName, row.Id);
         });
 
@@ -460,14 +460,14 @@ export class GraphTree7Widget {
     }
 
     loadSubgraphs() {
-        var subgraphs = this._gc.subgraphStoreData();
+        const subgraphs = this._gc.subgraphStoreData();
         this.subgraphsStore.setData(subgraphs);
         const context = this;
         const img = getImageURL("folder.png");
-        var columns = [
+        const columns = [
             {
                 label: this.i18n.ID, field: "Id", width: 54,
-                formatter: function (_id, row) {
+                formatter(_id, row) {
                     return "<img src='" + img + "'/>&nbsp;" + (context._hostPage ? "<a href='#" + _id + "' class='dgrid-row-url'>" + _id + "</a>" : _id);
                 }
             }
@@ -487,13 +487,13 @@ export class GraphTree7Widget {
     }
 
     loadVertices() {
-        var vertices = this._gc.activityStoreData();
+        const vertices = this._gc.activityStoreData();
         this.verticesStore.setData(vertices);
-        var columns = [
+        const columns = [
             {
                 label: this.i18n.ID, field: "Id", width: 54,
-                formatter: function (_id, row) {
-                    var img = getImageURL("file.png");
+                formatter(_id, row) {
+                    const img = getImageURL("file.png");
                     return "<img src='" + img + "'/>&nbsp;" + _id;
                 }
             },
@@ -514,9 +514,9 @@ export class GraphTree7Widget {
     }
 
     loadEdges() {
-        var edges = this._gc.edgeStoreData();
+        const edges = this._gc.edgeStoreData();
         this.edgesStore.setData(edges);
-        var columns = [
+        const columns = [
             { label: this.i18n.ID, field: "Id", width: 50 }
         ];
         this.edgesStore.appendColumns(columns, ["Label", "NumRowsProcessed"], ["IdSource", "IdTarget", "SourceIndex", "TargetIndex"]);
@@ -541,7 +541,7 @@ export class GraphTree7Widget {
             if (w) {
                 if (refresh) {
                     this._graph
-                        .data(this._gc.graphData(), true)   //  Force re-render 
+                        .data(this._gc.graphData(), true)   //  Force re-render
                         .render(w => {
                             setTimeout(() => {
                                 this._graph
@@ -579,7 +579,7 @@ export class GraphTree7Widget {
     }
 
     refreshActionState() {
-        var tab = this.widget.OverviewTabContainer.get("selectedChildWidget");
+        const tab = this.widget.OverviewTabContainer.get("selectedChildWidget");
         this.setDisabled(this.id + "FindPrevious", this.foundIndex <= 0, "iconLeft", "iconLeftDisabled");
         this.setDisabled(this.id + "FindNext", this.foundIndex >= this.found.length - 1, "iconRight", "iconRightDisabled");
         this.setDisabled(this.id + "ActivityMetric", tab && tab.id !== this.id + "ActivitiesTreeMap");
@@ -588,8 +588,8 @@ export class GraphTree7Widget {
 
 GraphTree7Widget.prototype._syncSelectionFrom = debounce(function (this: GraphTree7Widget, sourceControlOrGlobalIDs) {
     this.inSyncSelectionFrom = true;
-    var sourceControl = sourceControlOrGlobalIDs instanceof Array ? null : sourceControlOrGlobalIDs;
-    var selectedGlobalIDs = sourceControlOrGlobalIDs instanceof Array ? sourceControlOrGlobalIDs : [];
+    const sourceControl = sourceControlOrGlobalIDs instanceof Array ? null : sourceControlOrGlobalIDs;
+    let selectedGlobalIDs = sourceControlOrGlobalIDs instanceof Array ? sourceControlOrGlobalIDs : [];
     if (sourceControl) {
         //  Get Selected Items  ---
         if (sourceControl === this) {
@@ -606,8 +606,8 @@ GraphTree7Widget.prototype._syncSelectionFrom = debounce(function (this: GraphTr
                 .filter(item => !!item)
                 .map(item => item._.Id);
         } else if (sourceControl === this.verticesGrid || sourceControl === this.edgesGrid || sourceControl === this.subgraphsGrid) {
-            var items = sourceControl.getSelected();
-            for (var i = 0; i < items.length; ++i) {
+            const items = sourceControl.getSelected();
+            for (let i = 0; i < items.length; ++i) {
                 if (lang.exists("Id", items[i])) {
                     selectedGlobalIDs.push(items[i].Id);
                 }
@@ -636,16 +636,16 @@ GraphTree7Widget.prototype._syncSelectionFrom = debounce(function (this: GraphTr
         this._graph.selection(items);
     }
 
-    var propertiesDom = dom.byId(this.id + "Properties");
+    const propertiesDom = dom.byId(this.id + "Properties");
     propertiesDom.innerHTML = "";
     let html = "";
     for (const id of selectedGlobalIDs) {
         html += this._gc.calcGraphTooltip(id, this.findText);
     }
     propertiesDom.innerHTML = html;
-    var context = this;
+    const context = this;
     if (selectedGlobalIDs.length) {
-        var edges = arrayUtil.filter(selectedGlobalIDs, function (id) {
+        const edges = arrayUtil.filter(selectedGlobalIDs, function (id) {
             return id && id.indexOf && id.indexOf("_") >= 0;
         });
         if (edges.length === 1) {

+ 88 - 89
esp/src/src/GraphTreeWidget.ts

@@ -1,20 +1,20 @@
+import * as arrayUtil from "dojo/_base/array";
 import * as declare from "dojo/_base/declare";
+import * as Deferred from "dojo/_base/Deferred";
 import * as lang from "dojo/_base/lang";
+import * as dom from "dojo/dom";
+import * as html from "dojo/html";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
-import * as arrayUtil from "dojo/_base/array";
-import * as Deferred from "dojo/_base/Deferred";
-import * as dom from "dojo/dom";
 import * as on from "dojo/on";
-import * as html from "dojo/html";
 import * as topic from "dojo/topic";
 
-import * as registry from "dijit/registry";
+import * as CheckedMenuItem from "dijit/CheckedMenuItem";
 import * as Menu from "dijit/Menu";
 import * as MenuItem from "dijit/MenuItem";
 import * as MenuSeparator from "dijit/MenuSeparator";
-import * as CheckedMenuItem from "dijit/CheckedMenuItem";
+import * as registry from "dijit/registry";
 
 import * as entities from "dojox/html/entities";
 
@@ -25,31 +25,31 @@ import * as tree from "../dgrid/tree";
 import * as _Widget from "hpcc/_Widget";
 import * as ESPUtil from "./ESPUtil";
 import * as ESPWorkunit from "./ESPWorkunit";
-import * as WsWorkunits from "./WsWorkunits";
 import * as Utility from "./Utility";
+import * as WsWorkunits from "./WsWorkunits";
 
 // @ts-ignore
 import * as template from "dojo/text!hpcc/templates/GraphTreeWidget.html";
 
-import "hpcc/JSGraphWidget";
-import "hpcc/TimingTreeMapWidget";
-import "dijit/layout/BorderContainer";
-import "dijit/layout/TabContainer";
-import "dijit/layout/StackContainer";
-import "dijit/layout/StackController";
-import "dijit/layout/ContentPane";
 import "dijit/Dialog";
-import "dijit/form/TextBox";
-import "dijit/form/SimpleTextarea";
-import "dijit/form/NumberSpinner";
+import "dijit/form/Button";
 import "dijit/form/DropDownButton";
+import "dijit/form/NumberSpinner";
 import "dijit/form/Select";
-import "dijit/form/Button";
+import "dijit/form/SimpleTextarea";
+import "dijit/form/TextBox";
 import "dijit/form/ToggleButton";
+import "dijit/layout/BorderContainer";
+import "dijit/layout/ContentPane";
+import "dijit/layout/StackContainer";
+import "dijit/layout/StackController";
+import "dijit/layout/TabContainer";
 import "dijit/Toolbar";
 import "dijit/ToolbarSeparator";
+import "hpcc/JSGraphWidget";
+import "hpcc/TimingTreeMapWidget";
 
-import { declareDecorator } from './DeclareDecorator';
+import { declareDecorator } from "./DeclareDecorator";
 
 type _Widget = any;
 export interface GraphTreeWidget extends _Widget { }
@@ -87,7 +87,7 @@ export class GraphTreeWidget {
         this._initTimings();
         this._initActivitiesMap();
         this._initDialogs();
-        var context = this;
+        const context = this;
         topic.subscribe(this.id + "OverviewTabContainer-selectChild", function (topic) {
             context.refreshActionState();
         });
@@ -101,7 +101,7 @@ export class GraphTreeWidget {
         this._initVertices();
         this._initEdges();
 
-        var splitter = this.widget.BorderContainer.getSplitter("left");
+        let splitter = this.widget.BorderContainer.getSplitter("left");
         this.main.watchSplitter(splitter);
 
         splitter = this.widget.SideBorderContainer.getSplitter("bottom");
@@ -129,7 +129,7 @@ export class GraphTreeWidget {
 
     //  Implementation  ---
     _initGraphControls() {
-        var context = this;
+        const context = this;
         this.global = registry.byId(this.id + "GlobalGraphWidget");
 
         this.main = registry.byId(this.id + "MainGraphWidget");
@@ -147,21 +147,21 @@ export class GraphTreeWidget {
     }
 
     _initTimings() {
-        var context = this;
+        const context = this;
         this.widget.TimingsTreeMap.onClick = function (value) {
             context.syncSelectionFrom(context.widget.TimingsTreeMap);
-        }
+        };
     }
 
     _initActivitiesMap() {
-        var context = this;
+        const context = this;
         this.widget.ActivitiesTreeMap.onClick = function (value) {
             context.syncSelectionFrom(context.widget.ActivitiesTreeMap);
-        }
+        };
     }
 
     _initDialogs() {
-        var context = this;
+        const context = this;
 
         this.infoDialog = registry.byId(this.id + "InfoDialog");
         on(dom.byId(this.id + "InfoDialogCancel"), "click", function (event) {
@@ -173,13 +173,13 @@ export class GraphTreeWidget {
         on(dom.byId(this.id + "XGMMLDialogApply"), "click", function (event) {
             context.xgmmlDialog.hide();
             if (context.xgmmlDialog.get("hpccMode") === "XGMML") {
-                var xgmml = context.xgmmlTextArea.get("value");
+                const xgmml = context.xgmmlTextArea.get("value");
                 context.loadGraphFromXGMML(xgmml);
             } else if (context.xgmmlDialog.get("hpccMode") === "DOT") {
-                var dot = context.xgmmlTextArea.get("value");
+                const dot = context.xgmmlTextArea.get("value");
                 context.loadGraphFromDOT(dot);
             } else if (context.xgmmlDialog.get("hpccMode") === "DOTATTRS") {
-                var dotAttrs = context.xgmmlTextArea.get("value");
+                const dotAttrs = context.xgmmlTextArea.get("value");
                 context.global.setDotMetaAttributes(dotAttrs);
                 context.main.setDotMetaAttributes(dotAttrs);
                 context._onMainSync();
@@ -191,14 +191,14 @@ export class GraphTreeWidget {
     }
 
     _initItemGrid(grid) {
-        var context = this;
+        const context = this;
         grid.on("dgrid-select, dgrid-deselect", function (event) {
             context.syncSelectionFrom(grid);
         });
         grid.on(".dgrid-row:dblclick", function (evt) {
-            var item = grid.row(evt).data;
+            const item = grid.row(evt).data;
             if (item._globalID) {
-                var mainItem = context.main.getItem(item._globalID);
+                const mainItem = context.main.getItem(item._globalID);
                 context.main.centerOnItem(mainItem, true);
             }
         });
@@ -215,20 +215,20 @@ export class GraphTreeWidget {
     }
 
     initContextMenu() {
-        var context = this;
-        var pMenu = new Menu({
+        const context = this;
+        const pMenu = new Menu({
             targetNodeIds: [this.id + "TreeGrid"]
         });
         pMenu.addChild(new MenuItem({
             label: this.i18n.ExpandAll,
-            onClick: function (evt) {
+            onClick(evt) {
                 context.treeGrid.set("treeDepth", 9999);
                 context.treeGrid.refresh();
             }
         }));
         pMenu.addChild(new MenuItem({
             label: this.i18n.CollapseAll,
-            onClick: function (evt) {
+            onClick(evt) {
                 context.treeGrid.set("treeDepth", 1);
                 context.treeGrid.refresh();
             }
@@ -237,7 +237,7 @@ export class GraphTreeWidget {
         pMenu.addChild(new CheckedMenuItem({
             label: this.i18n.Activities,
             checked: false,
-            onClick: function (evt) {
+            onClick(evt) {
                 if (this.checked) {
                     context.treeGrid.set("query", {
                         id: "0"
@@ -289,7 +289,7 @@ export class GraphTreeWidget {
     }
 
     _onChangeActivityMetric() {
-        var metric = this.widget.ActivityMetric.get("value");
+        const metric = this.widget.ActivityMetric.get("value");
         this.widget.ActivitiesTreeMap.setActivityMetric(metric);
     }
 
@@ -338,7 +338,7 @@ export class GraphTreeWidget {
     }
 
     _onRenderSVG() {
-        var context = this
+        const context = this;
         this.main.localLayout(function (svg) {
             html.set(dom.byId(context.id + "InfoDialogContent"), "<div style='border: 1px inset grey; width: 640px; height: 480px; overflow : auto; '>" + svg + "</div>");
             context.infoDialog.set("title", this.i18n.RenderedSVG);
@@ -401,11 +401,11 @@ export class GraphTreeWidget {
 
         if (params.SafeMode && params.SafeMode !== "false") {
             this.main.depth.set("value", 1);
-            var dotAttrs = this.global.getDotMetaAttributes();
+            let dotAttrs = this.global.getDotMetaAttributes();
             dotAttrs = dotAttrs.replace("\n//graph[splines=\"line\"];", "\ngraph[splines=\"line\"];");
             this.global.setDotMetaAttributes(dotAttrs);
         } else {
-            var dotAttrs = this.global.getDotMetaAttributes();
+            let dotAttrs = this.global.getDotMetaAttributes();
             dotAttrs = dotAttrs.replace("\ngraph[splines=\"line\"];", "\n//graph[splines=\"line\"];");
             this.global.setDotMetaAttributes(dotAttrs);
         }
@@ -430,17 +430,16 @@ export class GraphTreeWidget {
             hideHelp: true
         }, params));
 
-
         if (this.isWorkunit()) {
             this.wu = ESPWorkunit.Get(params.Wuid);
 
-            var firstLoad = true;
-            var context = this;
+            let firstLoad = true;
+            const context = this;
             this.wu.monitor(function () {
                 context.wu.getInfo({
-                    onGetApplicationValues: function (applicationValues) {
+                    onGetApplicationValues(applicationValues) {
                     },
-                    onGetGraphs: function (graphs) {
+                    onGetGraphs(graphs) {
                         if (firstLoad === true) {
                             firstLoad = false;
                             context.loadGraphFromWu(context.wu, context.graphName, context.subGraphId);
@@ -448,7 +447,7 @@ export class GraphTreeWidget {
                             context.refreshGraphFromWU(context.wu, context.graphName, context.subGraphId);
                         }
                     },
-                    onGetTimers: function (timers) {
+                    onGetTimers(timers) {
                         context.graphTimers = context.wu.getGraphTimers(context.GraphName);
                     }
                 });
@@ -472,8 +471,8 @@ export class GraphTreeWidget {
     loadGraphFromXGMML(xgmml) {
         if (this.global.loadXGMML(xgmml, false, this.graphTimers, true)) {
             this.global.setMessage("...");  //  Just in case it decides to render  ---
-            var mainRoot = [0];
-            var complexityInfo = this.global.getComplexityInfo();
+            let mainRoot = [0];
+            const complexityInfo = this.global.getComplexityInfo();
             if (this.params.SubGraphId) {
                 mainRoot = [this.params.SubGraphId];
             } else if (complexityInfo.isComplex()) {
@@ -509,9 +508,9 @@ export class GraphTreeWidget {
     }
 
     loadGraphFromWu(wu, graphName, subGraphId, refresh: boolean = false) {
-        var deferred = new Deferred();
+        const deferred = new Deferred();
         this.main.setMessage(this.i18n.FetchingData);
-        var context = this;
+        const context = this;
         wu.fetchGraphXgmmlByName(graphName, subGraphId, function (xgmml, svg) {
             context.main.setMessage("");
             context.loadGraphFromXGMML(xgmml);
@@ -521,7 +520,7 @@ export class GraphTreeWidget {
     }
 
     refreshGraphFromWU(wu, graphName, subGraphId) {
-        var context = this;
+        const context = this;
         wu.fetchGraphXgmmlByName(graphName, subGraphId, function (xgmml) {
             context.mergeGraphFromXGMML(xgmml);
         }, true);
@@ -529,7 +528,7 @@ export class GraphTreeWidget {
 
     loadGraphFromQuery(targetQuery, queryId, graphName) {
         this.main.setMessage(this.i18n.FetchingData);
-        var context = this;
+        const context = this;
         WsWorkunits.WUQueryGetGraph({
             request: {
                 Target: targetQuery,
@@ -547,7 +546,7 @@ export class GraphTreeWidget {
     }
 
     refreshGraphFromQuery(targetQuery, queryId, graphName) {
-        var context = this;
+        const context = this;
         WsWorkunits.WUQueryGetGraph({
             request: {
                 Target: targetQuery,
@@ -564,15 +563,15 @@ export class GraphTreeWidget {
     }
 
     loadTree() {
-        var treeData = this.global.getTreeWithProperties();
+        const treeData = this.global.getTreeWithProperties();
         this.treeStore.setTree(treeData);
-        var context = this;
-        var columns = [
+        const context = this;
+        const columns = [
             tree({
                 field: "id",
                 label: this.i18n.ID, width: 150,
                 collapseOnRefresh: true,
-                shouldExpand: function (row, level, previouslyExpanded) {
+                shouldExpand(row, level, previouslyExpanded) {
                     if (previouslyExpanded !== undefined) {
                         return previouslyExpanded;
                     } else if (level < context.treeGrid.get("treeDepth")) {
@@ -580,9 +579,9 @@ export class GraphTreeWidget {
                     }
                     return false;
                 },
-                formatter: function (_id, row) {
-                    var img = Utility.getImageURL("file.png");
-                    var label = _id + " - ";
+                formatter(_id, row) {
+                    let img = Utility.getImageURL("file.png");
+                    let label = _id + " - ";
                     switch (row._globalType) {
                         case "Graph":
                             img = Utility.getImageURL("server.png");
@@ -614,13 +613,13 @@ export class GraphTreeWidget {
     }
 
     loadSubgraphs() {
-        var subgraphs = this.global.getSubgraphsWithProperties();
+        const subgraphs = this.global.getSubgraphsWithProperties();
         this.subgraphsStore.setData(subgraphs);
-        var columns = [
+        const columns = [
             {
                 label: this.i18n.ID, field: "id", width: 54,
-                formatter: function (_id, row) {
-                    var img = Utility.getImageURL("folder.png");
+                formatter(_id, row) {
+                    const img = Utility.getImageURL("folder.png");
                     return "<img src='" + img + "'/>&nbsp;" + _id;
                 }
             }
@@ -631,13 +630,13 @@ export class GraphTreeWidget {
     }
 
     loadVertices() {
-        var vertices = this.global.getVerticesWithProperties();
+        const vertices = this.global.getVerticesWithProperties();
         this.verticesStore.setData(vertices);
-        var columns = [
+        const columns = [
             {
                 label: this.i18n.ID, field: "id", width: 54,
-                formatter: function (_id, row) {
-                    var img = Utility.getImageURL("file.png");
+                formatter(_id, row) {
+                    const img = Utility.getImageURL("file.png");
                     return "<img src='" + img + "'/>&nbsp;" + _id;
                 }
             },
@@ -670,9 +669,9 @@ export class GraphTreeWidget {
     }
 
     loadEdges() {
-        var edges = this.global.getEdgesWithProperties();
+        const edges = this.global.getEdgesWithProperties();
         this.edgesStore.setData(edges);
-        var columns = [
+        const columns = [
             { label: this.i18n.ID, field: "id", width: 50 }
         ];
         this.edgesStore.appendColumns(columns, ["label", "count"], ["source", "target"]);
@@ -690,27 +689,27 @@ export class GraphTreeWidget {
     // _syncSelectionFrom: Utility.debounce(function (sourceControlOrGlobalIDs) {
     _syncSelectionFrom(sourceControlOrGlobalIDs) {
         this.inSyncSelectionFrom = true;
-        var sourceControl = sourceControlOrGlobalIDs instanceof Array ? null : sourceControlOrGlobalIDs;
-        var selectedGlobalIDs = sourceControlOrGlobalIDs instanceof Array ? sourceControlOrGlobalIDs : [];
+        const sourceControl = sourceControlOrGlobalIDs instanceof Array ? null : sourceControlOrGlobalIDs;
+        let selectedGlobalIDs = sourceControlOrGlobalIDs instanceof Array ? sourceControlOrGlobalIDs : [];
         if (sourceControl) {
             //  Get Selected Items  ---
             if (sourceControl === this.widget.TimingsTreeMap) {
-                var items = sourceControl.getSelected();
-                for (var i = 0; i < items.length; ++i) {
+                const items = sourceControl.getSelected();
+                for (let i = 0; i < items.length; ++i) {
                     if (items[i].SubGraphId) {
                         selectedGlobalIDs.push(items[i].SubGraphId);
                     }
                 }
             } else if (sourceControl === this.widget.ActivitiesTreeMap) {
-                var items = sourceControl.getSelected();
-                for (var i = 0; i < items.length; ++i) {
+                const items = sourceControl.getSelected();
+                for (let i = 0; i < items.length; ++i) {
                     if (items[i].ActivityID) {
                         selectedGlobalIDs.push(items[i].ActivityID);
                     }
                 }
             } else if (sourceControl === this.verticesGrid || sourceControl === this.edgesGrid || sourceControl === this.subgraphsGrid || sourceControl === this.treeGrid) {
-                var items = sourceControl.getSelected();
-                for (var i = 0; i < items.length; ++i) {
+                const items = sourceControl.getSelected();
+                for (let i = 0; i < items.length; ++i) {
                     if (lang.exists("_globalID", items[i])) {
                         selectedGlobalIDs.push(items[i]._globalID);
                     }
@@ -747,14 +746,14 @@ export class GraphTreeWidget {
             this.setMainRootItems(selectedGlobalIDs);
         }
 
-        var propertiesDom = dom.byId(this.id + "Properties");
+        const propertiesDom = dom.byId(this.id + "Properties");
         propertiesDom.innerHTML = "";
-        for (var i = 0; i < selectedGlobalIDs.length; ++i) {
+        for (let i = 0; i < selectedGlobalIDs.length; ++i) {
             this.global.displayProperties(this.wu, selectedGlobalIDs[i], propertiesDom);
         }
-        var context = this;
+        const context = this;
         if (selectedGlobalIDs.length) {
-            var edges = arrayUtil.filter(selectedGlobalIDs, function (id) {
+            const edges = arrayUtil.filter(selectedGlobalIDs, function (id) {
                 return id && id.indexOf && id.indexOf("_") >= 0;
             });
             if (edges.length === 1) {
@@ -766,7 +765,7 @@ export class GraphTreeWidget {
             }
         }
         this.inSyncSelectionFrom = false;
-        //}, 500, false)
+        // }, 500, false)
     }
 
     resetPage() {
@@ -774,17 +773,17 @@ export class GraphTreeWidget {
     }
 
     setMainRootItems(globalIDs) {
-        var graphView = this.global.getGraphView(globalIDs, this.main.getDepth(), this.main.distance.get("value"), this.main.option("subgraph"), this.main.option("vhidespills"));
+        const graphView = this.global.getGraphView(globalIDs, this.main.getDepth(), this.main.distance.get("value"), this.main.option("subgraph"), this.main.option("vhidespills"));
         return graphView.navigateTo(this.main);
     }
 
     refreshMainXGMML() {
-        var graphView = this.main.getCurrentGraphView();
+        const graphView = this.main.getCurrentGraphView();
         graphView.refreshXGMML(this.main);
     }
 
     displayGraphs(graphs) {
-        for (var i = 0; i < graphs.length; ++i) {
+        for (let i = 0; i < graphs.length; ++i) {
             this.wu.fetchGraphXgmml(i, null, function (xgmml) {
                 this.main.loadXGMML(xgmml, true);
             });
@@ -792,7 +791,7 @@ export class GraphTreeWidget {
     }
 
     refreshActionState() {
-        var tab = this.widget.OverviewTabContainer.get("selectedChildWidget");
+        const tab = this.widget.OverviewTabContainer.get("selectedChildWidget");
         this.setDisabled(this.id + "FindPrevious", this.foundIndex <= 0, "iconLeft", "iconLeftDisabled");
         this.setDisabled(this.id + "FindNext", this.foundIndex >= this.found.length - 1, "iconRight", "iconRightDisabled");
         this.setDisabled(this.id + "ActivityMetric", tab.id !== this.id + "ActivitiesTreeMap");

+ 6 - 6
esp/src/src/KeyValStore.ts

@@ -13,7 +13,7 @@ export interface IKeyValStore {
  *  Global Store
  *      Stores info in Dali, ignores user ID
  *      No push notifications outside of current tab
- **/
+ */
 export function globalKeyValStore(): IKeyValStore {
     return Store.attach({ baseUrl: "" }, "HPCCApps", "ECLWatch", false);
 }
@@ -22,7 +22,7 @@ export function globalKeyValStore(): IKeyValStore {
  *  User Store
  *      Stores info in Dali by user ID
  *      No push notifications outside of current tab
- **/
+ */
 export function userKeyValStore(): IKeyValStore {
     const userName = globalThis.dojoConfig.username;
     if (!userName) {
@@ -45,14 +45,14 @@ class LocalStorage implements IKeyValStore {
         this._prefixLength = this._prefix.length;
 
         if (typeof StorageEvent !== void (0)) {
-            window.addEventListener('storage', (event: StorageEvent) => {
+            window.addEventListener("storage", (event: StorageEvent) => {
                 if (this.isECLWatchKey(event.key)) {
                     this._dispatch.post(new ValueChangedMessage(this.extractKey(event.key), event.newValue, event.oldValue));
                 }
             });
         } else {
             console.log("Browser doesn't support multi-tab communication");
-        };
+        }
     }
 
     isECLWatchKey(key: string): boolean {
@@ -110,7 +110,7 @@ let _localStorage: LocalStorage;
  *  Local Store
  *      Stores info in local storage
  *      Includes push notifications outside of current tab
- **/
+ */
 export function localKeyValStore(): IKeyValStore {
     if (!_localStorage) {
         _localStorage = new LocalStorage();
@@ -133,7 +133,7 @@ let _sessionStorage: SessionStorage;
  *  Session Store
  *      Stores info in session storage
  *      Includes push notifications outside of current tab
- **/
+ */
 export function sessionKeyValStore(): IKeyValStore {
     if (!_sessionStorage) {
         _sessionStorage = new SessionStorage();

+ 6 - 6
esp/src/src/Pagination.ts

@@ -2,15 +2,15 @@ import * as declare from "dojo/_base/declare";
 import * as on from "dojo/on";
 
 // @ts-ignore
-import * as DGrid from "dgrid/Grid";
-// @ts-ignore
 import * as _StoreMixin from "dgrid/_StoreMixin";
 // @ts-ignore
 import * as DGridPagination from "dgrid/extensions/Pagination";
+// @ts-ignore
+import * as DGrid from "dgrid/Grid";
 
 export const Pagination = declare([DGridPagination], {
-    refresh: function () {
-        var self = this;
+    refresh() {
+        const self = this;
 
         _StoreMixin.prototype.refresh.apply(this, arguments);
 
@@ -20,7 +20,7 @@ export const Pagination = declare([DGridPagination], {
         }
 
         // Reset to current page and return promise from gotoPage
-        var page = Math.max(Math.min(this._currentPage, Math.ceil(this._total / this.rowsPerPage)), 1);
+        const page = Math.max(Math.min(this._currentPage, Math.ceil(this._total / this.rowsPerPage)), 1);
         return this.gotoPage(page).then(function (results) {
             // Emit on a separate turn to enable event to be used consistently for
             // initial render, regardless of whether the backing store is async
@@ -29,7 +29,7 @@ export const Pagination = declare([DGridPagination], {
                     bubbles: true,
                     cancelable: false,
                     grid: self,
-                    results: results // QueryResults object (may be a wrapped promise)
+                    results // QueryResults object (may be a wrapped promise)
                 });
             }, 0);
 

+ 3 - 3
esp/src/src/Session.ts

@@ -1,7 +1,7 @@
 import * as cookie from "dojo/cookie";
 import * as xhr from "dojo/request/xhr";
+import * as topic from "dojo/topic";
 import * as ESPUtil from "./ESPUtil";
-import * as topic from "dojo/topic"
 
 const espTimeoutSeconds = cookie("ESPSessionTimeoutSeconds") || 600; // 10 minuntes?
 const IDLE_TIMEOUT = espTimeoutSeconds * 1000;
@@ -26,7 +26,7 @@ export function initSession() {
             idleWatcher.stop();
             topic.publish("hpcc/session_management_status", {
                 status: "Idle",
-                idleCreator: idleCreator
+                idleCreator
             });
         });
 
@@ -57,4 +57,4 @@ function resetESPTime() {
         }).then(function (data) {
         });
     }
-}
+}

+ 11 - 11
esp/src/src/Timings.ts

@@ -1,8 +1,8 @@
+import { Column } from "@hpcc-js/chart";
+import { ascending as d3Ascending, max as d3Max, scaleLinear as d3ScaleLinear, select as d3Select } from "@hpcc-js/common";
 import { Workunit } from "@hpcc-js/comms";
-import { ascending as d3Ascending, max as d3Max, select as d3Select, scaleLinear as d3ScaleLinear } from "@hpcc-js/common";
 import { WUTimeline } from "@hpcc-js/eclwatch";
 import { ChartPanel } from "@hpcc-js/layout";
-import { Column } from "@hpcc-js/chart";
 
 class TimingColumn extends Column {
 
@@ -268,7 +268,7 @@ export class Timings {
             this._rawColumns = response.columns;
             this._graphLookup = {};
             this._subgraphLookup = {};
-            var rawData = response.data.filter(row => {
+            const rawData = response.data.filter(row => {
                 if (row.type === "graph") this._graphLookup[row.name] = row.id;
                 if (row.type === "subgraph") this._subgraphLookup[row.name] = row.id;
                 if (!row.id) return false;
@@ -283,16 +283,16 @@ export class Timings {
                 return 0;
             });
 
-            var measure = "";
-            var colArr = [];
-            for (var key in response.columns) {
+            const measure = "";
+            const colArr = [];
+            for (const key in response.columns) {
                 if (response.columns[key].Measure && response.columns[key].Measure !== "label") {
-                    colArr.push(key)
+                    colArr.push(key);
                 }
             }
             colArr.sort(d3Ascending);
             this._metricSelectLabel = this._metricSelectValues + (measure ? " (" + measure + ")" : "");
-            var options = this.metricsSelect.selectAll("option").data(colArr, function (d) { return d; });
+            const options = this.metricsSelect.selectAll("option").data(colArr, function (d) { return d; });
             options.enter().append("option")
                 .merge(options)
                 .property("value", d => d)
@@ -344,8 +344,8 @@ export class Timings {
             };
         });
         this._metricSelectValues.forEach(metric => {
-            var max = d3Max<number>(data.map(row => row[metric]));
-            var scale = d3ScaleLinear().domain([0, max]).range([0, 1]);
+            const max = d3Max<number>(data.map(row => row[metric]));
+            const scale = d3ScaleLinear().domain([0, max]).range([0, 1]);
             normalizedData.forEach(row => {
                 row[metric] = scale(row[metric]);
             });
@@ -389,7 +389,7 @@ export class WUTimelineEx extends WUTimeline {
                     started: row[1],
                     finished: row[2]
                 };
-            })
+            });
             this.setData(timeData);
         }
         return retVal;

+ 19 - 20
esp/src/src/UserPreferences/EnvironmentTheme.ts

@@ -2,19 +2,19 @@ import * as Utility from "../Utility";
 
 import { globalKeyValStore } from "../KeyValStore";
 
-import * as query from "dojo/query";
+import * as dom from "dojo/dom";
 import * as domConstruct from "dojo/dom-construct";
 import * as domStyle from "dojo/dom-style";
-import * as dom from "dojo/dom";
+import * as query from "dojo/query";
 
 const ws_store = globalKeyValStore();
 declare const dojoConfig;
 
 export function checkCurrentState(id, context) {
-    ws_store.get("HPCCPlatformWidget_Toolbar_Color").then(function(val) {
+    ws_store.get("HPCCPlatformWidget_Toolbar_Color").then(function (val) {
         if (val) {
             domStyle.set(id + "Titlebar", {
-                "backgroundColor": val
+                backgroundColor: val
             });
             context.toolbarColor.set("value", val);
             context.textColor = Utility.textColor(val);
@@ -24,39 +24,38 @@ export function checkCurrentState(id, context) {
         }
     });
 
-    ws_store.get("HPCCPlatformWidget_Toolbar_Text").then(function(val) {
+    ws_store.get("HPCCPlatformWidget_Toolbar_Text").then(function (val) {
         const searchUserMoreComponents = dom.byId(id + "searchUserMoreComponents");
         if (val) {
             context.environmentText.set("value", val);
             context.environmentTextCB.set("value", true);
-            const parent = domConstruct.create("div", {id: id + "BannerInnerText", class: "envrionmentText"}, searchUserMoreComponents, "before");
-            domConstruct.create("span", {id: context.id + "BannerContent", style:{color: context.textColor}, innerHTML: val}, parent);
+            const parent = domConstruct.create("div", { id: id + "BannerInnerText", class: "envrionmentText" }, searchUserMoreComponents, "before");
+            domConstruct.create("span", { id: context.id + "BannerContent", style: { color: context.textColor }, innerHTML: val }, parent);
             document.title = val;
         }
     });
 }
 
-
 export function setEnvironmentTheme(id, context) {
-    let searchUserMoreComponents = dom.byId(id + "searchUserMoreComponents");
+    const searchUserMoreComponents = dom.byId(id + "searchUserMoreComponents");
     ws_store.set("HPCCPlatformWidget_Toolbar_Text", context.environmentText.get("value"));
     ws_store.set("HPCCPlatformWidget_Toolbar_Color", context.toolbarColor.get("value"));
 
-    ws_store.get("HPCCPlatformWidget_Toolbar_Color").then(function(val){
+    ws_store.get("HPCCPlatformWidget_Toolbar_Color").then(function (val) {
         context.textColor = Utility.textColor(val);
         domStyle.set(id + "Titlebar", {
-            "backgroundColor": val
+            backgroundColor: val
         });
     });
 
     if (context.environmentTextCB.get("checked")) {
-        ws_store.get("HPCCPlatformWidget_Toolbar_Text").then(function(val) {
-            var customText = query("#stubBannerInnerText");
+        ws_store.get("HPCCPlatformWidget_Toolbar_Text").then(function (val) {
+            const customText = query("#stubBannerInnerText");
             if (customText.length > 0) {
                 domConstruct.destroy(id + "BannerInnerText");
             }
-            var parent = domConstruct.create("div", {id: id + "BannerInnerText", class: "envrionmentText"}, searchUserMoreComponents, "before");
-            domConstruct.create("span", {id: id + "BannerContent", style:{color: context.textColor}, innerHTML: val}, parent);
+            const parent = domConstruct.create("div", { id: id + "BannerInnerText", class: "envrionmentText" }, searchUserMoreComponents, "before");
+            domConstruct.create("span", { id: id + "BannerContent", style: { color: context.textColor }, innerHTML: val }, parent);
 
             document.title = val;
         });
@@ -69,17 +68,17 @@ export function _onResetDefaultTheme(id, context) {
     ws_store.set("HPCCPlatformWidget_Toolbar_Color", "#2196F3");
     ws_store.set("HPCCPlatformWidget_Toolbar_Text", "");
 
-    context.toolbarColor.set("value", "#2196F3")
+    context.toolbarColor.set("value", "#2196F3");
     context.environmentTextCB.set("checked", false);
     context.environmentText.set("value", "");
 
     domStyle.set(id + "Titlebar", {
-        "backgroundColor": "#2196F3"
+        backgroundColor: "#2196F3"
     });
 
-    var customText = query("#BannerContent");
+    const customText = query("#BannerContent");
     if (customText.length === 0) {
         domConstruct.destroy(id + "BannerInnerText");
     }
-    document.title = dojoConfig.pageTitle
-}
+    document.title = dojoConfig.pageTitle;
+}

+ 113 - 97
esp/src/src/Utility.ts

@@ -1,7 +1,7 @@
-import * as arrayUtil from "dojo/_base/array";
+import { Palette } from "@hpcc-js/common";
+import * as arrayUtil from "dojo/_base/array";
 import * as domConstruct from "dojo/dom-construct";
 import * as entities from "dojox/html/entities";
-import { Palette } from "@hpcc-js/common";
 
 declare const dojoConfig;
 declare const ActiveXObject;
@@ -14,26 +14,26 @@ export function xmlEncode(str) {
 
 export function xmlEncode2(str) {
     str = "" + str;
-    return str.replace(/&/g, '&amp;')
-        .replace(/"/g, '&quot;')
-        .replace(/'/g, '&apos;')
-        .replace(/</g, '&lt;')
-        .replace(/>/g, '&gt;')
-        .replace(/\n/g, '&#10;')
-        .replace(/\r/g, '&#13;')
+    return str.replace(/&/g, "&amp;")
+        .replace(/"/g, "&quot;")
+        .replace(/'/g, "&apos;")
+        .replace(/</g, "&lt;")
+        .replace(/>/g, "&gt;")
+        .replace(/\n/g, "&#10;")
+        .replace(/\r/g, "&#13;")
         ;
 }
 
 export function decodeHtml(html) {
-    var txt = document.createElement("textarea");
+    const txt = document.createElement("textarea");
     txt.innerHTML = html;
     return txt.value;
 }
 
 export function parseXML(val) {
-    var xmlDoc;
+    let xmlDoc;
     if ((window as any).DOMParser) {
-        var parser = new DOMParser();
+        const parser = new DOMParser();
         xmlDoc = parser.parseFromString(val, "text/xml");
     } else {
         xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
@@ -55,32 +55,32 @@ export function espTime2Seconds(duration) {
         return parseFloat(duration);
     }
     //  GH:  <n>ns or <m>ms or <s>s or [<d> days ][<h>:][<m>:]<s>[.<ms>]
-    var nsIndex = duration.indexOf("ns");
+    const nsIndex = duration.indexOf("ns");
     if (nsIndex !== -1) {
         return parseFloat(duration.substr(0, nsIndex)) / 1000000000;
     }
-    var msIndex = duration.indexOf("ms");
+    const msIndex = duration.indexOf("ms");
     if (msIndex !== -1) {
         return parseFloat(duration.substr(0, msIndex)) / 1000;
     }
-    var sIndex = duration.indexOf("s");
+    const sIndex = duration.indexOf("s");
     if (sIndex !== -1 && duration.indexOf("days") === -1) {
         return parseFloat(duration.substr(0, sIndex));
     }
 
-    var dayTimeParts = duration.split(" days ");
-    var days = parseFloat(dayTimeParts.length > 1 ? dayTimeParts[0] : 0.0);
-    var time = dayTimeParts.length > 1 ? dayTimeParts[1] : dayTimeParts[0];
-    var secs = 0.0;
-    var timeParts = time.split(":").reverse();
-    for (var j = 0; j < timeParts.length; ++j) {
+    const dayTimeParts = duration.split(" days ");
+    const days = parseFloat(dayTimeParts.length > 1 ? dayTimeParts[0] : 0.0);
+    const time = dayTimeParts.length > 1 ? dayTimeParts[1] : dayTimeParts[0];
+    let secs = 0.0;
+    const timeParts = time.split(":").reverse();
+    for (let j = 0; j < timeParts.length; ++j) {
         secs += parseFloat(timeParts[j]) * Math.pow(60, j);
     }
     return (days * 24 * 60 * 60) + secs;
 }
 
 export function espTime2SecondsTests() {
-    var tests = [
+    const tests = [
         { str: "1.1s", expected: 1.1 },
         { str: "2.2ms", expected: 0.0022 },
         { str: "3.3ns", expected: 0.0000000033 },
@@ -111,11 +111,11 @@ export function convertedSize(intsize: number): string {
 export function returnOSName(OS: number) {
     switch (OS) {
         case 0:
-            return "Windows"
+            return "Windows";
         case 1:
-            return "Solaris"
+            return "Solaris";
         case 2:
-            return "Linux"
+            return "Linux";
     }
 }
 
@@ -132,7 +132,7 @@ export function removeSpecialCharacters(stringToConvert): string {
 }
 
 export function unitTest(size, unit) {
-    var nsIndex = size.indexOf(unit);
+    const nsIndex = size.indexOf(unit);
     if (nsIndex !== -1) {
         return parseFloat(size.substr(0, nsIndex));
     }
@@ -145,35 +145,35 @@ export function espSize2Bytes(size) {
     } else if (!isNaN(size)) {
         return parseFloat(size);
     }
-    var retVal = unitTest(size, "Kb");
+    let retVal = unitTest(size, "Kb");
     if (retVal >= 0) {
         return retVal * 1024;
     }
-    var retVal = unitTest(size, "Mb");
+    retVal = unitTest(size, "Mb");
     if (retVal >= 0) {
         return retVal * Math.pow(1024, 2);
     }
-    var retVal = unitTest(size, "Gb");
+    retVal = unitTest(size, "Gb");
     if (retVal >= 0) {
         return retVal * Math.pow(1024, 3);
     }
-    var retVal = unitTest(size, "Tb");
+    retVal = unitTest(size, "Tb");
     if (retVal >= 0) {
         return retVal * Math.pow(1024, 4);
     }
-    var retVal = unitTest(size, "Pb");
+    retVal = unitTest(size, "Pb");
     if (retVal >= 0) {
         return retVal * Math.pow(1024, 5);
     }
-    var retVal = unitTest(size, "Eb");
+    retVal = unitTest(size, "Eb");
     if (retVal >= 0) {
         return retVal * Math.pow(1024, 6);
     }
-    var retVal = unitTest(size, "Zb");
+    retVal = unitTest(size, "Zb");
     if (retVal >= 0) {
         return retVal * Math.pow(1024, 7);
     }
-    var retVal = unitTest(size, "b");
+    retVal = unitTest(size, "b");
     if (retVal >= 0) {
         return retVal;
     }
@@ -181,7 +181,7 @@ export function espSize2Bytes(size) {
 }
 
 export function espSize2BytesTests() {
-    var tests = [
+    const tests = [
         { str: "1", expected: 1 },
         { str: "1b", expected: 1 },
         { str: "1Kb", expected: 1 * 1024 },
@@ -207,7 +207,7 @@ export function espSkew2Number(skew) {
 }
 
 export function espSkew2NumberTests() {
-    var tests = [
+    const tests = [
         { str: "", expected: 0 },
         { str: "1", expected: 1 },
         { str: "10%", expected: 10 },
@@ -221,18 +221,18 @@ export function espSkew2NumberTests() {
 }
 
 export function downloadToCSV(grid, rows, fileName) {
-    var csvContent = "";
-    var headers = grid.columns;
-    var container = [];
-    var headerNames = [];
+    let csvContent = "";
+    const headers = grid.columns;
+    const container = [];
+    const headerNames = [];
 
-    for (var key in headers) {
-        if (headers[key].selectorType !== 'checkbox') {
+    for (const key in headers) {
+        if (headers[key].selectorType !== "checkbox") {
             if (!headers[key].label) {
-                var str = csvEncode(headers[key].field);
+                const str = csvEncode(headers[key].field);
                 headerNames.push(str);
             } else {
-                var str = csvEncode(headers[key].label);
+                const str = csvEncode(headers[key].label);
                 headerNames.push(str);
             }
         }
@@ -244,19 +244,19 @@ export function downloadToCSV(grid, rows, fileName) {
     });
 
     arrayUtil.forEach(container, function (header, idx) {
-        var dataString = header.join(",");
+        const dataString = header.join(",");
         csvContent += dataString + "\n";
     });
 
-    var download = function (content, fileName, mimeType) {
-        var a = document.createElement('a');
-        mimeType = mimeType || 'application/octet-stream';
+    const download = function (content, fileName, mimeType) {
+        const a = document.createElement("a");
+        mimeType = mimeType || "application/octet-stream";
 
         if (navigator.msSaveBlob) { // IE10
             return navigator.msSaveBlob(new Blob([content], { type: mimeType }), fileName);
-        } else if ('download' in a) {
-            a.href = 'data:' + mimeType + ',' + encodeURIComponent(content);
-            a.setAttribute('download', fileName);
+        } else if ("download" in a) {
+            a.href = "data:" + mimeType + "," + encodeURIComponent(content);
+            a.setAttribute("download", fileName);
             document.body.appendChild(a);
             setTimeout(function () {
                 a.click();
@@ -264,17 +264,17 @@ export function downloadToCSV(grid, rows, fileName) {
             }, 66);
             return true;
         } else {
-            var f = document.createElement('iframe');
+            const f = document.createElement("iframe");
             document.body.appendChild(f);
-            f.src = 'data:' + mimeType + ',' + encodeURIComponent(content);
+            f.src = "data:" + mimeType + "," + encodeURIComponent(content);
 
             setTimeout(function () {
                 document.body.removeChild(f);
             }, 333);
             return true;
         }
-    }
-    download(csvContent, fileName, 'text/csv');
+    };
+    download(csvContent, fileName, "text/csv");
 }
 
 /* alphanum.js (C) Brian Huisman
@@ -282,17 +282,17 @@ export function downloadToCSV(grid, rows, fileName) {
  * The Alphanum Algorithm is discussed at http://www.DaveKoelle.com
  *
  * Distributed under same license as original
- * 
+ *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or any later version.
- * 
+ *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
- * 
+ *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
@@ -306,11 +306,17 @@ export function downloadToCSV(grid, rows, fileName) {
  */
 export function alphanum(a, b) {
     function chunkify(t) {
-        var tz = [];
-        var x = 0, y = -1, n = false, i, j;
-
+        const tz = [];
+        let x = 0;
+        let y = -1;
+        let n = false;
+        let i;
+        let j;
+
+        // tslint:disable-next-line: no-conditional-assignment
         while (i = (j = t.charAt(x++)).charCodeAt(0)) {
-            var m = (i == 46 || (i >= 48 && i <= 57));
+            // tslint:disable-next-line: triple-equals
+            const m = (i == 46 || (i >= 48 && i <= 57));
             if (m !== n) {
                 tz[++y] = "";
                 n = m;
@@ -320,12 +326,14 @@ export function alphanum(a, b) {
         return tz;
     }
 
-    var aa = chunkify(a);
-    var bb = chunkify(b);
+    const aa = chunkify(a);
+    const bb = chunkify(b);
 
-    for (var x = 0; aa[x] && bb[x]; x++) {
+    for (let x = 0; aa[x] && bb[x]; x++) {
         if (aa[x] !== bb[x]) {
-            var c = Number(aa[x]), d = Number(bb[x]);
+            const c = Number(aa[x]);
+            const d = Number(bb[x]);
+            // tslint:disable-next-line: triple-equals
             if (c == aa[x] && d == bb[x]) {
                 return c - d;
             } else return (aa[x] > bb[x]) ? 1 : -1;
@@ -334,7 +342,6 @@ export function alphanum(a, b) {
     return aa.length - bb.length;
 }
 
-
 /* ********************************************************************
  * Alphanum sort() function version - case insensitive
  *  - Slower, but easier to modify for arrays of objects which contain
@@ -343,11 +350,17 @@ export function alphanum(a, b) {
  */
 export function alphanumCase(a, b) {
     function chunkify(t) {
-        var tz = [];
-        var x = 0, y = -1, n = false, i, j;
-
+        const tz = [];
+        let x = 0;
+        let y = -1;
+        let n = false;
+        let i;
+        let j;
+
+        // tslint:disable-next-line: no-conditional-assignment
         while (i = (j = t.charAt(x++)).charCodeAt(0)) {
-            var m = (i == 46 || (i >= 48 && i <= 57));    // jshint ignore:line
+            // tslint:disable-next-line: triple-equals
+            const m = (i == 46 || (i >= 48 && i <= 57));    // jshint ignore:line
             if (m !== n) {
                 tz[++y] = "";
                 n = m;
@@ -357,12 +370,14 @@ export function alphanumCase(a, b) {
         return tz;
     }
 
-    var aa = chunkify(a.toLowerCase());
-    var bb = chunkify(b.toLowerCase());
+    const aa = chunkify(a.toLowerCase());
+    const bb = chunkify(b.toLowerCase());
 
-    for (var x = 0; aa[x] && bb[x]; x++) {
+    for (let x = 0; aa[x] && bb[x]; x++) {
         if (aa[x] !== bb[x]) {
-            var c = Number(aa[x]), d = Number(bb[x]);
+            const c = Number(aa[x]);
+            const d = Number(bb[x]);
+            // tslint:disable-next-line: triple-equals
             if (c == aa[x] && d == bb[x]) {   // jshint ignore:line
                 return c - d;
             } else return (aa[x] > bb[x]) ? 1 : -1;
@@ -762,9 +777,10 @@ export function getImageHTML(name, tooltip?) {
 }
 
 export function debounce(func, threshold, execAsap) {
-    var timeout;
+    let timeout;
     return function debounced() {
-        var obj = this, args = arguments;
+        const obj = this;
+        const args = arguments;
         function delayed() {
             if (!execAsap)
                 func.apply(obj, args);
@@ -775,55 +791,55 @@ export function debounce(func, threshold, execAsap) {
         else if (execAsap)
             func.apply(obj, args);
         timeout = setTimeout(delayed, threshold || 100);
-    }
+    };
 }
 
 export function DynamicDialogForm(object) {
-    var table = domConstruct.create("table", {});
+    const table = domConstruct.create("table", {});
 
-    for (var key in object) {
-        var tr = domConstruct.create("tr", {}, table);
+    for (const key in object) {
+        const tr = domConstruct.create("tr", {}, table);
         if (object.hasOwnProperty(key)) {
-            var td = domConstruct.create("td", {
+            const td = domConstruct.create("td", {
                 style: "width: 30%;"
             }, tr);
             domConstruct.create("label", {
-                innerHTML: object[key]['label']
+                innerHTML: object[key]["label"]
             }, td);
-            var td1 = domConstruct.create("td", {
+            const td1 = domConstruct.create("td", {
                 style: "width: 100%;"
             }, tr);
-            this.key = object[key]['widget'].placeAt(td1);
+            this.key = object[key]["widget"].placeAt(td1);
         }
     }
     return table;
 }
 
 export function DynamicDialogTable(headingsArr, rows) {
-    var table = domConstruct.create("table", {
+    const table = domConstruct.create("table", {
         style: "border-collapse: collapse; width: 100%;"
     });
 
-    var headingTr = domConstruct.create("tr", {
+    const headingTr = domConstruct.create("tr", {
         style: "border: 1px solid #dddddd;"
     }, table);
 
     arrayUtil.forEach(headingsArr, function (row, idx) {
-        //  @ts-ignore 
-        var th = domConstruct.create("th", {
+        //  @ts-ignore
+        const th = domConstruct.create("th", {
             innerHTML: row,
             style: "text-align: left; padding-left:5px;"
-        }, headingTr)
+        }, headingTr);
     });
 
     arrayUtil.forEach(rows, function (row, idx) {
-        var tr = domConstruct.create("tr", {
+        const tr = domConstruct.create("tr", {
             style: "padding: 5px 0 5px 0;"
         }, table);
-        for (var key in row) {
-            //  @ts-ignore 
-            var td = domConstruct.create("td", {
-                innerHTML: key === "ServiceName" ? "<a href=" + row.Protocol + "://" + location.hostname + ":" + row.Port + " target='_blank'>" + row[key] + "</a>" : row[key], //TODO improve the ability to add link in any cell
+        for (const key in row) {
+            //  @ts-ignore
+            const td = domConstruct.create("td", {
+                innerHTML: key === "ServiceName" ? "<a href=" + row.Protocol + "://" + location.hostname + ":" + row.Port + " target='_blank'>" + row[key] + "</a>" : row[key], // TODO improve the ability to add link in any cell
                 style: "style: width: 30%; padding: 5px 0 5px 5px; border: 1px solid #dddddd;"
             }, tr);
         }
@@ -853,7 +869,7 @@ export class Persist {
     }
     get(key, defValue?) {
         if (typeof (Storage) !== "undefined") {
-            var retVal = localStorage.getItem(this.id + key);
+            const retVal = localStorage.getItem(this.id + key);
             return retVal === null ? defValue : retVal;
         }
         return "";
@@ -867,7 +883,7 @@ export class Persist {
     }
     exists(key) {
         if (typeof (Storage) !== "undefined") {
-            var retVal = localStorage.getItem(this.id + key);
+            const retVal = localStorage.getItem(this.id + key);
             return retVal === null;
         }
         return false;

+ 1 - 1
esp/src/src/WUGraphLegend.ts

@@ -112,7 +112,7 @@ export class WUGraphLegend extends Legend {
                     .render();
             })
             .remove();
-        this._g.attr("transform", `translate(32, 16)`);
+        this._g.attr("transform", "translate(32, 16)");
         const bbox = this.getBBox(true, true);
         this.resize({ width: bbox.width + 32, height: bbox.height + 16 });
     }

+ 2 - 1
esp/src/src/WUScopeController.ts

@@ -182,6 +182,7 @@ export class WUScopeController {
             if (typeof attr === "string") {
                 return attr.toLowerCase().indexOf(findTerm) >= 0;
             }
+            // tslint:disable-next-line: triple-equals
             return attr == findTerm;
         }
 
@@ -489,7 +490,7 @@ export class WUScopeController {
                 const lightColor = active ? ACTIVE_FILL : finished ? FINISHED_FILL : UNKNOWN_FILL;
                 e.strokeColor(strokeColor);
 
-                const vInOut = [e.sourceVertex(), e.targetVertex()]
+                const vInOut = [e.sourceVertex(), e.targetVertex()];
                 vInOut.forEach(v => {
                     if (v instanceof Vertex) {
                         (v as any)["__started"] = started;

+ 18 - 18
esp/src/src/WsDFUXref.ts

@@ -14,15 +14,15 @@ export function DFUXRefUnusedFiles(params) {
     return ESPRequest.send("WsDFUXRef", "DFUXRefUnusedFiles", params);
 }
 export function DFUXRefFoundFiles(params) {
-    var request = {
+    const request = {
         Cluster: params
-    }
+    };
     return ESPRequest.send("WsDFUXRef", "DFUXRefFoundFiles", {
-        request: request
+        request
     }).then(function (response) {
-        var newRows = [];
+        const newRows = [];
         if (lang.exists("DFUXRefFoundFilesQueryResponse.DFUXRefFoundFilesQueryResult.File", response)) {
-            var results = response.DFUXRefFoundFilesQueryResponse.DFUXRefFoundFilesQueryResult.File;
+            const results = response.DFUXRefFoundFilesQueryResponse.DFUXRefFoundFilesQueryResult.File;
             if (results.length) {
                 arrayUtil.forEach(results, function (row, idx) {
                     newRows.push({
@@ -45,15 +45,15 @@ export function DFUXRefFoundFiles(params) {
     });
 }
 export function DFUXRefOrphanFiles(params) {
-    var request = {
+    const request = {
         Cluster: params
-    }
+    };
     return ESPRequest.send("WsDFUXRef", "DFUXRefOrphanFiles", {
-        request: request
+        request
     }).then(function (response) {
-        var newRows = [];
+        const newRows = [];
         if (lang.exists("DFUXRefOrphanFilesQueryResponse.DFUXRefOrphanFilesQueryResult.File", response)) {
-            var results = response.DFUXRefOrphanFilesQueryResponse.DFUXRefOrphanFilesQueryResult.File
+            const results = response.DFUXRefOrphanFilesQueryResponse.DFUXRefOrphanFilesQueryResult.File;
             if (results.length) {
                 arrayUtil.forEach(results, function (row, idx) {
                     newRows.push({
@@ -84,15 +84,15 @@ export function DFUXRefCleanDirectories(params) {
     return ESPRequest.send("WsDFUXRef", "DFUXRefCleanDirectories", params);
 }
 export function DFUXRefLostFiles(params) {
-    var request = {
+    const request = {
         Cluster: params
-    }
+    };
     return ESPRequest.send("WsDFUXRef", "DFUXRefLostFiles", {
-        request: request
+        request
     }).then(function (response) {
-        var newRows = [];
+        const newRows = [];
         if (lang.exists("DFUXRefLostFilesQueryResponse.DFUXRefLostFilesQueryResult.File", response)) {
-            var results = response.DFUXRefLostFilesQueryResponse.DFUXRefLostFilesQueryResult.File
+            const results = response.DFUXRefLostFilesQueryResponse.DFUXRefLostFilesQueryResult.File;
             if (results.length) {
                 arrayUtil.forEach(results, function (row, idx) {
                     newRows.push({
@@ -117,7 +117,7 @@ export function DFUXRefLostFiles(params) {
                 });
             }
         }
-        return newRows
+        return newRows;
     });
 
 }
@@ -131,7 +131,7 @@ export function DFUXRefArrayAction(xrefFiles, actionType, cluster, type) {
     arrayUtil.forEach(xrefFiles, function (item, idx) {
         item.qualifiedName = item.Name;
     });
-    var request = {
+    const request = {
         XRefFiles: xrefFiles,
         Action: actionType,
         Cluster: cluster,
@@ -139,7 +139,7 @@ export function DFUXRefArrayAction(xrefFiles, actionType, cluster, type) {
     };
     ESPRequest.flattenArray(request, "XRefFiles", "qualifiedName");
     return ESPRequest.send("WsDFUXRef", "DFUXRefArrayAction", {
-        request: request
+        request
     }).then(function (response) {
         if (lang.exists("DFUXRefArrayActionResponse.DFUXRefArrayActionResult", response)) {
             if (response.DFUXRefArrayActionResponse.DFUXRefArrayActionResult.Value) {

+ 26 - 26
esp/src/src/WsDfu.ts

@@ -1,25 +1,25 @@
+import * as arrayUtil from "dojo/_base/array";
 import * as declare from "dojo/_base/declare";
+import * as Deferred from "dojo/_base/Deferred";
 import * as lang from "dojo/_base/lang";
-import * as arrayUtil from "dojo/_base/array";
 import * as Memory from "dojo/store/Memory";
 import * as Observable from "dojo/store/Observable";
 import * as QueryResults from "dojo/store/util/QueryResults";
 import * as topic from "dojo/topic";
-import * as Deferred from "dojo/_base/Deferred";
 
 import * as parser from "dojox/xml/parser";
 
-import ESPBase from "./ESPBase";
+import { ESPBase } from "./ESPBase";
 
 import * as ESPRequest from "./ESPRequest";
 
-var DiskUsageStore = declare([Memory], {
+const DiskUsageStore = declare([Memory], {
 
-    constructor: function () {
+    constructor() {
         this.idProperty = "__hpcc_id";
     },
 
-    query: function (query, options) {
+    query(query, options) {
         switch (query.CountBy) {
             case "Year":
             case "Quarter":
@@ -29,12 +29,12 @@ var DiskUsageStore = declare([Memory], {
                 query.CountBy = "Date";
                 break;
         }
-        var deferredResults = new Deferred();
+        const deferredResults = new Deferred();
         deferredResults.total = new Deferred();
         DFUSpace({
             request: query
         }).then(lang.hitch(this, function (response) {
-            var data = [];
+            const data = [];
             if (lang.exists("DFUSpaceResponse.DFUSpaceItems.DFUSpaceItem", response)) {
                 arrayUtil.forEach(response.DFUSpaceResponse.DFUSpaceItems.DFUSpaceItem, function (item, idx) {
                     data.push(lang.mixin(item, {
@@ -44,8 +44,8 @@ var DiskUsageStore = declare([Memory], {
             }
             if (options.sort && options.sort.length) {
                 data.sort(function (_l, _r) {
-                    var l = _l[options.sort[0].attribute];
-                    var r = _r[options.sort[0].attribute];
+                    let l = _l[options.sort[0].attribute];
+                    let r = _r[options.sort[0].attribute];
                     if (l === r) {
                         return 0;
                     }
@@ -62,7 +62,7 @@ var DiskUsageStore = declare([Memory], {
                         return r < l ? -1 : 1;
                     }
                     return l < r ? -1 : 1;
-                })
+                });
             }
             this.setData(data);
             deferredResults.resolve(data);
@@ -73,7 +73,7 @@ var DiskUsageStore = declare([Memory], {
 });
 
 export function CreateDiskUsageStore() {
-    var store = new DiskUsageStore();
+    const store = new DiskUsageStore();
     return Observable(store);
 }
 
@@ -85,17 +85,17 @@ export function DFUArrayAction(logicalFiles, actionType) {
             item.qualifiedName = item.Name + "@" + item.NodeGroup;
         }
     });
-    var request = {
+    const request = {
         LogicalFiles: logicalFiles,
         Type: actionType
     };
     ESPRequest.flattenArray(request, "LogicalFiles", "qualifiedName");
 
     return ESPRequest.send("WsDfu", "DFUArrayAction", {
-        request: request
+        request
     }).then(function (response) {
         if (lang.exists("DFUArrayActionResponse.ActionResults.DFUActionInfo", response)) {
-            var exceptions = [];
+            const exceptions = [];
             arrayUtil.forEach(response.DFUArrayActionResponse.ActionResults.DFUActionInfo, function (item, idx) {
                 if (item.Failed) {
                     exceptions.push({
@@ -117,21 +117,21 @@ export function DFUArrayAction(logicalFiles, actionType) {
 }
 
 export function SuperfileAction(action, superfile, subfiles, removeSuperfile) {
-    var request = {
-        action: action,
-        superfile: superfile,
-        subfiles: subfiles,
-        removeSuperfile: removeSuperfile
+    const request = {
+        action,
+        superfile,
+        subfiles,
+        removeSuperfile
     };
     ESPRequest.flattenArray(request, "subfiles", "Name");
 
     return ESPRequest.send("WsDfu", "SuperfileAction", {
-        request: request
+        request
     });
 }
 
 export function AddtoSuperfile(logicalFiles, superfile, existingFile) {
-    var request = {
+    const request = {
         names: logicalFiles,
         Superfile: superfile,
         ExistingFile: existingFile ? 1 : 0
@@ -139,7 +139,7 @@ export function AddtoSuperfile(logicalFiles, superfile, existingFile) {
     ESPRequest.flattenArray(request, "names", "Name");
 
     return ESPRequest.send("WsDfu", "AddtoSuperfile", {
-        request: request
+        request
     });
 }
 
@@ -193,9 +193,9 @@ export function DFUDefFile(params) {
     });
     return ESPRequest.send("WsDfu", "DFUDefFile", params).then(function (response) {
         try {
-            var domXml = parser.parse(response);
-            var espBase = new ESPBase();
-            var exceptions = espBase.getValues(domXml, "Exception", ["Exception"]);
+            const domXml = parser.parse(response);
+            const espBase = new ESPBase();
+            const exceptions = espBase.getValues(domXml, "Exception", ["Exception"]);
             if (exceptions.length) {
                 response = "";
                 arrayUtil.forEach(exceptions, function (item, idx) {

+ 2 - 5
esp/src/src/WsESDLConfig.ts

@@ -1,4 +1,4 @@
-import * as ESPRequest from "./ESPRequest"
+import * as ESPRequest from "./ESPRequest";
 
 export function ListDESDLEspBindings(params) {
     return ESPRequest.send("WsESDLConfig", "ListDESDLEspBindings", params);
@@ -32,11 +32,8 @@ export function PublishESDLBinding(params) {
     return ESPRequest.send("WsESDLConfig", "PublishESDLBinding", params);
 }
 
-//post 1.3 services
+// post 1.3 services
 
 export function ListESDLBindings(params) {
     return ESPRequest.send("WsESDLConfig", "ListESDLBindings", params);
 }
-
-
-

+ 29 - 29
esp/src/src/WsEcl.ts

@@ -1,6 +1,6 @@
-import * as lang from "dojo/_base/lang";
 import * as arrayUtil from "dojo/_base/array";
 import * as Deferred from "dojo/_base/Deferred";
+import * as lang from "dojo/_base/lang";
 import * as request from "dojo/request";
 import * as script from "dojo/request/script";
 import * as xhr from "dojo/request/xhr";
@@ -10,12 +10,12 @@ import * as WsTopology from "./WsTopology";
 declare const dojoConfig;
 
 export function _flattenResults(results) {
-    if (Object.prototype.toString.call(results) === '[object Array]') {
-        for (var i = 0; i < results.length; ++i) {
+    if (Object.prototype.toString.call(results) === "[object Array]") {
+        for (let i = 0; i < results.length; ++i) {
             results[i] = this._flattenResults(results[i]);
         }
-    } else if (Object.prototype.toString.call(results) === '[object Object]') {
-        for (var key in results) {
+    } else if (Object.prototype.toString.call(results) === "[object Object]") {
+        for (const key in results) {
             results[key] = this._flattenResults(results[key]);
             if (key === "Row") {
                 return results.Row;
@@ -24,24 +24,24 @@ export function _flattenResults(results) {
     }
     return results;
 }
-//http://192.168.1.201:8002/WsEcl/submit/query/roxie/countydeeds.1/json?year=2013&jsonp=XYZ
+// http://192.168.1.201:8002/WsEcl/submit/query/roxie/countydeeds.1/json?year=2013&jsonp=XYZ
 export function Call(target, method, query) {
-    var deferred = new Deferred();
-    var context = this;
-    var request = null;
+    const deferred = new Deferred();
+    const context = this;
+    let request = null;
     if (dojoConfig.urlInfo.baseHost) {
         request = script.get(dojoConfig.urlInfo.baseHost + "/WsEcl/submit/query/" + target + "/" + method + "/json", {
-            query: query,
+            query,
             jsonp: "jsonp"
         });
     } else {
         request = xhr.get("/WsEcl/submit/query/" + target + "/" + method + "/json", {
-            query: query,
+            query,
             handleAs: "json"
         });
     }
     request.then(function (response) {
-        var results = response[method + "Response"] && response[method + "Response"].Results ? response[method + "Response"].Results : {};
+        let results = response[method + "Response"] && response[method + "Response"].Results ? response[method + "Response"].Results : {};
         results = context._flattenResults(results);
         deferred.resolve(results);
     });
@@ -49,27 +49,27 @@ export function Call(target, method, query) {
 }
 export function CallURL(url, query) {
     //  http://X.X.X.X:8002/WsEcl/submit/query/roxie/method/json
-    var urlParts = url.split("/");
-    var method = urlParts[urlParts.length - 2];
-    var context = this;
+    const urlParts = url.split("/");
+    const method = urlParts[urlParts.length - 2];
+    const context = this;
     return script.get(url, {
-        query: query,
+        query,
         jsonp: "jsonp"
     }).then(function (response) {
-        var results = response[method + "Response"] && response[method + "Response"].Results ? response[method + "Response"].Results : {};
+        const results = response[method + "Response"] && response[method + "Response"].Results ? response[method + "Response"].Results : {};
         return context._flattenResults(results);
     });
 }
 export function Submit(target, method, query) {
-    var deferred = new Deferred();
-    var context = this;
+    const deferred = new Deferred();
+    const context = this;
     WsTopology.GetWsEclURL("submit").then(function (response) {
-        var url = response + target + "/" + method + "/json";
+        const url = response + target + "/" + method + "/json";
         script.get(url, {
-            query: query,
+            query,
             jsonp: "jsonp"
         }).then(function (response) {
-            var results = response[method + "Response"] && response[method + "Response"].Results ? response[method + "Response"].Results : {};
+            let results = response[method + "Response"] && response[method + "Response"].Results ? response[method + "Response"].Results : {};
             results = context._flattenResults(results);
             if (lang.exists("Exceptions.Exception", response)) {
                 results.Exception = response.Exceptions.Exception;
@@ -81,19 +81,19 @@ export function Submit(target, method, query) {
 }
 export function SubmitXML(target, domXml) {
     domXml = domXml.firstChild;
-    var method = domXml.tagName;
-    method = method.slice(0, -7); //"Request"
-    var query = {};
+    let method = domXml.tagName;
+    method = method.slice(0, -7); // "Request"
+    const query = {};
     arrayUtil.forEach(domXml.childNodes, function (item, idx) {
         query[item.tagName] = item.textContent;
     });
     return this.Submit(target, method, query);
 }
-//http://192.168.1.201:8002/WsEcl/example/request/query/roxie/countydeeds.1
+// http://192.168.1.201:8002/WsEcl/example/request/query/roxie/countydeeds.1
 export function ExampleRequest(target, method) {
-    var deferred = new Deferred();
+    const deferred = new Deferred();
     WsTopology.GetWsEclURL("example/request").then(function (response) {
-        var url = response + target + "/" + method;
+        const url = response + target + "/" + method;
         //  HPCC-10488  ---
         //  script.get(url, {
         //    query: query,
@@ -101,7 +101,7 @@ export function ExampleRequest(target, method) {
         request.get(url, {
             handleAs: "xml"
         }).then(function (response) {
-            var fields = [];
+            const fields = [];
             arrayUtil.forEach(response.getElementsByTagName(method + "Request"), function (item, idx) {
                 arrayUtil.forEach(item.childNodes, function (child_item, idx) {
                     fields.push(child_item.tagName);

+ 12 - 12
esp/src/src/WsPackageMaps.ts

@@ -5,7 +5,7 @@ import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
 
 import * as ESPRequest from "./ESPRequest";
 
-var i18n = nlsHPCC;
+const i18n = nlsHPCC;
 
 export function PackageMapQuery(params) {
     return ESPRequest.send("WsPackageProcess", "ListPackages", params);
@@ -78,36 +78,36 @@ export function GetPackageMapSelectProcessFilter(params) {
     });
 }
 
-//Not used for now. May be used later.
+// Not used for now. May be used later.
 export function listProcessFilters(callback) {
-    var context = this;
+    const context = this;
     return ESPRequest.send("WsPackageProcess", "ListProcessFilters", {
         request: {},
-        load: function (response) {
+        load(response) {
             if (!lang.exists("ListProcessFiltersResponse.ProcessFilters", response))
                 callback.load(i18n.NoContent);
             else
                 callback.load(response.ListProcessFiltersResponse.ProcessFilters);
         },
-        error: function (err) {
+        error(err) {
             context.errorMessageCallback(callback, err);
         }
     });
 }
 
 export function validatePackage(params) {
-    var request = { Target: params.target };
+    const request = { Target: params.target };
     if (params.packageMap)
-        request['PMID'] = params.packageMap;
+        request["PMID"] = params.packageMap;
     if (params.process)
-        request['Process'] = params.process;
+        request["Process"] = params.process;
     if (params.content)
-        request['Info'] = params.content;
+        request["Info"] = params.content;
     if (params.active)
-        request['Active'] = params.active;
+        request["Active"] = params.active;
 
     return ESPRequest.send("WsPackageProcess", "ValidatePackage", {
-        request: request
+        request
     });
 }
 
@@ -121,4 +121,4 @@ export function deactivatePackageMap(params) {
 
 export function deletePackageMap(params) {
     return ESPRequest.send("WsPackageProcess", "DeletePackage", params);
-}
+}

+ 2 - 2
esp/src/src/WsSMC.ts

@@ -31,7 +31,7 @@ export function MoveJobBack(params) {
     return ESPRequest.send("WsSMC", "MoveJobBack", params);
 }
 export function parseBuildString(build) {
-    var retVal = {
+    const retVal = {
         orig: build,
         prefix: "",
         postfix: "",
@@ -43,7 +43,7 @@ export function parseBuildString(build) {
     retVal.orig = build;
     retVal.prefix = "";
     retVal.postfix = "";
-    var verArray = build.split("[");
+    let verArray = build.split("[");
     if (verArray.length > 1) {
         retVal.postfix = verArray[1].split("]")[0];
     }

+ 25 - 25
esp/src/src/WsTopology.ts

@@ -1,29 +1,29 @@
 import { Connection } from "@hpcc-js/comms";
-import * as declare from "dojo/_base/declare";
-import * as lang from "dojo/_base/lang";
 import * as arrayUtil from "dojo/_base/array";
+import * as declare from "dojo/_base/declare";
 import * as Deferred from "dojo/_base/Deferred";
+import * as lang from "dojo/_base/lang";
+import * as Evented from "dojo/Evented";
 import * as Memory from "dojo/store/Memory";
 import * as Observable from "dojo/store/Observable";
 import * as QueryResults from "dojo/store/util/QueryResults";
-import * as Evented from "dojo/Evented";
 
 import * as ESPRequest from "./ESPRequest";
 import * as Utility from "./Utility";
 
 declare const dojoConfig;
 
-var TpLogFileStore = declare([Memory, Evented], {
-    constructor: function () {
+const TpLogFileStore = declare([Memory, Evented], {
+    constructor() {
         this.idProperty = "__hpcc_id";
     },
 
-    query: function (query, options) {
-        var deferredResults = new Deferred();
+    query(query, options) {
+        const deferredResults = new Deferred();
         deferredResults.total = new Deferred();
 
         function nextItem(itemParts) {
-            var part = "";
+            let part = "";
             while (itemParts.length && part.trim() === "") {
                 part = itemParts[0]; itemParts.shift();
             }
@@ -40,24 +40,24 @@ var TpLogFileStore = declare([Memory, Evented], {
                     IncludeLogFieldNames: 0
                 })
             }).then(lang.hitch(this, function (response) {
-                var data = [];
+                const data = [];
                 if (lang.exists("TpLogFileResponse.LogData", response)) {
-                    var columns = response.TpLogFileResponse.LogFieldNames.Item;
+                    const columns = response.TpLogFileResponse.LogFieldNames.Item;
                     this.lastPage = response.TpLogFileResponse.LogData;
                     this.emit("pageLoaded", this.lastPage);
                     arrayUtil.forEach(response.TpLogFileResponse.LogData.split("\n"), function (item, idx) {
                         if (options.start === 0 || idx > 0) {
                             //  Throw away first line as it will probably only be a partial line  ---
-                            var itemParts = item.split(" ");
-                            var tempObj = {
+                            const itemParts = item.split(" ");
+                            const tempObj = {
                                 __hpcc_id: response.TpLogFileResponse.PageNumber + "_" + idx
                             };
 
-                            for  (var i = 0; i < columns.length; ++i) {
-                                var cleanName = Utility.removeSpecialCharacters(columns[i]);
-                                var value = "";
+                            for (let i = 0; i < columns.length; ++i) {
+                                const cleanName = Utility.removeSpecialCharacters(columns[i]);
+                                let value = "";
 
-                                if ((i + 1) == (columns).length) {
+                                if ((i + 1) === columns.length) {
                                     value = itemParts.join("");
                                 } else if (itemParts.length) {
                                     value = nextItem(itemParts);
@@ -98,9 +98,9 @@ export function TpClusterQuery(params) {
 }
 
 export function GetESPServiceBaseURL(type) {
-    var deferred = new Deferred();
+    const deferred = new Deferred();
     this.TpServiceQuery({}).then(function (response) {
-        var retVal = ESPRequest.getURL({
+        let retVal = ESPRequest.getURL({
             port: window.location.protocol === "https:" ? 18002 : 8002,
             pathname: ""
         });
@@ -127,9 +127,9 @@ export function GetESPServiceBaseURL(type) {
 }
 export const WsEclURL = "";
 export function GetWsEclURL(type) {
-    var deferred = new Deferred();
+    const deferred = new Deferred();
     if (this.WsEclURL === "") {
-        var context = this;
+        const context = this;
         this.GetESPServiceBaseURL("ws_ecl").then(function (response) {
             context.WsEclURL = response + "/WsEcl/";
             deferred.resolve(context.WsEclURL + type + "/query/");
@@ -141,9 +141,9 @@ export function GetWsEclURL(type) {
 }
 export const WsEclIFrameURL = "";
 export function GetWsEclIFrameURL(type) {
-    var deferred = new Deferred();
+    const deferred = new Deferred();
     if (this.WsEclIFrameURL === "") {
-        var context = this;
+        const context = this;
         this.GetESPServiceBaseURL("ws_ecl").then(function (response) {
             context.WsEclIFrameURL = response + dojoConfig.urlInfo.basePath + "/stub.htm?Widget=IFrameWidget&src=" + encodeURIComponent("/WsEcl/");
             deferred.resolve(context.WsEclIFrameURL + encodeURIComponent(type + "/query/"));
@@ -161,8 +161,8 @@ export function TpGroupQuery(params) {
 }
 export function TpLogicalClusterQuery(params?) {
     return ESPRequest.send("WsTopology", "TpLogicalClusterQuery", params).then(function (response) {
-        var best = null;
-        var hthor = null;
+        let best = null;
+        let hthor = null;
         if (lang.exists("TpLogicalClusterQueryResponse.TpLogicalClusters.TpLogicalCluster", response)) {
             arrayUtil.forEach(response.TpLogicalClusterQueryResponse.TpLogicalClusters.TpLogicalCluster, function (item, idx) {
                 if (!best) {
@@ -206,7 +206,7 @@ export function TpLogFile(params) {
     return ESPRequest.send("WsTopology", "TpLogFile", params);
 }
 export function CreateTpLogFileStore() {
-    var store = new TpLogFileStore();
+    const store = new TpLogFileStore();
     return Observable(store);
 }
 export function TpGetServerVersion() {

+ 29 - 29
esp/src/src/WsWorkunits.ts

@@ -1,10 +1,10 @@
+import * as arrayUtil from "dojo/_base/array";
 import * as declare from "dojo/_base/declare";
+import * as Deferred from "dojo/_base/Deferred";
 import * as lang from "dojo/_base/lang";
-import * as arrayUtil from "dojo/_base/array";
 import "dojo/i18n";
 // @ts-ignore
 import * as nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";
-import * as Deferred from "dojo/_base/Deferred";
 import * as all from "dojo/promise/all";
 import * as Observable from "dojo/store/Observable";
 import * as topic from "dojo/topic";
@@ -12,13 +12,13 @@ import * as ESPRequest from "./ESPRequest";
 
 declare const dojo;
 
-var EventScheduleStore = declare([ESPRequest.Store], {
+const EventScheduleStore = declare([ESPRequest.Store], {
     service: "WsWorkunits",
     action: "WUShowScheduled",
     responseQualifier: "WUShowScheduledResponse.Workunits.ScheduledWU",
     idProperty: "calculatedID",
 
-    preProcessRow: function (row) {
+    preProcessRow(row) {
         lang.mixin(row, {
             calculatedID: row.Wuid + row.EventText
         });
@@ -58,7 +58,7 @@ export function WUCreate(params) {
 }
 
 export function WUUpdate(params) {
-    ESPRequest.flattenMap(params.request, "ApplicationValues")
+    ESPRequest.flattenMap(params.request, "ApplicationValues");
     return ESPRequest.send("WsWorkunits", "WUUpdate", params);
 }
 
@@ -87,16 +87,16 @@ export function WUPushEvent(params) {
 }
 
 export function WUQuerysetAliasAction(selection, action) {
-    var requests = [];
+    const requests = [];
     arrayUtil.forEach(selection, function (item, idx) {
-        var request = {
-            QuerySetName: item.QuerySetId,
-            Action: action,
+        const request = {
+            "QuerySetName": item.QuerySetId,
+            "Action": action,
             "Aliases.QuerySetAliasActionItem.0.Name": item.Name,
             "Aliases.QuerySetAliasActionItem.itemcount": 1
         };
         requests.push(ESPRequest.send("WsWorkunits", "WUQuerysetAliasAction", {
-            request: request
+            request
         }));
     });
     return all(requests);
@@ -106,16 +106,16 @@ export function WUQuerysetQueryAction(selection, action) {
     if (action === "Deactivate") {
         return this.WUQuerysetAliasAction(selection, action);
     }
-    var requests = [];
+    const requests = [];
     arrayUtil.forEach(selection, function (item, idx) {
-        var request = {
-            QuerySetName: item.QuerySetId,
-            Action: action,
+        const request = {
+            "QuerySetName": item.QuerySetId,
+            "Action": action,
             "Queries.QuerySetQueryActionItem.0.QueryId": item.Id,
             "Queries.QuerySetQueryActionItem.itemcount": 1
         };
         requests.push(ESPRequest.send("WsWorkunits", "WUQuerysetQueryAction", {
-            request: request
+            request
         }));
     });
     return all(requests);
@@ -221,17 +221,17 @@ export function WUFile(params) {
 }
 
 export function WUAction(workunits, actionType, callback) {
-    var request = {
+    const request = {
         Wuids: workunits,
         WUActionType: actionType
     };
     ESPRequest.flattenArray(request, "Wuids", "Wuid");
 
     return ESPRequest.send("WsWorkunits", "WUAction", {
-        request: request,
-        load: function (response) {
+        request,
+        load(response) {
             if (lang.exists("WUActionResponse.ActionResults.WUActionResult", response)) {
-                var wuMap = {};
+                const wuMap = {};
                 arrayUtil.forEach(workunits, function (item, index) {
                     wuMap[item.Wuid] = item;
                 });
@@ -243,7 +243,7 @@ export function WUAction(workunits, actionType, callback) {
                             Exceptions: [{ Source: item.Action + " " + item.Wuid, Message: item.Result }]
                         });
                     } else {
-                        var wu = wuMap[item.Wuid];
+                        const wu = wuMap[item.Wuid];
                         if (actionType === "delete" && item.Result === "Success") {
                             wu.set("StateID", 999);
                             wu.set("State", "not found");
@@ -258,7 +258,7 @@ export function WUAction(workunits, actionType, callback) {
                 callback.load(response);
             }
         },
-        error: function (err) {
+        error(err) {
             if (callback && callback.error) {
                 callback.error(err);
             }
@@ -303,7 +303,7 @@ export const visualisations = [
     { value: "DojoD3Choropleth COUNTY", label: "US County Choropleth" }
 ];
 export function GetVisualisations() {
-    var deferred = new Deferred();
+    const deferred = new Deferred();
     if (this.visualisations) {
         deferred.resolve(this.visualisations);
     }
@@ -311,7 +311,7 @@ export function GetVisualisations() {
 }
 
 export function CreateEventScheduleStore(options) {
-    var store = new EventScheduleStore(options);
+    const store = new EventScheduleStore(options);
     return Observable(store);
 }
 
@@ -321,16 +321,16 @@ export function isComplete(stateID, actionEx, archived?) {
         return true;
     }
     switch (stateID) {
-        case 1: //WUStateCompiled
+        case 1: // WUStateCompiled
             if (actionEx && actionEx === "compile") {
                 return true;
             }
             break;
-        case 3: //WUStateCompleted:
-        case 4: //WUStateFailed:
-        case 5: //WUStateArchived:
-        case 7: //WUStateAborted:
-        case 999: //WUStateDeleted:
+        case 3: // WUStateCompleted:
+        case 4: // WUStateFailed:
+        case 5: // WUStateArchived:
+        case 7: // WUStateAborted:
+        case 999: // WUStateDeleted:
             return true;
     }
     return false;

+ 7 - 8
esp/src/src/dojoLib.ts

@@ -1,16 +1,15 @@
 //  dojo  ---
 import * as _ready from "dojo/ready";
-export const ready:any = _ready;
+export const ready: any = _ready;
 import * as _handlers from "dojo/request/handlers";
-export const handlers:any = _handlers;
-import * as _xhr from "dojo/request/xhr";
-export const xhr:any = _xhr;
-import * as _json from "dojo/request/xhr";
-export const json:any = _json;
+export const handlers: any = _handlers;
+import * as _xhrJson from "dojo/request/xhr";
+export const xhr: any = _xhrJson;
+export const json: any = _xhrJson;
 import * as _dom from "dojo/dom";
-export const dom:any = _dom;
+export const dom: any = _dom;
 import * as _on from "dojo/on";
-export const on:any = _on;
+export const on: any = _on;
 import "dojo/i18n";
 // @ts-ignore
 import * as _nlsHPCC from "dojo/i18n!hpcc/nls/hpcc";

+ 77 - 77
esp/src/src/ws_access.ts

@@ -1,18 +1,18 @@
+import * as arrayUtil from "dojo/_base/array";
 import * as declare from "dojo/_base/declare";
+import * as Deferred from "dojo/_base/Deferred";
 import * as lang from "dojo/_base/lang";
-import * as arrayUtil from "dojo/_base/array";
 import * as all from "dojo/promise/all";
 import * as Memory from "dojo/store/Memory";
 import * as Observable from "dojo/store/Observable";
-import * as Deferred from "dojo/_base/Deferred";
 import * as QueryResults from "dojo/store/util/QueryResults";
 import * as SimpleQueryEngine from "dojo/store/util/SimpleQueryEngine";
 import * as topic from "dojo/topic";
 
-import * as ESPUtil from "./ESPUtil";
 import * as ESPRequest from "./ESPRequest";
+import * as ESPUtil from "./ESPUtil";
 
-var UsersStore = declare([ESPRequest.Store], {
+const UsersStore = declare([ESPRequest.Store], {
     service: "ws_access",
     action: "UserQuery",
     responseQualifier: "UserQueryResponse.Users.User",
@@ -20,10 +20,10 @@ var UsersStore = declare([ESPRequest.Store], {
     idProperty: "username",
     startProperty: "PageStartFrom",
     countProperty: "PageSize",
-    SortbyProperty: 'SortBy'
+    SortbyProperty: "SortBy"
 });
 
-var GroupsStore = declare([ESPRequest.Store], {
+const GroupsStore = declare([ESPRequest.Store], {
     service: "ws_access",
     action: "GroupQuery",
     responseQualifier: "GroupQueryResponse.Groups.Group",
@@ -31,9 +31,9 @@ var GroupsStore = declare([ESPRequest.Store], {
     idProperty: "name",
     startProperty: "PageStartFrom",
     countProperty: "PageSize",
-    SortbyProperty: 'SortBy',
+    SortbyProperty: "SortBy",
 
-    preRequest: function (request) {
+    preRequest(request) {
         switch (request.SortBy) {
             case "name":
                 request.SortBy = "Name";
@@ -45,17 +45,17 @@ var GroupsStore = declare([ESPRequest.Store], {
     }
 });
 
-var CONCAT_SYMBOL = ":";
-var ResourcesStore = declare([Memory], {
+const CONCAT_SYMBOL = ":";
+const ResourcesStore = declare([Memory], {
 
-    constructor: function () {
+    constructor() {
         this.idProperty = "__hpcc_id";
     },
 
     put: ESPUtil.override(function (inherited, row) {
         this.get(row.__hpcc_id);
-        var retVal = inherited(arguments);
-        var request = {
+        const retVal = inherited(arguments);
+        const request = {
             account_name: this.groupname ? this.groupname : this.username,
             account_type: this.groupname ? 1 : 0,
             BasednName: row.__hpcc_parent.name,
@@ -63,26 +63,26 @@ var ResourcesStore = declare([Memory], {
             action: "update"
         };
         lang.mixin(request, row);
-        delete request['__hpcc_parent'];
+        delete request["__hpcc_parent"];
         PermissionAction({
-            request: request
+            request
         });
         return retVal;
     }),
 
-    query: function (query, options) {
-        var results = all([
+    query(query, options) {
+        const results = all([
             this.refreshResources(query),
             this.refreshAccountPermissions(query)
         ]).then(lang.hitch(this, function (response) {
-            var accountPermissions = {};
+            const accountPermissions = {};
             arrayUtil.forEach(response[1], function (item, idx) {
                 accountPermissions[item.ResourceName] = item;
             }, this);
 
-            var data = [];
+            const data = [];
             arrayUtil.forEach(response[0], function (item, idx) {
-                var accountPermission = accountPermissions[item.name];
+                const accountPermission = accountPermissions[item.name];
                 data.push(lang.mixin(item, {
                     __hpcc_type: "Resources",
                     __hpcc_id: this.parentRow.__hpcc_id + CONCAT_SYMBOL + item.name,
@@ -106,7 +106,7 @@ var ResourcesStore = declare([Memory], {
         return QueryResults(results);
     },
 
-    refreshResources: function (query) {
+    refreshResources(query) {
         return Resources({
             request: {
                 name: this.parentRow.name
@@ -119,7 +119,7 @@ var ResourcesStore = declare([Memory], {
         }));
     },
 
-    refreshAccountPermissions: function () {
+    refreshAccountPermissions() {
         if (!this.groupname && !this.username) {
             return [];
         }
@@ -138,16 +138,16 @@ var ResourcesStore = declare([Memory], {
     }
 });
 
-var InheritedPermissionStore = declare([Memory], {
+const InheritedPermissionStore = declare([Memory], {
 
-    constructor: function () {
+    constructor() {
         this.idProperty = "__hpcc_id";
     },
 
     put: ESPUtil.override(function (inherited, row) {
         this.get(row.__hpcc_id);
-        var retVal = inherited(arguments);
-        var request = {
+        const retVal = inherited(arguments);
+        const request = {
             BasednName: row.BasednName,
             rname: row.ResourceName,
             account_name: row.account_name,
@@ -156,17 +156,17 @@ var InheritedPermissionStore = declare([Memory], {
         };
         lang.mixin(request, row);
         PermissionAction({
-            request: request
+            request
         });
         return retVal;
     }),
 
-    query: function (query, options) {
-        var data = [];
-        var results = all([
+    query(query, options) {
+        const data = [];
+        const results = all([
             this.refreshAccountPermissions(query)
         ]).then(lang.hitch(this, function (response) {
-            var accountPermissions = {};
+            const accountPermissions = {};
             arrayUtil.forEach(response[0], function (item, idx) {
                 accountPermissions[item.ResourceName] = item;
                 data.push(lang.mixin(item, {
@@ -191,7 +191,7 @@ var InheritedPermissionStore = declare([Memory], {
         return QueryResults(results);
     },
 
-    refreshAccountPermissions: function () {
+    refreshAccountPermissions() {
         if (!this.AccountName) {
             return [];
         }
@@ -204,8 +204,8 @@ var InheritedPermissionStore = declare([Memory], {
             }
         }).then(lang.hitch(this, function (response) {
             if (lang.exists("AccountPermissionsResponse.GroupPermissions.GroupPermission", response)) {
-                var arr = response.AccountPermissionsResponse.GroupPermissions.GroupPermission;
-                for (var index in arr) {
+                const arr = response.AccountPermissionsResponse.GroupPermissions.GroupPermission;
+                for (const index in arr) {
                     if (arr[index].GroupName === this.TabName) {
                         return response.AccountPermissionsResponse.GroupPermissions.GroupPermission[index].Permissions.Permission;
                     }
@@ -216,16 +216,16 @@ var InheritedPermissionStore = declare([Memory], {
     }
 });
 
-var AccountResourcesStore = declare([Memory], {
+const AccountResourcesStore = declare([Memory], {
 
-    constructor: function () {
+    constructor() {
         this.idProperty = "__hpcc_id";
     },
 
     put: ESPUtil.override(function (inherited, row) {
         this.get(row.__hpcc_id);
-        var retVal = inherited(arguments);
-        var request = {
+        const retVal = inherited(arguments);
+        const request = {
             BasednName: row.BasednName,
             rname: row.ResourceName,
             account_name: row.account_name,
@@ -233,17 +233,17 @@ var AccountResourcesStore = declare([Memory], {
         };
         lang.mixin(request, row);
         PermissionAction({
-            request: request
+            request
         });
         return retVal;
     }),
 
-    query: function (query, options) {
-        var data = [];
-        var results = all([
+    query(query, options) {
+        const data = [];
+        const results = all([
             this.refreshAccountPermissions(query)
         ]).then(lang.hitch(this, function (response) {
-            var accountPermissions = {};
+            const accountPermissions = {};
             arrayUtil.forEach(response[0], function (item, idx) {
                 accountPermissions[item.ResourceName] = item;
                 data.push(lang.mixin(item, {
@@ -268,7 +268,7 @@ var AccountResourcesStore = declare([Memory], {
         return QueryResults(results);
     },
 
-    refreshAccountPermissions: function () {
+    refreshAccountPermissions() {
         if (!this.AccountName) {
             return [];
         }
@@ -287,16 +287,16 @@ var AccountResourcesStore = declare([Memory], {
     }
 });
 
-var IndividualPermissionsStore = declare([Memory], {
+const IndividualPermissionsStore = declare([Memory], {
 
-    constructor: function () {
+    constructor() {
         this.idProperty = "__hpcc_id";
     },
 
     put: ESPUtil.override(function (inherited, row) {
         this.get(row.__hpcc_id);
-        var retVal = inherited(arguments);
-        var request = {
+        const retVal = inherited(arguments);
+        const request = {
             BasednName: row.BasednName,
             rname: row.rname,
             account_name: row.account_name,
@@ -304,17 +304,17 @@ var IndividualPermissionsStore = declare([Memory], {
         };
         lang.mixin(request, row);
         PermissionAction({
-            request: request
+            request
         });
         return retVal;
     }),
 
-    query: function (query, options) {
-        var data = [];
-        var results = all([
+    query(query, options) {
+        const data = [];
+        const results = all([
             this.refreshAccountPermissions(query)
         ]).then(lang.hitch(this, function (response) {
-            var accountPermissions = {};
+            const accountPermissions = {};
             arrayUtil.forEach(response[0], function (item, idx) {
                 accountPermissions[item.account_name] = item;
                 data.push(lang.mixin(item, {
@@ -340,7 +340,7 @@ var IndividualPermissionsStore = declare([Memory], {
         return QueryResults(results);
     },
 
-    refreshAccountPermissions: function () {
+    refreshAccountPermissions() {
         return ResourcePermissions({
             request: {
                 name: this.name ? this.name : "",
@@ -355,25 +355,25 @@ var IndividualPermissionsStore = declare([Memory], {
     }
 });
 
-var PermissionsStore = declare([Memory], {
+const PermissionsStore = declare([Memory], {
     service: "ws_access",
     action: "Permissions",
     responseQualifier: "BasednsResponse.Basedns.Basedn",
     idProperty: "__hpcc_id",
 
-    constructor: function () {
+    constructor() {
         this.idProperty = "__hpcc_id";
     },
 
     get: ESPUtil.override(function (inherited, id) {
-        var tmp = id.split(CONCAT_SYMBOL);
+        const tmp = id.split(CONCAT_SYMBOL);
         if (tmp.length > 0) {
-            var parentID = tmp[0];
-            var parent = inherited([parentID]);
+            const parentID = tmp[0];
+            const parent = inherited([parentID]);
             if (tmp.length === 1) {
                 return parent;
             }
-            var child = parent.children.get(id);
+            const child = parent.children.get(id);
             if (child) {
                 return child;
             }
@@ -382,24 +382,24 @@ var PermissionsStore = declare([Memory], {
         return null;
     }),
 
-    putChild: function (row) {
-        var parent = row.__hpcc_parent;
+    putChild(row) {
+        const parent = row.__hpcc_parent;
         return parent.children.put(row);
     },
 
-    getChildren: function (parent, options) {
+    getChildren(parent, options) {
         return parent.children.query();
     },
 
-    mayHaveChildren: function (object) {
+    mayHaveChildren(object) {
         return object.__hpcc_type === "Permission";
     },
 
-    query: function (query, options) {
-        var deferredResults = new Deferred();
+    query(query, options) {
+        const deferredResults = new Deferred();
         deferredResults.total = new Deferred();
         Permissions().then(lang.hitch(this, function (response) {
-            var data = [];
+            const data = [];
             if (lang.exists("BasednsResponse.Basedns.Basedn", response)) {
                 arrayUtil.forEach(response.BasednsResponse.Basedns.Basedn, function (item, idx) {
                     data.push(lang.mixin(item, {
@@ -425,8 +425,8 @@ var PermissionsStore = declare([Memory], {
 });
 
 export function checkError(response, sourceMethod, showOkMsg) {
-    var retCode = lang.getObject(sourceMethod + "Response.retcode", false, response);
-    var retMsg = lang.getObject(sourceMethod + "Response.retmsg", false, response);
+    const retCode = lang.getObject(sourceMethod + "Response.retcode", false, response);
+    const retMsg = lang.getObject(sourceMethod + "Response.retmsg", false, response);
     if (retCode) {
         topic.publish("hpcc/brToaster", {
             Severity: "Error",
@@ -587,7 +587,7 @@ export function CheckFilePermissions() {
 }
 
 export function CreateUsersStore(groupname, observable) {
-    var store = new UsersStore();
+    const store = new UsersStore();
     store.groupname = groupname;
     if (observable) {
         return Observable(store);
@@ -596,7 +596,7 @@ export function CreateUsersStore(groupname, observable) {
 }
 
 export function CreateGroupsStore(username, observable) {
-    var store = new GroupsStore();
+    const store = new GroupsStore();
     store.username = username;
     if (observable) {
         return Observable(store);
@@ -605,14 +605,14 @@ export function CreateGroupsStore(username, observable) {
 }
 
 export function CreatePermissionsStore(groupname, username) {
-    var store = new PermissionsStore();
+    const store = new PermissionsStore();
     store.groupname = groupname;
     store.username = username;
     return Observable(store);
 }
 
 export function CreateAccountPermissionsStore(IsGroup, IncludeGroup, AccountName) {
-    var store = new AccountResourcesStore();
+    const store = new AccountResourcesStore();
     store.IsGroup = IsGroup;
     store.IncludeGroup = IncludeGroup;
     store.AccountName = AccountName;
@@ -620,7 +620,7 @@ export function CreateAccountPermissionsStore(IsGroup, IncludeGroup, AccountName
 }
 
 export function CreateInheritedPermissionsStore(IsGroup, IncludeGroup, AccountName, TabName) {
-    var store = new InheritedPermissionStore();
+    const store = new InheritedPermissionStore();
     store.IsGroup = IsGroup;
     store.IncludeGroup = IncludeGroup;
     store.AccountName = AccountName;
@@ -629,17 +629,17 @@ export function CreateInheritedPermissionsStore(IsGroup, IncludeGroup, AccountNa
 }
 
 export function CreateIndividualPermissionsStore(basedn, name) {
-    var store = new IndividualPermissionsStore();
+    const store = new IndividualPermissionsStore();
     store.basedn = basedn;
     store.name = name;
     return Observable(store);
 }
 
 export function CreateResourcesStore(groupname, username, basedn, name) {
-    var store = new ResourcesStore();
+    const store = new ResourcesStore();
     store.groupname = groupname;
     store.username = username;
     store.basedn = basedn;
     store.name = name;
     return Observable(store);
-}
+}

+ 3 - 4
esp/src/src/ws_account.ts

@@ -4,8 +4,8 @@ import * as topic from "dojo/topic";
 import * as ESPRequest from "./ESPRequest";
 
 export function checkError(response, sourceMethod, showOkMsg) {
-    var retCode = lang.getObject(sourceMethod + "Response.retcode", false, response);
-    var retMsg = lang.getObject(sourceMethod + "Response.message", false, response);
+    const retCode = lang.getObject(sourceMethod + "Response.retcode", false, response);
+    const retMsg = lang.getObject(sourceMethod + "Response.message", false, response);
     if (retCode) {
         topic.publish("hpcc/brToaster", {
             Severity: "Error",
@@ -22,7 +22,7 @@ export function checkError(response, sourceMethod, showOkMsg) {
 }
 
 export function UpdateUser(params) {
-    var context = this;
+    const context = this;
     return ESPRequest.send("ws_account", "UpdateUser", params).then(function (response) {
         context.checkError(response, "UpdateUser", params ? params.showOkMsg : false);
         return response;
@@ -50,4 +50,3 @@ export function Lock(params) {
     });
     return ESPRequest.send("esp", "lock", params);
 }
-

+ 7 - 7
esp/src/src/ws_machine.ts

@@ -1,17 +1,17 @@
 import * as declare from "dojo/_base/declare";
-import * as topic from "dojo/topic";
 import * as Observable from "dojo/store/Observable";
+import * as topic from "dojo/topic";
 
 import * as ESPRequest from "./ESPRequest";
 
-var NagiosStore = declare([ESPRequest.Store], {
+const NagiosStore = declare([ESPRequest.Store], {
     service: "ws_machine",
     action: "GetComponentStatus",
     responseQualifier: "GetComponentStatusResponse.ComponentStatusList.ComponentStatus",
     idProperty: "__hpcc_id"
 });
 
-var monitorHandle;
+let monitorHandle;
 export function GetComponentStatus(params) {
     return ESPRequest.send("ws_machine", "GetComponentStatus", params);
 }
@@ -25,15 +25,15 @@ export function GetMachineInfo(params) {
 }
 
 export function MonitorComponentStatus(params) {
-    var prevResponse = null;
+    let prevResponse = null;
     if (!monitorHandle) {
-        var context = this;
+        const context = this;
         monitorHandle = setInterval(function () {
             context.GetComponentStatus(params).then(function (response) {
                 if (response && response.GetComponentStatusResponse.ComponentStatus) {
                     response.GetComponentStatusResponse.ComponentStatusList.ComponentStatus.forEach(function (row) {
                         topic.publish("hpcc/monitoring_component_update", {
-                            response: response,
+                            response,
                             status: response.GetComponentStatusResponse.ComponentStatus
                         });
                     });
@@ -46,6 +46,6 @@ export function MonitorComponentStatus(params) {
 }
 
 export function CreateNagiosStore(options) {
-    var store = new NagiosStore(options);
+    const store = new NagiosStore(options);
     return Observable(store);
 }

+ 35 - 12
esp/src/tslint.json

@@ -8,8 +8,9 @@
     "extends": "tslint:recommended",
     "rules": {
         /*
-     * Any rules specified here will override those from the base config we are extending.
-     */
+         * Any rules specified here will override those from the base config we are extending.
+        */
+        "member-ordering": false,
         "prefer-for-of": false,
         "no-console": [
             false
@@ -18,6 +19,10 @@
         "interface-over-type-literal": false,
         "no-empty-interface": false,
         "no-unused-expression": false,
+        "no-shadowed-variable": [
+            false,
+            {}
+        ],
         "space-before-function-paren": false,
         "arrow-parens": false,
         "forin": false,
@@ -27,19 +32,14 @@
         ],
         "object-literal-sort-keys": false,
         "trailing-comma": [
-            false,
+            true,
             {
-                "multiline": "always",
+                "multiline": "never",
                 "singleline": "never"
             }
         ],
         "curly": false,
-        "member-ordering": [
-            true
-        ],
-        "max-classes-per-file": [
-            false
-        ],
+        "max-classes-per-file": false,
         "no-empty": false,
         "max-line-length": [
             false
@@ -60,10 +60,33 @@
             "check-operator",
             "check-module",
             "check-separator",
-            "check-type"
+            "check-rest-spread",
+            "check-type",
+            "check-typecast",
+            "check-type-operator",
+            "check-preblock"
         ],
         "prefer-const": true,
-        "no-string-literal": false
+        "no-string-literal": false,
+        "indent": [
+            true,
+            "spaces",
+            4
+        ],
+        "deprecation": true,
+        "no-duplicate-imports": true,
+        "no-default-export": true,
+        "no-require-imports": true,
+        "no-irregular-whitespace": true,
+        "no-unnecessary-callback-wrapper": true,
+        "quotemark": [
+            true,
+            "double",
+            "avoid-template",
+            "avoid-escape"
+        ],
+        "unified-signatures": false,
+        "no-bitwise": false
     },
     "jsRules": {
         /*