]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: typescript cleanup 26338/head
authoralfonsomthd <almartin@redhat.com>
Wed, 20 Feb 2019 09:27:34 +0000 (10:27 +0100)
committeralfonsomthd <almartin@redhat.com>
Fri, 22 Feb 2019 07:48:30 +0000 (08:48 +0100)
* Added npm script 'lint:tsc' to check for unused local variables & parameters.
  Notice that vars/params beginning with '_' are ignored by compiler.

* tslint: removed 'no-unused-variable' controversial rule in favor of compiler checks.

* Added npm script 'test:config' to address 'lint:tsc' complaining about
  not finding module 'unit-test-configuration.ts'.

Signed-off-by: Alfonso Martínez <almartin@redhat.com>
69 files changed:
src/pybind/mgr/dashboard/frontend/e2e/tsconfig.e2e.json
src/pybind/mgr/dashboard/frontend/package.json
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi/iscsi.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/mirror-health-color.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-response.model.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-configuration-list/rbd-configuration-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-configuration-list/rbd-configuration-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-scrub-modal/osd-scrub-modal.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mds-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mgr-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mon-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/osd-summary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form.component.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/login/login.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd-mirroring.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/critical-confirmation-modal/critical-confirmation-modal.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/grafana/grafana.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/components/sparkline/sparkline.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/empty.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/cd-date.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-release-name.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/ceph-short-version.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/dimless-binary-per-second.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/dimless-binary.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/dimless.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/filter.pipe.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/iops.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/list.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/log-priority.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/milliseconds.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-guard.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-guard.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/auth-storage.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/feature-toggles-guard.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/feature-toggles-guard.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/module-status-guard.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-wrapper.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/jestGlobalMocks.ts
src/pybind/mgr/dashboard/frontend/src/tsconfig.app.json
src/pybind/mgr/dashboard/frontend/src/tsconfig.spec.json
src/pybind/mgr/dashboard/frontend/tslint.json

index 1d9e5edf0965125ddb36005861f4c4b8cb0ddff1..e3d6ae7644a6b4e763a44ab4a0e3bbc64b35b758 100644 (file)
@@ -9,6 +9,7 @@
       "jasmine",
       "jasminewd2",
       "node"
-    ]
+    ],
+    "noEmit": true
   }
 }
index ff3139e79648bc1d6fbb05b4d20ad5d91e4d5956..a11a69e933f9b2da10b11eed70305f19222e8f58 100644 (file)
@@ -8,14 +8,16 @@
     "build": "npm run env_build && ng build",
     "env_build": "cp src/environments/environment.tpl.ts src/environments/environment.prod.ts && cp src/environments/environment.tpl.ts src/environments/environment.ts  && node ./environment.build.js",
     "i18n": "ng xi18n --i18n-format xlf --i18n-locale en-US --output-path locale --progress=false && ngx-extractor -i 'src/**/*.ts' -f xlf -o src/locale/messages.xlf -l en-US",
-    "test": "jest --watch",
-    "test:ci": "JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter",
+    "test": "npm run test:config && jest --watch",
+    "test:ci": "npm run test:config && JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter",
+    "test:config": "if [ ! -e 'src/unit-test-configuration.ts' ]; then cp 'src/unit-test-configuration.ts.sample' 'src/unit-test-configuration.ts'; fi",
     "e2e": "npm run env_build && ng e2e",
     "e2e:dev": "npm run env_build && ng e2e --dev-server-target",
     "lint:tslint": "ng lint",
     "lint:prettier": "prettier --list-different \"{src,e2e}/**/*.{ts,scss}\"",
     "lint:html": "html-linter --config html-linter.config.json",
-    "lint": "npm run lint:tslint && npm run lint:prettier && npm run lint:html",
+    "lint:tsc": "npm run test:config && tsc -p src/tsconfig.app.json --noEmit --noUnusedLocals --noUnusedParameters && tsc -p src/tsconfig.spec.json --noEmit --noUnusedLocals --noUnusedParameters && tsc -p e2e/tsconfig.e2e.json --noEmit --noUnusedLocals --noUnusedParameters",
+    "lint": "npm run lint:tsc && npm run lint:tslint && npm run lint:prettier && npm run lint:html",
     "fix:prettier": "prettier --write \"{src,e2e}/**/*.{ts,scss}\"",
     "fix:tslint": "npm run lint:tslint -- --fix",
     "fixmod": "prettier --write $(git rev-parse --show-toplevel)/$(git status --porcelain | grep -E '^(\\sM|\\?\\?|A)' | sed -e 's/^...//' | grep -E '^(src|e2e).*\\.(ts|scss)$') 1>/dev/null 2>&1 && echo 'done' || echo 'no changes found'",
@@ -44,6 +46,9 @@
     "modulePathIgnorePatterns": [
       "<rootDir>/coverage/"
     ],
