diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 818785367..fdd03c021 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -8,3 +8,4 @@ what it is today. * Alex Engelhardt * João França * Pidockmedia + * Frédéric Fouret (BRUCELLA2) diff --git a/comixed-frontend/src/app/comic-import/components/comic-file-list-toolbar/comic-file-list-toolbar.component.ts b/comixed-frontend/src/app/comic-import/components/comic-file-list-toolbar/comic-file-list-toolbar.component.ts index 898f1063e..e3e21f475 100644 --- a/comixed-frontend/src/app/comic-import/components/comic-file-list-toolbar/comic-file-list-toolbar.component.ts +++ b/comixed-frontend/src/app/comic-import/components/comic-file-list-toolbar/comic-file-list-toolbar.component.ts @@ -86,10 +86,18 @@ export class ComicFileListToolbarComponent implements OnInit, OnDestroy { this.layoutSubscription = this.libraryDisplayAdaptor.layout$.subscribe( layout => (this.gridLayout = layout === 'grid') ); - this.sortFieldSubscription = this.libraryDisplayAdaptor.sortField$.subscribe(field => this.sortField = field); - this.rowsSubscription = this.libraryDisplayAdaptor.rows$.subscribe(rows => this.rows = rows); - this.sameHeightSubscription = this.libraryDisplayAdaptor.sameHeight$.subscribe(sameHeight => this.sameHeight = sameHeight); - this.coverSizeSubscription = this.libraryDisplayAdaptor.coverSize$.subscribe(coverSize => this.coverSize = coverSize); + this.sortFieldSubscription = this.libraryDisplayAdaptor.sortField$.subscribe( + field => (this.sortField = field) + ); + this.rowsSubscription = this.libraryDisplayAdaptor.rows$.subscribe( + rows => (this.rows = rows) + ); + this.sameHeightSubscription = this.libraryDisplayAdaptor.sameHeight$.subscribe( + sameHeight => (this.sameHeight = sameHeight) + ); + this.coverSizeSubscription = this.libraryDisplayAdaptor.coverSize$.subscribe( + coverSize => (this.coverSize = coverSize) + ); } ngOnDestroy() { diff --git a/comixed-frontend/src/app/comic-import/index.ts b/comixed-frontend/src/app/comic-import/index.ts index b2730bf53..17ed7d6a0 100644 --- a/comixed-frontend/src/app/comic-import/index.ts +++ b/comixed-frontend/src/app/comic-import/index.ts @@ -15,31 +15,31 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see */ -import {Params} from '@angular/router'; +import { Params } from '@angular/router'; import * as fromRouter from '@ngrx/router-store'; import * as fromImporting from './reducers/comic-import.reducer'; -import {ComicImportState} from './reducers/comic-import.reducer'; -import {ActionReducerMap, MetaReducer} from '@ngrx/store'; -import {environment} from '../../environments/environment'; +import { ComicImportState } from './reducers/comic-import.reducer'; +import { ActionReducerMap, MetaReducer } from '@ngrx/store'; +import { environment } from '../../environments/environment'; interface RouterStateUrl { - url: string; - params: Params; - queryParams: Params; + url: string; + params: Params; + queryParams: Params; } export interface AppState { - router: fromRouter.RouterReducerState; - comicImport: ComicImportState; + router: fromRouter.RouterReducerState; + comicImport: ComicImportState; } export type State = AppState; export const reducers: ActionReducerMap = { - router: fromRouter.routerReducer, - comicImport: fromImporting.reducer + router: fromRouter.routerReducer, + comicImport: fromImporting.reducer }; export const metaReducers: MetaReducer[] = !environment.production - ? [] - : []; + ? [] + : []; diff --git a/comixed-frontend/src/app/comics/models/scraping-issue.fixtures.ts b/comixed-frontend/src/app/comics/models/scraping-issue.fixtures.ts index 718baca57..81d63075d 100644 --- a/comixed-frontend/src/app/comics/models/scraping-issue.fixtures.ts +++ b/comixed-frontend/src/app/comics/models/scraping-issue.fixtures.ts @@ -19,11 +19,11 @@ import { ScrapingIssue } from 'app/comics/models/scraping-issue'; export const SCRAPING_ISSUE_1000: ScrapingIssue = { - id: 1000, - coverDate: '0', - coverUrl: 'http://comixed.org/issues/1000', - issueNumber: '1000', - name: 'Issue1000', - volumeName: '2009', - volumeId: 1000 - }; + id: 1000, + coverDate: '0', + coverUrl: 'http://comixed.org/issues/1000', + issueNumber: '1000', + name: 'Issue1000', + volumeName: '2009', + volumeId: 1000 +}; diff --git a/comixed-frontend/src/app/comics/services/scraping.service.spec.ts b/comixed-frontend/src/app/comics/services/scraping.service.spec.ts index 3e959ee35..252c75e9b 100644 --- a/comixed-frontend/src/app/comics/services/scraping.service.spec.ts +++ b/comixed-frontend/src/app/comics/services/scraping.service.spec.ts @@ -81,9 +81,7 @@ describe('ScrapingService', () => { .getVolumes(API_KEY, SERIES, VOLUME, SKIP_CACHE) .subscribe(response => expect(response).toEqual(VOLUMES)); - const req = httpMock.expectOne( - interpolate(GET_VOLUMES_URL) - ); + const req = httpMock.expectOne(interpolate(GET_VOLUMES_URL)); expect(req.request.method).toEqual('POST'); expect(req.request.body).toEqual({ apiKey: API_KEY, diff --git a/comixed-frontend/src/app/components/main-menu/main-menu.component.ts b/comixed-frontend/src/app/components/main-menu/main-menu.component.ts index fc0b61a2d..1857a2a8f 100644 --- a/comixed-frontend/src/app/components/main-menu/main-menu.component.ts +++ b/comixed-frontend/src/app/components/main-menu/main-menu.component.ts @@ -75,7 +75,7 @@ export class MainMenuComponent implements OnInit { }, { label: this.translateService.instant( - 'main-menu.item.library.duplicates' + 'main-menu.item.library.duplicates' ), icon: 'fa fw fas fa-clone', routerLink: ['/comics/duplicates'], diff --git a/comixed-frontend/src/app/library/components/comic-list-toolbar/comic-list-toolbar.component.spec.ts b/comixed-frontend/src/app/library/components/comic-list-toolbar/comic-list-toolbar.component.spec.ts index 007433058..3417b4c36 100644 --- a/comixed-frontend/src/app/library/components/comic-list-toolbar/comic-list-toolbar.component.spec.ts +++ b/comixed-frontend/src/app/library/components/comic-list-toolbar/comic-list-toolbar.component.spec.ts @@ -16,17 +16,17 @@ * along with this program. If not, see */ -import {HttpClientTestingModule} from '@angular/common/http/testing'; -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import {FormsModule} from '@angular/forms'; -import {Router} from '@angular/router'; -import {RouterTestingModule} from '@angular/router/testing'; -import {EffectsModule} from '@ngrx/effects'; -import {Store, StoreModule} from '@ngrx/store'; -import {TranslateModule} from '@ngx-translate/core'; -import {ScrapingAdaptor} from 'app/comics/adaptors/scraping.adaptor'; -import {COMIC_1, COMIC_3, COMIC_5} from 'app/comics/comics.fixtures'; -import {ComicsModule} from 'app/comics/comics.module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { FormsModule } from '@angular/forms'; +import { Router } from '@angular/router'; +import { RouterTestingModule } from '@angular/router/testing'; +import { EffectsModule } from '@ngrx/effects'; +import { Store, StoreModule } from '@ngrx/store'; +import { TranslateModule } from '@ngx-translate/core'; +import { ScrapingAdaptor } from 'app/comics/adaptors/scraping.adaptor'; +import { COMIC_1, COMIC_3, COMIC_5 } from 'app/comics/comics.fixtures'; +import { ComicsModule } from 'app/comics/comics.module'; import { AppState, LibraryAdaptor, @@ -34,11 +34,11 @@ import { ReadingListAdaptor, SelectionAdaptor } from 'app/library'; -import {LibraryEffects} from 'app/library/effects/library.effects'; +import { LibraryEffects } from 'app/library/effects/library.effects'; import * as fromLibrary from 'app/library/reducers/library.reducer'; import * as fromSelect from 'app/library/reducers/selection.reducer'; -import {AuthenticationAdaptor} from 'app/user'; -import {LoggerModule} from '@angular-ru/logger'; +import { AuthenticationAdaptor } from 'app/user'; +import { LoggerModule } from '@angular-ru/logger'; import { ButtonModule, CheckboxModule, @@ -53,9 +53,9 @@ import { TooltipModule, TreeModule } from 'primeng/primeng'; -import {ComicListToolbarComponent} from './comic-list-toolbar.component'; -import {LibraryNavigationTreeComponent} from 'app/library/components/library-navigation-tree/library-navigation-tree.component'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; +import { ComicListToolbarComponent } from './comic-list-toolbar.component'; +import { LibraryNavigationTreeComponent } from 'app/library/components/library-navigation-tree/library-navigation-tree.component'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; describe('ComicListToolbarComponent', () => { const COMICS = [COMIC_1, COMIC_3, COMIC_5]; @@ -80,12 +80,12 @@ describe('ComicListToolbarComponent', () => { LoggerModule.forRoot(), StoreModule.forRoot({}), StoreModule.forFeature( - fromLibrary.LIBRARY_FEATURE_KEY, - fromLibrary.reducer + fromLibrary.LIBRARY_FEATURE_KEY, + fromLibrary.reducer ), StoreModule.forFeature( - fromSelect.SELECTION_FEATURE_KEY, - fromSelect.reducer + fromSelect.SELECTION_FEATURE_KEY, + fromSelect.reducer ), EffectsModule.forRoot([]), EffectsModule.forFeature([LibraryEffects]), @@ -135,7 +135,7 @@ describe('ComicListToolbarComponent', () => { it('emits an event', () => { component.startScraping.subscribe(response => - expect(response).toBeTruthy() + expect(response).toBeTruthy() ); }); }); diff --git a/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.spec.ts b/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.spec.ts index ac617b0d9..b056b59c9 100644 --- a/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.spec.ts +++ b/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.spec.ts @@ -118,10 +118,9 @@ describe('ConsolidateLibraryComponent', () => { describe('consolidating the library', () => { beforeEach(() => { - spyOn( - confirmationService, - 'confirm' - ).and.callFake((confirm: Confirmation) => confirm.accept()); + spyOn(confirmationService, 'confirm').and.callFake( + (confirm: Confirmation) => confirm.accept() + ); spyOn(libraryAdaptor, 'consolidate'); spyOn(authenticationAdaptor, 'setPreference'); }); diff --git a/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.ts b/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.ts index 984a93af3..3fdeab1f9 100644 --- a/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.ts +++ b/comixed-frontend/src/app/library/components/consolidate-library/consolidate-library.component.ts @@ -75,7 +75,9 @@ export class ConsolidateLibraryComponent implements OnInit, OnDestroy { message: this.translateService.instant( 'consolidate-library.confirm.message', { - deletePhysicalFiles: this.consolidationForm.controls['deletePhysicalFiles'].value + deletePhysicalFiles: this.consolidationForm.controls[ + 'deletePhysicalFiles' + ].value } ), accept: () => { diff --git a/comixed-frontend/src/app/library/components/duplicates-page-toolbar/duplicates-page-toolbar.component.spec.ts b/comixed-frontend/src/app/library/components/duplicates-page-toolbar/duplicates-page-toolbar.component.spec.ts index 13fe6e3f4..89acc5e99 100644 --- a/comixed-frontend/src/app/library/components/duplicates-page-toolbar/duplicates-page-toolbar.component.spec.ts +++ b/comixed-frontend/src/app/library/components/duplicates-page-toolbar/duplicates-page-toolbar.component.spec.ts @@ -117,10 +117,9 @@ describe('DuplicatesPageToolbarComponent', () => { describe('turn on blocked for selected pages', () => { beforeEach(() => { - spyOn( - confirmationService, - 'confirm' - ).and.callFake((confirm: Confirmation) => confirm.accept()); + spyOn(confirmationService, 'confirm').and.callFake( + (confirm: Confirmation) => confirm.accept() + ); spyOn(duplicatesPagesAdaptors, 'setBlocking'); component.selectedPages = PAGES; component.setBlocking(true); @@ -136,10 +135,9 @@ describe('DuplicatesPageToolbarComponent', () => { describe('turn off blocked for selected pages', () => { beforeEach(() => { - spyOn( - confirmationService, - 'confirm' - ).and.callFake((confirm: Confirmation) => confirm.accept()); + spyOn(confirmationService, 'confirm').and.callFake( + (confirm: Confirmation) => confirm.accept() + ); spyOn(duplicatesPagesAdaptors, 'setBlocking'); component.selectedPages = PAGES; component.setBlocking(false); diff --git a/comixed-frontend/src/app/library/pages/library-page/library-page.component.spec.ts b/comixed-frontend/src/app/library/pages/library-page/library-page.component.spec.ts index 7c1912444..f0b2d140d 100644 --- a/comixed-frontend/src/app/library/pages/library-page/library-page.component.spec.ts +++ b/comixed-frontend/src/app/library/pages/library-page/library-page.component.spec.ts @@ -16,12 +16,12 @@ * along with this program. If not, see */ -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; -import {FormsModule, ReactiveFormsModule} from '@angular/forms'; -import {RouterTestingModule} from '@angular/router/testing'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {TranslateModule} from '@ngx-translate/core'; -import {Store, StoreModule} from '@ngrx/store'; +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; +import { FormsModule, ReactiveFormsModule } from '@angular/forms'; +import { RouterTestingModule } from '@angular/router/testing'; +import { BrowserAnimationsModule } from '@angular/platform-browser/animations'; +import { TranslateModule } from '@ngx-translate/core'; +import { Store, StoreModule } from '@ngrx/store'; import { AppState, LibraryAdaptor, @@ -29,24 +29,24 @@ import { ReadingListAdaptor, SelectionAdaptor } from 'app/library'; -import {ConfirmDialogModule} from 'primeng/confirmdialog'; -import {DataViewModule} from 'primeng/dataview'; -import {SliderModule} from 'primeng/slider'; -import {ConfirmationService, MessageService} from 'primeng/api'; -import {CheckboxModule} from 'primeng/checkbox'; -import {DropdownModule} from 'primeng/dropdown'; -import {PanelModule} from 'primeng/panel'; -import {SidebarModule} from 'primeng/sidebar'; -import {SplitButtonModule} from 'primeng/splitbutton'; -import {ScrollPanelModule} from 'primeng/scrollpanel'; -import {OverlayPanelModule} from 'primeng/overlaypanel'; -import {CardModule} from 'primeng/card'; -import {ComicListComponent} from 'app/library/components/comic-list/comic-list.component'; -import {ComicListItemComponent} from 'app/library/components/comic-list-item/comic-list-item.component'; -import {ComicGridItemComponent} from 'app/library/components/comic-grid-item/comic-grid-item.component'; -import {UserService} from 'app/services/user.service'; -import {UserServiceMock} from 'app/services/user.service.mock'; -import {LibraryPageComponent} from './library-page.component'; +import { ConfirmDialogModule } from 'primeng/confirmdialog'; +import { DataViewModule } from 'primeng/dataview'; +import { SliderModule } from 'primeng/slider'; +import { ConfirmationService, MessageService } from 'primeng/api'; +import { CheckboxModule } from 'primeng/checkbox'; +import { DropdownModule } from 'primeng/dropdown'; +import { PanelModule } from 'primeng/panel'; +import { SidebarModule } from 'primeng/sidebar'; +import { SplitButtonModule } from 'primeng/splitbutton'; +import { ScrollPanelModule } from 'primeng/scrollpanel'; +import { OverlayPanelModule } from 'primeng/overlaypanel'; +import { CardModule } from 'primeng/card'; +import { ComicListComponent } from 'app/library/components/comic-list/comic-list.component'; +import { ComicListItemComponent } from 'app/library/components/comic-list-item/comic-list-item.component'; +import { ComicGridItemComponent } from 'app/library/components/comic-grid-item/comic-grid-item.component'; +import { UserService } from 'app/services/user.service'; +import { UserServiceMock } from 'app/services/user.service.mock'; +import { LibraryPageComponent } from './library-page.component'; import { ContextMenuModule, DialogModule, @@ -55,22 +55,22 @@ import { TooltipModule, TreeModule } from 'primeng/primeng'; -import {UserModule} from 'app/user/user.module'; -import {HttpClientTestingModule} from '@angular/common/http/testing'; -import {EffectsModule} from '@ngrx/effects'; -import {BreadcrumbAdaptor} from 'app/adaptors/breadcrumb.adaptor'; -import {ComicListToolbarComponent} from 'app/library/components/comic-list-toolbar/comic-list-toolbar.component'; +import { UserModule } from 'app/user/user.module'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { EffectsModule } from '@ngrx/effects'; +import { BreadcrumbAdaptor } from 'app/adaptors/breadcrumb.adaptor'; +import { ComicListToolbarComponent } from 'app/library/components/comic-list-toolbar/comic-list-toolbar.component'; import { LIBRARY_FEATURE_KEY, reducer } from 'app/library/reducers/library.reducer'; -import {LibraryEffects} from 'app/library/effects/library.effects'; -import {ComicsModule} from 'app/comics/comics.module'; -import {COMIC_1} from 'app/comics/comics.fixtures'; -import {LoggerModule} from '@angular-ru/logger'; -import {ConvertComicsSettingsComponent} from 'app/library/components/convert-comics-settings/convert-comics-settings.component'; -import {LibraryNavigationTreeComponent} from 'app/library/components/library-navigation-tree/library-navigation-tree.component'; -import {ReadingListEditComponent} from 'app/library/components/reading-list-edit/reading-list-edit.component'; +import { LibraryEffects } from 'app/library/effects/library.effects'; +import { ComicsModule } from 'app/comics/comics.module'; +import { COMIC_1 } from 'app/comics/comics.fixtures'; +import { LoggerModule } from '@angular-ru/logger'; +import { ConvertComicsSettingsComponent } from 'app/library/components/convert-comics-settings/convert-comics-settings.component'; +import { LibraryNavigationTreeComponent } from 'app/library/components/library-navigation-tree/library-navigation-tree.component'; +import { ReadingListEditComponent } from 'app/library/components/reading-list-edit/reading-list-edit.component'; describe('LibraryPageComponent', () => { const COMIC = COMIC_1; @@ -133,7 +133,7 @@ describe('LibraryPageComponent', () => { ConfirmationService, MessageService, UserService, - {provide: UserService, useClass: UserServiceMock} + { provide: UserService, useClass: UserServiceMock } ] }).compileComponents(); diff --git a/comixed-frontend/src/app/library/reducers/library.reducer.spec.ts b/comixed-frontend/src/app/library/reducers/library.reducer.spec.ts index bf3eb4319..c8ddd8ac4 100644 --- a/comixed-frontend/src/app/library/reducers/library.reducer.spec.ts +++ b/comixed-frontend/src/app/library/reducers/library.reducer.spec.ts @@ -41,8 +41,8 @@ import { LibraryStartRescanFailed, LibraryUpdatesReceived } from 'app/library/actions/library.actions'; -import {COMIC_1_LAST_READ_DATE} from 'app/library/models/last-read-date.fixtures'; -import {initialState, LibraryState, reducer} from './library.reducer'; +import { COMIC_1_LAST_READ_DATE } from 'app/library/models/last-read-date.fixtures'; +import { initialState, LibraryState, reducer } from './library.reducer'; import { READING_LIST_1, READING_LIST_2 @@ -64,7 +64,7 @@ describe('Library Reducer', () => { let state: LibraryState; beforeEach(() => { - state = {...initialState}; + state = { ...initialState }; }); describe('the initial state', () => { @@ -127,7 +127,7 @@ describe('Library Reducer', () => { describe('when resetting the library', () => { beforeEach(() => { - state = reducer({...state, comics: COMICS}, new LibraryReset()); + state = reducer({ ...state, comics: COMICS }, new LibraryReset()); }); it('clears the comics', () => { @@ -142,14 +142,14 @@ describe('Library Reducer', () => { describe('when getting library updates', () => { beforeEach(() => { state = reducer( - {...state, fetchingUpdates: false}, - new LibraryGetUpdates({ - lastUpdateDate: new Date(), - timeout: 60, - maximumComics: 100, - processingCount: 27, - lastComicId: 1010 - }) + { ...state, fetchingUpdates: false }, + new LibraryGetUpdates({ + lastUpdateDate: new Date(), + timeout: 60, + maximumComics: 100, + processingCount: 27, + lastComicId: 1010 + }) ); }); @@ -160,33 +160,33 @@ describe('Library Reducer', () => { describe('when updates are received', () => { const LATEST_UPDATE = new Date().getTime(); - const UPDATED_COMIC = {...COMIC_2, lastUpdatedDate: LATEST_UPDATE}; + const UPDATED_COMIC = { ...COMIC_2, lastUpdatedDate: LATEST_UPDATE }; const CURRENT_COMICS = [ - {...COMIC_1, lastUpdatedDate: 0}, - {...COMIC_3, lastUpdatedDate: 0}, - {...COMIC_5, lastUpdatedDate: 0} + { ...COMIC_1, lastUpdatedDate: 0 }, + { ...COMIC_3, lastUpdatedDate: 0 }, + { ...COMIC_5, lastUpdatedDate: 0 } ]; - const UPDATE_COMICS = [UPDATED_COMIC, {...COMIC_4, lastUpdatedDate: 0}]; + const UPDATE_COMICS = [UPDATED_COMIC, { ...COMIC_4, lastUpdatedDate: 0 }]; const PROCESSING_COUNT = 20; const READING_LISTS = [READING_LIST_2]; beforeEach(() => { state = reducer( - { - ...state, - fetchingUpdates: true, - comics: CURRENT_COMICS, - readingLists: [READING_LIST_1] - }, - new LibraryUpdatesReceived({ - comics: UPDATE_COMICS, - lastComicId: LAST_COMIC_ID, - mostRecentUpdate: MOST_RECENT_UPDATE, - lastReadDates: LAST_READ_DATES, - moreUpdates: MORE_UPDATES, - processingCount: PROCESSING_COUNT, - readingLists: READING_LISTS - }) + { + ...state, + fetchingUpdates: true, + comics: CURRENT_COMICS, + readingLists: [READING_LIST_1] + }, + new LibraryUpdatesReceived({ + comics: UPDATE_COMICS, + lastComicId: LAST_COMIC_ID, + mostRecentUpdate: MOST_RECENT_UPDATE, + lastReadDates: LAST_READ_DATES, + moreUpdates: MORE_UPDATES, + processingCount: PROCESSING_COUNT, + readingLists: READING_LISTS + }) ); }); @@ -226,8 +226,8 @@ describe('Library Reducer', () => { describe('when getting updates fails', () => { beforeEach(() => { state = reducer( - {...state, fetchingUpdates: true}, - new LibraryGetUpdatesFailed() + { ...state, fetchingUpdates: true }, + new LibraryGetUpdatesFailed() ); }); @@ -239,8 +239,8 @@ describe('Library Reducer', () => { describe('when starting a rescan', () => { beforeEach(() => { state = reducer( - {...state, startingRescan: false}, - new LibraryStartRescan() + { ...state, startingRescan: false }, + new LibraryStartRescan() ); }); @@ -252,8 +252,8 @@ describe('Library Reducer', () => { describe('when rescanning has started', () => { beforeEach(() => { state = reducer( - {...state, startingRescan: true}, - new LibraryRescanStarted({count: 17}) + { ...state, startingRescan: true }, + new LibraryRescanStarted({ count: 17 }) ); }); @@ -265,8 +265,8 @@ describe('Library Reducer', () => { describe('when starting the rescan fails', () => { beforeEach(() => { state = reducer( - {...state, startingRescan: true}, - new LibraryStartRescanFailed() + { ...state, startingRescan: true }, + new LibraryStartRescanFailed() ); }); @@ -278,8 +278,8 @@ describe('Library Reducer', () => { describe('when deleting multiple comics', () => { beforeEach(() => { state = reducer( - {...state, deletingComics: false}, - new LibraryDeleteMultipleComics({ids: [1, 2, 3, 4]}) + { ...state, deletingComics: false }, + new LibraryDeleteMultipleComics({ ids: [1, 2, 3, 4] }) ); }); @@ -291,8 +291,8 @@ describe('Library Reducer', () => { describe('when multiple comics are deleted', () => { beforeEach(() => { state = reducer( - {...state, deletingComics: true}, - new LibraryMultipleComicsDeleted({count: 5}) + { ...state, deletingComics: true }, + new LibraryMultipleComicsDeleted({ count: 5 }) ); }); @@ -304,8 +304,8 @@ describe('Library Reducer', () => { describe('when deleting multiple comics fails', () => { beforeEach(() => { state = reducer( - {...state, deletingComics: true}, - new LibraryDeleteMultipleComicsFailed() + { ...state, deletingComics: true }, + new LibraryDeleteMultipleComicsFailed() ); }); @@ -317,12 +317,12 @@ describe('Library Reducer', () => { describe('when converting comics', () => { beforeEach(() => { state = reducer( - {...state, convertingComics: false}, - new LibraryConvertComics({ - comics: COMICS, - archiveType: 'CBZ', - renamePages: true - }) + { ...state, convertingComics: false }, + new LibraryConvertComics({ + comics: COMICS, + archiveType: 'CBZ', + renamePages: true + }) ); }); @@ -334,8 +334,8 @@ describe('Library Reducer', () => { describe('when comics have started converting', () => { beforeEach(() => { state = reducer( - {...state, convertingComics: true}, - new LibraryComicsConverting() + { ...state, convertingComics: true }, + new LibraryComicsConverting() ); }); @@ -347,8 +347,8 @@ describe('Library Reducer', () => { describe('when comics fail to start converting', () => { beforeEach(() => { state = reducer( - {...state, convertingComics: true}, - new LibraryConvertComicsFailed() + { ...state, convertingComics: true }, + new LibraryConvertComicsFailed() ); }); @@ -360,8 +360,8 @@ describe('Library Reducer', () => { describe('when consolidating the library', () => { beforeEach(() => { state = reducer( - {...state, consolidating: false}, - new LibraryConsolidate({deletePhysicalFiles: true}) + { ...state, consolidating: false }, + new LibraryConsolidate({ deletePhysicalFiles: true }) ); }); @@ -375,12 +375,12 @@ describe('Library Reducer', () => { beforeEach(() => { state = reducer( - { - ...state, - consolidating: true, - comics: COMICS - }, - new LibraryConsolidated({deletedComics: DELETED_COMICS}) + { + ...state, + consolidating: true, + comics: COMICS + }, + new LibraryConsolidated({ deletedComics: DELETED_COMICS }) ); }); @@ -390,7 +390,7 @@ describe('Library Reducer', () => { it('removes the deleted comics from the state', () => { DELETED_COMICS.forEach(comic => - expect(state.comics).not.toContain(comic) + expect(state.comics).not.toContain(comic) ); }); }); @@ -398,8 +398,8 @@ describe('Library Reducer', () => { describe('when consolidation fails', () => { beforeEach(() => { state = reducer( - {...state, consolidating: true}, - new LibraryConsolidateFailed() + { ...state, consolidating: true }, + new LibraryConsolidateFailed() ); }); diff --git a/comixed-frontend/src/app/library/services/reading-list.service.spec.ts b/comixed-frontend/src/app/library/services/reading-list.service.spec.ts index 756c83bd5..d28cafcf9 100644 --- a/comixed-frontend/src/app/library/services/reading-list.service.spec.ts +++ b/comixed-frontend/src/app/library/services/reading-list.service.spec.ts @@ -16,21 +16,21 @@ * along with this program. If not, see */ -import {TestBed} from '@angular/core/testing'; +import { TestBed } from '@angular/core/testing'; -import {ReadingListService} from './reading-list.service'; +import { ReadingListService } from './reading-list.service'; import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; -import {interpolate} from 'app/app.functions'; -import {SaveReadingListRequest} from 'app/library/models/net/save-reading-list-request'; -import {LoggerModule} from '@angular-ru/logger'; +import { interpolate } from 'app/app.functions'; +import { SaveReadingListRequest } from 'app/library/models/net/save-reading-list-request'; +import { LoggerModule } from '@angular-ru/logger'; import { CREATE_READING_LIST_URL, UPDATE_READING_LIST_URL } from 'app/library/library.constants'; -import {READING_LIST_1} from 'app/comics/models/reading-list.fixtures'; +import { READING_LIST_1 } from 'app/comics/models/reading-list.fixtures'; describe('ReadingListService', () => { const READING_LIST = READING_LIST_1; @@ -57,8 +57,8 @@ describe('ReadingListService', () => { it('can save a reading list', () => { service - .save(null, READING_LIST_NAME, READING_LIST_SUMMARY) - .subscribe(response => expect(response).toEqual(READING_LIST)); + .save(null, READING_LIST_NAME, READING_LIST_SUMMARY) + .subscribe(response => expect(response).toEqual(READING_LIST)); const req = http_mock.expectOne(interpolate(CREATE_READING_LIST_URL)); expect(req.request.method).toEqual('POST'); @@ -71,11 +71,11 @@ describe('ReadingListService', () => { it('can update a reading list', () => { service - .save(READING_LIST_ID, READING_LIST_NAME, READING_LIST_SUMMARY) - .subscribe(response => expect(response).toEqual(READING_LIST)); + .save(READING_LIST_ID, READING_LIST_NAME, READING_LIST_SUMMARY) + .subscribe(response => expect(response).toEqual(READING_LIST)); const req = http_mock.expectOne( - interpolate(UPDATE_READING_LIST_URL, {id: READING_LIST_ID}) + interpolate(UPDATE_READING_LIST_URL, { id: READING_LIST_ID }) ); expect(req.request.method).toEqual('PUT'); expect(req.request.body).toEqual({ diff --git a/comixed-frontend/src/app/user/adaptors/authentication.adaptor.spec.ts b/comixed-frontend/src/app/user/adaptors/authentication.adaptor.spec.ts index c394888ed..8e700ea9c 100644 --- a/comixed-frontend/src/app/user/adaptors/authentication.adaptor.spec.ts +++ b/comixed-frontend/src/app/user/adaptors/authentication.adaptor.spec.ts @@ -38,7 +38,7 @@ describe('AuthenticationAdaptor', () => { beforeEach(() => { TestBed.configureTestingModule({ imports: [StoreModule.forRoot({ auth_state: reducer })], - providers: [AuthenticationAdaptor], + providers: [AuthenticationAdaptor] }); auth_adaptor = TestBed.get(AuthenticationAdaptor); @@ -241,7 +241,7 @@ describe('AuthenticationAdaptor', () => { expect(store.dispatch).toHaveBeenCalledWith( new AuthActions.AuthSetPreference({ name: PREFERENCE_NAME, - value: PREFERENCE_VALUE, + value: PREFERENCE_VALUE }) ); }); @@ -253,8 +253,8 @@ describe('AuthenticationAdaptor', () => { new AuthActions.AuthUserLoaded({ user: { ...USER_READER, - preferences: [{ name: PREFERENCE_NAME, value: PREFERENCE_VALUE }], - }, + preferences: [{ name: PREFERENCE_NAME, value: PREFERENCE_VALUE }] + } }) ); }); diff --git a/comixed-frontend/src/app/user/adaptors/authentication.adaptor.ts b/comixed-frontend/src/app/user/adaptors/authentication.adaptor.ts index a0d76a1e6..11ea314f9 100644 --- a/comixed-frontend/src/app/user/adaptors/authentication.adaptor.ts +++ b/comixed-frontend/src/app/user/adaptors/authentication.adaptor.ts @@ -27,7 +27,7 @@ import { AuthLogout, AuthSetPreference, AuthShowLogin, - AuthSubmitLogin, + AuthSubmitLogin } from 'app/user/actions/authentication.actions'; import { AuthenticationState } from 'app/user/models/authentication-state'; import { BehaviorSubject, Observable } from 'rxjs'; @@ -44,13 +44,13 @@ export class AuthenticationAdaptor { _user$ = new BehaviorSubject(null); _role$ = new BehaviorSubject({ admin: false, - reader: false, + reader: false }); constructor(private store: Store) { this.store .select(AUTHENTICATION_FEATURE_KEY) - .pipe(filter((state) => !!state)) + .pipe(filter(state => !!state)) .subscribe((auth_state: AuthenticationState) => { this._initialized$.next(auth_state.initialized); this._authenticating$.next(auth_state.authenticating); @@ -61,7 +61,7 @@ export class AuthenticationAdaptor { reader: this.hasRole(auth_state.user, 'READER') || this.hasRole(auth_state.user, 'ADMIN'), - admin: this.hasRole(auth_state.user, 'ADMIN'), + admin: this.hasRole(auth_state.user, 'ADMIN') }); this._user$.next(auth_state.user); }); @@ -69,7 +69,7 @@ export class AuthenticationAdaptor { private hasRole(user: User, name: string): boolean { if (user) { - return user.roles.some((role) => role.name === name); + return user.roles.some(role => role.name === name); } return false; } @@ -156,7 +156,7 @@ export class AuthenticationAdaptor { if (this._user$.getValue()) { const preference = this._user$ .getValue() - .preferences.find((entry) => entry.name === name); + .preferences.find(entry => entry.name === name); if (preference) { return preference.value; diff --git a/comixed-frontend/src/app/user/effects/authentication.effects.spec.ts b/comixed-frontend/src/app/user/effects/authentication.effects.spec.ts index a3f120c36..031e49e4b 100644 --- a/comixed-frontend/src/app/user/effects/authentication.effects.spec.ts +++ b/comixed-frontend/src/app/user/effects/authentication.effects.spec.ts @@ -51,7 +51,7 @@ describe('AuthenticationEffects', () => { imports: [ RouterTestingModule.withRoutes([{ path: 'home', redirectTo: '' }]), TranslateModule.forRoot(), - LoggerModule.forRoot(), + LoggerModule.forRoot() ], providers: [ AuthenticationEffects, @@ -67,12 +67,12 @@ describe('AuthenticationEffects', () => { ), setPreference: jasmine.createSpy( 'AuthenticationService.setPreference' - ), - }, + ) + } }, TokenService, - MessageService, - ], + MessageService + ] }); effects = TestBed.get(AuthenticationEffects); @@ -93,7 +93,7 @@ describe('AuthenticationEffects', () => { const serviceResponse = { email: USER_READER.email, token: AUTH_TOKEN }; const action = new AuthActions.AuthSubmitLogin({ email: EMAIL, - password: PASSWORD, + password: PASSWORD }); const outcome1 = new AuthActions.AuthCheckState(); const outcome2 = new AuthActions.AuthSetToken({ token: AUTH_TOKEN }); @@ -115,7 +115,7 @@ describe('AuthenticationEffects', () => { const serviceResponse = new HttpErrorResponse({}); const action = new AuthActions.AuthSubmitLogin({ email: EMAIL, - password: PASSWORD, + password: PASSWORD }); const outcome = new AuthActions.AuthNoUserLoaded(); @@ -134,7 +134,7 @@ describe('AuthenticationEffects', () => { it('fires an action on general failure', () => { const action = new AuthActions.AuthSubmitLogin({ email: EMAIL, - password: PASSWORD, + password: PASSWORD }); const outcome = new AuthActions.AuthNoUserLoaded(); @@ -154,7 +154,7 @@ describe('AuthenticationEffects', () => { const serviceResponse = USER; const action = new AuthActions.AuthCheckState(); const outcome = new AuthActions.AuthUserLoaded({ - user: serviceResponse, + user: serviceResponse }); actions = hot('-a', { a: action }); @@ -241,7 +241,7 @@ describe('AuthenticationEffects', () => { const serviceResponse = USER; const action = new AuthActions.AuthSetPreference({ name: PREFERENCE_NAME, - value: PREFERENCE_VALUE, + value: PREFERENCE_VALUE }); const outcome = new AuthActions.AuthPreferenceSet({ user: USER }); @@ -256,7 +256,7 @@ describe('AuthenticationEffects', () => { const serviceResponse = new HttpErrorResponse({}); const action = new AuthActions.AuthSetPreference({ name: PREFERENCE_NAME, - value: PREFERENCE_VALUE, + value: PREFERENCE_VALUE }); const outcome = new AuthActions.AuthSetPreferenceFailed(); @@ -272,7 +272,7 @@ describe('AuthenticationEffects', () => { it('fires an action on general failure', () => { const action = new AuthActions.AuthSetPreference({ name: PREFERENCE_NAME, - value: PREFERENCE_VALUE, + value: PREFERENCE_VALUE }); const outcome = new AuthActions.AuthSetPreferenceFailed(); diff --git a/comixed-frontend/src/app/user/effects/authentication.effects.ts b/comixed-frontend/src/app/user/effects/authentication.effects.ts index 9a5a44164..65d983739 100644 --- a/comixed-frontend/src/app/user/effects/authentication.effects.ts +++ b/comixed-frontend/src/app/user/effects/authentication.effects.ts @@ -39,7 +39,7 @@ import { AuthSetPreference, AuthSetPreferenceFailed, AuthSetToken, - AuthSubmitLogin, + AuthSubmitLogin } from '../actions/authentication.actions'; @Injectable() @@ -56,12 +56,12 @@ export class AuthenticationEffects { @Effect() getAuthenticatedUser$: Observable = this.actions$.pipe( ofType(AuthenticationActionTypes.AUTH_CHECK_STATE), - tap((action) => + tap(action => this.logger.debug('effect: getting authenticated user:', action) ), - switchMap((action) => + switchMap(action => this.authenticationService.getAuthenticatedUser().pipe( - tap((response) => + tap(response => this.logger.debug('getting authenticated user response:', response) ), map((response: User) => @@ -69,7 +69,7 @@ export class AuthenticationEffects { ? new AuthenticationActions.AuthUserLoaded({ user: response }) : new AuthNoUserLoaded() ), - catchError((error) => { + catchError(error => { this.logger.error( 'service failure getting authenticated user:', error @@ -78,7 +78,7 @@ export class AuthenticationEffects { }) ) ), - catchError((error) => { + catchError(error => { this.logger.error('general failure getting authenticated user:', error); return of(new AuthNoUserLoaded()); }) @@ -88,13 +88,13 @@ export class AuthenticationEffects { submitLoginData$: Observable = this.actions$.pipe( ofType(AuthenticationActionTypes.AUTH_SUBMIT_LOGIN), map((action: AuthSubmitLogin) => action.payload), - tap((action) => this.logger.debug('effect: submit login data:', action)), - switchMap((action) => + tap(action => this.logger.debug('effect: submit login data:', action)), + switchMap(action => this.authenticationService .submitLoginData(action.email, action.password) .pipe( - tap((data) => this.tokenService.saveToken(data.token)), - tap((response) => + tap(data => this.tokenService.saveToken(data.token)), + tap(response => this.logger.debug('submit login data response:', response) ), tap(() => @@ -102,21 +102,21 @@ export class AuthenticationEffects { severity: 'info', detail: this.translateService.instant( 'authentication-effects.submit-login-data.success.detail' - ), + ) }) ), switchMap((response: LoginResponse) => [ new AuthCheckState(), new AuthSetToken({ token: response.token }), - new AuthHideLogin(), + new AuthHideLogin() ]), - catchError((error) => { + catchError(error => { this.logger.error('service failure submitting login data:', error); this.messageService.add({ severity: 'error', detail: this.translateService.instant( 'authentication-effects.submit-login-data.failure.detail' - ), + ) }); return of(new AuthNoUserLoaded()); }) @@ -128,7 +128,7 @@ export class AuthenticationEffects { severity: 'error', detail: this.translateService.instant( 'authentication-effects.submit-login-data.failure.detail' - ), + ) }); return of(new AuthNoUserLoaded()); }) @@ -137,14 +137,14 @@ export class AuthenticationEffects { @Effect() logout$: Observable = this.actions$.pipe( ofType(AuthenticationActionTypes.AUTH_LOGOUT), - tap((action) => this.logger.debug('effect: logging out:', action)), + tap(action => this.logger.debug('effect: logging out:', action)), tap(() => this.tokenService.signout()), tap(() => this.messageService.add({ severity: 'info', detail: this.translateService.instant( 'authentication-effects.logout.detail' - ), + ) }) ), map(() => new AuthCheckState()) @@ -153,14 +153,14 @@ export class AuthenticationEffects { @Effect() authenticationFailed$: Observable = this.actions$.pipe( ofType(AuthenticationActionTypes.AUTH_LOGIN_FAILED), - tap((action) => this.logger.debug('effect: logging failed:', action)), + tap(action => this.logger.debug('effect: logging failed:', action)), tap(() => this.tokenService.signout()), tap(() => this.messageService.add({ severity: 'error', detail: this.translateService.instant( 'authentication-effects.submit-login-data.failure.detail' - ), + ) }) ), map(() => new AuthCheckState()) @@ -170,22 +170,22 @@ export class AuthenticationEffects { setPreference$: Observable = this.actions$.pipe( ofType(AuthenticationActionTypes.AUTH_SET_PREFERENCE), map((action: AuthSetPreference) => action.payload), - tap((action) => + tap(action => this.logger.debug('effect: setting user preference:', action) ), - switchMap((action) => + switchMap(action => this.authenticationService.setPreference(action.name, action.value).pipe( - tap((response) => + tap(response => this.logger.debug('setting user preference response:', response) ), map((response: User) => new AuthPreferenceSet({ user: response })), - catchError((error) => { + catchError(error => { this.logger.error('service failure setting user preference:', error); return of(new AuthSetPreferenceFailed()); }) ) ), - catchError((error) => { + catchError(error => { this.logger.error('service failure setting user preference:', error); return of(new AuthSetPreferenceFailed()); }) diff --git a/comixed-frontend/src/app/user/models/save-user-details.ts b/comixed-frontend/src/app/user/models/save-user-details.ts index 9437a468f..92a3380d6 100644 --- a/comixed-frontend/src/app/user/models/save-user-details.ts +++ b/comixed-frontend/src/app/user/models/save-user-details.ts @@ -17,8 +17,8 @@ */ export interface SaveUserDetails { - id: number; - email: string; - password: string; - isAdmin: boolean; + id: number; + email: string; + password: string; + isAdmin: boolean; } diff --git a/comixed-frontend/src/app/user/reducers/authentication.reducer.spec.ts b/comixed-frontend/src/app/user/reducers/authentication.reducer.spec.ts index 8bb3ac0e4..c00de8284 100644 --- a/comixed-frontend/src/app/user/reducers/authentication.reducer.spec.ts +++ b/comixed-frontend/src/app/user/reducers/authentication.reducer.spec.ts @@ -20,7 +20,7 @@ import * as AuthenticationActions from 'app/user/actions/authentication.actions' import { USER_ADMIN, USER_READER } from 'app/user/models/user.fixtures'; import { AuthenticationState, - initial_state, + initial_state } from 'app/user/models/authentication-state'; import { reducer } from 'app/user/reducers/authentication.reducer'; import * as AuthActions from 'app/user/actions/authentication.actions'; @@ -220,7 +220,7 @@ describe('Authentication Reducer', () => { ...state, authenticated: true, auth_token: AUTH_TOKEN, - user: USER_ADMIN, + user: USER_ADMIN }, new AuthenticationActions.AuthLogout() ); @@ -245,7 +245,7 @@ describe('Authentication Reducer', () => { { ...state, setting_preference: false }, new AuthenticationActions.AuthSetPreference({ name: PREFERENCE_NAME, - value: PREFERENCE_VALUE, + value: PREFERENCE_VALUE }) ); }); @@ -259,7 +259,7 @@ describe('Authentication Reducer', () => { const OLD_USER = { ...USER_READER, preferences: [] }; const NEW_USER = { ...USER_READER, - preferences: [{ name: PREFERENCE_NAME, value: PREFERENCE_VALUE }], + preferences: [{ name: PREFERENCE_NAME, value: PREFERENCE_VALUE }] }; beforeEach(() => { diff --git a/comixed-frontend/src/app/user/reducers/authentication.reducer.ts b/comixed-frontend/src/app/user/reducers/authentication.reducer.ts index f8490eff1..650c131fc 100644 --- a/comixed-frontend/src/app/user/reducers/authentication.reducer.ts +++ b/comixed-frontend/src/app/user/reducers/authentication.reducer.ts @@ -18,11 +18,11 @@ import { AuthenticationActions, - AuthenticationActionTypes, + AuthenticationActionTypes } from '../actions/authentication.actions'; import { AuthenticationState, - initial_state, + initial_state } from 'app/user/models/authentication-state'; export const AUTHENTICATION_FEATURE_KEY = 'auth_state'; @@ -45,7 +45,7 @@ export function reducer( authenticated: true, authenticating: false, show_login: false, - user: action.payload.user, + user: action.payload.user }; case AuthenticationActionTypes.AUTH_NO_USER_LOADED: @@ -54,14 +54,14 @@ export function reducer( initialized: true, authenticating: false, authenticated: false, - user: null, + user: null }; case AuthenticationActionTypes.AUTH_SET_TOKEN: return { ...state, authenticated: true, - auth_token: action.payload.token, + auth_token: action.payload.token }; case AuthenticationActionTypes.AUTH_CLEAR_TOKEN: diff --git a/comixed-frontend/src/app/user/user.module.ts b/comixed-frontend/src/app/user/user.module.ts index 6557df8ac..340dcc04b 100644 --- a/comixed-frontend/src/app/user/user.module.ts +++ b/comixed-frontend/src/app/user/user.module.ts @@ -37,12 +37,13 @@ import { AccountPageComponent } from 'app/user/pages/account-page/account-page.c import { TranslateModule } from '@ngx-translate/core'; import { UserDetailsComponent } from 'app/user/components/user-details/user-details.component'; import { - ButtonModule, InputSwitchModule, - PanelModule, - TabViewModule, - ToggleButtonModule, - ToolbarModule, - TooltipModule + ButtonModule, + InputSwitchModule, + PanelModule, + TabViewModule, + ToggleButtonModule, + ToolbarModule, + TooltipModule } from 'primeng/primeng'; import { AccountPreferencesComponent } from 'app/user/components/account-preferences/account-preferences.component'; import { TableModule } from 'primeng/table'; @@ -55,30 +56,30 @@ import { UserAdminAdaptor } from 'app/user/adaptors/user-admin.adaptor'; import { UserPreferencePipe } from 'app/user/pipes/user-preference.pipe'; @NgModule({ - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - UserRoutingModule, - TranslateModule.forRoot(), - StoreModule.forFeature( - fromAuth.AUTHENTICATION_FEATURE_KEY, - fromAuth.reducer - ), - StoreModule.forFeature( - fromUserAdmin.USER_ADMIN_FEATURE_KEY, - fromUserAdmin.reducer - ), - EffectsModule.forFeature([AuthenticationEffects, UserAdminEffects]), - TabViewModule, - TableModule, - PanelModule, - ButtonModule, - TooltipModule, - ToggleButtonModule, - ToolbarModule, - InputSwitchModule - ], + imports: [ + CommonModule, + FormsModule, + ReactiveFormsModule, + UserRoutingModule, + TranslateModule.forRoot(), + StoreModule.forFeature( + fromAuth.AUTHENTICATION_FEATURE_KEY, + fromAuth.reducer + ), + StoreModule.forFeature( + fromUserAdmin.USER_ADMIN_FEATURE_KEY, + fromUserAdmin.reducer + ), + EffectsModule.forFeature([AuthenticationEffects, UserAdminEffects]), + TabViewModule, + TableModule, + PanelModule, + ButtonModule, + TooltipModule, + ToggleButtonModule, + ToolbarModule, + InputSwitchModule + ], providers: [ AuthenticationAdaptor, UserAdminAdaptor, diff --git a/comixed-frontend/src/app/xhr.interceptor.ts b/comixed-frontend/src/app/xhr.interceptor.ts index 389c82b46..5e703c8d5 100644 --- a/comixed-frontend/src/app/xhr.interceptor.ts +++ b/comixed-frontend/src/app/xhr.interceptor.ts @@ -7,7 +7,7 @@ import { HttpRequest, HttpResponse, HttpSentEvent, - HttpUserEvent, + HttpUserEvent } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { Router } from '@angular/router'; @@ -59,11 +59,11 @@ export class XhrInterceptor implements HttpInterceptor { authReq = req.clone({ headers: req.headers .set(TOKEN_HEADER_KEY, `Bearer ${this.tokenService.getToken()}`) - .set('X-Request-With', 'XMLHttpRequest'), + .set('X-Request-With', 'XMLHttpRequest') }); } else { authReq = req.clone({ - headers: req.headers.set('X-Request-With', 'XMLHttpRequest'), + headers: req.headers.set('X-Request-With', 'XMLHttpRequest') }); } return next.handle(authReq).pipe(