Skip to content

Commit

Permalink
Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaraDipi committed Dec 11, 2020
1 parent 84ff2d0 commit d6ba7a8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 9 deletions.
5 changes: 4 additions & 1 deletion src/app/components/components-mixins.ts
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -15,29 +15,29 @@ 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))
.map((p) => Array(this.row).fill(1).map((_, i) => p.slice(i * this.col, i * this.col + this.col)))
;
}

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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion src/app/directives/editorial-convention-layout.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ export class EditorialConventionLayoutDirective implements OnInit, OnChanges {
@Input('evtEditorialConventionLayout') data: EditorialConventionLayoutData;
@Input() defaultLayouts: Partial<EditorialConventionLayouts>;

private _oldStyle;
// tslint:disable-next-line: variable-name
private _oldStyle: {
// tslint:disable-next-line: no-any
[cssProperty: string]: any;
};

constructor(
private editorialConventionsService: EditorialConventionsService,
Expand Down

0 comments on commit d6ba7a8

Please sign in to comment.