From aad32e02a9bdf62f3f46ef77e82e8d8d5ccdd17b Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Tue, 2 Apr 2019 14:39:05 +0000 Subject: [PATCH] mgr/dashboard: Switch ng2-toastr for ngx-toastr Fixes: https://tracker.ceph.com/issues/40768 Signed-off-by: Tiago Melo (cherry picked from commit 67f5e5b18b71ccabcaa8d9e35c57630d17395b06) Signed-off-by: Ernesto Puerta Required manual (trivial) fixing of the following files: Conflicts: src/pybind/mgr/dashboard/frontend/package.json src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/alert-list/alert-list.component.spec.ts src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-form/silence-form.component.spec.ts src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/silence-list/silence-list.component.spec.ts src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/pool-list/pool-list.component.spec.ts src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.spec.ts --- src/pybind/mgr/dashboard/HACKING.rst | 10 +++++----- .../mgr/dashboard/frontend/angular.json | 2 +- .../mgr/dashboard/frontend/package-lock.json | 12 ++++++++---- .../mgr/dashboard/frontend/package.json | 2 +- .../frontend/src/app/app.component.spec.ts | 4 +--- .../frontend/src/app/app.component.ts | 12 ++---------- .../dashboard/frontend/src/app/app.module.ts | 19 ++++++------------- ...i-target-discovery-modal.component.spec.ts | 4 ++-- .../iscsi-target-form.component.spec.ts | 4 ++-- .../iscsi-target-list.component.spec.ts | 4 ++-- .../overview/overview.component.spec.ts | 4 ++-- .../pool-edit-mode-modal.component.spec.ts | 4 ++-- .../pool-edit-peer-modal.component.spec.ts | 4 ++-- .../pool-list/pool-list.component.spec.ts | 4 ++-- .../block/rbd-form/rbd-form.component.spec.ts | 4 ++-- .../rbd-images/rbd-images.component.spec.ts | 4 ++-- .../block/rbd-list/rbd-list.component.spec.ts | 4 ++-- .../rbd-snapshot-form.component.spec.ts | 4 ++-- .../rbd-snapshot-list.component.spec.ts | 4 ++-- .../rbd-trash-list.component.spec.ts | 4 ++-- .../rbd-trash-move-modal.component.spec.ts | 4 ++-- .../rbd-trash-purge-modal.component.spec.ts | 4 ++-- .../rbd-trash-restore-modal.component.spec.ts | 4 ++-- .../configuration-form.component.spec.ts | 4 ++-- .../mgr-module-form.component.spec.ts | 4 ++-- .../mgr-module-list.component.spec.ts | 4 ++-- .../osd-flags-modal.component.spec.ts | 4 ++-- .../osd-pg-scrub-modal.component.spec.ts | 4 ++-- .../osd-recv-speed-modal.component.spec.ts | 4 ++-- .../prometheus-list.component.spec.ts | 4 ++-- .../nfs/nfs-form/nfs-form.component.spec.ts | 4 ++-- .../nfs/nfs-list/nfs-list.component.spec.ts | 4 ++-- ...rasure-code-profile-form.component.spec.ts | 4 ++-- .../pool-form/pool-form.component.spec.ts | 4 ++-- .../pool-list/pool-list.component.spec.ts | 4 ++-- .../rgw-bucket-form.component.spec.ts | 4 ++-- .../rgw-user-form.component.spec.ts | 4 ++-- ...rgw-user-swift-key-modal.component.spec.ts | 4 ++-- .../role-details.component.spec.ts | 9 +-------- .../role-form/role-form.component.spec.ts | 4 ++-- .../role-list/role-list.component.spec.ts | 4 ++-- .../user-form/user-form.component.spec.ts | 4 ++-- .../user-list/user-list.component.spec.ts | 4 ++-- .../user-tabs/user-tabs.component.spec.ts | 9 +-------- .../notifications.component.spec.ts | 4 ++-- .../copy2clipboard-button.directive.ts | 4 ++-- .../src/app/shared/models/cd-notification.ts | 4 ++-- .../services/api-interceptor.service.spec.ts | 4 ++-- .../services/notification.service.spec.ts | 8 ++++---- .../shared/services/notification.service.ts | 8 ++++---- .../prometheus-alert-formatter.spec.ts | 4 ++-- .../services/prometheus-alert.service.spec.ts | 4 ++-- .../prometheus-notification.service.spec.ts | 6 +++--- .../services/task-wrapper.service.spec.ts | 4 ++-- 54 files changed, 121 insertions(+), 148 deletions(-) diff --git a/src/pybind/mgr/dashboard/HACKING.rst b/src/pybind/mgr/dashboard/HACKING.rst index 55894e03e2b3f..9c2050da01e62 100644 --- a/src/pybind/mgr/dashboard/HACKING.rst +++ b/src/pybind/mgr/dashboard/HACKING.rst @@ -214,7 +214,7 @@ Example: import { Component } from '@angular/core'; import { Router } from '@angular/router'; - import { ToastsManager } from 'ng2-toastr'; + import { ToastrManager } from 'ngx-toastr'; import { Credentials } from '../../../shared/models/credentials.model'; import { HostService } from './services/host.service'; @@ -257,7 +257,7 @@ or removed to/from a set of items (e.g.: 'Add permission' to a user vs. 'Create In order to enforce the use of this wording, a service ``ActionLabelsI18n`` has been created, which provides translated labels for use in UI elements. - + Frontend branding ~~~~~~~~~~~~~~~~~ @@ -1462,7 +1462,7 @@ decorators that can be used to add more information: * ``@EndpointDoc()`` for documentation of endpoints. It has four optional arguments (explained below): ``description``, ``group``, ``parameters`` and``responses``. -* ``@ControllerDoc()`` for documentation of controller or group associated with +* ``@ControllerDoc()`` for documentation of controller or group associated with the endpoints. It only takes the two first arguments: ``description`` and``group``. @@ -1471,7 +1471,7 @@ decorators that can be used to add more information: ``group``: By default, an endpoint is grouped together with other endpoints within the same controller class. ``group`` is a string that can be used to -assign an endpoint or all endpoints in a class to another controller or a +assign an endpoint or all endpoints in a class to another controller or a conceived group name. @@ -1505,7 +1505,7 @@ for nested parameters). 'item2': (str, 'Description of item2', True), # item2 is optional 'item3': (str, 'Description of item3', True, 'foo'), # item3 is optional with 'foo' as default value }, 'Description of my_dictionary')}) - + If the parameter is a ``list`` of primitive types, the type should be surrounded with square brackets. diff --git a/src/pybind/mgr/dashboard/frontend/angular.json b/src/pybind/mgr/dashboard/frontend/angular.json index 068aa101dfccc..b64f58a32a6ac 100644 --- a/src/pybind/mgr/dashboard/frontend/angular.json +++ b/src/pybind/mgr/dashboard/frontend/angular.json @@ -21,8 +21,8 @@ "src/favicon.ico" ], "styles": [ + "node_modules/ngx-toastr/toastr.css", "node_modules/bootstrap/dist/css/bootstrap.css", - "node_modules/ng2-toastr/bundles/ng2-toastr.min.css", "node_modules/fork-awesome/css/fork-awesome.css", "node_modules/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css", "node_modules/ngx-bootstrap/datepicker/bs-datepicker.css", diff --git a/src/pybind/mgr/dashboard/frontend/package-lock.json b/src/pybind/mgr/dashboard/frontend/package-lock.json index ed5fec69af010..46ec0cb622374 100644 --- a/src/pybind/mgr/dashboard/frontend/package-lock.json +++ b/src/pybind/mgr/dashboard/frontend/package-lock.json @@ -11333,10 +11333,6 @@ "chart.js": "^2.6.0" } }, - "ng2-toastr": { - "version": "github:zzakir/ng2-toastr#0eafd72f1581058113ca338218d77f5c27f5b630", - "from": "github:zzakir/ng2-toastr#0eafd72" - }, "ng2-tree": { "version": "2.0.0-rc.11", "resolved": "https://registry.npmjs.org/ng2-tree/-/ng2-tree-2.0.0-rc.11.tgz", @@ -11347,6 +11343,14 @@ "resolved": "https://registry.npmjs.org/ngx-bootstrap/-/ngx-bootstrap-3.2.0.tgz", "integrity": "sha512-oLSLIWZgRiIfcuxyXLMZUOhX3wZtg6lpuMbdo/0UzMDg2bSOe1XPskcKZ/iuOa3FOlU9rjuYMzswHYYV5f/QCA==" }, + "ngx-toastr": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/ngx-toastr/-/ngx-toastr-10.0.2.tgz", + "integrity": "sha512-sHlVAzRnuGYPR24l/C8+ftgWQuAJQ7XFNY55xCrPzSK8+jPg4ZViY6xSEQ5Aw0OXmjsa5aeBqWwAg5CVb1t7cg==", + "requires": { + "tslib": "^1.9.0" + } + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", diff --git a/src/pybind/mgr/dashboard/frontend/package.json b/src/pybind/mgr/dashboard/frontend/package.json index 89adcc19e5565..938767f1188c0 100644 --- a/src/pybind/mgr/dashboard/frontend/package.json +++ b/src/pybind/mgr/dashboard/frontend/package.json @@ -77,9 +77,9 @@ "moment": "2.24.0", "ng-block-ui": "2.1.1", "ng2-charts": "1.6.0", - "ng2-toastr": "zzakir/ng2-toastr#0eafd72", "ng2-tree": "2.0.0-rc.11", "ngx-bootstrap": "3.2.0", + "ngx-toastr": "10.0.2", "rxjs": "6.4.0", "rxjs-compat": "6.4.0", "tslib": "1.9.3", diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/app.component.spec.ts index a157a44eb3fb4..16fb5adb2e457 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app.component.spec.ts @@ -2,8 +2,6 @@ import { NO_ERRORS_SCHEMA } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; - import { configureTestBed } from '../testing/unit-test-helper'; import { AppComponent } from './app.component'; import { AuthStorageService } from './shared/services/auth-storage.service'; @@ -13,7 +11,7 @@ describe('AppComponent', () => { let fixture: ComponentFixture; configureTestBed({ - imports: [RouterTestingModule, ToastModule.forRoot()], + imports: [RouterTestingModule], declarations: [AppComponent], schemas: [NO_ERRORS_SCHEMA], providers: [AuthStorageService] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts index 938449dde251b..363a213d214c2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app.component.ts @@ -1,7 +1,6 @@ -import { Component, ViewContainerRef } from '@angular/core'; +import { Component } from '@angular/core'; import { Router } from '@angular/router'; -import { ToastsManager } from 'ng2-toastr'; import { TooltipConfig } from 'ngx-bootstrap/tooltip'; import { AuthStorageService } from './shared/services/auth-storage.service'; @@ -23,14 +22,7 @@ import { AuthStorageService } from './shared/services/auth-storage.service'; export class AppComponent { title = 'cd'; - constructor( - private authStorageService: AuthStorageService, - private router: Router, - public toastr: ToastsManager, - private vcr: ViewContainerRef - ) { - this.toastr.setRootViewContainerRef(this.vcr); - } + constructor(private authStorageService: AuthStorageService, private router: Router) {} isLoginActive() { return this.router.url === '/login' || !this.authStorageService.isLoggedIn(); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts index 920069ab0bf3a..3da5eada655f1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/app.module.ts @@ -7,10 +7,10 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; import { JwtModule } from '@auth0/angular-jwt'; import { I18n } from '@ngx-translate/i18n-polyfill'; import { BlockUIModule } from 'ng-block-ui'; -import { ToastModule, ToastOptions } from 'ng2-toastr/ng2-toastr'; import { AccordionModule } from 'ngx-bootstrap/accordion'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { AppRoutingModule } from './app-routing.module'; import { AppComponent } from './app.component'; @@ -21,13 +21,6 @@ import { ApiInterceptorService } from './shared/services/api-interceptor.service import { JsErrorHandler } from './shared/services/js-error-handler.service'; import { SharedModule } from './shared/shared.module'; -export class CustomOption extends ToastOptions { - animate = 'flyRight'; - newestOnTop = true; - showCloseButton = true; - enableHTML = true; -} - export function jwtTokenGetter() { return localStorage.getItem('access_token'); } @@ -41,7 +34,11 @@ registerLocaleData(LocaleHelper.getLocaleData(), LocaleHelper.getLocale()); BlockUIModule.forRoot(), BrowserModule, BrowserAnimationsModule, - ToastModule.forRoot(), + ToastrModule.forRoot({ + positionClass: 'toast-top-right', + preventDuplicates: true, + enableHtml: true + }), AppRoutingModule, CoreModule, SharedModule, @@ -66,10 +63,6 @@ registerLocaleData(LocaleHelper.getLocaleData(), LocaleHelper.getLocale()); useClass: ApiInterceptorService, multi: true }, - { - provide: ToastOptions, - useClass: CustomOption - }, i18nProviders, I18n ], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.spec.ts index 69b59047cf78c..f6236e707f070 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-discovery-modal/iscsi-target-discovery-modal.component.spec.ts @@ -8,8 +8,8 @@ import { ReactiveFormsModule } from '@angular/forms'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { Permission } from '../../../shared/models/permissions'; @@ -31,7 +31,7 @@ describe('IscsiTargetDiscoveryModalComponent', () => { HttpClientTestingModule, ReactiveFormsModule, SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), RouterTestingModule ], providers: [i18nProviders, BsModalRef] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts index 3b3ffd9243f20..c4eb15dd40b83 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-form/iscsi-target-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { ActivatedRouteStub } from '../../../../testing/activated-route-stub'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -130,7 +130,7 @@ describe('IscsiTargetFormComponent', () => { ReactiveFormsModule, HttpClientTestingModule, RouterTestingModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: [ i18nProviders, diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.spec.ts index 7a48d2ab6bf22..2f93c86a63ea2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/iscsi-target-list/iscsi-target-list.component.spec.ts @@ -3,9 +3,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TreeModule } from 'ng2-tree'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { BehaviorSubject, of } from 'rxjs'; import { @@ -40,7 +40,7 @@ describe('IscsiTargetListComponent', () => { SharedModule, TabsModule.forRoot(), TreeModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], declarations: [IscsiTargetListComponent, IscsiTabsComponent, IscsiTargetDetailsComponent], providers: [TaskListService, i18nProviders] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.spec.ts index 417733f11ca63..a7a0aa4a72b94 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/overview/overview.component.spec.ts @@ -2,10 +2,10 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { ProgressbarModule } from 'ngx-bootstrap/progressbar'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; import { SharedModule } from '../../../../shared/shared.module'; @@ -34,7 +34,7 @@ describe('OverviewComponent', () => { ProgressbarModule.forRoot(), HttpClientTestingModule, RouterTestingModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: i18nProviders }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.spec.ts index efa9281cf2866..5d3af10a417a2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-mode-modal/pool-edit-mode-modal.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { @@ -31,7 +31,7 @@ describe('PoolEditModeModalComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: [BsModalRef, BsModalService, i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.spec.ts index 99f199a924ec4..6353ce89765b4 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-edit-peer-modal/pool-edit-peer-modal.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { @@ -32,7 +32,7 @@ describe('PoolEditPeerModalComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: [BsModalRef, BsModalService, i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.spec.ts index 819aa0e7beae1..129dd7c2a1b83 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/mirroring/pool-list/pool-list.component.spec.ts @@ -2,10 +2,10 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { ProgressbarModule } from 'ngx-bootstrap/progressbar'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; import { SharedModule } from '../../../../shared/shared.module'; @@ -25,7 +25,7 @@ describe('PoolListComponent', () => { ProgressbarModule.forRoot(), HttpClientTestingModule, RouterTestingModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: i18nProviders }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts index 9d15d10cfe69f..46b5ac21b61db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.spec.ts @@ -5,7 +5,7 @@ import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; import { TooltipModule } from 'ngx-bootstrap/tooltip'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { By } from '@angular/platform-browser'; import { ActivatedRouteStub } from '../../../../testing/activated-route-stub'; @@ -26,7 +26,7 @@ describe('RbdFormComponent', () => { HttpClientTestingModule, ReactiveFormsModule, RouterTestingModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), SharedModule, TooltipModule ], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-images/rbd-images.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-images/rbd-images.component.spec.ts index 8faade1e5ded5..e1fda888a4697 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-images/rbd-images.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-images/rbd-images.component.spec.ts @@ -2,9 +2,9 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; import { TooltipModule } from 'ngx-bootstrap/tooltip'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { TaskListService } from '../../../shared/services/task-list.service'; @@ -34,7 +34,7 @@ describe('RbdImagesComponent', () => { RouterTestingModule, SharedModule, TabsModule.forRoot(), - ToastModule.forRoot(), + ToastrModule.forRoot(), TooltipModule.forRoot() ], providers: [TaskListService, i18nProviders] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts index 346a6bd650678..1a418fe83ec4c 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-list/rbd-list.component.spec.ts @@ -3,12 +3,12 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { AlertModule } from 'ngx-bootstrap/alert'; import { BsDropdownModule } from 'ngx-bootstrap/dropdown'; import { ModalModule } from 'ngx-bootstrap/modal'; import { TabsModule } from 'ngx-bootstrap/tabs'; import { TooltipModule } from 'ngx-bootstrap/tooltip'; +import { ToastrModule } from 'ngx-toastr'; import { BehaviorSubject, of } from 'rxjs'; import { @@ -47,7 +47,7 @@ describe('RbdListComponent', () => { TabsModule.forRoot(), ModalModule.forRoot(), TooltipModule.forRoot(), - ToastModule.forRoot(), + ToastrModule.forRoot(), AlertModule.forRoot(), RouterTestingModule, HttpClientTestingModule diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form.component.spec.ts index fe292c50a7665..1002b82f4d8db 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-form/rbd-snapshot-form.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { ApiModule } from '../../../shared/api/api.module'; @@ -22,7 +22,7 @@ describe('RbdSnapshotFormComponent', () => { ComponentsModule, HttpClientTestingModule, ApiModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), RouterTestingModule ], declarations: [RbdSnapshotFormComponent], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts index e925a86f42e77..414ba70acffe5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-snapshot-list/rbd-snapshot-list.component.spec.ts @@ -4,8 +4,8 @@ import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; import { I18n } from '@ngx-translate/i18n-polyfill'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { Subject, throwError as observableThrowError } from 'rxjs'; import { @@ -47,7 +47,7 @@ describe('RbdSnapshotListComponent', () => { imports: [ DataTableModule, ComponentsModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), ApiModule, HttpClientTestingModule, RouterTestingModule, 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 5f8126aa428f8..403341c8a4214 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 @@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { By } from '@angular/platform-browser'; @@ -23,7 +23,7 @@ describe('RbdTrashListComponent', () => { configureTestBed({ declarations: [RbdTrashListComponent], - imports: [SharedModule, HttpClientTestingModule, RouterTestingModule, ToastModule.forRoot()], + imports: [SharedModule, HttpClientTestingModule, RouterTestingModule, ToastrModule.forRoot()], providers: [TaskListService, i18nProviders] }); 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 737d6b5b66225..1c77198e8d969 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,9 +4,9 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import * as moment from 'moment'; -import { ToastModule } from 'ng2-toastr'; import { BsDatepickerModule } from 'ngx-bootstrap/datepicker'; import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { NotificationService } from '../../../shared/services/notification.service'; @@ -24,7 +24,7 @@ describe('RbdTrashMoveModalComponent', () => { HttpClientTestingModule, RouterTestingModule, SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), BsDatepickerModule.forRoot() ], declarations: [RbdTrashMoveModalComponent], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.spec.ts index 749236c0da063..32969f10d7c5e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-purge-modal/rbd-trash-purge-modal.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { Permission } from '../../../shared/models/permissions'; @@ -22,7 +22,7 @@ describe('RbdTrashPurgeModalComponent', () => { HttpClientTestingModule, ReactiveFormsModule, SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), RouterTestingModule ], declarations: [RbdTrashPurgeModalComponent], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.spec.ts index 3689b2a18cbb8..caa6cf945eb3e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-restore-modal/rbd-trash-restore-modal.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { NotificationService } from '../../../shared/services/notification.service'; @@ -20,7 +20,7 @@ describe('RbdTrashRestoreModalComponent', () => { imports: [ ReactiveFormsModule, HttpClientTestingModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), SharedModule, RouterTestingModule ], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.spec.ts index 1c73c559c07eb..070455fbb45bc 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/configuration/configuration-form/configuration-form.component.spec.ts @@ -4,7 +4,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; import { ConfigFormModel } from '../../../../shared/components/config-option/config-option.model'; @@ -20,7 +20,7 @@ describe('ConfigurationFormComponent', () => { HttpClientTestingModule, ReactiveFormsModule, RouterTestingModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), SharedModule ], declarations: [ConfigurationFormComponent], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.spec.ts index 1021482f84459..1832ccd8c3af5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-form/mgr-module-form.component.spec.ts @@ -3,7 +3,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; import { SharedModule } from '../../../../shared/shared.module'; @@ -20,7 +20,7 @@ describe('MgrModuleFormComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: i18nProviders }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-list/mgr-module-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-list/mgr-module-list.component.spec.ts index 93b1498896925..252bd67e2085a 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-list/mgr-module-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/mgr-modules/mgr-module-list/mgr-module-list.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { of as observableOf, throwError as observableThrowError } from 'rxjs'; import { @@ -33,7 +33,7 @@ describe('MgrModuleListComponent', () => { SharedModule, HttpClientTestingModule, TabsModule.forRoot(), - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: [MgrModuleService, NotificationService, i18nProviders] }); 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 00583a014e877..ae4bafec4c2c9 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,8 +4,8 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import * as _ from 'lodash'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef, ModalModule } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; import { NotificationType } from '../../../../shared/enum/notification-type.enum'; @@ -32,7 +32,7 @@ describe('OsdFlagsModalComponent', () => { SharedModule, HttpClientTestingModule, RouterTestingModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], declarations: [OsdFlagsModalComponent], providers: [BsModalRef, i18nProviders] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.spec.ts index beda0bd026713..3fb4ee792e27e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/osd/osd-pg-scrub-modal/osd-pg-scrub-modal.component.spec.ts @@ -4,8 +4,8 @@ import { ReactiveFormsModule } from '@angular/forms'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef, ModalModule } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { of as observableOf } from 'rxjs'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; @@ -27,7 +27,7 @@ describe('OsdPgScrubModalComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], declarations: [OsdPgScrubModalComponent], providers: [BsModalRef, i18nProviders] 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 b373629132751..57855adbddcbd 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,8 +4,8 @@ import { ReactiveFormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; import * as _ from 'lodash'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef, ModalModule } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { of as observableOf } from 'rxjs'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; @@ -25,7 +25,7 @@ describe('OsdRecvSpeedModalComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], declarations: [OsdRecvSpeedModalComponent], providers: [BsModalRef, i18nProviders] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list/prometheus-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list/prometheus-list.component.spec.ts index 7901a05cb33f9..acf76ed801b5f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list/prometheus-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/prometheus/prometheus-list/prometheus-list.component.spec.ts @@ -1,8 +1,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../../testing/unit-test-helper'; import { SharedModule } from '../../../../shared/shared.module'; @@ -13,7 +13,7 @@ describe('PrometheusListComponent', () => { let fixture: ComponentFixture; configureTestBed({ - imports: [HttpClientTestingModule, TabsModule.forRoot(), ToastModule.forRoot(), SharedModule], + imports: [HttpClientTestingModule, TabsModule.forRoot(), ToastrModule.forRoot(), SharedModule], declarations: [PrometheusListComponent], providers: [i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts index ec3a11e906d3a..cd9f3299caee9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-form/nfs-form.component.spec.ts @@ -4,8 +4,8 @@ import { ReactiveFormsModule } from '@angular/forms'; import { ActivatedRoute } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TypeaheadModule } from 'ngx-bootstrap/typeahead'; +import { ToastrModule } from 'ngx-toastr'; import { ActivatedRouteStub } from '../../../../testing/activated-route-stub'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -28,7 +28,7 @@ describe('NfsFormComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), TypeaheadModule.forRoot() ], providers: [ diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.spec.ts index 056e6b45b053c..bb1b882ba53b9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/nfs/nfs-list/nfs-list.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { BehaviorSubject, of } from 'rxjs'; import { @@ -39,7 +39,7 @@ describe('NfsListComponent', () => { HttpClientTestingModule, RouterTestingModule, SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), TabsModule.forRoot() ], providers: [TaskListService, i18nProviders] diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form.component.spec.ts index 66c69ee65ddd1..9db51d4d5849b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/pool/erasure-code-profile-form/erasure-code-profile-form.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { @@ -28,7 +28,7 @@ describe('ErasureCodeProfileFormComponent', () => { let data: {}; configureTestBed({ - imports: [HttpClientTestingModule, RouterTestingModule, ToastModule.forRoot(), PoolModule], + imports: [HttpClientTestingModule, RouterTestingModule, ToastrModule.forRoot(), PoolModule], providers: [ErasureCodeProfileService, BsModalRef, i18nProviders] }); 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 7f78a0ef4f054..297c75622a57d 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 @@ -5,9 +5,9 @@ import { By } from '@angular/platform-browser'; import { ActivatedRoute, Router, Routes } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalService } from 'ngx-bootstrap/modal'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { @@ -136,7 +136,7 @@ describe('PoolFormComponent', () => { imports: [ HttpClientTestingModule, RouterTestingModule.withRoutes(routes), - ToastModule.forRoot(), + ToastrModule.forRoot(), TabsModule.forRoot(), PoolModule ], 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 21e553ba14721..80ee99ce0e70f 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 @@ -2,9 +2,9 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalService } from 'ngx-bootstrap/modal'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -43,7 +43,7 @@ describe('PoolListComponent', () => { declarations: [PoolListComponent, PoolDetailsComponent, RbdConfigurationListComponent], imports: [ SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), RouterTestingModule, TabsModule.forRoot(), HttpClientTestingModule 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 22d9710604d4c..dfebff4b6ea81 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 { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { of as observableOf } from 'rxjs'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -26,7 +26,7 @@ describe('RgwBucketFormComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: [i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts index a4d5038dff6ab..38f74ced342a5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.spec.ts @@ -4,8 +4,8 @@ import { FormControl, ReactiveFormsModule } from '@angular/forms'; import { Router } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalService } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { of as observableOf } from 'rxjs'; import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -29,7 +29,7 @@ describe('RgwUserFormComponent', () => { ReactiveFormsModule, RouterTestingModule, SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], providers: [BsModalService, i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-swift-key-modal/rgw-user-swift-key-modal.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-swift-key-modal/rgw-user-swift-key-modal.component.spec.ts index 8850fc71f93cf..38d9bde31a3ef 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-swift-key-modal/rgw-user-swift-key-modal.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-swift-key-modal/rgw-user-swift-key-modal.component.spec.ts @@ -2,8 +2,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { FormsModule } from '@angular/forms'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalRef } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { SharedModule } from '../../../shared/shared.module'; @@ -15,7 +15,7 @@ describe('RgwUserSwiftKeyModalComponent', () => { configureTestBed({ declarations: [RgwUserSwiftKeyModalComponent], - imports: [ToastModule.forRoot(), FormsModule, SharedModule, RouterTestingModule], + imports: [ToastrModule.forRoot(), FormsModule, SharedModule, RouterTestingModule], providers: [BsModalRef, i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.spec.ts index 71ec6fbf7e13c..e14cbb63e66a5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-details/role-details.component.spec.ts @@ -2,7 +2,6 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -15,13 +14,7 @@ describe('RoleDetailsComponent', () => { let fixture: ComponentFixture; configureTestBed({ - imports: [ - SharedModule, - ToastModule.forRoot(), - TabsModule.forRoot(), - RouterTestingModule, - HttpClientTestingModule - ], + imports: [SharedModule, TabsModule.forRoot(), RouterTestingModule, HttpClientTestingModule], declarations: [RoleDetailsComponent], providers: i18nProviders }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.spec.ts index 639fa91501867..b5d36b5861e21 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-form/role-form.component.spec.ts @@ -5,7 +5,7 @@ import { ReactiveFormsModule } from '@angular/forms'; import { Router, Routes } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -37,7 +37,7 @@ describe('RoleFormComponent', () => { RouterTestingModule.withRoutes(routes), HttpClientTestingModule, ReactiveFormsModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), SharedModule ], declarations: [RoleFormComponent, FakeComponent], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.spec.ts index 30048cf9bf7a6..7274125f04dc1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/role-list/role-list.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, @@ -26,7 +26,7 @@ describe('RoleListComponent', () => { declarations: [RoleListComponent, RoleDetailsComponent, UserTabsComponent], imports: [ SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), TabsModule.forRoot(), RouterTestingModule, HttpClientTestingModule diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts index 9d0cfb72b89af..b91a71fd3a6d5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-form/user-form.component.spec.ts @@ -5,8 +5,8 @@ import { ReactiveFormsModule } from '@angular/forms'; import { Router, Routes } from '@angular/router'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { BsModalService } from 'ngx-bootstrap/modal'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { configureTestBed, FormHelper, i18nProviders } from '../../../../testing/unit-test-helper'; @@ -47,7 +47,7 @@ describe('UserFormComponent', () => { HttpClientTestingModule, ReactiveFormsModule, ComponentsModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), SharedModule ], declarations: [UserFormComponent, FakeComponent], diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.spec.ts index f1604a13d46c3..1a34a2f6b7d66 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-list/user-list.component.spec.ts @@ -3,8 +3,8 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { By } from '@angular/platform-browser'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, @@ -24,7 +24,7 @@ describe('UserListComponent', () => { configureTestBed({ imports: [ SharedModule, - ToastModule.forRoot(), + ToastrModule.forRoot(), TabsModule.forRoot(), RouterTestingModule, HttpClientTestingModule diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-tabs/user-tabs.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-tabs/user-tabs.component.spec.ts index 4071d25fbaef2..d73395141d031 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-tabs/user-tabs.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/auth/user-tabs/user-tabs.component.spec.ts @@ -2,7 +2,6 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; import { TabsModule } from 'ngx-bootstrap/tabs'; import { configureTestBed } from '../../../../testing/unit-test-helper'; @@ -14,13 +13,7 @@ describe('UserTabsComponent', () => { let fixture: ComponentFixture; configureTestBed({ - imports: [ - SharedModule, - ToastModule.forRoot(), - TabsModule.forRoot(), - RouterTestingModule, - HttpClientTestingModule - ], + imports: [SharedModule, TabsModule.forRoot(), RouterTestingModule, HttpClientTestingModule], declarations: [UserTabsComponent] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.spec.ts index a11be2b8c68df..6ce6241ff6036 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/notifications/notifications.component.spec.ts @@ -1,8 +1,8 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing'; -import { ToastModule } from 'ng2-toastr'; import { PopoverModule } from 'ngx-bootstrap/popover'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; import { PrometheusService } from '../../../shared/api/prometheus.service'; @@ -21,7 +21,7 @@ describe('NotificationsComponent', () => { HttpClientTestingModule, PopoverModule.forRoot(), SharedModule, - ToastModule.forRoot() + ToastrModule.forRoot() ], declarations: [NotificationsComponent], providers: i18nProviders diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts index 23aa4c12c8a86..55efbaabdbef5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/directives/copy2clipboard-button.directive.ts @@ -1,6 +1,6 @@ import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@angular/core'; -import { ToastsManager } from 'ng2-toastr'; +import { ToastrService } from 'ngx-toastr'; @Directive({ selector: '[cdCopy2ClipboardButton]' @@ -12,7 +12,7 @@ export class Copy2ClipboardButtonDirective implements OnInit { constructor( private elementRef: ElementRef, private renderer: Renderer2, - private toastr: ToastsManager + private toastr: ToastrService ) {} ngOnInit() { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-notification.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-notification.ts index cc0bebfcf6f87..1acbba1a5e4ea 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-notification.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/models/cd-notification.ts @@ -1,4 +1,4 @@ -import { ToastOptions } from 'ng2-toastr'; +import { IndividualConfig } from 'ngx-toastr'; import { NotificationType } from '../enum/notification-type.enum'; export class CdNotificationConfig { @@ -13,7 +13,7 @@ export class CdNotificationConfig { public type: NotificationType = NotificationType.info, public title?: string, public message?: string, // Use this for additional information only - public options?: any | ToastOptions, + public options?: any | IndividualConfig, public application: string = 'Ceph' ) { this.applicationClass = this.classes[this.application]; diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts index a8fcb4e81a8fd..744f2137b5a5f 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/api-interceptor.service.spec.ts @@ -3,7 +3,7 @@ import { HttpClientTestingModule, HttpTestingController } from '@angular/common/ import { fakeAsync, TestBed, tick } from '@angular/core/testing'; import { Router } from '@angular/router'; -import { ToastsManager } from 'ng2-toastr'; +import { ToastrService } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper'; import { AppModule } from '../../app.module'; @@ -53,7 +53,7 @@ describe('ApiInterceptorService', () => { NotificationService, i18nProviders, { - provide: ToastsManager, + provide: ToastrService, useValue: { error: () => true } 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 e6fd703491d66..09578f4213824 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 @@ -2,7 +2,7 @@ import { DatePipe } from '@angular/common'; import { fakeAsync, TestBed, tick } from '@angular/core/testing'; import * as _ from 'lodash'; -import { ToastsManager } from 'ng2-toastr'; +import { ToastrService } from 'ngx-toastr'; import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper'; import { NotificationType } from '../enum/notification-type.enum'; @@ -26,7 +26,7 @@ describe('NotificationService', () => { DatePipe, NotificationService, TaskMessageService, - { provide: ToastsManager, useValue: toastFakeService }, + { provide: ToastrService, useValue: toastFakeService }, { provide: CdDatePipe, useValue: { transform: (d) => d } }, i18nProviders ] @@ -201,7 +201,7 @@ describe('NotificationService', () => { }); describe('showToasty', () => { - let toastr: ToastsManager; + let toastr: ToastrService; const time = '2022-02-22T00:00:00.000Z'; beforeEach(() => { @@ -209,7 +209,7 @@ describe('NotificationService', () => { spyOn(global, 'Date').and.returnValue(baseTime); spyOn(window, 'setTimeout').and.callFake((fn) => fn()); - toastr = TestBed.get(ToastsManager); + toastr = TestBed.get(ToastrService); // spyOn needs to know the methods before spying and can't read the array for clarification ['error', 'info', 'success'].forEach((method: 'error' | 'info' | 'success') => spyOn(toastr, method).and.stub() 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 7dcb01392b067..217acf2648d09 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,7 +1,7 @@ import { Injectable } from '@angular/core'; import * as _ from 'lodash'; -import { ToastOptions, ToastsManager } from 'ng2-toastr'; +import { IndividualConfig, ToastrService } from 'ngx-toastr'; import { BehaviorSubject } from 'rxjs'; import { NotificationType } from '../enum/notification-type.enum'; @@ -27,7 +27,7 @@ export class NotificationService { KEY = 'cdNotifications'; constructor( - public toastr: ToastsManager, + public toastr: ToastrService, private taskMessageService: TaskMessageService, private cdDatePipe: CdDatePipe ) { @@ -81,7 +81,7 @@ export class NotificationService { type: NotificationType, title: string, message?: string, - options?: any | ToastOptions, + options?: any | IndividualConfig, application?: string ): number; show(config: CdNotificationConfig | (() => CdNotificationConfig)): number; @@ -89,7 +89,7 @@ export class NotificationService { arg: NotificationType | CdNotificationConfig | (() => CdNotificationConfig), title?: string, message?: string, - options?: any | ToastOptions, + options?: any | IndividualConfig, application?: string ): number { return window.setTimeout(() => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.spec.ts index 2b865a400caf2..0b0190553aaf5 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert-formatter.spec.ts @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { configureTestBed, @@ -20,7 +20,7 @@ describe('PrometheusAlertFormatter', () => { let prometheus: PrometheusHelper; configureTestBed({ - imports: [ToastModule.forRoot(), SharedModule], + imports: [ToastrModule.forRoot(), SharedModule], providers: [PrometheusAlertFormatter, i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.spec.ts index 294ac37f884be..4412b46e0d829 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-alert.service.spec.ts @@ -1,7 +1,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; import { @@ -26,7 +26,7 @@ describe('PrometheusAlertService', () => { let prometheus: PrometheusHelper; configureTestBed({ - imports: [ToastModule.forRoot(), SharedModule, HttpClientTestingModule], + imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule], providers: [PrometheusAlertService, PrometheusAlertFormatter, i18nProviders] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.spec.ts index c5ced809559df..f34a616d7d790 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/prometheus-notification.service.spec.ts @@ -1,7 +1,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { fakeAsync, TestBed, tick } from '@angular/core/testing'; -import { ToastModule, ToastsManager } from 'ng2-toastr'; +import { ToastrModule, ToastrService } from 'ngx-toastr'; import { of } from 'rxjs'; import { @@ -33,12 +33,12 @@ describe('PrometheusNotificationService', () => { }; configureTestBed({ - imports: [ToastModule.forRoot(), SharedModule, HttpClientTestingModule], + imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule], providers: [ PrometheusNotificationService, PrometheusAlertFormatter, i18nProviders, - { provide: ToastsManager, useValue: toastFakeService } + { provide: ToastrService, useValue: toastFakeService } ] }); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-wrapper.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-wrapper.service.spec.ts index 1dda8afc226c6..747964e1c7eb2 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-wrapper.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/task-wrapper.service.spec.ts @@ -2,7 +2,7 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { inject, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; -import { ToastModule } from 'ng2-toastr'; +import { ToastrModule } from 'ngx-toastr'; import { Observable } from 'rxjs'; import { configureTestBed, i18nProviders } from '../../../testing/unit-test-helper'; @@ -17,7 +17,7 @@ describe('TaskWrapperService', () => { let service: TaskWrapperService; configureTestBed({ - imports: [HttpClientTestingModule, ToastModule.forRoot(), SharedModule, RouterTestingModule], + imports: [HttpClientTestingModule, ToastrModule.forRoot(), SharedModule, RouterTestingModule], providers: [TaskWrapperService, i18nProviders] }); -- 2.39.5