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

mitchell852 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new cc8e93e  Fix issues with flot (#5526)
cc8e93e is described below

commit cc8e93e99b690e812c6cf382dc80f0f891a64773
Author: Steve Hamrick <[email protected]>
AuthorDate: Thu Mar 4 12:48:59 2021 -0700

    Fix issues with flot (#5526)
    
    * Fix issues with flot
    
    * Fix time axis labels
    
    * Assume go is on path
---
 .github/actions/tp-e2e-tests/entrypoint.sh         |  6 +-
 build/functions.sh                                 |  2 +-
 .../common/modules/chart/bps/ChartBPSController.js |  8 ++-
 .../chart/httpStatus/ChartHttpStatusController.js  |  5 +-
 .../common/modules/chart/tps/ChartTPSController.js |  5 +-
 .../widget/cdnChart/WidgetCDNChartController.js    |  5 +-
 traffic_portal/bower.json                          |  3 -
 traffic_portal/grunt/browserify.js                 | 24 +++----
 traffic_portal/package-lock.json                   | 80 +++++++++++++++++-----
 traffic_portal/package.json                        |  4 +-
 10 files changed, 98 insertions(+), 44 deletions(-)

diff --git a/.github/actions/tp-e2e-tests/entrypoint.sh 
b/.github/actions/tp-e2e-tests/entrypoint.sh
index 6f1b322..65becee 100755
--- a/.github/actions/tp-e2e-tests/entrypoint.sh
+++ b/.github/actions/tp-e2e-tests/entrypoint.sh
@@ -165,8 +165,10 @@ if [[ ! -e "$REPO_DIR" ]]; then
 fi
 
 cd "${REPO_DIR}/traffic_ops/traffic_ops_golang"
-/usr/local/go/bin/go mod vendor -v > /dev/null
-/usr/local/go/bin/go build . > /dev/null
+
+go mod vendor -v > /dev/null
+go build . > /dev/null
+ 
 
 openssl req -new -x509 -nodes -newkey rsa:4096 -out localhost.crt -keyout 
localhost.key -subj "/CN=tptests";
 
diff --git a/build/functions.sh b/build/functions.sh
index b66ba79..2edcf1e 100755
--- a/build/functions.sh
+++ b/build/functions.sh
@@ -327,7 +327,7 @@ verify_and_set_go_version() {
 
                version_pattern='.*go([1-9]+)\.([1-9]+).*'
                if echo "$go_version" | grep -E "$version_pattern"; then
-                       group_1="$(echo "$go_version" | sed -E 
"s/.*${version_pattern}/\1/")"
+                       group_1="$(echo "$go_version" | sed -E 
"s/${version_pattern}/\1/")"
                        group_2="$(echo "$go_version" | sed -E 
"s/${version_pattern}/\2/")"
                        if [ ! "$group_1" -ge "$major_version" ] || [ ! 
"$group_2" -ge "$minor_version" ]; then
                                GO_VERSION="${group_1}.${group_2}"; export 
