Skip to content

Commit

Permalink
cleanup ngx-bootstrap forRoot() imports
Browse files Browse the repository at this point in the history
  • Loading branch information
jrassa committed Jul 14, 2023
1 parent e430fff commit 0e5fe99
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 47 deletions.
9 changes: 8 additions & 1 deletion src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { TestBed, waitForAsync } from '@angular/core/testing';

import { ModalModule } from 'ngx-bootstrap/modal';
import { PopoverModule } from 'ngx-bootstrap/popover';
import { of } from 'rxjs';

Expand All @@ -17,7 +18,13 @@ describe('AppComponent', () => {

TestBed.configureTestingModule({
declarations: [AppComponent],
imports: [AppRoutingModule, CoreModule, SiteModule, PopoverModule.forRoot()],
imports: [
AppRoutingModule,
CoreModule,
SiteModule,
PopoverModule,
ModalModule.forRoot()
],
providers: [{ provide: ConfigService, useValue: configServiceSpy }]
}).compileComponents();
}));
Expand Down
12 changes: 12 additions & 0 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { AlertModule } from 'ngx-bootstrap/alert';
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { ModalModule } from 'ngx-bootstrap/modal';
import { PopoverModule } from 'ngx-bootstrap/popover';
import { TabsModule } from 'ngx-bootstrap/tabs';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { TypeaheadModule } from 'ngx-bootstrap/typeahead';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
Expand All @@ -18,8 +24,14 @@ import { SiteModule } from './site/site.module';
BrowserAnimationsModule,
HttpClientModule,

AlertModule.forRoot(),
BsDatepickerModule.forRoot(),
BsDropdownModule.forRoot(),
ModalModule.forRoot(),
PopoverModule.forRoot(),
TabsModule.forRoot(),
TooltipModule.forRoot(),
TypeaheadModule.forRoot(),

AppRoutingModule,
CoreModule,
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/modal.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ContainerModalComponent } from './modal/container-modal/container-modal
import { ModalComponent } from './modal/modal/modal.component';

