From: Alfonso Martínez Date: Wed, 19 Aug 2020 14:39:53 +0000 (+0200) Subject: mgr/dashboard: use SASS colors in TypeScript X-Git-Tag: v16.1.0~1373^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=673f6961cfb67161b7e678abee798d21d552d42c;p=ceph.git mgr/dashboard: use SASS colors in TypeScript NOTE: Enabled TS compiler option esModuleInterop for the unit tests to pass, which is also highly recommended: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop This implied updating lodash & momentjs imports (unneeded ones have been removed). Fixes: https://tracker.ceph.com/issues/47036 Signed-off-by: Alfonso Martínez --- diff --git a/src/pybind/mgr/dashboard/frontend/.stylelintrc b/src/pybind/mgr/dashboard/frontend/.stylelintrc index 244a8f22cdf..c48d66dca19 100644 --- a/src/pybind/mgr/dashboard/frontend/.stylelintrc +++ b/src/pybind/mgr/dashboard/frontend/.stylelintrc @@ -2,7 +2,7 @@ "extends": "stylelint-config-sass-guidelines", "plugins": [ "stylelint-declaration-use-variable" - ], + ], "rules": { "function-parentheses-space-inside": null, "indentation": null, @@ -32,6 +32,12 @@ ] } ] + ], + "property-no-unknown": [ + true, + { + "ignoreSelectors": [":export"] + } ] - } + } } diff --git a/src/pybind/mgr/dashboard/frontend/package-lock.json b/src/pybind/mgr/dashboard/frontend/package-lock.json index 48a6487d083..c5a44ce9284 100644 --- a/src/pybind/mgr/dashboard/frontend/package-lock.json +++ b/src/pybind/mgr/dashboard/frontend/package-lock.json @@ -8508,11 +8508,6 @@ "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, - "fsevents": { - "dev": true, - "optional": true, - "version": "2.1.3" - }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -8751,6 +8746,12 @@ "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true }, + "harmony-reflect": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/harmony-reflect/-/harmony-reflect-1.6.1.tgz", + "integrity": "sha512-WJTeyp0JzGtHcuMsi7rw2VwtkvLa+JyfEKJCFyfcS0+CDkjQ5lHPu7zEhFZP+PDSRrEgXa5Ah0l1MbgbE41XjA==", + "dev": true + }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -9528,6 +9529,15 @@ "postcss": "^7.0.14" } }, + "identity-obj-proxy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz", + "integrity": "sha1-lNK9qWCERT7zb7xarsN+D3nx/BQ=", + "dev": true, + "requires": { + "harmony-reflect": "^1.4.6" + } + }, "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", @@ -13684,8 +13694,6 @@ } }, "fsevents": { - "dev": true, - "optional": true, "version": "2.1.3" }, "glob-parent": { @@ -22438,8 +22446,6 @@ } }, "fsevents": { - "dev": true, - "optional": true, "version": "2.1.3" }, "glob-parent": { @@ -23081,8 +23087,6 @@ } }, "fsevents": { - "dev": true, - "optional": true, "version": "2.1.3" }, "glob-parent": { diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 48c21d82914..16b7f29c3a6 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -42,6 +42,9 @@ }, "private": true, "jest": { + "moduleNameMapper": { + "\\.scss$": "identity-obj-proxy" + }, "preset": "jest-preset-angular", "setupFilesAfterEnv": [ "/src/setupJest.ts" @@ -117,6 +120,7 @@ "cypress": "4.12.1", "html-linter": "1.1.1", "htmllint-cli": "0.0.7", + "identity-obj-proxy": "3.0.0", "jest": "26.3.0", "jest-canvas-mock": "2.2.0", "jest-preset-angular": "8.2.1", diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts index 12330c96b31..ad65a078347 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts @@ -1,7 +1,7 @@ import { Injectable, NgModule } from '@angular/core'; import { ActivatedRouteSnapshot, PreloadAllModules, RouterModule, Routes } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CephfsListComponent } from './ceph/cephfs/cephfs-list/cephfs-list.component'; import { ConfigurationFormComponent } from './ceph/cluster/configuration/configuration-form/configuration-form.component'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts index e0cef596b6a..f671da3807d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.spec.ts @@ -2,7 +2,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { TreeModel, TreeModule } from 'angular-tree-component'; -import * as _ from 'lodash'; import { configureTestBed } from '../../../../testing/unit-test-helper'; import { SharedModule } from '../../../shared/shared.module'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts index 983efd4580c..f6bc232e27d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-details/iscsi-target-details.component.ts @@ -7,7 +7,7 @@ import { TreeNode, TREE_ACTIONS } from 'angular-tree-component'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { TableComponent } from '../../../shared/datatable/table/table.component'; import { Icons } from '../../../shared/enum/icons.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts index 41d67ca87b2..eefb0bca28f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.ts @@ -3,7 +3,7 @@ import { FormArray, FormControl, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin } from 'rxjs'; import { IscsiService } from '../../../shared/api/iscsi.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts index 36d2e70f0d5..e78194b6429 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-image-settings-modal/iscsi-target-image-settings-modal.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AbstractControl, FormControl } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { IscsiService } from '../../../shared/api/iscsi.service'; import { CdFormGroup } from '../../../shared/forms/cd-form-group'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts index dcb7a754c40..fae1142d296 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-iqn-settings-modal/iscsi-target-iqn-settings-modal.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { IscsiService } from '../../../shared/api/iscsi.service'; import { CdFormGroup } from '../../../shared/forms/cd-form-group'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts index 1d7559f7285..a6c82055ac2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.ts @@ -1,7 +1,7 @@ import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Subscription } from 'rxjs'; import { IscsiService } from '../../../shared/api/iscsi.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts index 16c52e7d36f..fba654f366e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-create-modal/bootstrap-create-modal.component.ts @@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { concat, forkJoin, Subscription } from 'rxjs'; import { last, tap } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts index e534596d107..ee58c365786 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/bootstrap-import-modal/bootstrap-import-modal.component.ts @@ -2,7 +2,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { FormControl, FormGroup, ValidatorFn, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { concat, forkJoin, Observable, Subscription } from 'rxjs'; import { last } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts index f1ae3273071..c4146a088e2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, OnInit } from '@angular/core'; import { FormControl, ValidatorFn, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin, Observable, ReplaySubject } from 'rxjs'; import { first, switchMap } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts index 3bc1bcc8af9..70be703fdf4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { RbdService } from '../../../shared/api/rbd.service'; import { ListWithDetails } from '../../../shared/classes/list-with-details.class'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-list/rbd-namespace-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-list/rbd-namespace-list.component.ts index cd66c7cf9c4..706a91be580 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-list/rbd-namespace-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-namespace-list/rbd-namespace-list.component.ts @@ -1,7 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; import { forkJoin, Observable } from 'rxjs'; import { PoolService } from '../../../shared/api/pool.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts index c966c52974b..396bd45eb0c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-actions.model.ts @@ -1,5 +1,3 @@ -import * as _ from 'lodash'; - import { ActionLabelsI18n } from '../../../shared/constants/app.constants'; import { Icons } from '../../../shared/enum/icons.enum'; import { CdTableAction } from '../../../shared/models/cd-table-action'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts index 1559a9854f9..d2d7378a8f5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as moment from 'moment'; +import moment from 'moment'; import { of } from 'rxjs'; import { RbdService } from '../../../shared/api/rbd.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.spec.ts index d975a1c4128..52192d79f51 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.spec.ts @@ -5,7 +5,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import * as moment from 'moment'; +import moment from 'moment'; import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts index f6743c6607e..cdd39f37845 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-list/rbd-trash-list.component.ts @@ -1,8 +1,8 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; -import * as moment from 'moment'; +import _ from 'lodash'; +import moment from 'moment'; import { RbdService } from '../../../shared/api/rbd.service'; import { TableStatusViewCache } from '../../../shared/classes/table-status-view-cache'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.spec.ts index 22fc800585c..8f9291f229c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbActiveModal, NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; -import * as moment from 'moment'; +import moment from 'moment'; import { ToastrModule } from 'ngx-toastr'; import { configureTestBed } from '../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts index ba1ccbed0c6..f7c49123868 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as moment from 'moment'; +import moment from 'moment'; import { RbdService } from '../../../shared/api/rbd.service'; import { CdFormBuilder } from '../../../shared/forms/cd-form-builder'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-chart/cephfs-chart.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-chart/cephfs-chart.component.ts index 61dbc974fe1..286982f8f2e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-chart/cephfs-chart.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-chart/cephfs-chart.component.ts @@ -1,8 +1,8 @@ import { Component, ElementRef, Input, OnChanges, OnInit, ViewChild } from '@angular/core'; import { ChartDataSets, ChartOptions, ChartPoint, ChartType } from 'chart.js'; -import * as _ from 'lodash'; -import * as moment from 'moment'; +import _ from 'lodash'; +import moment from 'moment'; import { ChartTooltip } from '../../../shared/models/chart-tooltip'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts index 655aefa18b1..bbf63f4107c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-detail/cephfs-detail.component.ts @@ -1,7 +1,5 @@ import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import * as _ from 'lodash'; - import { CdTableColumn } from '../../../shared/models/cd-table-column'; import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe'; import { DimlessPipe } from '../../../shared/pipes/dimless.pipe'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts index 13c9c87e164..78f5d1a84f6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-directories/cephfs-directories.component.ts @@ -9,8 +9,8 @@ import { TreeNode, TREE_ACTIONS } from 'angular-tree-component'; -import * as _ from 'lodash'; -import * as moment from 'moment'; +import _ from 'lodash'; +import moment from 'moment'; import { CephfsService } from '../../../shared/api/cephfs.service'; import { ConfirmationModalComponent } from '../../../shared/components/confirmation-modal/confirmation-modal.component'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.spec.ts index b02cc9673b9..c01d9dd7d2d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.spec.ts @@ -4,7 +4,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; import { TreeModule } from 'angular-tree-component'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.ts index 64449b3919f..0d313010c19 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-tabs/cephfs-tabs.component.ts @@ -1,6 +1,6 @@ import { Component, Input, NgZone, OnChanges, OnDestroy } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Subscription, timer } from 'rxjs'; import { CephfsService } from '../../../shared/api/cephfs.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts index df0e6d16261..0d4b67d43fe 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-details/configuration-details.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Component({ selector: 'cd-configuration-details', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts index aa9ab7b839c..6bb71597e50 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, FormGroup, ValidatorFn } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ConfigurationService } from '../../../../shared/api/configuration.service'; import { ConfigFormModel } from '../../../../shared/components/config-option/config-option.model'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts index 391d87f7a0c..861ae203123 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts @@ -3,7 +3,6 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import * as _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts index a095f6c6b77..9848545014d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { Router } from '@angular/router'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { HostService } from '../../../shared/api/host.service'; import { OrchestratorService } from '../../../shared/api/orchestrator.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.spec.ts index b05f37af319..8bc8f8c9ad7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.spec.ts @@ -5,7 +5,6 @@ import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; -import * as _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { configureTestBed } from '../../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.ts index d6ec52e680e..e19ad08879e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/inventory/inventory-devices/inventory-devices.component.ts @@ -8,7 +8,7 @@ import { ViewChild } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Subscription } from 'rxjs'; import { OrchestratorService } from '../../../../shared/api/orchestrator.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts index 715ee5035c8..2fdb9aced61 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { ValidatorFn, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin as observableForkJoin } from 'rxjs'; import { MgrModuleService } from '../../../../shared/api/mgr-module.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts index 82d765dac5b..841634d71bc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/monitor/monitor.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { MonitorService } from '../../../shared/api/monitor.service'; import { CellTemplate } from '../../../shared/enum/cell-template.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.ts index 61b86cad2e7..5a6a08fcc5f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-creation-preview-modal/osd-creation-preview-modal.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { OsdService } from '../../../../shared/api/osd.service'; import { ActionLabelsI18n, URLVerbs } from '../../../../shared/constants/app.constants'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts index 2ed5e0fe1f7..21f63d2bb74 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-details/osd-details.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { OsdService } from '../../../../shared/api/osd.service'; import { Permission } from '../../../../shared/models/permissions'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.ts index 3693bc558cc..cd23f8ce1e0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-groups/osd-devices-selection-groups.component.ts @@ -1,6 +1,6 @@ import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Icons } from '../../../../shared/enum/icons.enum'; import { CdTableColumnFiltersChange } from '../../../../shared/models/cd-table-column-filters-change'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.ts index 4f677ac147d..217f471a8e8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-devices-selection-modal/osd-devices-selection-modal.component.ts @@ -2,7 +2,7 @@ import { AfterViewInit, Component, EventEmitter, Output, ViewChild } from '@angu import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; import { TableColumnProp } from '@swimlane/ngx-datatable'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ActionLabelsI18n } from '../../../../shared/constants/app.constants'; import { Icons } from '../../../../shared/enum/icons.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.spec.ts index 78d472da16a..e91c9534e96 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { configureTestBed } from '../../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts index 78ca001ce7a..2245c69c600 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-flags-modal/osd-flags-modal.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { OsdService } from '../../../../shared/api/osd.service'; import { NotificationType } from '../../../../shared/enum/notification-type.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/drive-group.model.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/drive-group.model.ts index dd5d3b0b13e..53e370dde22 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/drive-group.model.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/drive-group.model.ts @@ -1,4 +1,4 @@ -import * as _ from 'lodash'; +import _ from 'lodash'; import { CdTableColumnFiltersChange } from '../../../../shared/models/cd-table-column-filters-change'; import { FormatterService } from '../../../../shared/services/formatter.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.ts index 651ae814ffa..74d8b89f11f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-form/osd-form.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, ViewChild } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { OrchestratorService } from '../../../../shared/api/orchestrator.service'; import { SubmitButtonComponent } from '../../../../shared/components/submit-button/submit-button.component'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts index 52ccec23622..3b921789415 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.spec.ts @@ -6,7 +6,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { EMPTY, of } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts index ef9483aab25..f42e9f15842 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-list/osd-list.component.ts @@ -3,7 +3,7 @@ import { FormControl } from '@angular/forms'; import { Router } from '@angular/router'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin as observableForkJoin, Observable } from 'rxjs'; import { OrchestratorService } from '../../../../shared/api/orchestrator.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-performance-histogram/osd-performance-histogram.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-performance-histogram/osd-performance-histogram.component.ts index f7024f72387..44a2f3e05ff 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-performance-histogram/osd-performance-histogram.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-performance-histogram/osd-performance-histogram.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Component({ selector: 'cd-osd-performance-histogram', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.spec.ts index c6351ea8a72..368c9692496 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { of as observableOf } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts index f4b165b2eea..b96f84ddcff 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-recv-speed-modal/osd-recv-speed-modal.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ConfigurationService } from '../../../../shared/api/configuration.service'; import { OsdService } from '../../../../shared/api/osd.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts index ee3d5e956e3..69c0306f403 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts @@ -5,8 +5,8 @@ import { ActivatedRoute, Router, Routes } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbPopoverModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; -import * as moment from 'moment'; +import _ from 'lodash'; +import moment from 'moment'; import { ToastrModule } from 'ngx-toastr'; import { of, throwError } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts index 0212ac0ebf2..77a03102827 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.ts @@ -2,8 +2,8 @@ import { Component } from '@angular/core'; import { Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; -import * as moment from 'moment'; +import _ from 'lodash'; +import moment from 'moment'; import { PrometheusService } from '../../../../shared/api/prometheus.service'; import { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.spec.ts index c888fb5bb60..f20dd467693 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbActiveModal, NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { of } from 'rxjs'; import { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts index e0afaa805bd..62eccd640e4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-matcher-modal/silence-matcher-modal.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Output, ViewChild } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { NgbActiveModal, NgbTypeahead } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { merge, Observable, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.spec.ts index 23fe0950889..f37b9477184 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.spec.ts @@ -1,7 +1,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { of } from 'rxjs'; import { configureTestBed } from '../../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts index 16c23f3b579..e0df084e299 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-daemon-list/service-daemon-list.component.ts @@ -11,7 +11,7 @@ import { ViewChildren } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable, Subscription } from 'rxjs'; import { CephServiceService } from '../../../../shared/api/ceph-service.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts index 50d76cca905..b224aaa22f7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbTypeaheadModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, FormHelper } from '../../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts index 4bf6d36143a..10071d71c9e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.ts @@ -3,7 +3,7 @@ import { AbstractControl, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import { NgbTypeahead } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { merge, Observable, Subject } from 'rxjs'; import { debounceTime, distinctUntilChanged, filter, map } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.spec.ts index 5ffb046cf16..a655a635aba 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { of as observableOf } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts index 2abbade4847..d2c4c894459 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/telemetry/telemetry.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { ValidatorFn, Validators } from '@angular/forms'; import { Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin as observableForkJoin } from 'rxjs'; import { MgrModuleService } from '../../../shared/api/mgr-module.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.scss b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.scss index acbba504fee..23560b00427 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.scss +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.scss @@ -5,10 +5,6 @@ $canvas-width: 100%; $canvas-height: 100%; .chart-container { - @each $key_name, $value in bd.$health-chart-colors { - --color-#{$key_name}: #{$value}; - } - height: $canvas-height; margin-left: auto; margin-right: auto; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.spec.ts index 96331ff0a5b..25782502ca5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.spec.ts @@ -55,16 +55,6 @@ describe('HealthPieComponent', () => { expect(component.chartConfig.dataset[0].data).toEqual(initialData); }); - it('should set colors from css variables', () => { - const cssVar = '--my-color'; - const cssVarColor = '#73c5c5'; - component['getCssVar'] = (name: string) => (name === cssVar ? cssVarColor : ''); - component.chartConfig.colors[0].backgroundColor = [cssVar, '#ffffff']; - fixture.detectChanges(); - - expect(component.chartConfig.colors[0].backgroundColor).toEqual([cssVarColor, '#ffffff']); - }); - describe('tooltip body', () => { const tooltipBody = ['text: 10000']; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.ts index 0c08973da8a..67ef99df1b9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health-pie/health-pie.component.ts @@ -10,9 +10,10 @@ import { } from '@angular/core'; import * as Chart from 'chart.js'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { PluginServiceGlobalRegistrationAndOptions } from 'ng2-charts'; +import styles from '../../../../styles.scss'; import { ChartTooltip } from '../../../shared/models/chart-tooltip'; import { DimlessBinaryPipe } from '../../../shared/pipes/dimless-binary.pipe'; import { DimlessPipe } from '../../../shared/pipes/dimless.pipe'; @@ -52,11 +53,11 @@ export class HealthPieComponent implements OnChanges, OnInit { colors: [ { backgroundColor: [ - '--color-green', - '--color-yellow', - '--color-orange', - '--color-red', - '--color-blue' + styles.chartHealthColorGreen, + styles.chartHealthColorYellow, + styles.chartHealthColorOrange, + styles.chartHealthColorRed, + styles.chartHealthColorBlue ] } ], @@ -77,7 +78,7 @@ export class HealthPieComponent implements OnChanges, OnInit { tooltips: { enabled: true, displayColors: false, - backgroundColor: 'rgba(0,0,0,0.8)', + backgroundColor: styles.chartHealthTootlipBgColor, cornerRadius: 0, bodyFontSize: 14, bodyFontStyle: '600', @@ -104,8 +105,6 @@ export class HealthPieComponent implements OnChanges, OnInit { { id: 'center_text', beforeDraw(chart: Chart) { - const defaultFontColorA = '#151515'; - const defaultFontColorB = '#72767B'; const defaultFontFamily = 'Helvetica Neue, Helvetica, Arial, sans-serif'; Chart.defaults.global.defaultFontFamily = defaultFontFamily; const ctx = chart.ctx; @@ -122,12 +121,12 @@ export class HealthPieComponent implements OnChanges, OnInit { ctx.textBaseline = 'middle'; ctx.font = `24px ${defaultFontFamily}`; - ctx.fillStyle = defaultFontColorA; + ctx.fillStyle = styles.chartHealthCenterTextColor; ctx.fillText(label[0], centerX, centerY - 10); if (label.length > 1) { ctx.font = `14px ${defaultFontFamily}`; - ctx.fillStyle = defaultFontColorB; + ctx.fillStyle = styles.chartHealthCenterTextDescriptionColor; ctx.fillText(label[1], centerX, centerY + 10); } ctx.restore(); @@ -159,8 +158,6 @@ export class HealthPieComponent implements OnChanges, OnInit { _.merge(this.chartConfig, this.config); - this.setColorsFromCssVars(); - this.prepareFn.emit([this.chartConfig, this.data]); } @@ -169,24 +166,6 @@ export class HealthPieComponent implements OnChanges, OnInit { this.setChartSliceBorderWidth(); } - private setColorsFromCssVars() { - this.chartConfig.colors.forEach( - (colorEl: { backgroundColor: string[] }, colorIndex: number) => { - colorEl.backgroundColor.forEach((bgColor: string, bgColorIndex: number) => { - if (bgColor.startsWith('--')) { - this.chartConfig.colors[colorIndex].backgroundColor[bgColorIndex] = this.getCssVar( - bgColor - ); - } - }); - } - ); - } - - private getCssVar(name: string): string { - return getComputedStyle(document.querySelector('.chart-container')).getPropertyValue(name); - } - private getChartTooltipBody(body: string[]) { const bodySplit = body[0].split(': '); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts index df6222fd1c5..bc54ff4a162 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.spec.ts @@ -3,7 +3,7 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { of } from 'rxjs'; import { configureTestBed } from '../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts index c11fba7aab6..717a113c8ad 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/health/health.component.ts @@ -1,8 +1,9 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Subscription } from 'rxjs'; +import styles from '../../../../styles.scss'; import { HealthService } from '../../../shared/api/health.service'; import { Icons } from '../../../shared/enum/icons.enum'; import { Permissions } from '../../../shared/models/permissions'; @@ -31,7 +32,7 @@ export class HealthComponent implements OnInit, OnDestroy { clientStatsConfig = { colors: [ { - backgroundColor: ['--color-cyan', '--color-purple'] + backgroundColor: [styles.chartHealthColorCyan, styles.chartHealthColorPurple] } ] }; @@ -39,7 +40,7 @@ export class HealthComponent implements OnInit, OnDestroy { rawCapacityChartConfig = { colors: [ { - backgroundColor: ['--color-blue', '--color-gray'] + backgroundColor: [styles.chartHealthColorBlue, styles.chartHealthColorGray] } ] }; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mds-summary.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mds-summary.pipe.ts index 68853cb0bee..9cc72ac96ad 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mds-summary.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mds-summary.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'mdsSummary' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mgr-summary.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mgr-summary.pipe.ts index 286d5dd337f..ffdee730099 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mgr-summary.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/mgr-summary.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'mgrSummary' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/osd-summary.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/osd-summary.pipe.ts index 05fc7ad7f80..72bea4a0aea 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/osd-summary.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/dashboard/osd-summary.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'osdSummary' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.spec.ts index 2411aa22eff..2c2e5e189af 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-details/nfs-details.component.spec.ts @@ -4,7 +4,7 @@ import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { configureTestBed } from '../../../../testing/unit-test-helper'; import { SharedModule } from '../../../shared/shared.module'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts index 3ed39cff7c2..a35b514eec3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form-client/nfs-form-client.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormArray, FormControl, NgForm, Validators } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { NfsService } from '../../../shared/api/nfs.service'; import { Icons } from '../../../shared/enum/icons.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts index 9987512859f..b07ecf4a6d3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.ts @@ -2,7 +2,7 @@ import { ChangeDetectorRef, Component, OnInit, ViewChild } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin, Observable, of } from 'rxjs'; import { debounceTime, distinctUntilChanged, map, mergeMap } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts index 6cebd9f1ebe..817533ad30c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.ts @@ -1,7 +1,7 @@ import { Component, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Subscription } from 'rxjs'; import { NfsService } from '../../../shared/api/nfs.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts index be4f85e0290..ef3f38fb774 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/crush-rule-form-modal/crush-rule-form-modal.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, OnInit, Output } from '@angular/core'; import { Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CrushRuleService } from '../../../shared/api/crush-rule.service'; import { CrushNodeSelectionClass } from '../../../shared/classes/crush.node.selection.class'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.ts index 74242d9ec2a..8c9278216d8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-details/pool-details.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { PoolService } from '../../../shared/api/pool.service'; import { CdTableColumn } from '../../../shared/models/cd-table-column'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts index 0ca5df70d8c..cfb42ecd9b8 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.spec.ts @@ -12,7 +12,7 @@ import { NgbModalRef, NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { NgBootstrapFormValidationModule } from 'ng-bootstrap-form-validation'; import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts index 7691b5e494b..b590e8b82d7 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-form/pool-form.component.ts @@ -3,7 +3,7 @@ import { FormControl, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { NgbNav, NgbTooltip } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable, Subscription } from 'rxjs'; import { CrushRuleService } from '../../../shared/api/crush-rule.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts index 06506f19614..e4c216f68a3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts @@ -4,7 +4,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { RouterTestingModule } from '@angular/router/testing'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts index 6501d4ea7fc..97340f1452e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.ts @@ -1,7 +1,7 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ConfigurationService } from '../../../shared/api/configuration.service'; import { PoolService } from '../../../shared/api/pool.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts index 5a9e3e221ad..ad84c1a52f9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.spec.ts @@ -4,7 +4,7 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrModule } from 'ngx-toastr'; import { of as observableOf } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts index 484a2bf0a0f..658d6fcb559 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-form/rgw-bucket-form.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AbstractControl, AsyncValidatorFn, ValidationErrors, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin } from 'rxjs'; import { RgwBucketService } from '../../../shared/api/rgw-bucket.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts index 2cc2601488c..5593c324b92 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-bucket-list/rgw-bucket-list.component.ts @@ -7,7 +7,7 @@ import { ViewChild } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin as observableForkJoin, Observable, Subscriber } from 'rxjs'; import { RgwBucketService } from '../../../shared/api/rgw-bucket.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts index e338572aae3..eba47aa722b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-daemon-details/rgw-daemon-details.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { RgwDaemonService } from '../../../shared/api/rgw-daemon.service'; import { Permission } from '../../../shared/models/permissions'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts index 3b1ce3fc81c..bc1e5a449f9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-capability-modal/rgw-user-capability-modal.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Output } from '@angular/core'; import { Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ActionLabelsI18n } from '../../../shared/constants/app.constants'; import { CdFormBuilder } from '../../../shared/forms/cd-form-builder'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts index 276950c8d6e..7a2d998a861 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-details/rgw-user-details.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { RgwUserService } from '../../../shared/api/rgw-user.service'; import { Icons } from '../../../shared/enum/icons.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts index 8055daf029a..1aceb55f274 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { AbstractControl, ValidationErrors, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { concat as observableConcat, forkJoin as observableForkJoin, Observable } from 'rxjs'; import { RgwUserService } from '../../../shared/api/rgw-user.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts index c06129d39fc..c1323c5f045 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-s3-key-modal/rgw-user-s3-key-modal.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Output } from '@angular/core'; import { Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ActionLabelsI18n } from '../../../shared/constants/app.constants'; import { CdFormBuilder } from '../../../shared/forms/cd-form-builder'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts index 3a534497001..b7b239b62a1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-subuser-modal/rgw-user-subuser-modal.component.ts @@ -2,7 +2,7 @@ import { Component, EventEmitter, Output } from '@angular/core'; import { AbstractControl, ValidationErrors, ValidatorFn, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ActionLabelsI18n } from '../../../shared/constants/app.constants'; import { CdFormBuilder } from '../../../shared/forms/cd-form-builder'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/pg-category.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/pg-category.service.ts index cf77649502a..d9c90e8b24e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/pg-category.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/pg-category.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CephSharedModule } from './ceph-shared.module'; import { PgCategory } from './pg-category.model'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.spec.ts index ac79d93fff7..7570528aba6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.spec.ts @@ -5,7 +5,7 @@ import { By } from '@angular/platform-browser'; import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { of } from 'rxjs'; import { configureTestBed } from '../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts index f02a537c08c..ee9c729813e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/shared/smart-list/smart-list.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { HostService } from '../../../shared/api/host.service'; import { OsdService } from '../../../shared/api/osd.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.ts index 8470836fbcd..2479cb736ed 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnChanges, OnInit } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CellTemplate } from '../../../shared/enum/cell-template.enum'; import { CdTableColumn } from '../../../shared/models/cd-table-column'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.ts index 08d8f463b02..8a455e0ebcd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { FormControl, Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin as observableForkJoin } from 'rxjs'; import { RoleService } from '../../../shared/api/role.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts index c3e1b227779..627766ac2fe 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.ts @@ -3,8 +3,8 @@ import { Validators } from '@angular/forms'; import { ActivatedRoute, Router } from '@angular/router'; import { NgbModalRef } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; -import * as moment from 'moment'; +import _ from 'lodash'; +import moment from 'moment'; import { forkJoin as observableForkJoin } from 'rxjs'; import { AuthService } from '../../../shared/api/auth.service'; @@ -174,9 +174,6 @@ export class UserFormComponent extends CdForm implements OnInit { ); const expirationDate = response['pwdExpirationDate']; if (expirationDate) { - const mom = moment(expirationDate * 1000); - console.log(this.pwdExpirationFormat, mom.format(this.pwdExpirationFormat)); - this.userForm .get('pwdExpirationDate') .setValue(moment(expirationDate * 1000).format(this.pwdExpirationFormat)); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts index e7ef06c15a5..7d6f9127e4c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-password-form/user-password-form.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core'; import { Validators } from '@angular/forms'; import { Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { UserService } from '../../../shared/api/user.service'; import { ActionLabelsI18n } from '../../../shared/constants/app.constants'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts index 367a081f6f1..07bd4deb9cb 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/ceph-service.service.ts @@ -1,7 +1,6 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; import { Observable } from 'rxjs'; import { Daemon } from '../models/daemon.interface'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts index 7f071900ec2..e5c53b74195 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/cephfs.service.ts @@ -1,7 +1,7 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable } from 'rxjs'; import { cdEncode } from '../decorators/cd-encode'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts index 0fe9883f9e3..89a23393b90 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/orchestrator.service.ts @@ -1,7 +1,7 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable, of as observableOf } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts index cc088d0e95f..b68aaf1c193 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/osd.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { map } from 'rxjs/operators'; import { CdDevice } from '../models/devices'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts index 38c02bd0557..d65c2356f56 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rbd.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { map } from 'rxjs/operators'; import { cdEncode, cdEncodeNot } from '../decorators/cd-encode'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts index f939a55c104..4c8654d4cb9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts @@ -1,7 +1,7 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin as observableForkJoin, of as observableOf } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts index 6adc55dda4a..e4b9b597ade 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts @@ -1,7 +1,7 @@ import { HttpClient, HttpParams } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { forkJoin as observableForkJoin, Observable, of as observableOf } from 'rxjs'; import { mergeMap } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts index 52433a8a419..1e53fa06493 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/api/settings.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.spec.ts index fd67cdec30c..d3bd7306b38 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.spec.ts @@ -1,6 +1,6 @@ import { FormControl } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { configureTestBed, Mocks } from '../../../testing/unit-test-helper'; import { CrushNode } from '../models/crush-node'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.ts index e1cf4b0ec3c..34cebbcc877 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/classes/crush.node.selection.class.ts @@ -1,6 +1,6 @@ import { AbstractControl } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CrushNode } from '../models/crush-node'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts index be2db943542..6be0df05377 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.spec.ts @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { of as observableOf } from 'rxjs'; import { configureTestBed } from '../../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.ts index 7778deccb3c..a8bdf44e081 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.component.ts @@ -1,7 +1,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl, NgForm } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Icons } from '../../../shared/enum/icons.enum'; import { ConfigurationService } from '../../api/configuration.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.types.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.types.ts index eb1bce5748d..73e006fee7a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.types.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/config-option/config-option.types.ts @@ -1,6 +1,6 @@ import { Validators } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CdValidators } from '../../forms/cd-validators'; import { ConfigFormModel } from './config-option.model'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/date-time-picker/date-time-picker.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/date-time-picker/date-time-picker.component.ts index c3ff2a7ff71..390edbfd84a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/date-time-picker/date-time-picker.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/date-time-picker/date-time-picker.component.ts @@ -2,7 +2,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { FormControl } from '@angular/forms'; import { NgbCalendar, NgbDateStruct, NgbTimeStruct } from '@ng-bootstrap/ng-bootstrap'; -import * as moment from 'moment'; +import moment from 'moment'; import { Subscription } from 'rxjs'; @Component({ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.ts index b8dad67a46b..dec43d33b63 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/form-modal/form-modal.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { FormControl, ValidatorFn, Validators } from '@angular/forms'; import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CdFormBuilder } from '../../forms/cd-form-builder'; import { CdFormGroup } from '../../forms/cd-form-group'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/language-selector/language-selector.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/language-selector/language-selector.component.ts index 6f18afffd7f..49fc02f9146 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/language-selector/language-selector.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/language-selector/language-selector.component.ts @@ -1,6 +1,6 @@ import { Component, OnInit } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { LanguageService } from '../../services/language.service'; import { SupportedLanguages } from './supported-languages.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/notifications-sidebar/notifications-sidebar.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/notifications-sidebar/notifications-sidebar.component.ts index 5a0f9b603e9..a334b8b77fc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/notifications-sidebar/notifications-sidebar.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/notifications-sidebar/notifications-sidebar.component.ts @@ -9,8 +9,8 @@ import { } from '@angular/core'; import { Mutex } from 'async-mutex'; -import * as _ from 'lodash'; -import * as moment from 'moment'; +import _ from 'lodash'; +import moment from 'moment'; import { Subscription } from 'rxjs'; import { Icons } from '../../enum/icons.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select-messages.model.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select-messages.model.ts index 6362b4e26cb..7a28ffb5e80 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select-messages.model.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select-messages.model.ts @@ -1,4 +1,4 @@ -import * as _ from 'lodash'; +import _ from 'lodash'; export class SelectMessages { empty: string; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.ts index e4b780fcdf9..b303af4c138 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/select/select.component.ts @@ -1,7 +1,7 @@ import { Component, EventEmitter, Input, OnChanges, OnInit, Output } from '@angular/core'; import { FormControl, ValidatorFn } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Icons } from '../../../shared/enum/icons.enum'; import { CdFormGroup } from '../../forms/cd-form-group'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.ts index 0d4d0e770b1..ad4d6094aff 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/components/submit-button/submit-button.component.ts @@ -1,7 +1,7 @@ import { Component, ElementRef, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { AbstractControl, FormGroup, FormGroupDirective, NgForm } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Icons } from '../../../shared/enum/icons.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-actions/table-actions.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-actions/table-actions.component.ts index fb11b64a68f..a6f30a066d3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-actions/table-actions.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-actions/table-actions.component.ts @@ -1,6 +1,6 @@ import { Component, Input, OnInit } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Icons } from '../../../shared/enum/icons.enum'; import { CdTableAction } from '../../models/cd-table-action'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.ts index 38bd942b20a..dd48a431bed 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table-key-value/table-key-value.component.ts @@ -8,7 +8,7 @@ import { ViewChild } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { CellTemplate } from '../../enum/cell-template.enum'; import { CdTableColumn } from '../../models/cd-table-column'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts index baf3505cc15..774c754b3a0 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.spec.ts @@ -5,7 +5,7 @@ import { RouterTestingModule } from '@angular/router/testing'; import { NgbDropdownModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap'; import { NgxDatatableModule } from '@swimlane/ngx-datatable'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { configureTestBed } from '../../../../testing/unit-test-helper'; import { ComponentsModule } from '../../components/components.module'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts index 51259b27b16..25f4b95cf15 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/datatable/table/table.component.ts @@ -22,7 +22,7 @@ import { SortPropDir, TableColumnProp } from '@swimlane/ngx-datatable'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable, Subject, Subscription, timer as observableTimer } from 'rxjs'; import { TableStatus } from '../../../shared/classes/table-status'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/decorators/cd-encode.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/decorators/cd-encode.ts index d201d53b7bd..afff2ec6d38 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/decorators/cd-encode.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/decorators/cd-encode.ts @@ -1,4 +1,4 @@ -import * as _ from 'lodash'; +import _ from 'lodash'; /** * This decorator can be used in a class or method. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/autofocus.directive.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/autofocus.directive.ts index 169571f3d09..dc34b9f3c30 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/autofocus.directive.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/autofocus.directive.ts @@ -1,6 +1,6 @@ import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Directive({ selector: '[autofocus]' // tslint:disable-line diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary-per-second.directive.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary-per-second.directive.ts index 011439248fa..a90e2b8f8ab 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary-per-second.directive.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary-per-second.directive.ts @@ -9,7 +9,7 @@ import { } from '@angular/core'; import { NgControl } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { DimlessBinaryPerSecondPipe } from '../pipes/dimless-binary-per-second.pipe'; import { FormatterService } from '../services/formatter.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary.directive.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary.directive.ts index cda47925cc8..1c27ae1cecf 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary.directive.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/dimless-binary.directive.ts @@ -9,7 +9,7 @@ import { } from '@angular/core'; import { NgControl } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { DimlessBinaryPipe } from '../pipes/dimless-binary.pipe'; import { FormatterService } from '../services/formatter.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/trim.directive.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/trim.directive.ts index 7731721dd90..4b3604e4309 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/trim.directive.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/trim.directive.ts @@ -1,7 +1,7 @@ import { Directive, HostListener } from '@angular/core'; import { NgControl } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Directive({ selector: '[cdTrim]' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/color.enum.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/color.enum.ts index 0378827b286..881cc012f35 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/color.enum.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/enum/color.enum.ts @@ -1,6 +1,8 @@ -export enum Color { +import styles from '../../../styles.scss'; + +export class Color { // HEALTH - HEALTH_ERR = '#ff0000', - HEALTH_WARN = '#ffa500', - HEALTH_OK = '#00bb00' + static HEALTH_ERR = styles.healthColorError; + static HEALTH_WARN = styles.healthColorWarning; + static HEALTH_OK = styles.healthColorHealthy; } diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts index d72bcdc7c1e..3541c2ba22b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/forms/cd-validators.ts @@ -6,7 +6,7 @@ import { Validators } from '@angular/forms'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable, of as observableOf, timer as observableTimer } from 'rxjs'; import { map, switchMapTo, take } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/array.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/array.pipe.ts index b61b0b023e7..f82e35316ab 100755 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/array.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/array.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; /** * Convert the given value to an array. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/cd-date.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/cd-date.pipe.spec.ts index 08212b2687a..b67ed62c8a6 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/cd-date.pipe.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/cd-date.pipe.spec.ts @@ -1,6 +1,6 @@ import { DatePipe } from '@angular/common'; -import * as moment from 'moment'; +import moment from 'moment'; import { CdDatePipe } from './cd-date.pipe'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.spec.ts index 7241812e560..a97f8a75166 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.spec.ts @@ -1,4 +1,4 @@ -import * as moment from 'moment'; +import moment from 'moment'; import { DurationPipe } from './duration.pipe'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.ts index c2b874ac457..407de929154 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/duration.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as moment from 'moment'; +import moment from 'moment'; @Pipe({ name: 'duration', diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/empty.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/empty.pipe.ts index 7ee51b63bb2..fb753e8d9ac 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/empty.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/empty.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'empty' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.spec.ts index 2293dd9aca7..471a877031b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/health-color.pipe.spec.ts @@ -1,3 +1,4 @@ +import styles from '../../../styles.scss'; import { HealthColorPipe } from './health-color.pipe'; describe('HealthColorPipe', () => { @@ -8,15 +9,15 @@ describe('HealthColorPipe', () => { }); it('transforms "HEALTH_OK"', () => { - expect(pipe.transform('HEALTH_OK')).toEqual({ color: '#00bb00' }); + expect(pipe.transform('HEALTH_OK')).toEqual({ color: styles.healthColorHealthy }); }); it('transforms "HEALTH_WARN"', () => { - expect(pipe.transform('HEALTH_WARN')).toEqual({ color: '#ffa500' }); + expect(pipe.transform('HEALTH_WARN')).toEqual({ color: styles.healthColorWarning }); }); it('transforms "HEALTH_ERR"', () => { - expect(pipe.transform('HEALTH_ERR')).toEqual({ color: '#ff0000' }); + expect(pipe.transform('HEALTH_ERR')).toEqual({ color: styles.healthColorError }); }); it('transforms others', () => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/map.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/map.pipe.ts index 9242bb4ebe2..1c0839d080b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/map.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/map.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'map' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.spec.ts index b3cf64c459b..97859d10646 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.spec.ts @@ -1,4 +1,4 @@ -import * as moment from 'moment'; +import moment from 'moment'; import { RelativeDatePipe } from './relative-date.pipe'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.ts index c9e536c9034..1718ee258b3 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/relative-date.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as moment from 'moment'; +import moment from 'moment'; @Pipe({ name: 'relativeDate' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts index 1365ddeffa2..077831ac296 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/round.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'round' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/truncate.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/truncate.pipe.ts index d825832f5e6..ff49c63860c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/truncate.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/truncate.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'truncate' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/upper-first.pipe.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/upper-first.pipe.ts index 11d7fc97abe..b73b1bc2099 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/upper-first.pipe.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/upper-first.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Pipe({ name: 'upperFirst' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts index 7384b527de1..5f025118c05 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.ts @@ -8,7 +8,7 @@ import { import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable, throwError as observableThrowError } from 'rxjs'; import { catchError } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.spec.ts index e9b41b1a9f3..00524317efc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import * as moment from 'moment'; +import moment from 'moment'; import { CdDevice } from '../models/devices'; import { DeviceService } from './device.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.ts index f81467f3825..b433f235bff 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/device.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as moment from 'moment'; +import moment from 'moment'; import { CdDevice } from '../models/devices'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts index 1377dcdd2c2..a4b6d427b01 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/formatter.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Injectable({ providedIn: 'root' diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.spec.ts index 226fa4712fc..52700dab7de 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.spec.ts @@ -1,7 +1,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { fakeAsync, TestBed, tick } from '@angular/core/testing'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ToastrService } from 'ngx-toastr'; import { configureTestBed } from '../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts index fddc55f52f8..c05dbce0f57 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/notification.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { IndividualConfig, ToastrService } from 'ngx-toastr'; import { BehaviorSubject, Subject } from 'rxjs'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts index c768a36aa94..295420c27dc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/password-policy.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.ts index 58c084bb0cd..f7dbd1e564e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { Icons } from '../../shared/enum/icons.enum'; import { NotificationType } from '../enum/notification-type.enum'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts index dc1731b9266..0e47306a6bc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { PrometheusService } from '../api/prometheus.service'; import { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.ts index 422c0b262ed..ab94c686e1b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { PrometheusService } from '../api/prometheus.service'; import { CdNotificationConfig } from '../models/cd-notification'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-silence-matcher.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-silence-matcher.service.ts index c819a16f426..7aec6d1d37c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-silence-matcher.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-silence-matcher.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { AlertmanagerSilenceMatcher, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts index a0783402773..f8282ae9758 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/summary.service.ts @@ -1,7 +1,7 @@ import { HttpClient } from '@angular/common/http'; import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { BehaviorSubject, Observable, Subscription } from 'rxjs'; import { filter, first } from 'rxjs/operators'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.spec.ts index 9a951169d63..675b037b1cf 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.spec.ts @@ -1,6 +1,6 @@ import { fakeAsync, TestBed, tick } from '@angular/core/testing'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { BehaviorSubject } from 'rxjs'; import { configureTestBed } from '../../../testing/unit-test-helper'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.ts index 7e99e5aad90..0310a78263a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-manager.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { ExecutingTask } from '../models/executing-task'; import { FinishedTask } from '../models/finished-task'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.spec.ts index 920d79dd73a..282ef649a77 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-message.service.spec.ts @@ -1,7 +1,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import * as _ from 'lodash'; +import _ from 'lodash'; import { configureTestBed } from '../../../testing/unit-test-helper'; import { RbdService } from '../api/rbd.service'; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/time-diff.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/time-diff.service.ts index 16fd45a4a49..37477658ce9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/time-diff.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/time-diff.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; -import * as _ from 'lodash'; +import _ from 'lodash'; @Injectable({ providedIn: 'root' diff --git a/src/pybind/mgr/dashboard/frontend/src/styles.scss b/src/pybind/mgr/dashboard/frontend/src/styles.scss index 2fc5c504a69..9cff9458ed5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/styles.scss +++ b/src/pybind/mgr/dashboard/frontend/src/styles.scss @@ -133,3 +133,24 @@ tags-input .tags { a { cursor: pointer; } + +:export { + chartHealthCenterTextColor: #151515; + chartHealthCenterTextDescriptionColor: #72767b; + chartHealthColorBlue: #06c; + chartHealthColorCyan: #73c5c5; + chartHealthColorGray: #ededed; + chartHealthColorGreen: #7cc674; + chartHealthColorLightBlue: #519de9; + chartHealthColorLightYellow: #f9e0a2; + chartHealthColorMagenta: #009596; + chartHealthColorOrange: #ef9234; + chartHealthColorPurple: #3c3d99; + chartHealthColorRed: #c9190b; + chartHealthColorYellow: #f6d173; + chartHealthTootlipBgColor: #000; + + healthColorError: #f00; + healthColorHealthy: #0b0; + healthColorWarning: #ffa500; +} diff --git a/src/pybind/mgr/dashboard/frontend/src/styles.scss.d.ts b/src/pybind/mgr/dashboard/frontend/src/styles.scss.d.ts new file mode 100644 index 00000000000..f805807c86c --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/styles.scss.d.ts @@ -0,0 +1,25 @@ +export interface Styles { + chartHealthColorRed: string; + chartHealthColorBlue: string; + chartHealthColorOrange: string; + chartHealthColorYellow: string; + chartHealthColorMagenta: string; + chartHealthColorGreen: string; + chartHealthColorGray: string; + chartHealthColorLightBlue: string; + chartHealthColorLightYellow: string; + chartHealthColorCyan: string; + chartHealthColorPurple: string; + + chartHealthCenterTextColor: string; + chartHealthCenterTextDescriptionColor: string; + chartHealthTootlipBgColor: string; + + healthColorError: string; + healthColorWarning: string; + healthColorHealthy: string; +} + +export const styles: Styles; + +export default styles; diff --git a/src/pybind/mgr/dashboard/frontend/src/styles/defaults/_bootstrap-defaults.scss b/src/pybind/mgr/dashboard/frontend/src/styles/defaults/_bootstrap-defaults.scss index 7c41fd080f7..b00aaa0195c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/styles/defaults/_bootstrap-defaults.scss +++ b/src/pybind/mgr/dashboard/frontend/src/styles/defaults/_bootstrap-defaults.scss @@ -25,20 +25,6 @@ $green: #0b0; $teal: #20c997 !default; $cyan: #17a2b8 !default; -$health-chart-colors: ( - 'red': #c9190b, - 'blue': #06c, - 'orange': #ef9234, - 'yellow': #f6d173, - 'magenta': #009596, - 'green': #7cc674, - 'gray': #ededed, - 'light-blue': #519de9, - 'light-yellow': #f9e0a2, - 'cyan': #73c5c5, - 'purple': #3c3d99 -); - $primary: #2b99a8; $secondary: #374249; $success: $green; diff --git a/src/pybind/mgr/dashboard/frontend/tsconfig.base.json b/src/pybind/mgr/dashboard/frontend/tsconfig.base.json index 5458df81518..29443d44f4b 100644 --- a/src/pybind/mgr/dashboard/frontend/tsconfig.base.json +++ b/src/pybind/mgr/dashboard/frontend/tsconfig.base.json @@ -2,6 +2,7 @@ "compileOnSave": false, "compilerOptions": { "downlevelIteration": true, + "esModuleInterop": true, "importHelpers": true, "module": "es2020", "outDir": "./dist/out-tsc",