bug(chartjs/zonejs): dependency conflict while creating new container 56/10756/4
authorbravof <fbravo@whitestack.com>
Wed, 5 May 2021 20:50:46 +0000 (16:50 -0400)
committerbravof <fbravo@whitestack.com>
Thu, 6 May 2021 13:49:09 +0000 (09:49 -0400)
Change-Id: I86db7b06a315581bc792a17a3ad81334e5d290d1
Signed-off-by: bravof <fbravo@whitestack.com>
.dockerignore [new file with mode: 0644]
.gitignore
docker/Dockerfile
package.json
src/app/dashboard/DashboardComponent.ts
src/polyfills.ts
src/tsconfig.app.json
tsconfig.json

diff --git a/.dockerignore b/.dockerignore
new file mode 100644 (file)
index 0000000..3abfee1
--- /dev/null
@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+
+# Copyright 2021 Whitestack, LLC
+# *************************************************************
+
+# This file is part of OSM Monitoring module
+# All Rights Reserved to Whitestack, LLC
+
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+
+#         http://www.apache.org/licenses/LICENSE-2.0
+
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+# For those usages not covered by the Apache License, Version 2.0 please
+# contact: fbravo@whitestack.com
+##
+
+node_modules
\ No newline at end of file
index 9a88115..3ff03e0 100644 (file)
@@ -24,6 +24,7 @@
 # dependencies
 /node_modules
 package-lock.json
+yarn.lock
 
 # profiling files
 chrome-profiler-events.json
index f89dec2..c554f50 100644 (file)
@@ -25,19 +25,21 @@ RUN apt-get update && apt-get install -y curl xz-utils gnupg2 \
     && apt-get update && apt-get install -y nodejs \
     && apt-get install -y nginx
 
+RUN npm install -g yarn
+
 # Preparing working environment.
 RUN mkdir -p /usr/src/osm-angularapp
 WORKDIR /usr/src/osm-angularapp
 
 # Installing dependencies.
 COPY ./package.json /usr/src/osm-angularapp/
-RUN npm install
+RUN yarn install
 
 # Copy osm-angularapp source into image.
 COPY ./ /usr/src/osm-angularapp
 
 # Building app.
-RUN npm run build
+RUN yarn build
 
 # Removing nginx default page.
 RUN rm -rf /usr/share/nginx/html/*
index 798656e..ca23253 100644 (file)
@@ -39,7 +39,7 @@
     "@types/ol": "^5.3.5",
     "angular-notifier": "^6.0.1",
     "bootstrap": "^4.4.1",
-    "chart.js": "^2.8.0",
+    "chart.js": "^3.2.1",
     "codemirror": "^5.51.0",
     "core-js": "^2.5.4",
     "d3": "^5.9.2",
@@ -59,7 +59,7 @@
     "stream": "0.0.2",
     "tslib": "^2.0.0",
     "web-animations-js": "^2.3.2",
-    "zone.js": "~0.10.3"
+    "zone.js": "~0.10.0"
   },
   "devDependencies": {
     "@angular-devkit/build-angular": "^0.1100.2",
@@ -79,7 +79,7 @@
     "karma-jasmine": "~4.0.0",
     "karma-jasmine-html-reporter": "^1.5.0",
     "ng2-completer": "^3.0.3",
-    "node-sass": "^4.14.1",
+    "node-sass": "^5.0.0",
     "protractor": "~7.0.0",
     "ts-node": "~7.0.0",
     "tslint": "~6.1.0",
index 56b79a4..4660732 100644 (file)
@@ -21,7 +21,7 @@
 import { Component, Injector, OnInit } from '@angular/core';
 import { TranslateService } from '@ngx-translate/core';
 import { AuthenticationService } from 'AuthenticationService';
-import { Chart } from 'chart.js';
+import { ActiveElement, Chart, ChartEvent } from 'chart.js';
 import { ERRORDATA } from 'CommonModel';
 import { environment } from 'environment';
 import { NSDDetails } from 'NSDModel';
@@ -303,36 +303,29 @@ export class DashboardComponent implements OnInit {
                     data: this.noOfHours,
                     label: this.translateService.instant('NOOFHOURS'),
                     borderColor: this.backgroundColor,
-                    fill: false,
                     backgroundColor: this.backgroundColor
                 }]
             },
             options: {
-                hover: {
-                    onHover(evt: Event, item: {}): void {
-                        const el: HTMLElement = document.getElementById('canvas');
-                        el.style.cursor = item[0] ? 'pointer' : 'default';
-                    }
+                onHover: (evt: ChartEvent, elements):void => {
+                    const el: HTMLElement = document.getElementById('canvas');
+                    el.style.cursor = elements[0] ? 'pointer' : 'default';
+                },
+                plugins: {
+                    legend: { display: false },
                 },
-                legend: { display: false },
                 scales: {
-                    xAxes: [{
+                    x{
                         display: true,
-                        scaleLabel: {
-                            display: true,
-                            labelString: this.translateService.instant('INSTANCES')
-                        }
-                    }],
-                    yAxes: [{
+                        labels: [this.translateService.instant('INSTANCES')],
+                    },
+                    y: {
                         ticks: {
-                            beginAtZero: true
+                            labelOffset: 0,
                         },
                         display: true,
-                        scaleLabel: {
-                            display: true,
-                            labelString: this.translateService.instant('NOOFHOURS')
-                        }
-                    }]
+                        labels: [this.translateService.instant('NOOFHOURS')]
+                    },
                 }
             }
         });
index 5167690..9d349d1 100644 (file)
@@ -77,7 +77,7 @@ import 'web-animations-js';  // Run `npm install --save web-animations-js`.
 /***************************************************************************************************
  * Zone JS is required by default for Angular itself.
  */
-import 'zone.js/dist/zone';  // Included with Angular CLI.
+import 'zone.js';  // Included with Angular CLI.
 
 /***************************************************************************************************
  * APPLICATION IMPORTS
index 384c218..e4f7c71 100644 (file)
@@ -2,7 +2,7 @@
     "extends": "../tsconfig.json",
     "compilerOptions": {
         "outDir": "../out-tsc/app",
-        "types": []
+        "types": ["node"]
     },
     "exclude": [
         "test.ts",
index 4ca53c1..6397742 100644 (file)
@@ -13,6 +13,9 @@
         "experimentalDecorators": true,
         "importHelpers": true,
         "target": "es5",
+        "types": [
+          "node"
+        ],
         "typeRoots": [
             "node_modules/@types"
         ],