@NgModule({
imports: [BsModalModule.forRoot(), CommonModule, FormsModule, A11yModule],
imports: [BsModalModule, CommonModule, FormsModule, A11yModule],
exports: [ConfigurableModalComponent, ModalComponent],
declarations: [ConfigurableModalComponent, ContainerModalComponent, ModalComponent]
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/system-alert.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { SystemAlertIconComponent } from './system-alert/system-alert-icon.compo
import { SystemAlertComponent } from './system-alert/system-alert.component';

@NgModule({
imports: [CommonModule, FormsModule, AlertModule.forRoot()],
imports: [CommonModule, FormsModule, AlertModule],
exports: [SystemAlertComponent],
declarations: [SystemAlertComponent, SystemAlertIconComponent]
})
Expand Down
2 changes: 1 addition & 1 deletion src/app/common/table.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { AsyTableEmptyStateComponent } from './table/table-empty-state/asy-table
FormsModule,
SearchInputModule,
NgSelectModule,
BsDropdownModule.forRoot(),
BsDropdownModule,
BsDatepickerModule,
DragDropModule
],
Expand Down
4 changes: 2 additions & 2 deletions src/app/core/admin/cache-entries/cache-entries.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import { CacheEntryModalComponent } from './cache-entry-modal.component';

@NgModule({
imports: [
BsDropdownModule.forRoot(),
BsModalModule.forRoot(),
BsDropdownModule,
BsModalModule,
CommonModule,
DirectivesModule,
FormsModule,
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/admin/end-user-agreement/admin-eua.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { AdminListEuasComponent } from './list-euas/admin-list-euas.component';

@NgModule({
imports: [
BsDropdownModule.forRoot(),
BsDropdownModule,
CommonModule,
DirectivesModule,
FormsModule,
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/admin/feedback/admin-feedback.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { AdminListFeedbackComponent } from './list-feedback/admin-list-feedback.
imports: [
CommonModule,

TooltipModule.forRoot(),
TooltipModule,

PipesModule,
SearchInputModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ describe('Admin List Feedback Component Spec', () => {
SearchInputModule,
SystemAlertModule,
NgSelectModule,
TooltipModule.forRoot(),
TooltipModule,
CdkTableModule,
TableModule,
BrowserAnimationsModule
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/admin/messages/admin-messages.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ListMessagesComponent } from './list-messages/list-messages.component';

@NgModule({
imports: [
BsDropdownModule.forRoot(),
BsDropdownModule,
CommonModule,
FormsModule,
RouterModule,
Expand Down
8 changes: 3 additions & 5 deletions src/app/core/admin/user-management/admin-user.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';

import { AlertModule } from 'ngx-bootstrap/alert';
import { ButtonsModule } from 'ngx-bootstrap/buttons';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { TooltipModule } from 'ngx-bootstrap/tooltip';

Expand All @@ -21,10 +20,9 @@ import { UserRoleFilterDirective } from './list-users/user-role-filter.directive

@NgModule({
imports: [
AlertModule.forRoot(),
ButtonsModule.forRoot(),
BsDropdownModule.forRoot(),
TooltipModule.forRoot(),
AlertModule,
BsDropdownModule,
TooltipModule,

CommonModule,
DirectivesModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterTestingModule } from '@angular/router/testing';

import { BsModalService } from 'ngx-bootstrap/modal';
import { ModalModule } from 'ngx-bootstrap/modal';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { of } from 'rxjs';

Expand Down Expand Up @@ -75,16 +75,16 @@ describe('Admin List Users Component Spec', () => {
PipesModule,
SearchInputModule,
SystemAlertModule,
TooltipModule.forRoot(),
TooltipModule,
CdkTableModule,
TableModule,
BrowserAnimationsModule
BrowserAnimationsModule,
ModalModule.forRoot()
],
providers: [
{ provide: AdminUsersService, useValue: adminUsersServiceSpy },
{ provide: ConfigService, useValue: configServiceSpy },
{ provide: ExportConfigService, useValue: exportConfigServiceSpy },
BsModalService,
ModalService
]
});
Expand Down
8 changes: 4 additions & 4 deletions src/app/core/audit/audit.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ import { ListAuditEntriesComponent } from './list-audit-entries/list-audit-entri

@NgModule({
imports: [
BsDatepickerModule.forRoot(),
BsModalModule.forRoot(),
TypeaheadModule.forRoot(),
TooltipModule.forRoot(),
BsDatepickerModule,
BsModalModule,
TypeaheadModule,
TooltipModule,
NgSelectModule,

AuditRoutingModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

import { NgSelectModule } from '@ng-select/ng-select';
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
import { BsModalService, ModalModule } from 'ngx-bootstrap/modal';
import { ModalModule } from 'ngx-bootstrap/modal';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { TypeaheadModule } from 'ngx-bootstrap/typeahead';
import { of } from 'rxjs';
Expand Down Expand Up @@ -122,23 +122,23 @@ describe('Audit Component Spec', () => {
UserAuthenticationObjectComponent
],
imports: [
BsDatepickerModule.forRoot(),
BsDatepickerModule,
ModalModule.forRoot(),
TypeaheadModule.forRoot(),
TooltipModule.forRoot(),
TypeaheadModule,
TooltipModule,
NgSelectModule,
DirectivesModule,
FormsModule,
PipesModule,
SystemAlertModule,
CdkTableModule,
TableModule,
BrowserAnimationsModule
BrowserAnimationsModule,
ModalModule
],
providers: [
{ provide: AuditService, useValue: auditServiceSpy },
{ provide: ConfigService, useValue: configServiceSpy },
BsModalService,
SystemAlertService
]
}).overrideModule(BrowserDynamicTestingModule, {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/core.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function getConfiguration(configService: ConfigService) {
HttpClientModule,
RouterModule,

ModalModule.forRoot(),
ModalModule,
PopoverModule,
TooltipModule,

Expand Down
9 changes: 1 addition & 8 deletions src/app/core/feedback/feedback.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@ import { FeedbackFlyoutComponent } from './feedback-flyout/feedback-flyout.compo
import { FeedbackModalComponent } from './feedback-modal/feedback-modal.component';

@NgModule({
imports: [
TooltipModule.forRoot(),
NgSelectModule,
CommonModule,
FormsModule,
FlyoutModule,
ModalModule
],
imports: [TooltipModule, NgSelectModule, CommonModule, FormsModule, FlyoutModule, ModalModule],
exports: [FeedbackModalComponent, FeedbackFlyoutComponent],
declarations: [FeedbackModalComponent, FeedbackFlyoutComponent]
})
Expand Down
9 changes: 4 additions & 5 deletions src/app/core/site-navbar/site-navbar.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { By } from '@angular/platform-browser';
import { RouterTestingModule } from '@angular/router/testing';

import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
import { BsModalService, ModalModule } from 'ngx-bootstrap/modal';
import { ModalModule } from 'ngx-bootstrap/modal';
import { PopoverDirective, PopoverModule } from 'ngx-bootstrap/popover';
import { TooltipModule } from 'ngx-bootstrap/tooltip';
import { of } from 'rxjs';
Expand Down Expand Up @@ -91,15 +91,14 @@ describe('Site Navbar Component Spec', () => {
],
imports: [
HttpClientTestingModule,
BsDatepickerModule.forRoot(),
BsDatepickerModule,
ModalModule.forRoot(),
TooltipModule.forRoot(),
PopoverModule.forRoot(),
TooltipModule,
PopoverModule,
FormsModule,
RouterTestingModule
],
providers: [
BsModalService,
{ provide: AuthorizationService, useValue: authorizationServiceSpy },
{ provide: ConfigService, useValue: configServiceSpy },
{ provide: MessageService, useValue: messageServiceSpy },
Expand Down
6 changes: 3 additions & 3 deletions src/app/core/teams/teams.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ import { ViewTeamComponent } from './view-team/view-team.component';

@NgModule({
imports: [
BsDropdownModule.forRoot(),
TabsModule.forRoot(),
TooltipModule.forRoot(),
BsDropdownModule,
TabsModule,
TooltipModule,

NgSelectModule,

Expand Down
2 changes: 1 addition & 1 deletion src/app/core/teams/view-team/view-team.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';

import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy';
import { filter, first, map, switchMap, tap } from 'rxjs/operators';
import { filter, first, map, switchMap } from 'rxjs/operators';

import { ModalAction } from '../../../common/modal/modal.model';
import { ModalService } from '../../../common/modal/modal.service';
Expand Down

0 comments on commit 0e5fe99

Please sign in to comment.