Browse Source

HPCC-23280 Remove "nopack=1" support

Signed-off-by: Gordon Smith <gordonjsmith@gmail.com>
Gordon Smith 5 years ago
parent
commit
34030deb65

+ 1 - 2
esp/src/eclwatch/_Widget.js

@@ -135,14 +135,13 @@ define([
                 var baseUrlParts = baseUrl.split("?");
                 baseUrl = baseUrlParts[0];
                 var args = baseUrlParts[1];
-                var nopack = (args && args.indexOf("nopack=1") >= 0) ? "nopack=1&" : "";
                 delete this.params.__filter;
                 var filterParams = this.getFilterParams();
                 if (filterParams) {
                     this.params.__filter = ioQuery.objectToQuery(filterParams);
                 }
                 var paramsString = ioQuery.objectToQuery(this.params);
-                return baseUrl + "?" + nopack + paramsString;
+                return baseUrl + "?" + paramsString;
             },
 
             _onNewPage: function (event) {

+ 1 - 3
esp/src/eclwatch/dojoConfig.js

@@ -56,9 +56,7 @@ function getConfig(env) {
             "codemirror": baseUrl + "/node_modules/codemirror",
             "crossfilter": baseUrl + "/node_modules/crossfilter2/crossfilter.min",
             "font-awesome": baseUrl + "/node_modules/@hpcc-js/common/font-awesome",
-            "tslib": baseUrl + "/node_modules/tslib/tslib",
-            "react": baseUrl + "/node_modules/react/umd/react.production.min",
-            "react-dom": baseUrl + "/node_modules/react-dom/umd/react-dom.production.min"
+            "tslib": baseUrl + "/node_modules/tslib/tslib"
         },
         packages: [
             {

+ 6 - 6
esp/src/package.json

@@ -17,13 +17,13 @@
     "copy-res": "run-p copy-res-es6-promise copy-res-eclwatch-img copy-res-eclwatch-ecl copy-res-dojo copy-res-dojox copy-res-TopoJSON copy-res-font-awesome copy-res-stub_htm",
     "compile": "tsc",
     "compile-watch": "npm run compile -- -w",
-    "bundle": "node node_modules/webpack/bin/webpack.js --env.production --config webpack.config.js",
-    "bundle-dev": "node node_modules/webpack/bin/webpack.js --progress --config webpack.config.js",
-    "bundle-watch": "npm run bundle -- --watch",
+    "bundle": "node node_modules/webpack/bin/webpack.js --env production --config webpack.config.js",
+    "bundle-dev": "node node_modules/webpack/bin/webpack.js --env development --config webpack.config.js",
+    "bundle-watch": "npm run bundle-dev -- --watch",
     "build": "npm-run-all --parallel copy-res compile --serial bundle",
     "build-dev": "npm-run-all --parallel copy-res compile --serial bundle-dev",
-    "start:dev": "ws",
-    "dev-start": "ws",
+    "dev-start-ws": "ws",
+    "dev-start": "run-p bundle-watch dev-start-ws",
     "dev-start-verbose": "ws --verbose.include request response",
     "dev-link": "rimraf ./node_modules/@hpcc-js && mklink /J .\\node_modules\\@hpcc-js ..\\..\\..\\hpcc-js\\packages",
     "dev-unlink": "rimraf ./node_modules/@hpcc-js && npm install",
@@ -77,4 +77,4 @@
     "type": "git",
     "url": "https://github.com/hpcc-systems/HPCC-Platform"
   }
-}
+}

+ 9 - 16
esp/src/stub.htm

@@ -2,36 +2,29 @@
 <html>
 
 <head>
-    <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta charset="utf-8">
     <title>ECL Watch</title>
     <script src="/esp/files/node_modules/es6-promise/dist/es6-promise.auto.min.js"></script>
     <link rel="stylesheet" href="/esp/files/dist/font-awesome/css/font-awesome.min.css">
     <link rel="icon" type="image/png" href="/esp/files/img/favlogo.png">
-    <!-- load dojo and provide config via dojoConfig global -->
+    <script type="text/javascript" src="/esp/files/dist/stub.eclwatch.js" charset="utf-8"></script>
     <script type="text/javascript">
-        if (/[?&]nopack=(1|true)/i.test(location.search)) {
-            document.write("<script type=\"text/javascript\" src=\"/esp/files/eclwatch/dojoConfig.js\" charset=\"utf-8\"><" + "/script>");
-            document.write("<script type=\"text/javascript\" src=\"/esp/files/eclwatch/debugConfig.js\" charset=\"utf-8\"><" + "/script>");
-            document.write("<script type=\"text/javascript\" src=\"/esp/files/node_modules/dojo/dojo.js\" charset=\"utf-8\"><" + "/script>");
-        } else {
-            document.write("<script type=\"text/javascript\" src=\"/esp/files/dist/stub.eclwatch.js\" charset=\"utf-8\"><" + "/script>");
-        }
         getAuthType();
-        function getAuthType(){
-            if (document.cookie.indexOf ("ESPSessionState=true") > -1){
+        function getAuthType() {
+            if (document.cookie.indexOf("ESPSessionState=true") > -1) {
                 checkCookie();
-            } else if (document.cookie.indexOf ("ESPSessionState=false") > -1) {
+            } else if (document.cookie.indexOf("ESPSessionState=false") > -1) {
                 window.location.href;
             } else {
                 sendAuthRequest();
             }
 
-            function checkCookie(){
-                    document.cookie.indexOf ("ESPAuthenticated=true") > -1 ? window.location.href : window.location.href = location.origin + "/esp/files/Login.html";
-                }
+            function checkCookie() {
+                document.cookie.indexOf("ESPAuthenticated=true") > -1 ? window.location.href : window.location.href = location.origin + "/esp/files/Login.html";
+            }
 
-            function sendAuthRequest(){
+            function sendAuthRequest() {
                 var xhttp = new XMLHttpRequest();
                 xhttp.onload = function () {
                     var responseType = this.responseXML && this.responseXML.childNodes && this.responseXML.childNodes.length ? this.responseXML.childNodes[0].textContent : "None";

+ 1 - 1
esp/src/tsconfig.json

@@ -25,4 +25,4 @@
     "include": [
         "src/**/*"
     ]
-}
+}

+ 1 - 2
esp/src/webpack.config.js

@@ -1,4 +1,3 @@
-
 var DojoWebpackPlugin = require("dojo-webpack-plugin");
 var CopyWebpackPlugin = require("copy-webpack-plugin");
 
@@ -7,7 +6,7 @@ var webpack = require("webpack");
 var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
 
 module.exports = function (env) {
-    const isDev = env && env.build === "development";
+    const isDev = env && env === "development";
     const isProduction = !isDev;
 
     const plugins = [