+    "testMatch": [
+      "**/*.spec.ts"
+    ],
     "testURL": "http://localhost/"
   },
   "dependencies": {
index df0d3d07711f015cd1a418ed57ad5245bc1aec25..758a34daf0b26bc1032141edf9c75710f7edb49b 100644 (file)
@@ -27,7 +27,7 @@ export class IscsiTargetImageSettingsModalComponent implements OnInit {
     const currentSettings = this.imagesSettings[this.image];
     this.helpText = this.iscsiService.imageAdvancedSettings;
 
-    _.forIn(this.disk_default_controls, (value, key) => {
+    _.forIn(this.disk_default_controls, (_value, key) => {
       fg[key] = new FormControl(currentSettings[key]);
     });
 
index db0cdf33ea7f47f5a0223fb2dcc49e1967972acd..eef5276cb73dabb41e921fd0149136284569d76b 100644 (file)
@@ -25,7 +25,7 @@ export class IscsiTargetIqnSettingsModalComponent implements OnInit {
     const fg = {};
     this.helpText = this.iscsiService.targetAdvancedSettings;
 
-    _.forIn(this.target_default_controls, (value, key) => {
+    _.forIn(this.target_default_controls, (_value, key) => {
       fg[key] = new FormControl(this.target_controls.value[key]);
     });
 
index 45648292795d8540a777c9788b572ab69a7df437..dcc1be8a1a0fb9b8179d127a297622527bad38b6 100644 (file)
@@ -20,7 +20,7 @@ describe('IscsiComponent', () => {
 
   const fakeService = {
     tcmuiscsi: () => {
-      return new Promise(function(resolve, reject) {
+      return new Promise(function() {
         return;
       });
     }
index 43d880ffb1aa8a207f8e78ebcb05d3582039229e..33e0204c69e9a4258febe2ac11119e0f94a6b2c2 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'mirrorHealthColor'
 })
 export class MirrorHealthColorPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (value === 'warning') {
       return 'label label-warning';
     } else if (value === 'error') {
index 76c61b0c875eb2d5c56d97fb0e296efb94f8740b..b4666d71ed6a9165bd2f3ad1dc749807bc6072db 100644 (file)
@@ -57,9 +57,8 @@ export class PoolListComponent implements OnInit, OnDestroy {
       icon: 'fa-plus',
       name: this.i18n('Add Peer'),
       click: () => this.editPeersModal('add'),
-      disable: (selection: CdTableSelection) =>
-        !this.selection.first() || this.selection.first().mirror_mode === 'disabled',
-      visible: (selection: CdTableSelection) => !this.getPeerUUID(),
+      disable: () => !this.selection.first() || this.selection.first().mirror_mode === 'disabled',
+      visible: () => !this.getPeerUUID(),
       canBePrimary: () => false
     };
     const editPeerAction: CdTableAction = {
@@ -67,14 +66,14 @@ export class PoolListComponent implements OnInit, OnDestroy {
       icon: 'fa-exchange',
       name: this.i18n('Edit Peer'),
       click: () => this.editPeersModal('edit'),
-      visible: (selection: CdTableSelection) => !!this.getPeerUUID()
+      visible: () => !!this.getPeerUUID()
     };
     const deletePeerAction: CdTableAction = {
       permission: 'delete',
       icon: 'fa-times',
       name: this.i18n('Delete Peer'),
       click: () => this.deletePeersModal(),
-      visible: (selection: CdTableSelection) => !!this.getPeerUUID()
+      visible: () => !!this.getPeerUUID()
     };
     this.tableActions = [editModeAction, addPeerAction, editPeerAction, deletePeerAction];
   }
index 72b0114b37d0e06a48d50732918c0165c6d7a5f4..426c76b0c377184ffdf91ec06a936ff67a1a00d6 100644 (file)
@@ -1,4 +1,3 @@
-import { SimpleChange } from '@angular/core';
 import { ComponentFixture, TestBed } from '@angular/core/testing';
 import { FormsModule } from '@angular/forms';
 import { RouterTestingModule } from '@angular/router/testing';
@@ -59,7 +58,7 @@ describe('RbdConfigurationListComponent', () => {
     } as RbdConfigurationEntry;
 
     component.data = [fakeOption, realOption];
-    component.ngOnChanges({ name: new SimpleChange(null, null, null) });
+    component.ngOnChanges();
 
     expect(component.data.length).toBe(1);
     expect(component.data.pop()).toBe(realOption);
index 55389fd43a7e79981c91c7a3d609481855755d0c..aff443b0f3df6910151c123a99bf327d3c9a5ab4 100644 (file)
@@ -1,12 +1,4 @@
-import {
-  Component,
-  Input,
-  OnChanges,
-  OnInit,
-  SimpleChanges,
-  TemplateRef,
-  ViewChild
-} from '@angular/core';
+import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
 
 import { I18n } from '@ngx-translate/i18n-polyfill';
 import { CdTableColumn } from '../../../shared/models/cd-table-column';
@@ -51,7 +43,7 @@ export class RbdConfigurationListComponent implements OnInit, OnChanges {
     ];
   }
 
-  ngOnChanges(changes: SimpleChanges): void {
+  ngOnChanges(): void {
     if (!this.data) {
       return;
     }
index 2805645027c0b4c774ff42c1a1b713a04d1a938a..b5d2a080bc507b7e5ddaeb5a7e010af1ef4da158 100644 (file)
@@ -73,7 +73,7 @@ export class RbdSnapshotFormComponent implements OnInit {
     this.rbdService
       .renameSnapshot(this.poolName, this.imageName, this.snapName, snapshotName)
       .toPromise()
-      .then((resp) => {
+      .then(() => {
         this.taskManagerService.subscribe(
           finishedTask.name,
           finishedTask.metadata,
@@ -84,7 +84,7 @@ export class RbdSnapshotFormComponent implements OnInit {
         this.modalRef.hide();
         this.onSubmit.next(this.snapName);
       })
-      .catch((resp) => {
+      .catch(() => {
         this.snapshotForm.setErrors({ cdSubmitButton: true });
       });
   }
@@ -101,7 +101,7 @@ export class RbdSnapshotFormComponent implements OnInit {
     this.rbdService
       .createSnapshot(this.poolName, this.imageName, snapshotName)
       .toPromise()
-      .then((resp) => {
+      .then(() => {
         this.taskManagerService.subscribe(
           finishedTask.name,
           finishedTask.metadata,
@@ -112,7 +112,7 @@ export class RbdSnapshotFormComponent implements OnInit {
         this.modalRef.hide();
         this.onSubmit.next(snapshotName);
       })
-      .catch((resp) => {
+      .catch(() => {
         this.snapshotForm.setErrors({ cdSubmitButton: true });
       });
   }
index 0294daf2b09f5a9d8bd0fbe85a448e63d1833c26..522c60f8737242ecb5acc298688816fccbf52231 100644 (file)
@@ -83,8 +83,8 @@ describe('RbdSnapshotListComponent', () => {
       fixture.detectChanges();
       const i18n = TestBed.get(I18n);
       called = false;
-      rbdService = new RbdService(null);
-      notificationService = new NotificationService(null, null);
+      rbdService = new RbdService(null, null);
+      notificationService = new NotificationService(null, null, null);
       authStorageService = new AuthStorageService();
       authStorageService.set('user', '', { 'rbd-image': ['create', 'read', 'update', 'delete'] });
       component = new RbdSnapshotListComponent(
index b1fd47fa13e424c4c511f0f2dcf7dd31b571da9a..cc40bea3032a4a57ee0a5fa69a0d58950370251e 100644 (file)
@@ -206,7 +206,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
     this.rbdService
       .protectSnapshot(this.poolName, this.rbdName, snapshotName, !isProtected)
       .toPromise()
-      .then((resp) => {
+      .then(() => {
         const executingTask = new ExecutingTask();
         executingTask.name = finishedTask.name;
         executingTask.metadata = finishedTask.metadata;
@@ -247,7 +247,7 @@ export class RbdSnapshotListComponent implements OnInit, OnChanges {
           }
         );
       })
-      .catch((resp) => {
+      .catch(() => {
         this.modalRef.content.stopLoadingSpinner();
       });
   }
index 1db21cedac6d85a82a76c141c5cb593df3a30190..420e35e7c290969547111726233fa827793e0311 100644 (file)
@@ -86,7 +86,7 @@ export class CephfsDetailComponent implements OnChanges, OnInit {
         {
           name: this.i18n('Usage'),
           cellTemplate: this.poolUsageTpl,
-          comparator: (valueA, valueB, rowA, rowB, sortDirection) => {
+          comparator: (_valueA, _valueB, rowA, rowB) => {
             const valA = rowA.used / rowA.avail;
             const valB = rowB.used / rowB.avail;
 
@@ -124,7 +124,7 @@ export class CephfsDetailComponent implements OnChanges, OnInit {
     });
 
     this.cephfsService.getMdsCounters(this.id).subscribe((data) => {
-      _.each(this.mdsCounters, (value, key) => {
+      _.each(this.mdsCounters, (_value, key) => {
         if (data[key] === undefined) {
           delete this.mdsCounters[key];
         }
@@ -137,7 +137,7 @@ export class CephfsDetailComponent implements OnChanges, OnInit {
     });
   }
 
-  trackByFn(index, item) {
+  trackByFn(_index, item) {
     return item.name;
   }
 }
index b7e0fca6bf511d6a496f5962253294b05a945ddd..d775fb0208f89239b217b6f14a3b7f352dad92df 100644 (file)
@@ -160,7 +160,8 @@ describe('OsdListComponent', () => {
     const expectOpensModal = (actionName: string, modalClass): void => {
       openActionModal(actionName);
 
-      expect(modalServiceShowSpy.calls.any()).toBe(true, 'modalService.show called');
+      // @TODO: check why tsc is complaining when passing 'expectationFailOutput' param.
+      expect(modalServiceShowSpy.calls.any()).toBeTruthy();
       expect(modalServiceShowSpy.calls.first().args[0]).toBe(modalClass);
 
       modalServiceShowSpy.calls.reset();
index 1fc99668bcb59e6799a217da98687c045692121b..cf08843c263f13dbb6f54bb01fb187dfb0c3a1b3 100644 (file)
@@ -15,19 +15,13 @@ describe('OsdScrubModalComponent', () => {
 
   const fakeService = {
     list: () => {
-      return new Promise(function(resolve, reject) {
-        return {};
-      });
+      return new Promise(() => {});
     },
-    scrub: (data: any) => {
-      return new Promise(function(resolve, reject) {
-        return {};
-      });
+    scrub: () => {
+      return new Promise(() => {});
     },
-    scrub_many: (data: any) => {
-      return new Promise(function(resolve, reject) {
-        return {};
-      });
+    scrub_many: () => {
+      return new Promise(() => {});
     }
   };
 
index de76ea884e85121700bc9e16ebc9284fd83c659a..18b03254f61c1d2fa775945b5dc40ef6e5453e7c 100644 (file)
@@ -33,7 +33,7 @@ export class OsdScrubModalComponent implements OnInit {
     const id = this.selected[0].id;
 
     this.osdService.scrub(id, this.deep).subscribe(
-      (res) => {
+      () => {
         const operation = this.deep ? 'Deep scrub' : 'Scrub';
 
         this.notificationService.show(
index 94daabbb8e74cf9c6677a6e1c9395c640ffb0d97..a28afa613e8564fbc33449401a8dcc7033e3cefa 100644 (file)
@@ -183,7 +183,7 @@ export class HealthPieComponent implements OnChanges, OnInit {
   }
 
   private hideSlices() {
-    _.forEach(this.chartConfig.dataset[0].data, (slice, sliceIndex) => {
+    _.forEach(this.chartConfig.dataset[0].data, (_slice, sliceIndex) => {
       if (this.hiddenSlices[sliceIndex]) {
         this.chartConfig.dataset[0].data[sliceIndex] = undefined;
       }
index ae75eca6482667eb022f7a6da06f70795fb85956..a722afebd7e1c784795968c644365f4015571a73 100644 (file)
@@ -52,7 +52,7 @@ export class HealthComponent implements OnInit, OnDestroy {
     });
   }
 
-  prepareReadWriteRatio(chart, data) {
+  prepareReadWriteRatio(chart) {
     const ratioLabels = [];
     const ratioData = [];
 
index 3bfdd5267bf89075b3a51ae624404ac9a9376e89..5d43e4244e52c457907a1f65d24de84b200fb734 100644 (file)
@@ -9,7 +9,7 @@ import * as _ from 'lodash';
 export class MdsSummaryPipe implements PipeTransform {
   constructor(private i18n: I18n) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (!value) {
       return '';
     }
@@ -19,7 +19,7 @@ export class MdsSummaryPipe implements PipeTransform {
     let standbys = 0;
     let active = 0;
     let standbyReplay = 0;
-    _.each(value.standbys, (s, i) => {
+    _.each(value.standbys, () => {
       standbys += 1;
     });
 
@@ -29,8 +29,8 @@ export class MdsSummaryPipe implements PipeTransform {
     } else if (value.filesystems.length === 0) {
       contentLine1 = this.i18n('no filesystems');
     } else {
-      _.each(value.filesystems, (fs, i) => {
-        _.each(fs.mdsmap.info, (mds, j) => {
+      _.each(value.filesystems, (fs) => {
+        _.each(fs.mdsmap.info, (mds) => {
           if (mds.state === 'up:standby-replay') {
             standbyReplay += 1;
           } else {
index c37eb88606defe035f4b6edb694c38fe173dffe3..b3782ca32c13ce6fa87a356b6b90e48502f5b055 100644 (file)
@@ -9,7 +9,7 @@ import * as _ from 'lodash';
 export class MgrSummaryPipe implements PipeTransform {
   constructor(private i18n: I18n) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (!value) {
       return '';
     }
index 48949a04fa849514f3719d5a6b6d163f1bf6c9ff..31339f52e292e7fa517974e57f90481e16d1c69b 100644 (file)
@@ -8,7 +8,7 @@ import { I18n } from '@ngx-translate/i18n-polyfill';
 export class MonSummaryPipe implements PipeTransform {
   constructor(private i18n: I18n) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (!value) {
       return '';
     }
index b6a444be67382e61dbc88a491724476b4a92838b..c007c313cf32c780a995fd1a78d9095088ca7dcf 100644 (file)
@@ -9,7 +9,7 @@ import * as _ from 'lodash';
 export class OsdSummaryPipe implements PipeTransform {
   constructor(private i18n: I18n) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (!value) {
       return '';
     }
index 2ab70555b639bfa9704e68c6766f014b7cd87f75..128782fc961100c7b043cb3f4f98b1914296dd18 100644 (file)
@@ -109,20 +109,15 @@ export class NfsFormComponent implements OnInit {
   }
 
   getData(promises) {
-    forkJoin(promises).subscribe(
-      (data: any[]) => {
-        this.resolveDaemons(data[0]);
-        this.resolvefsals(data[1]);
-        this.resolveClients(data[2]);
-        this.resolveFilesystems(data[3]);
-        if (data[4]) {
-          this.resolveModel(data[4]);
-        }
-      },
-      (error) => {
-        // this.error = error;
+    forkJoin(promises).subscribe((data: any[]) => {
+      this.resolveDaemons(data[0]);
+      this.resolvefsals(data[1]);
+      this.resolveClients(data[2]);
+      this.resolveFilesystems(data[3]);
+      if (data[4]) {
+        this.resolveModel(data[4]);
       }
-    );
+    });
   }
 
   createForm() {
index fb00a8ae3e9982504d60a5c3398d925f41212158..2a52098923e092d9c04ad6d35c5e796e3bde4af5 100644 (file)
@@ -149,7 +149,7 @@ export class NfsListComponent implements OnInit, OnDestroy {
           this.builders
         );
       },
-      (error) => {
+      () => {
         this.onFetchError();
       }
     );
index 7599833bc2ad8de9301d60a683355861a6ebb5ab..128e221867f206c403bc4b6c9347332cf373e33b 100644 (file)
@@ -239,7 +239,7 @@ export class ErasureCodeProfileFormComponent implements OnInit {
       })
       .subscribe(
         undefined,
-        (resp) => {
+        () => {
           this.form.setErrors({ cdSubmitButton: true });
         },
         () => {
index 117b7d26590cd1cb9766f042cb929500eee06062..da7161dd4dce32c8ab7200351d0acabfcca342a8 100644 (file)
@@ -177,7 +177,7 @@ describe('PoolListComponent', () => {
 
   describe('getPgStatusCellClass', () => {
     const testMethod = (value, expected) =>
-      expect(component.getPgStatusCellClass({ row: '', column: '', value: value })).toEqual({
+      expect(component.getPgStatusCellClass('', '', value)).toEqual({
         'text-right': true,
         [expected]: true
       });
index 9ddc9a8391aa7c0c02c951e749a317569432e765..86ec1c35a0188f1a1a9f7caeff0baf1e93e19f5f 100644 (file)
@@ -103,7 +103,7 @@ export class PoolListComponent implements OnInit {
         name: this.i18n('PG Status'),
         flexGrow: 3,
         cellClass: ({ row, column, value }): any => {
-          return this.getPgStatusCellClass({ row, column, value });
+          return this.getPgStatusCellClass(row, column, value);
         }
       },
       {
@@ -190,7 +190,7 @@ export class PoolListComponent implements OnInit {
     });
   }
 
-  getPgStatusCellClass({ row, column, value }): object {
+  getPgStatusCellClass(_row, _column, value): object {
     return {
       'text-right': true,
       [`pg-${this.pgCategoryService.getTypeByStates(value)}`]: true
index e03aaf866b761b7a6846a6f416d4eff55210cd12..daa96f34e8bfda92edd00912fa19859a81d770cf 100644 (file)
@@ -25,8 +25,8 @@ describe('LoginComponent', () => {
   });
 
   it('should ensure no modal dialogs are opened', () => {
-    component.bsModalService.modalsCount = 2;
+    component['bsModalService']['modalsCount'] = 2;
     component.ngOnInit();
-    expect(component.bsModalService.getModalsCount()).toBe(0);
+    expect(component['bsModalService'].getModalsCount()).toBe(0);
   });
 });
index b80fa441176f477c8adef58b0bbcf5cac3473421..639fa915018678c1647b4021ca36042a14d33831 100644 (file)
@@ -123,7 +123,9 @@ describe('RoleFormComponent', () => {
         cephfs: ['read', 'delete'],
         grafana: ['update']
       });
-      component.onClickHeaderCheckbox('scope', { target: { checked: false } });
+      component.onClickHeaderCheckbox('scope', ({
+        target: { checked: false }
+      } as unknown) as Event);
       const scopes_permissions = form.getValue('scopes_permissions');
       expect(scopes_permissions).toEqual({});
     });
@@ -134,7 +136,7 @@ describe('RoleFormComponent', () => {
         cephfs: ['create', 'update'],
         grafana: ['delete']
       });
-      component.onClickHeaderCheckbox('scope', { target: { checked: true } });
+      component.onClickHeaderCheckbox('scope', ({ target: { checked: true } } as unknown) as Event);
       const scopes_permissions = form.getValue('scopes_permissions');
       const keys = Object.keys(scopes_permissions);
       expect(keys).toEqual(['cephfs', 'grafana']);
index 47276a8f561c704495d326b7f271d469afe9ee56..9d0cfb72b89afb54614c502a453d802e459fa5c4 100644 (file)
@@ -193,7 +193,7 @@ describe('UserFormComponent', () => {
     it('should alert if user is removing needed role permission', () => {
       spyOn(TestBed.get(AuthStorageService), 'getUsername').and.callFake(() => user.username);
       let modalBodyTpl = null;
-      spyOn(modalService, 'show').and.callFake((content, config) => {
+      spyOn(modalService, 'show').and.callFake((_content, config) => {
         modalBodyTpl = config.initialState.bodyTpl;
       });
       formHelper.setValue('roles', ['read-only']);
index 6432e187ce33f01a730ddcd75dcdb22803960737..cc4b7d31c65e3bbc797262486d664123c6da0560 100644 (file)
@@ -16,7 +16,8 @@ describe('RbdMirroringService', () => {
       image_error: [],
       image_syncing: [],
       image_ready: []
-    }
+    },
+    executing_tasks: [{}]
   };
 
   configureTestBed(
index 1bd28c2e10a4a835c5a95e87934ed51bd83d1197..9602ad784c2fe42024f85ba986a13c72d9ab4390 100644 (file)
@@ -104,7 +104,7 @@ describe('CriticalConfirmationModalComponent', () => {
     mockFixture = TestBed.createComponent(MockComponent);
     mockComponent = mockFixture.componentInstance;
     // Mocking the modals as a lot would be left over
-    spyOn(mockComponent.modalService, 'show').and.callFake((modalComp, config) => {
+    spyOn(mockComponent.modalService, 'show').and.callFake((_modalComp, config) => {
       const ref = new BsModalRef();
       fixture = TestBed.createComponent(CriticalConfirmationModalComponent);
       component = fixture.componentInstance;
index ed0ec929e47a83b248d2875a6921ade40d255cf3..1a2656e00ca32c2afd1338bc441c4cd68e09ff4e 100644 (file)
@@ -216,7 +216,7 @@ export class GrafanaComponent implements OnInit, OnChanges {
     this.grafanaSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.url);
   }
 
-  onTimepickerChange(event) {
+  onTimepickerChange() {
     if (this.grafanaExist) {
       this.getFrame();
     }
@@ -229,7 +229,7 @@ export class GrafanaComponent implements OnInit, OnChanges {
     }
   }
 
-  ngOnChanges(changes) {
+  ngOnChanges() {
     if (this.grafanaExist) {
       this.getFrame();
     }
index 906fb64d49ce1bb68cbe67741cf3ab3ec2faf2ba..565f7e4dbced6c3fa0e7ccfaafa25fc33cc88d05 100644 (file)
@@ -90,7 +90,7 @@ export class SparklineComponent implements OnInit, OnChanges {
   constructor(private dimlessBinaryPipe: DimlessBinaryPipe) {}
 
   ngOnInit() {
-    const getStyleTop = (tooltip, positionY) => {
+    const getStyleTop = (tooltip) => {
       return tooltip.caretY - tooltip.height - tooltip.yPadding - 5 + 'px';
     };
 
index ae110a7e77da09933c7add82ee40d325f3811695..aab90c9545e7c3f38b97b536f986f0bf35939ed1 100644 (file)
@@ -91,7 +91,7 @@ export class TableKeyValueComponent implements OnInit, OnChanges {
     this.useData();
   }
 
-  ngOnChanges(changes) {
+  ngOnChanges() {
     this.useData();
   }
 
index 703368fbb42db8893b53113ee1361d696ae27764..e82a10978ce8b0f24a1f1a3812ed39d13cd0fc72 100644 (file)
@@ -125,7 +125,7 @@ describe('TableComponent', () => {
 
       it('should test search manipulation', () => {
         let searchTerms = [];
-        spyOn(component, 'subSearch').and.callFake((d, search) => {
+        spyOn(component, 'subSearch').and.callFake((_d, search) => {
           expect(search).toEqual(searchTerms);
         });
         const searchTest = (s: string, st: string[]) => {
index 19ba5e427ee6aacbf772d9122743870635378364..efb2644d00c420102b786eb4d3894e126d2514f9 100644 (file)
@@ -333,7 +333,7 @@ export class TableComponent implements AfterContentChecked, OnInit, OnChanges, O
     return _.isEmpty(css) ? undefined : css;
   }
 
-  ngOnChanges(changes) {
+  ngOnChanges() {
     this.useData();
   }
 
index ac19aa34f353dc0c9fa90e7fcaed68063564259f..7ee51b63bb2e98ec3fedcd38a443e2b4b7f28ab5 100644 (file)
@@ -6,7 +6,7 @@ import * as _ from 'lodash';
   name: 'empty'
 })
 export class EmptyPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     return _.isUndefined(value) || _.isNull(value) ? '-' : value;
   }
 }
index 6af1b6b4d060bcba284316d47cee1d934b81978c..911f320410f4b68117d7ac13a45b1550f6600d6e 100644 (file)
@@ -7,7 +7,7 @@ import { Pipe, PipeTransform } from '@angular/core';
 export class CdDatePipe implements PipeTransform {
   constructor(private datePipe: DatePipe) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (value === null || value === '') {
       return '';
     }
index 5374d56e40db775847746a4314b0fef9cb7f02ba..c7c1e1d7423db5b7e9ef34e6e81d9384bb204747 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'cephReleaseName'
 })
 export class CephReleaseNamePipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     // Expect "ceph version 13.1.0-419-g251e2515b5
     //         (251e2515b563856349498c6caf34e7a282f62937) nautilus (dev)"
     const result = /ceph version\s+[^ ]+\s+\(.+\)\s+(.+)\s+\((.+)\)/.exec(value);
index 9599112c811c558a31235484685e7c7039c53dfd..03e75dfb3859280173cda021c229c6e1d5d388a6 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'cephShortVersion'
 })
 export class CephShortVersionPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     // Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
     const result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(value);
     if (result) {
index bcd8f666c7e6ab78d830d029ac5134cf37b45729..67faad2b402282f99feee16cf747040b514fc944 100644 (file)
@@ -7,7 +7,7 @@ import { FormatterService } from '../services/formatter.service';
 export class DimlessBinaryPerSecondPipe implements PipeTransform {
   constructor(private formatter: FormatterService) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     return this.formatter.format_number(value, 1024, [
       'B/s',
       'kB/s',
index b1784fcf16b3503cf5392741765188bb7b3d9aa6..493696ef9311987c145cbb4727cee8aeb66550d1 100644 (file)
@@ -7,7 +7,7 @@ import { FormatterService } from '../services/formatter.service';
 export class DimlessBinaryPipe implements PipeTransform {
   constructor(private formatter: FormatterService) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     return this.formatter.format_number(value, 1024, [
       'B',
       'KiB',
index 7cd6a45aeed6534008d99245a223c60eddd1a279..18994bd12bddcc28d099e738d0e724a12cf7f866 100644 (file)
@@ -7,7 +7,7 @@ import { FormatterService } from '../services/formatter.service';
 export class DimlessPipe implements PipeTransform {
   constructor(private formatter: FormatterService) {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     return this.formatter.format_number(value, 1000, ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']);
   }
 }
index c516ad3835da56480a84e8160764e203b748e263..94e5f8bdfec61d7fbb7eea41d0a4f33cdd982e95 100644 (file)
@@ -44,7 +44,7 @@ describe('FilterPipe', () => {
     const filters = [
       {
         value: '',
-        applyFilter: (row, val) => {
+        applyFilter: () => {
           return false;
         }
       }
index 9d82475a14f66084fc3726a829c160dbd298c444..4b95022668c34d536cb69fe04b2492f8aafa7e6a 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'healthColor'
 })
 export class HealthColorPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (value === 'HEALTH_OK') {
       return { color: '#00bb00' };
     } else if (value === 'HEALTH_WARN') {
index 921e773af61229f862e160fd420cffac95dede72..9644801f8cecc0d18553ecdaef76d0b7939fe0c5 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'iops'
 })
 export class IopsPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     return `${value} IOPS`;
   }
 }
index 1e379190e04ecbd9af35fb038e867159009e68c1..9a044c1b0f6921510a8f22b6d839868ad5fd91ab 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'list'
 })
 export class ListPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     return value.join(', ');
   }
 }
index ea46d16c0e3a070087c9778717f5f3d99299e4ca..c7f5e50b5eeba95a8526a4cf142aa39d4dcaaab5 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'logPriority'
 })
 export class LogPriorityPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (value === '[INF]') {
       return 'info';
     } else if (value === '[WRN]') {
index c2e45ca33cb739b955154d650ae45c8f54f1ee6e..b0dc68604a789e4bbf6732b2682e429096116f8a 100644 (file)
@@ -4,7 +4,7 @@ import { Pipe, PipeTransform } from '@angular/core';
   name: 'milliseconds'
 })
 export class MillisecondsPipe implements PipeTransform {
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     return `${value} ms`;
   }
 }
index 6bfa3958c6284ad2e9be02f3e573d2d786eed232..3ebc389eb22193dfb65b52bcb1aa3a8839f3e32b 100644 (file)
@@ -8,7 +8,7 @@ import * as moment from 'moment';
 export class RelativeDatePipe implements PipeTransform {
   constructor() {}
 
-  transform(value: any, args?: any): any {
+  transform(value: any): any {
     if (!value) {
       return 'unknown';
     }
index 5ae427572a33f90e8d2e4c144d9f187444ac72b8..67e93e2a0457a898dcd155aa1395d5f7783d5d5c 100644 (file)
@@ -18,7 +18,7 @@ describe('ApiInterceptorService', () => {
   let router: Router;
   const url = 'api/xyz';
 
-  const httpError = (error, errorOpts, done = (resp) => {}) => {
+  const httpError = (error, errorOpts, done = (_resp) => {}) => {
     httpClient.get(url).subscribe(
       () => {},
       (resp) => {
index bf8c71c34d8323b98c9536a0d4ab1b5ff2ab178b..f23d7dc267009ac99dc4a2b18960c9b415e331a9 100644 (file)
@@ -35,13 +35,13 @@ describe('AuthGuardService', () => {
 
   it('should allow the user if loggedIn', () => {
     spyOn(authStorageService, 'isLoggedIn').and.returnValue(true);
-    expect(service.canActivate(null, null)).toBe(true);
+    expect(service.canActivate()).toBe(true);
   });
 
   it('should prevent user if not loggedIn and redirect to login page', fakeAsync(() => {
     const router = TestBed.get(Router);
     ngZone.run(() => {
-      expect(service.canActivate(null, null)).toBe(false);
+      expect(service.canActivate()).toBe(false);
     });
     tick();
     expect(router.url).toBe('/login');
index f376e6a8cab9e1a84bc5a7d16ca0941bbffdacc8..2b4f635f63d6da4cb90bb7954a80688cf12707e2 100644 (file)
@@ -1,11 +1,5 @@
 import { Injectable } from '@angular/core';
-import {
-  ActivatedRouteSnapshot,
-  CanActivate,
-  CanActivateChild,
-  Router,
-  RouterStateSnapshot
-} from '@angular/router';
+import { CanActivate, CanActivateChild, Router } from '@angular/router';
 
 import { AuthStorageService } from './auth-storage.service';
 import { ServicesModule } from './services.module';
@@ -16,7 +10,7 @@ import { ServicesModule } from './services.module';
 export class AuthGuardService implements CanActivate, CanActivateChild {
   constructor(private router: Router, private authStorageService: AuthStorageService) {}
 
-  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+  canActivate() {
     if (this.authStorageService.isLoggedIn()) {
       return true;
     }
@@ -24,7 +18,7 @@ export class AuthGuardService implements CanActivate, CanActivateChild {
     return false;
   }
 
-  canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
-    return this.canActivate(route, state);
+  canActivateChild(): boolean {
+    return this.canActivate();
   }
 }
index 068a1e1d6a0a1ed398f677b6fef0a162c5a24fad..e9726a47e10cb2e2e833fc7532bbdd5bf30528e9 100644 (file)
@@ -13,18 +13,18 @@ describe('AuthStorageService', () => {
   });
 
   it('should store username', () => {
-    service.set(username);
+    service.set(username, '');
     expect(localStorage.getItem('dashboard_username')).toBe(username);
   });
 
   it('should remove username', () => {
-    service.set(username);
+    service.set(username, '');
     service.remove();
     expect(localStorage.getItem('dashboard_username')).toBe(null);
   });
 
   it('should be loggedIn', () => {
-    service.set(username);
+    service.set(username, '');
     expect(service.isLoggedIn()).toBe(true);
   });
 
index 961b7c8264426499977c78652bb62cfe6e49a6e2..6665647bb2a9b9de2209c5567935ffd4f3bb36dd 100644 (file)
@@ -52,7 +52,7 @@ describe('FeatureTogglesGuardService', () => {
 
     ngZone.run(() => {
       service
-        .canActivate(<ActivatedRouteSnapshot>{ routeConfig: { path: path } }, null)
+        .canActivate(<ActivatedRouteSnapshot>{ routeConfig: { path: path } })
         .subscribe((val) => (result = val));
     });
     tick();
index 9114ffd632688da2fc9dfe81932851c3fb23a4e2..07ee7d5c4fbaebe16320b444f2ecc830f6d69661 100644 (file)
@@ -1,11 +1,5 @@
 import { Injectable } from '@angular/core';
-import {
-  ActivatedRouteSnapshot,
-  CanActivate,
-  CanActivateChild,
-  Router,
-  RouterStateSnapshot
-} from '@angular/router';
+import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router } from '@angular/router';
 
 import { map } from 'rxjs/operators';
 
@@ -18,7 +12,7 @@ import { ServicesModule } from './services.module';
 export class FeatureTogglesGuardService implements CanActivate, CanActivateChild {
   constructor(private router: Router, private featureToggles: FeatureTogglesService) {}
 
-  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+  canActivate(route: ActivatedRouteSnapshot) {
     return this.featureToggles.get().pipe(
       map((enabledFeatures: FeatureTogglesMap) => {
         if (enabledFeatures[route.routeConfig.path] === false) {
@@ -30,7 +24,7 @@ export class FeatureTogglesGuardService implements CanActivate, CanActivateChild
     );
   }
 
-  canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
-    return this.canActivate(route.parent, state);
+  canActivateChild(route: ActivatedRouteSnapshot) {
+    return this.canActivate(route.parent);
   }
 }
index 5da62ddc19e1685eddd235a69991a0ce811cdc1d..b0c1860dcdb91801655b12fdbdfda823b19d7694 100644 (file)
@@ -63,7 +63,7 @@ describe('FormatterService', () => {
       expect(service.toBytes('1.1  kib')).toBeNull();
       expect(service.toBytes('1.kib')).toBeNull();
       expect(service.toBytes('1 ki')).toBeNull();
-      expect(service.toBytes()).toBeNull();
+      expect(service.toBytes(undefined)).toBeNull();
       expect(service.toBytes('')).toBeNull();
       expect(service.toBytes('-')).toBeNull();
       expect(service.toBytes(null)).toBeNull();
index 112a194f12a22b9d6b3653c77f71f6799fc53f94..2528826783c25911de432e79457febd8474d497d 100644 (file)
@@ -29,7 +29,7 @@ describe('ModuleStatusGuardService', () => {
     let result: boolean;
     spyOn(httpClient, 'get').and.returnValue(observableOf(getResult));
     ngZone.run(() => {
-      service.canActivateChild(route, null).subscribe((resp) => {
+      service.canActivateChild(route).subscribe((resp) => {
         result = resp;
       });
     });
index 5f47c2dc20cfc1fe99c99557644464627d945143..f37024ea63c3429546d35d53d24f39700a3a740c 100644 (file)
@@ -1,12 +1,6 @@
 import { HttpClient } from '@angular/common/http';
 import { Injectable } from '@angular/core';
-import {
-  ActivatedRouteSnapshot,
-  CanActivate,
-  CanActivateChild,
-  Router,
-  RouterStateSnapshot
-} from '@angular/router';
+import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router } from '@angular/router';
 
 import { of as observableOf } from 'rxjs';
 import { catchError, map } from 'rxjs/operators';
@@ -44,11 +38,11 @@ import { ServicesModule } from './services.module';
 export class ModuleStatusGuardService implements CanActivate, CanActivateChild {
   constructor(private http: HttpClient, private router: Router) {}
 
-  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+  canActivate(route: ActivatedRouteSnapshot) {
     return this.doCheck(route);
   }
 
-  canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+  canActivateChild(childRoute: ActivatedRouteSnapshot) {
     return this.doCheck(childRoute);
   }
 
index 0612d2f7f28462a1738e5799bdb2770e7d02706d..08b6ff8878b7cfd9ed9b80dacb1b790d9f52a430 100644 (file)
@@ -36,7 +36,7 @@ export class NotificationService {
     let notifications: CdNotification[] = [];
 
     if (_.isString(stringNotifications)) {
-      notifications = JSON.parse(stringNotifications, (key, value) => {
+      notifications = JSON.parse(stringNotifications, (_key, value) => {
         if (_.isPlainObject(value)) {
           return _.assign(new CdNotification(), value);
         }
index 36fe4c66fbd9e7d8a669af72ff70e707610123d5..71d12c0f42853ffc7f72df91160239f5e2a95607 100644 (file)
@@ -42,7 +42,7 @@ describe('PrometheusAlertService', () => {
     const resp = { status: 500, error: {} };
     service = new PrometheusAlertService(null, <PrometheusService>{
       ifAlertmanagerConfigured: (fn) => fn(),
-      list: () => ({ subscribe: (fn, err) => err(resp) })
+      list: () => ({ subscribe: (_fn, err) => err(resp) })
     });
 
     expect(service['connected']).toBe(true);
index 0806935989127bea19a25fd59ee638b94021a806..f457423fcd8b8140888937627cad3d5ff9be9fc0 100644 (file)
@@ -293,24 +293,24 @@ export class TaskMessageService {
     'rbd/mirroring/pool/edit': this.newTaskMessage(
       this.commonOperations.update,
       this.rbd_mirroring.pool,
-      (metadata) => ({
+      () => ({
         16: this.i18n('Cannot disable mirroring because it contains a peer.')
       })
     ),
     'rbd/mirroring/peer/add': this.newTaskMessage(
       this.commonOperations.create,
       this.rbd_mirroring.pool_peer,
-      (metadata) => ({})
+      () => ({})
     ),
     'rbd/mirroring/peer/edit': this.newTaskMessage(
       this.commonOperations.update,
       this.rbd_mirroring.pool_peer,
-      (metadata) => ({})
+      () => ({})
     ),
     'rbd/mirroring/peer/delete': this.newTaskMessage(
       this.commonOperations.delete,
       this.rbd_mirroring.pool_peer,
-      (metadata) => ({})
+      () => ({})
     ),
     // iSCSI target tasks
     'iscsi/target/create': this.newTaskMessage(this.commonOperations.create, (metadata) =>
index 75968de6904661fa370f08d90653dc9a6a6a1e56..1dda8afc226c649768bc409012524fc720574a96 100644 (file)
@@ -76,7 +76,7 @@ describe('TaskWrapperService', () => {
 
     it('should call notifyTask if asynchronous task would have been finished', () => {
       const taskManager = TestBed.get(TaskManagerService);
-      spyOn(taskManager, 'subscribe').and.callFake((name, metadata, onTaskFinished) => {
+      spyOn(taskManager, 'subscribe').and.callFake((_name, _metadata, onTaskFinished) => {
         onTaskFinished();
       });
       callWrapTaskAroundCall(202, 'async').subscribe(null, null, () => (passed = true));
index 3ccce9a1d28c01257a4efe286085874f2fc8d248..6c6750adbbd56d31153d67238f0aa86e848702b1 100644 (file)
@@ -12,7 +12,7 @@ Object.defineProperty(window, 'localStorage', { value: mock() });
 Object.defineProperty(window, 'sessionStorage', { value: mock() });
 Object.defineProperty(window, 'getComputedStyle', {
   value: () => ({
-    getPropertyValue: (prop) => {
+    getPropertyValue: () => {
       return '';
     }
   })
index 89c61e3f07d02f5c3d4ada50b2f20c4320154b5b..05a9aad19356c702abbae3d236171a96615cf9c1 100644 (file)
@@ -8,7 +8,6 @@
   },
   "exclude": [
     "**/*.spec.ts",
-    "test.ts",
     "testing/*.ts"
   ]
 }
index b5de1d67b30c7e2b3820cc478c1a84072e4cb1fa..0533feab55966991dd75f37bf96bf03fae133e94 100644 (file)
@@ -6,12 +6,12 @@
     "module": "commonjs",
     "target": "es5",
     "types": [
-      "jasmine",
+      "jest",
       "node"
-    ]
+    ],
+    "noEmit": true
   },
   "files": [
-    "test.ts",
     "polyfills.ts"
   ],
   "include": [
index e4c09adcb8129fcf5c3818c0256903e75025c9d3..f0ce66cf44c373fe6608d93f9518aa7bc3f2cc3c 100644 (file)
@@ -40,7 +40,6 @@
     "no-trailing-whitespace": true,
     "no-unnecessary-initializer": true,
     "no-unused-expression": true,
-    "no-unused-variable": true,
     "no-use-before-declare": true,
     "no-var-keyword": true,
     "object-literal-sort-keys": false,
@@ -61,7 +60,7 @@
       }
     ],
     "unified-signatures": true,
-    "variable-name": [true, "check-format", "allow-snake-case"],
+    "variable-name": [true, "check-format", "allow-snake-case", "allow-leading-underscore"],
     "whitespace": [
       true,
       "check-branch",