From d6ba7a8aa583d555afa9a96c0d511df2dbe42096 Mon Sep 17 00:00:00 2001 From: ChiaraDipi Date: Fri, 11 Dec 2020 13:02:04 +0100 Subject: [PATCH] Fix linting errors --- src/app/components/components-mixins.ts | 5 ++++- .../edition-level-selector.component.ts | 1 + .../manuscript-thumbnails-viewer.component.ts | 14 +++++++------- .../page-selector/page-selector.component.ts | 1 + .../editorial-convention-layout.directive.ts | 6 +++++- 5 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/app/components/components-mixins.ts b/src/app/components/components-mixins.ts index 71d2445ec..2d1e18c48 100644 --- a/src/app/components/components-mixins.ts +++ b/src/app/components/components-mixins.ts @@ -1,20 +1,23 @@ -import { Input, Directive } from '@angular/core'; +import { Directive, Input } from '@angular/core'; import { EditionLevelType, TextFlow } from '../app.config'; import { HighlightData } from '../models/evt-models'; import { EntitiesSelectItem } from './entities-select/entities-select.component'; @Directive() +// tslint:disable-next-line: directive-class-suffix export class Highlightable { @Input() highlightData: HighlightData; @Input() itemsToHighlight: EntitiesSelectItem[]; } @Directive() +// tslint:disable-next-line: directive-class-suffix export class EditionlevelSusceptible { @Input() editionLevel: EditionLevelType; } @Directive() +// tslint:disable-next-line: directive-class-suffix export class TextFlowSusceptible { @Input() textFlow: TextFlow; } diff --git a/src/app/components/edition-level-selector/edition-level-selector.component.ts b/src/app/components/edition-level-selector/edition-level-selector.component.ts index 11657f289..17a4be823 100644 --- a/src/app/components/edition-level-selector/edition-level-selector.component.ts +++ b/src/app/components/edition-level-selector/edition-level-selector.component.ts @@ -12,6 +12,7 @@ import { EvtIconInfo } from '../../ui-components/icon/icon.component'; export class EditionLevelSelectorComponent { public editionLevels = (AppConfig.evtSettings.edition.availableEditionLevels || []).filter((el) => !el.disabled); + // tslint:disable-next-line: variable-name private _edLevelID: EditionLevelType; @Input() set editionLevelID(p: EditionLevelType) { this._edLevelID = p; diff --git a/src/app/components/manuscript-thumbnails-viewer/manuscript-thumbnails-viewer.component.ts b/src/app/components/manuscript-thumbnails-viewer/manuscript-thumbnails-viewer.component.ts index 9d33eaf7f..23cb48bb5 100644 --- a/src/app/components/manuscript-thumbnails-viewer/manuscript-thumbnails-viewer.component.ts +++ b/src/app/components/manuscript-thumbnails-viewer/manuscript-thumbnails-viewer.component.ts @@ -1,5 +1,5 @@ import { Component, Input, OnInit } from '@angular/core'; -import {GridItem} from '../../models/evt-models'; +import { GridItem } from '../../models/evt-models'; @Component({ selector: 'evt-manuscript-thumbnails', @@ -15,12 +15,12 @@ export class ManuscriptThumbnailsViewerComponent implements OnInit { public indexPage = 0; private items: GridItem[]; - public grid:GridItem[][][] = []; + public grid: GridItem[][][] = []; ngOnInit() { this.items = this.urls.map((url, i) => ({ url, name: 'page_' + i, active: false })); - this.col = this.isValid(this.col) ? this.col : 1; - this.row = this.isValid(this.row) ? this.row : 1; + this.col = this.isValid(this.col) ? this.col : 1; + this.row = this.isValid(this.row) ? this.row : 1; const gridSize = this.col * this.row; this.grid = Array(Math.ceil(this.items.length / gridSize)).fill(1) .map((_, i) => this.items.slice(i * gridSize, i * gridSize + gridSize)) @@ -28,16 +28,16 @@ export class ManuscriptThumbnailsViewerComponent implements OnInit { ; } - isValid(value){ + isValid(value) { return !(isNaN(value) || value <= 0); } goToPrevPage() { - this.indexPage = Math.max(0, this.indexPage-1); + this.indexPage = Math.max(0, this.indexPage - 1); } goToNextPage() { - this.indexPage = Math.min(this.indexPage+1, this.grid.length -1); + this.indexPage = Math.min(this.indexPage + 1, this.grid.length - 1); } clickedItem(item) { diff --git a/src/app/components/page-selector/page-selector.component.ts b/src/app/components/page-selector/page-selector.component.ts index 2819603f6..d5df5865a 100644 --- a/src/app/components/page-selector/page-selector.component.ts +++ b/src/app/components/page-selector/page-selector.component.ts @@ -12,6 +12,7 @@ import { EVTModelService } from '../../services/evt-model.service'; export class PageSelectorComponent { public pages$ = this.evtModelService.pages$; + // tslint:disable-next-line: variable-name private _pageID: string; @Input() set pageID(p: string) { this._pageID = p; diff --git a/src/app/directives/editorial-convention-layout.directive.ts b/src/app/directives/editorial-convention-layout.directive.ts index a6a35afc1..8ba26e266 100644 --- a/src/app/directives/editorial-convention-layout.directive.ts +++ b/src/app/directives/editorial-convention-layout.directive.ts @@ -17,7 +17,11 @@ export class EditorialConventionLayoutDirective implements OnInit, OnChanges { @Input('evtEditorialConventionLayout') data: EditorialConventionLayoutData; @Input() defaultLayouts: Partial; - private _oldStyle; + // tslint:disable-next-line: variable-name + private _oldStyle: { + // tslint:disable-next-line: no-any + [cssProperty: string]: any; + }; constructor( private editorialConventionsService: EditorialConventionsService,