]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Update npm packages
authorTiago Melo <tmelo@suse.com>
Wed, 27 Feb 2019 11:39:52 +0000 (11:39 +0000)
committerTiago Melo <tmelo@suse.com>
Tue, 30 Apr 2019 17:02:30 +0000 (17:02 +0000)
Fix some npm packages vulnerabilities.

Since we don't use the same npm packages anymore, it's not possible to backport
this changes from master to mimic.

Fixes: http://tracker.ceph.com/issues/39080
Signed-off-by: Tiago Melo <tmelo@suse.com>
src/pybind/mgr/dashboard/frontend/.angular-cli.json [deleted file]
src/pybind/mgr/dashboard/frontend/angular.json [new file with mode: 0644]
src/pybind/mgr/dashboard/frontend/karma.conf.js
src/pybind/mgr/dashboard/frontend/package.json
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/directives/password-button.directive.ts
src/pybind/mgr/dashboard/frontend/src/polyfills.ts
src/pybind/mgr/dashboard/frontend/src/tsconfig.spec.json
src/pybind/mgr/dashboard/frontend/tsconfig.json
src/pybind/mgr/dashboard/frontend/tslint.json

diff --git a/src/pybind/mgr/dashboard/frontend/.angular-cli.json b/src/pybind/mgr/dashboard/frontend/.angular-cli.json
deleted file mode 100644 (file)
index f268010..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-{
-  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
-  "project": {
-    "name": "ceph-dashboard"
-  },
-  "apps": [
-    {
-      "root": "src",
-      "outDir": "dist",
-      "assets": [
-        "assets",
-        "favicon.ico"
-      ],
-      "index": "index.html",
-      "main": "main.ts",
-      "polyfills": "polyfills.ts",
-      "test": "test.ts",
-      "tsconfig": "tsconfig.app.json",
-      "testTsconfig": "tsconfig.spec.json",
-      "prefix": "cd",
-      "styles": [
-        "../node_modules/bootstrap/dist/css/bootstrap.css",
-        "../node_modules/ng2-toastr/bundles/ng2-toastr.min.css",
-        "../node_modules/fork-awesome/css/fork-awesome.css",
-        "../node_modules/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css",
-        "styles.scss"
-      ],
-      "scripts": [
-        "../node_modules/chart.js/dist/Chart.bundle.js"
-      ],
-      "environmentSource": "environments/environment.ts",
-      "environments": {
-        "dev": "environments/environment.ts",
-        "prod": "environments/environment.prod.ts"
-      }
-    }
-  ],
-  "e2e": {
-    "protractor": {
-      "config": "./protractor.conf.js"
-    }
-  },
-  "lint": [
-    {
-      "project": "src/tsconfig.app.json",
-      "exclude": "**/node_modules/**"
-    },
-    {
-      "project": "src/tsconfig.spec.json",
-      "exclude": "**/node_modules/**"
-    },
-    {
-      "project": "e2e/tsconfig.e2e.json",
-      "exclude": "**/node_modules/**"
-    }
-  ],
-  "test": {
-    "karma": {
-      "config": "./karma.conf.js"
-    }
-  },
-  "defaults": {
-    "styleExt": "scss",
-    "component": {}
-  }
-}
diff --git a/src/pybind/mgr/dashboard/frontend/angular.json b/src/pybind/mgr/dashboard/frontend/angular.json
new file mode 100644 (file)
index 0000000..35e14f9
--- /dev/null
@@ -0,0 +1,144 @@
+{
+  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
+  "version": 1,
+  "newProjectRoot": "projects",
+  "projects": {
+    "ceph-dashboard": {
+      "root": "",
+      "sourceRoot": "src",
+      "projectType": "application",
+      "architect": {
+        "build": {
+          "builder": "@angular-devkit/build-angular:browser",
+          "options": {
+            "outputPath": "dist",
+            "index": "src/index.html",
+            "main": "src/main.ts",
+            "tsConfig": "src/tsconfig.app.json",
+            "polyfills": "src/polyfills.ts",
+            "assets": [
+              "src/assets",
+              "src/favicon.ico"
+            ],
+            "styles": [
+              "node_modules/bootstrap/dist/css/bootstrap.css",
+              "node_modules/ng2-toastr/bundles/ng2-toastr.min.css",
+              "node_modules/fork-awesome/css/fork-awesome.css",
+              "node_modules/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css",
+              "src/styles.scss"
+            ],
+            "scripts": [
+              "node_modules/chart.js/dist/Chart.bundle.js"
+            ]
+          },
+          "configurations": {
+            "production": {
+              "optimization": true,
+              "outputHashing": "all",
+              "sourceMap": false,
+              "extractCss": true,
+              "namedChunks": false,
+              "aot": true,
+              "extractLicenses": true,
+              "vendorChunk": false,
+              "buildOptimizer": true,
+              "fileReplacements": [
+                {
+                  "replace": "src/environments/environment.ts",
+                  "with": "src/environments/environment.prod.ts"
+                }
+              ]
+            }
+          }
+        },
+        "serve": {
+          "builder": "@angular-devkit/build-angular:dev-server",
+          "options": {
+            "browserTarget": "ceph-dashboard:build"
+          },
+          "configurations": {
+            "production": {
+              "browserTarget": "ceph-dashboard:build:production"
+            }
+          }
+        },
+        "extract-i18n": {
+          "builder": "@angular-devkit/build-angular:extract-i18n",
+          "options": {
+            "browserTarget": "ceph-dashboard:build"
+          }
+        },
+        "test": {
+          "builder": "@angular-devkit/build-angular:karma",
+          "options": {
+            "main": "src/test.ts",
+            "karmaConfig": "./karma.conf.js",
+            "polyfills": "src/polyfills.ts",
+            "tsConfig": "src/tsconfig.spec.json",
+            "scripts": [
+              "node_modules/chart.js/dist/Chart.bundle.js"
+            ],
+            "styles": [
+              "node_modules/bootstrap/dist/css/bootstrap.css",
+              "node_modules/ng2-toastr/bundles/ng2-toastr.min.css",
+              "node_modules/fork-awesome/css/fork-awesome.css",
+              "node_modules/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css",
+              "src/styles.scss"
+            ],
+            "assets": [
+              "src/assets",
+              "src/favicon.ico"
+            ]
+          }
+        },
+        "lint": {
+          "builder": "@angular-devkit/build-angular:tslint",
+          "options": {
+            "tsConfig": [
+              "src/tsconfig.app.json",
+              "src/tsconfig.spec.json"
+            ],
+            "exclude": [
+              "**/node_modules/**"
+            ]
+          }
+        }
+      }
+    },
+    "ceph-dashboard-e2e": {
+      "root": "e2e",
+      "sourceRoot": "e2e",
+      "projectType": "application",
+      "architect": {
+        "e2e": {
+          "builder": "@angular-devkit/build-angular:protractor",
+          "options": {
+            "protractorConfig": "./protractor.conf.js",
+            "devServerTarget": "ceph-dashboard:serve"
+          }
+        },
+        "lint": {
+          "builder": "@angular-devkit/build-angular:tslint",
+          "options": {
+            "tsConfig": [
+              "e2e/tsconfig.e2e.json"
+            ],
+            "exclude": [
+              "**/node_modules/**"
+            ]
+          }
+        }
+      }
+    }
+  },
+  "defaultProject": "ceph-dashboard",
+  "schematics": {
+    "@schematics/angular:component": {
+      "prefix": "cd",
+      "styleext": "scss"
+    },
+    "@schematics/angular:directive": {
+      "prefix": "cd"
+    }
+  }
+}
\ No newline at end of file
index f86ab20aa5fd6f6059970ebb22b8d8b77c2d49dd..07276206c25bc80eff1f321d77bd427ec53e65fd 100644 (file)
@@ -4,13 +4,13 @@
 module.exports = function (config) {
   config.set({
     basePath: '',
-    frameworks: ['jasmine', '@angular/cli'],
+    frameworks: ['jasmine', '@angular-devkit/build-angular'],
     plugins: [
       require('karma-jasmine'),
       require('karma-chrome-launcher'),
       require('karma-jasmine-html-reporter'),
       require('karma-coverage-istanbul-reporter'),
-      require('@angular/cli/plugins/karma'),
+      require('@angular-devkit/build-angular/plugins/karma'),
       require('karma-phantomjs-launcher'),
       require('karma-junit-reporter')
     ],
@@ -18,12 +18,10 @@ module.exports = function (config) {
       clearContext: false // leave Jasmine Spec Runner output visible in browser
     },
     coverageIstanbulReporter: {
-      reports: [ 'html', 'lcovonly', 'cobertura' ],
+      dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly', 'cobertura' ],
       fixWebpackSourcePaths: true
     },
-    angularCli: {
-      environment: 'dev'
-    },
+    
     reporters: ['progress', 'kjhtml', 'junit'],
     junitReporter: {
       'outputFile': 'junit.frontend.xml',
index 9f0e148d236a9779a766681683139151e8f66500..9df41c3bec1a1829b77d05759a3a29faa55d3603 100644 (file)
   },
   "private": true,
   "dependencies": {
-    "@angular/animations": "^5.0.0",
-    "@angular/common": "^5.0.0",
-    "@angular/compiler": "^5.0.0",
-    "@angular/core": "^5.0.0",
-    "@angular/forms": "^5.0.0",
-    "@angular/http": "^5.0.0",
-    "@angular/platform-browser": "^5.0.0",
-    "@angular/platform-browser-dynamic": "^5.0.0",
-    "@angular/router": "^5.0.0",
-    "@swimlane/ngx-datatable": "^11.1.7",
-    "@types/lodash": "4.14.95",
+    "@angular/animations": "7.2.10",
+    "@angular/common": "7.2.10",
+    "@angular/compiler": "7.2.10",
+    "@angular/core": "7.2.10",
+    "@angular/forms": "7.2.10",
+    "@angular/http": "7.2.10",
+    "@angular/platform-browser": "7.2.10",
+    "@angular/platform-browser-dynamic": "7.2.10",
+    "@angular/router": "7.2.10",
+    "@swimlane/ngx-datatable": "11.3.2",
     "awesome-bootstrap-checkbox": "0.3.7",
-    "bootstrap": "^3.3.7",
-    "chart.js": "^2.7.1",
-    "core-js": "^2.4.1",
+    "bootstrap": "3.4.1",
+    "chart.js": "2.8.0",
+    "core-js": "2.6.5",
     "fork-awesome": "1.0.11",
-    "lodash": "4.17.4",
+    "lodash": "4.17.11",
     "moment": "2.20.1",
-    "ng2-charts": "^1.6.0",
-    "ng2-toastr": "4.1.2",
-    "ngx-bootstrap": "^2.0.1",
-    "rxjs": "^5.5.2",
-    "zone.js": "^0.8.14"
+    "ng2-charts": "1.6.0",
+    "ng2-toastr": "github:zzakir/ng2-toastr#0eafd72",
+    "ngx-bootstrap": "2.0.5",
+    "rxjs": "6.4.0",
+    "rxjs-compat": "6.4.0",
+    "tslib": "1.9.3",
+    "zone.js": "0.8.29"
   },
   "devDependencies": {
-    "@angular/cli": "^1.6.5",
-    "@angular/compiler-cli": "^5.0.0",
-    "@angular/language-service": "^5.0.0",
-    "@types/jasmine": "~2.5.53",
-    "@types/jasminewd2": "~2.0.2",
-    "@types/node": "~6.0.60",
-    "codelyzer": "4.3.0",
+    "@angular-devkit/build-angular": "0.13.6",
+    "@angular/cli": "7.3.6",
+    "@angular/compiler-cli": "7.2.10",
+    "@angular/language-service": "7.2.10",
+    "@types/jasmine": "2.5.54",
+    "@types/jasminewd2": "2.0.6",
+    "@types/lodash": "4.14.122",
+    "@types/node": "6.0.118",
+    "codelyzer": "4.5.0",
     "copy-webpack-plugin": "4.3.0",
-    "jasmine-core": "~2.6.2",
-    "jasmine-spec-reporter": "~4.1.0",
-    "karma": "~1.7.0",
-    "karma-chrome-launcher": "~2.1.1",
-    "karma-cli": "~1.0.1",
-    "karma-coverage-istanbul-reporter": "^1.2.1",
-    "karma-jasmine": "~1.1.0",
-    "karma-jasmine-html-reporter": "^0.2.2",
-    "karma-junit-reporter": "^1.2.0",
-    "karma-phantomjs-launcher": "^1.0.4",
-    "protractor": "~5.3.0",
-    "ts-node": "~3.2.0",
-    "tslint": "~5.9.1",
-    "tslint-eslint-rules": "^4.1.1",
-    "typescript": "~2.4.2"
+    "jasmine-core": "2.6.4",
+    "jasmine-spec-reporter": "4.1.1",
+    "karma": "4.0.1",
+    "karma-chrome-launcher": "2.1.1",
+    "karma-cli": "1.0.1",
+    "karma-coverage-istanbul-reporter": "1.4.3",
+    "karma-jasmine": "1.1.2",
+    "karma-jasmine-html-reporter": "0.2.2",
+    "karma-junit-reporter": "1.2.0",
+    "karma-phantomjs-launcher": "1.0.4",
+    "protractor": "5.4.2",
+    "ts-node": "3.2.2",
+    "tslint": "5.9.1",
+    "tslint-eslint-rules": "4.1.1",
+    "typescript": "3.2.4"
   }
 }
index 41a0c03e59f7b9c91a7ad2da79dfc45d68c8f3a5..458b930034913709d9a35a4959291bac5690c376 100644 (file)
@@ -148,7 +148,7 @@ export class RbdListComponent implements OnInit, OnDestroy {
           images = images.concat(pool.value);
         });
         const viewCacheStatusList = [];
-        _.forEach(viewCacheStatusMap, (value, key) => {
+        _.forEach(viewCacheStatusMap, (value: [], key) => {
           viewCacheStatusList.push({
             status: parseInt(key, 10),
             statusFor: (value.length > 1 ? 'pools ' : 'pool ') +
index 7421a3c35975ff69a26bc88747cd955c2b951d51..4ee8a26596a2f93f679fb6c8f653cf520689a7d3 100644 (file)
@@ -7,7 +7,7 @@ import { ToastsManager } from 'ng2-toastr';
 })
 export class Copy2ClipboardButtonDirective implements OnInit {
 
-  @Input('cdCopy2ClipboardButton') private cdCopy2ClipboardButton: string;
+  @Input() cdCopy2ClipboardButton: string;
 
   constructor(private elementRef: ElementRef,
               private renderer: Renderer2,
index 3e152a3334ade807c5a9f671cc4e98f913db5ce0..3a849a567c6c4a23764652f9dbc73e6fb7e96ff5 100644 (file)
@@ -6,7 +6,7 @@ import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@
 export class PasswordButtonDirective implements OnInit {
   private iElement: HTMLElement;
 
-  @Input('cdPasswordButton') private cdPasswordButton: string;
+  @Input() private cdPasswordButton: string;
 
   constructor(private elementRef: ElementRef,
               private renderer: Renderer2) {}
index caac2e0875de1c5fc81e57630c6cc284596d18aa..396e0e63beef6c1de0725d4276aeb7aae5c9a5cb 100644 (file)
@@ -35,16 +35,6 @@ import 'core-js/es6/symbol';
 import 'core-js/es6/weak-map';
 import 'core-js/es7/object';
 
-/** IE10 and IE11 requires the following for NgClass support on SVG elements */
-// import 'classlist.js';  // Run `npm install --save classlist.js`.
-
-/** IE10 and IE11 requires the following for the Reflect API. */
-// import 'core-js/es6/reflect';
-
-/** Evergreen browsers require these. **/
-// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
-import 'core-js/es7/reflect';
-
 /**
  * Required to support Web Animations `@angular/platform-browser/animations`.
  * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation
index 63d89ff283f6a57698af38f3857a81dc1364a36a..18bad40ed42a304233bb8474c00ca104bb0835a1 100644 (file)
@@ -11,7 +11,8 @@
     ]
   },
   "files": [
-    "test.ts"
+    "test.ts",
+    "polyfills.ts"
   ],
   "include": [
     "**/*.spec.ts",
index a6c016bf38ad7b4c02385b2e5797752c227bb2e0..4ad3a431d83cf354a425501249b4f0c0e83a5dcb 100644 (file)
@@ -1,6 +1,7 @@
 {
   "compileOnSave": false,
   "compilerOptions": {
+    "importHelpers": true,
     "outDir": "./dist/out-tsc",
     "sourceMap": true,
     "declaration": false,
@@ -14,6 +15,8 @@
     "lib": [
       "es2017",
       "dom"
-    ]
+    ],
+    "module": "es2015",
+    "baseUrl": "./"
   }
 }
index 8a462673dcda96e9d9d438513a89e41358d3f6ea..2e64a8d381e69f5b8617e17da684bbae71271f51 100644 (file)
@@ -19,7 +19,6 @@
     "forin": true,
     "import-blacklist": [
       true,
-      "rxjs",
       "rxjs/Rx"
     ],
     "import-spacing": true,