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';
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
~~~~~~~~~~~~~~~~~
* ``@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``.
``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.
'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.
"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",
"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",
"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",
"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",
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';
let fixture: ComponentFixture<AppComponent>;
configureTestBed({
- imports: [RouterTestingModule, ToastModule.forRoot()],
+ imports: [RouterTestingModule],
declarations: [AppComponent],
schemas: [NO_ERRORS_SCHEMA],
providers: [AuthStorageService]
-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';
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();
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';
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');
}
BlockUIModule.forRoot(),
BrowserModule,
BrowserAnimationsModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot({
+ positionClass: 'toast-top-right',
+ preventDuplicates: true,
+ enableHtml: true
+ }),
AppRoutingModule,
CoreModule,
SharedModule,
useClass: ApiInterceptorService,
multi: true
},
- {
- provide: ToastOptions,
- useClass: CustomOption
- },
i18nProviders,
I18n
],
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';
HttpClientTestingModule,
ReactiveFormsModule,
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
RouterTestingModule
],
providers: [i18nProviders, BsModalRef]
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';
ReactiveFormsModule,
HttpClientTestingModule,
RouterTestingModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: [
i18nProviders,
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 {
SharedModule,
TabsModule.forRoot(),
TreeModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
declarations: [IscsiTargetListComponent, IscsiTabsComponent, IscsiTargetDetailsComponent],
providers: [TaskListService, i18nProviders]
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';
ProgressbarModule.forRoot(),
HttpClientTestingModule,
RouterTestingModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: i18nProviders
});
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 {
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: [BsModalRef, BsModalService, i18nProviders]
});
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 {
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: [BsModalRef, BsModalService, i18nProviders]
});
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';
ProgressbarModule.forRoot(),
HttpClientTestingModule,
RouterTestingModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: i18nProviders
});
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';
HttpClientTestingModule,
ReactiveFormsModule,
RouterTestingModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
SharedModule,
TooltipModule
],
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';
RouterTestingModule,
SharedModule,
TabsModule.forRoot(),
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
TooltipModule.forRoot()
],
providers: [TaskListService, i18nProviders]
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 {
TabsModule.forRoot(),
ModalModule.forRoot(),
TooltipModule.forRoot(),
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
AlertModule.forRoot(),
RouterTestingModule,
HttpClientTestingModule
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';
ComponentsModule,
HttpClientTestingModule,
ApiModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
RouterTestingModule
],
declarations: [RbdSnapshotFormComponent],
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 {
imports: [
DataTableModule,
ComponentsModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
ApiModule,
HttpClientTestingModule,
RouterTestingModule,
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';
configureTestBed({
declarations: [RbdTrashListComponent],
- imports: [SharedModule, HttpClientTestingModule, RouterTestingModule, ToastModule.forRoot()],
+ imports: [SharedModule, HttpClientTestingModule, RouterTestingModule, ToastrModule.forRoot()],
providers: [TaskListService, i18nProviders]
});
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';
HttpClientTestingModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
BsDatepickerModule.forRoot()
],
declarations: [RbdTrashMoveModalComponent],
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';
HttpClientTestingModule,
ReactiveFormsModule,
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
RouterTestingModule
],
declarations: [RbdTrashPurgeModalComponent],
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';
imports: [
ReactiveFormsModule,
HttpClientTestingModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
SharedModule,
RouterTestingModule
],
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';
HttpClientTestingModule,
ReactiveFormsModule,
RouterTestingModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
SharedModule
],
declarations: [ConfigurationFormComponent],
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';
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: i18nProviders
});
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 {
SharedModule,
HttpClientTestingModule,
TabsModule.forRoot(),
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: [MgrModuleService, NotificationService, i18nProviders]
});
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';
SharedModule,
HttpClientTestingModule,
RouterTestingModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
declarations: [OsdFlagsModalComponent],
providers: [BsModalRef, i18nProviders]
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';
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
declarations: [OsdPgScrubModalComponent],
providers: [BsModalRef, i18nProviders]
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';
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
declarations: [OsdRecvSpeedModalComponent],
providers: [BsModalRef, i18nProviders]
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';
let fixture: ComponentFixture<PrometheusListComponent>;
configureTestBed({
- imports: [HttpClientTestingModule, TabsModule.forRoot(), ToastModule.forRoot(), SharedModule],
+ imports: [HttpClientTestingModule, TabsModule.forRoot(), ToastrModule.forRoot(), SharedModule],
declarations: [PrometheusListComponent],
providers: [i18nProviders]
});
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';
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
TypeaheadModule.forRoot()
],
providers: [
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 {
HttpClientTestingModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
TabsModule.forRoot()
],
providers: [TaskListService, i18nProviders]
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 {
let data: {};
configureTestBed({
- imports: [HttpClientTestingModule, RouterTestingModule, ToastModule.forRoot(), PoolModule],
+ imports: [HttpClientTestingModule, RouterTestingModule, ToastrModule.forRoot(), PoolModule],
providers: [ErasureCodeProfileService, BsModalRef, i18nProviders]
});
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 {
imports: [
HttpClientTestingModule,
RouterTestingModule.withRoutes(routes),
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
TabsModule.forRoot(),
PoolModule
],
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';
declarations: [PoolListComponent, PoolDetailsComponent, RbdConfigurationListComponent],
imports: [
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
RouterTestingModule,
TabsModule.forRoot(),
HttpClientTestingModule
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';
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: [i18nProviders]
});
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';
ReactiveFormsModule,
RouterTestingModule,
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
providers: [BsModalService, i18nProviders]
});
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';
configureTestBed({
declarations: [RgwUserSwiftKeyModalComponent],
- imports: [ToastModule.forRoot(), FormsModule, SharedModule, RouterTestingModule],
+ imports: [ToastrModule.forRoot(), FormsModule, SharedModule, RouterTestingModule],
providers: [BsModalRef, i18nProviders]
});
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';
let fixture: ComponentFixture<RoleDetailsComponent>;
configureTestBed({
- imports: [
- SharedModule,
- ToastModule.forRoot(),
- TabsModule.forRoot(),
- RouterTestingModule,
- HttpClientTestingModule
- ],
+ imports: [SharedModule, TabsModule.forRoot(), RouterTestingModule, HttpClientTestingModule],
declarations: [RoleDetailsComponent],
providers: i18nProviders
});
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';
RouterTestingModule.withRoutes(routes),
HttpClientTestingModule,
ReactiveFormsModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
SharedModule
],
declarations: [RoleFormComponent, FakeComponent],
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,
declarations: [RoleListComponent, RoleDetailsComponent, UserTabsComponent],
imports: [
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
TabsModule.forRoot(),
RouterTestingModule,
HttpClientTestingModule
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';
HttpClientTestingModule,
ReactiveFormsModule,
ComponentsModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
SharedModule
],
declarations: [UserFormComponent, FakeComponent],
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,
configureTestBed({
imports: [
SharedModule,
- ToastModule.forRoot(),
+ ToastrModule.forRoot(),
TabsModule.forRoot(),
RouterTestingModule,
HttpClientTestingModule
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';
let fixture: ComponentFixture<UserTabsComponent>;
configureTestBed({
- imports: [
- SharedModule,
- ToastModule.forRoot(),
- TabsModule.forRoot(),
- RouterTestingModule,
- HttpClientTestingModule
- ],
+ imports: [SharedModule, TabsModule.forRoot(), RouterTestingModule, HttpClientTestingModule],
declarations: [UserTabsComponent]
});
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';
HttpClientTestingModule,
PopoverModule.forRoot(),
SharedModule,
- ToastModule.forRoot()
+ ToastrModule.forRoot()
],
declarations: [NotificationsComponent],
providers: i18nProviders
import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@angular/core';
-import { ToastsManager } from 'ng2-toastr';
+import { ToastrService } from 'ngx-toastr';
@Directive({
selector: '[cdCopy2ClipboardButton]'
constructor(
private elementRef: ElementRef,
private renderer: Renderer2,
- private toastr: ToastsManager
+ private toastr: ToastrService
) {}
ngOnInit() {
-import { ToastOptions } from 'ng2-toastr';
+import { IndividualConfig } from 'ngx-toastr';
import { NotificationType } from '../enum/notification-type.enum';
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];
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';
NotificationService,
i18nProviders,
{
- provide: ToastsManager,
+ provide: ToastrService,
useValue: {
error: () => true
}
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';
DatePipe,
NotificationService,
TaskMessageService,
- { provide: ToastsManager, useValue: toastFakeService },
+ { provide: ToastrService, useValue: toastFakeService },
{ provide: CdDatePipe, useValue: { transform: (d) => d } },
i18nProviders
]
});
describe('showToasty', () => {
- let toastr: ToastsManager;
+ let toastr: ToastrService;
const time = '2022-02-22T00:00:00.000Z';
beforeEach(() => {
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()
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';
KEY = 'cdNotifications';
constructor(
- public toastr: ToastsManager,
+ public toastr: ToastrService,
private taskMessageService: TaskMessageService,
private cdDatePipe: CdDatePipe
) {
type: NotificationType,
title: string,
message?: string,
- options?: any | ToastOptions,
+ options?: any | IndividualConfig,
application?: string
): number;
show(config: CdNotificationConfig | (() => CdNotificationConfig)): number;
arg: NotificationType | CdNotificationConfig | (() => CdNotificationConfig),
title?: string,
message?: string,
- options?: any | ToastOptions,
+ options?: any | IndividualConfig,
application?: string
): number {
return window.setTimeout(() => {
import { TestBed } from '@angular/core/testing';
-import { ToastModule } from 'ng2-toastr';
+import { ToastrModule } from 'ngx-toastr';
import {
configureTestBed,
let prometheus: PrometheusHelper;
configureTestBed({
- imports: [ToastModule.forRoot(), SharedModule],
+ imports: [ToastrModule.forRoot(), SharedModule],
providers: [PrometheusAlertFormatter, i18nProviders]
});
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 {
let prometheus: PrometheusHelper;
configureTestBed({
- imports: [ToastModule.forRoot(), SharedModule, HttpClientTestingModule],
+ imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule],
providers: [PrometheusAlertService, PrometheusAlertFormatter, i18nProviders]
});
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 {
};
configureTestBed({
- imports: [ToastModule.forRoot(), SharedModule, HttpClientTestingModule],
+ imports: [ToastrModule.forRoot(), SharedModule, HttpClientTestingModule],
providers: [
PrometheusNotificationService,
PrometheusAlertFormatter,
i18nProviders,
- { provide: ToastsManager, useValue: toastFakeService }
+ { provide: ToastrService, useValue: toastFakeService }
]
});
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';
let service: TaskWrapperService;
configureTestBed({
- imports: [HttpClientTestingModule, ToastModule.forRoot(), SharedModule, RouterTestingModule],
+ imports: [HttpClientTestingModule, ToastrModule.forRoot(), SharedModule, RouterTestingModule],
providers: [TaskWrapperService, i18nProviders]
});