GO_VERSION
diff --git 
a/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js 
b/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js
index 827d79f..f99d51c 100644
--- a/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js
+++ b/traffic_portal/app/src/common/modules/chart/bps/ChartBPSController.js
@@ -62,9 +62,10 @@ var ChartBPSController = function(deliveryService, $scope, 
$state, $timeout, $fi
                var normalizedChartData = [];
 
                if (angular.isDefined(series)) {
-                       _.each(series.values, function(seriesItem) {
+                       series.values.forEach(function(seriesItem) {
                                if (moment(seriesItem[0]).isSame(start) || 
moment(seriesItem[0]).isAfter(start)) {
-                                       normalizedChartData.push([ 
moment(seriesItem[0]).valueOf(), numberUtils.convertTo(seriesItem[1], 
$scope.unitSize) ]); // converts data to appropriate unit
+                                       normalizedChartData.push([ 
moment(seriesItem[0]).valueOf(), 
+                                               
numberUtils.convertTo(seriesItem[1], $scope.unitSize) ]); // converts data to 
appropriate unit
                                }
                        });
                }
@@ -78,7 +79,8 @@ var ChartBPSController = function(deliveryService, $scope, 
$state, $timeout, $fi
                        xaxis: {
                                mode: "time",
                                timezone: "utc",
-                               twelveHourClock: false
+                               twelveHourClock: false,
+                               timeBase: "milliseconds"
                        },
                        yaxes: [
                                {
diff --git 
a/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
 
b/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
index af2981a..e606c41 100644
--- 
a/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
+++ 
b/traffic_portal/app/src/common/modules/chart/httpStatus/ChartHttpStatusController.js
@@ -76,7 +76,7 @@ var ChartHttpStatusController = function(deliveryService, 
$scope, $state, $timeo
                        series = result.series;
 
                if (angular.isDefined(series)) {
-                       _.each(series.values, function(seriesItem) {
+                       series.values.forEach(function(seriesItem) {
                                if (moment(seriesItem[0]).isSame(start) || 
moment(seriesItem[0]).isAfter(start)) {
                                        if (_.isNumber(seriesItem[1])) {
                                                normalizedChartData.push([ 
moment(seriesItem[0]).valueOf(), seriesItem[1] ]);
@@ -94,7 +94,8 @@ var ChartHttpStatusController = function(deliveryService, 
$scope, $state, $timeo
                        xaxis: {
                                mode: "time",
                                timezone: "browser",
-                               twelveHourClock: true
+                               twelveHourClock: true,
+                               timeBase: "milliseconds"
                        },
                        yaxes: [
                                {
diff --git 
a/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js 
b/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js
index 76d0076..68bda7d 100644
--- a/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js
+++ b/traffic_portal/app/src/common/modules/chart/tps/ChartTPSController.js
@@ -62,7 +62,7 @@ var ChartTPSController = function(deliveryService, $scope, 
$state, $timeout, $fi
                var normalizedChartData = [];
 
                if (angular.isDefined(series)) {
-                       _.each(series.values, function(seriesItem) {
+                       series.values.forEach(function(seriesItem) {
                                if (moment(seriesItem[0]).isSame(start) || 
moment(seriesItem[0]).isAfter(start)) {
                                        normalizedChartData.push([ 
moment(seriesItem[0]).valueOf(), seriesItem[1] ]);
                                }
@@ -78,7 +78,8 @@ var ChartTPSController = function(deliveryService, $scope, 
$state, $timeout, $fi
                        xaxis: {
                                mode: "time",
                                timezone: "utc",
-                               twelveHourClock: false
+                               twelveHourClock: false,
+                               timeBase: "milliseconds"
                        },
                        yaxes: [
                                {
diff --git 
a/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
 
b/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
index 9f5dd2c..95b2f89 100644
--- 
a/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
+++ 
b/traffic_portal/app/src/common/modules/widget/cdnChart/WidgetCDNChartController.js
@@ -91,7 +91,7 @@ var WidgetCDNChartController = function(cdn, $scope, 
$timeout, $filter, $q, $int
                var normalizedChartData = [];
 
                if (angular.isDefined(series)) {
-                       _.each(series.values, function(seriesItem) {
+                       series.values.forEach(function(seriesItem) {
                                if (moment(seriesItem[0]).isSame(start) || 
moment(seriesItem[0]).isAfter(start)) {
                                        if (_.isNumber(seriesItem[1])) {
                                                normalizedChartData.push([ 
moment(seriesItem[0]).valueOf(), seriesItem[1] ]);
@@ -109,7 +109,8 @@ var WidgetCDNChartController = function(cdn, $scope, 
$timeout, $filter, $q, $int
                        xaxis: {
                                mode: "time",
                                timezone: "utc",
-                               twelveHourClock: false
+                               twelveHourClock: false,
+                               timeBase: "milliseconds"
                        },
                        yaxes: [
                                {
diff --git a/traffic_portal/bower.json b/traffic_portal/bower.json
index 21d84b8..442276f 100644
--- a/traffic_portal/bower.json
+++ b/traffic_portal/bower.json
@@ -13,9 +13,6 @@
         "angular-jwt": "0.0.9",
         "bootstrap-sass-official": "3.3.6",
         "es5-shim": "4.5.6",
-        "flot": "2.1.2",
-        "flot.tooltip": "0.9.0",
-        "flot-axislabels": "release-2.0.1",
         "font-awesome": "4.5.0",
         "jquery": "2.0.0",
         "json3": "3.3.2"
diff --git a/traffic_portal/grunt/browserify.js 
b/traffic_portal/grunt/browserify.js
index 0c0dc08..63806c6 100644
--- a/traffic_portal/grunt/browserify.js
+++ b/traffic_portal/grunt/browserify.js
@@ -38,12 +38,12 @@ module.exports = {
                 "es5-shim": './<%= globalConfig.app 
%>/bower_components/es5-shim/es5-shim.min.js',
                 "jquery": './<%= globalConfig.app 
%>/bower_components/jquery/jquery.min.js',
                 "json3": './<%= globalConfig.app 
%>/bower_components/json3/lib/json3.min.js',
-                'jquery-flot': './<%= globalConfig.app 
%>/bower_components/flot/source/jquery.flot.js',
-                'jquery-flot-pie': './<%= globalConfig.app 
%>/bower_components/flot/source/jquery.flot.pie.js',
-                'jquery-flot-stack': './<%= globalConfig.app 
%>/bower_components/flot/source/jquery.flot.stack.js',
-                'jquery-flot-time': './<%= globalConfig.app 
%>/bower_components/flot/source/jquery.flot.time.js',
-                'jquery-flot-tooltip': './<%= globalConfig.app 
%>/bower_components/flot.tooltip/js/jquery.flot.tooltip.min.js',
-                'jquery-flot-axislabels': './<%= globalConfig.app 
%>/bower_components/flot-axislabels/jquery.flot.axislabels.js',
+                'jquery-flot': './<%= globalConfig.importdir 
%>/flot/dist/es5/jquery.flot.js',
+                'jquery-flot-pie': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.pie.js',
+                'jquery-flot-stack': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.stack.js',
+                'jquery-flot-time': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.time.js',
+                'jquery-flot-tooltip': './<%= globalConfig.importdir 
%>/jquery.flot.tooltip/js/jquery.flot.tooltip.js',
+                'jquery-flot-axislabels': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.axislabels.js',
             },
         },
     },
@@ -67,12 +67,12 @@ module.exports = {
                 "es5-shim": './<%= globalConfig.app 
%>/bower_components/es5-shim/es5-shim.min.js',
                 "jquery": './<%= globalConfig.app 
%>/bower_components/jquery/jquery.min.js',
                 "json3": './<%= globalConfig.app 
%>/bower_components/json3/lib/json3.min.js',
-                'jquery-flot': './<%= globalConfig.app 
%>/bower_components/flot/jquery.flot.js',
-                'jquery-flot-pie': './<%= globalConfig.app 
%>/bower_components/flot/jquery.flot.pie.js',
-                'jquery-flot-stack': './<%= globalConfig.app 
%>/bower_components/flot/jquery.flot.stack.js',
-                'jquery-flot-time': './<%= globalConfig.app 
%>/bower_components/flot/jquery.flot.time.js',
-                'jquery-flot-tooltip': './<%= globalConfig.app 
%>/bower_components/flot.tooltip/js/jquery.flot.tooltip.min.js',
-                'jquery-flot-axislabels': './<%= globalConfig.app 
%>/bower_components/flot-axislabels/jquery.flot.axislabels.js',
+                'jquery-flot': './<%= globalConfig.importdir 
%>/flot/dist/es5/jquery.flot.js',
+                'jquery-flot-pie': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.pie.js',
+                'jquery-flot-stack': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.stack.js',
+                'jquery-flot-time': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.time.js',
+                'jquery-flot-tooltip': './<%= globalConfig.importdir 
%>/jquery.flot.tooltip/js/jquery.flot.tooltip.js',
+                'jquery-flot-axislabels': './<%= globalConfig.importdir 
%>/flot/source/jquery.flot.axislabels.js',
             },
         },
     },
diff --git a/traffic_portal/package-lock.json b/traffic_portal/package-lock.json
index f5a220e..0a6f7e9 100644
--- a/traffic_portal/package-lock.json
+++ b/traffic_portal/package-lock.json
@@ -374,8 +374,7 @@
     "balanced-match": {
       "version": "1.0.0",
       "resolved": 
"https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz";,
-      "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
-      "dev": true
+      "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c="
     },
     "base": {
       "version": "0.11.2",
@@ -579,7 +578,6 @@
       "version": "1.1.11",
       "resolved": 
"https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz";,
       "integrity": 
"sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
-      "dev": true,
       "requires": {
         "balanced-match": "^1.0.0",
         "concat-map": "0.0.1"
@@ -1104,6 +1102,11 @@
         }
       }
     },
+    "clone": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz";,
+      "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4="
+    },
     "coffeescript": {
       "version": "1.10.0",
       "resolved": 
"https://registry.npmjs.org/coffeescript/-/coffeescript-1.10.0.tgz";,
@@ -1156,8 +1159,7 @@
     "commander": {
       "version": "2.20.3",
       "resolved": 
"https://registry.npmjs.org/commander/-/commander-2.20.3.tgz";,
-      "integrity": 
"sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
-      "dev": true
+      "integrity": 
"sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
     },
     "component-emitter": {
       "version": "1.3.0",
@@ -1168,8 +1170,7 @@
     "concat-map": {
       "version": "0.0.1",
       "resolved": 
"https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz";,
-      "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
-      "dev": true
+      "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
     },
     "concat-stream": {
       "version": "1.6.2",
@@ -1471,6 +1472,14 @@
       "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=",
       "dev": true
     },
+    "defaults": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz";,
+      "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
+      "requires": {
+        "clone": "^1.0.2"
+      }
+    },
     "define-property": {
       "version": "2.0.2",
       "resolved": 
"https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz";,
@@ -2077,6 +2086,14 @@
         "object-assign": "^4.1.0"
       }
     },
+    "file-exist": {
+      "version": "0.0.4",
+      "resolved": 
"https://registry.npmjs.org/file-exist/-/file-exist-0.0.4.tgz";,
+      "integrity": "sha1-bPDldLw9us20vAaLzGncblr8Bck=",
+      "requires": {
+        "commander": "^2.8.1"
+      }
+    },
     "file-sync-cmp": {
       "version": "0.1.1",
       "resolved": 
"https://registry.npmjs.org/file-sync-cmp/-/file-sync-cmp-0.1.1.tgz";,
@@ -2090,6 +2107,29 @@
       "dev": true,
       "optional": true
     },
+    "files-exist": {
+      "version": "1.1.0",
+      "resolved": 
"https://registry.npmjs.org/files-exist/-/files-exist-1.1.0.tgz";,
+      "integrity": 
"sha512-FG9ZrkR5Ek6s+2MHe5ljMwEz2/gWOTNIh+qboHFgc49DZJIOZMwJVwMvH/Sn0ifHELrAKPy7bvKfHOL8ZcmDmQ==",
+      "requires": {
+        "defaults": "^1.0.3",
+        "glob": "^6.0.2"
+      },
+      "dependencies": {
+        "glob": {
+          "version": "6.0.4",
+          "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz";,
+          "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=",
+          "requires": {
+            "inflight": "^1.0.4",
+            "inherits": "2",
+            "minimatch": "2 || 3",
+            "once": "^1.3.0",
+            "path-is-absolute": "^1.0.0"
+          }
+        }
+      }
+    },
     "fill-range": {
       "version": "4.0.0",
       "resolved": 
"https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz";,
@@ -2162,6 +2202,15 @@
         }
       }
     },
+    "flot": {
+      "version": "2.3.2",
+      "resolved": "https://registry.npmjs.org/flot/-/flot-2.3.2.tgz";,
+      "integrity": 
"sha512-zvLb5jXOFMbKdbeACyh8P6zjqIsUQ336QBqjAnd5QTuYNPSPuGTzTdL2beGe7TmZ3z8k7W1fatO01jLbS1NO3g==",
+      "requires": {
+        "file-exist": "0.0.4",
+        "files-exist": "^1.1.0"
+      }
+    },
     "for-in": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz";,
@@ -3347,7 +3396,6 @@
       "version": "1.0.6",
       "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz";,
       "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
-      "dev": true,
       "requires": {
         "once": "^1.3.0",
         "wrappy": "1"
@@ -3356,8 +3404,7 @@
     "inherits": {
       "version": "2.0.3",
       "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz";,
-      "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
-      "dev": true
+      "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
     },
     "inline-source-map": {
       "version": "0.6.2",
@@ -3604,6 +3651,11 @@
       "integrity": "sha1-AIw6f+Hpa9DYTiYOofoXg0V/ecI=",
       "dev": true
     },
+    "jquery.flot.tooltip": {
+      "version": "0.9.0",
+      "resolved": 
"https://registry.npmjs.org/jquery.flot.tooltip/-/jquery.flot.tooltip-0.9.0.tgz";,
+      "integrity": "sha1-rha/lLJsLtmrTbFnu6Ut/bYVwd8="
+    },
     "js-stringify": {
       "version": "1.0.2",
       "resolved": 
"https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz";,
@@ -4084,7 +4136,6 @@
       "version": "3.0.4",
       "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz";,
       "integrity": 
"sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
-      "dev": true,
       "requires": {
         "brace-expansion": "^1.1.7"
       }
@@ -4339,7 +4390,6 @@
       "version": "1.4.0",
       "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz";,
       "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
-      "dev": true,
       "requires": {
         "wrappy": "1"
       }
@@ -4515,8 +4565,7 @@
     "path-is-absolute": {
       "version": "1.0.1",
       "resolved": 
"https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz";,
-      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
-      "dev": true
+      "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
     },
     "path-parse": {
       "version": "1.0.6",
@@ -6651,8 +6700,7 @@
     "wrappy": {
       "version": "1.0.2",
       "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz";,
-      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
-      "dev": true
+      "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
     },
     "xtend": {
       "version": "4.0.2",
diff --git a/traffic_portal/package.json b/traffic_portal/package.json
index 942d662..a89b0a9 100644
--- a/traffic_portal/package.json
+++ b/traffic_portal/package.json
@@ -39,6 +39,8 @@
     "time-grunt": "1.3.0"
   },
   "dependencies": {
-    "ag-grid-community": "^23.2.0"
+    "ag-grid-community": "^23.2.0",
+    "flot": "^2.1.6",
+    "jquery.flot.tooltip": "^0.9.0"
   }
 }

Reply via email to