From 08dedb2dc34eb3f5dc823ee2a8a8d4012e90a32a Mon Sep 17 00:00:00 2001 From: Art Lowel Date: Mon, 17 Feb 2020 18:01:55 +0100 Subject: [PATCH] fix lint errors --- .../builders/remote-data-build.service.ts | 4 +- src/app/core/cache/object-cache.service.ts | 2 +- src/app/core/data/data.service.spec.ts | 3 +- .../data/default-change-analyzer.service.ts | 3 -- src/app/core/data/entity-type-data.service.ts | 2 + src/app/core/data/license-data.service.ts | 2 + .../data/relationship-type.service.spec.ts | 1 - .../core/data/relationship.service.spec.ts | 1 - src/app/core/shared/content-source.model.ts | 2 +- src/app/core/shared/dspace-object.model.ts | 1 - src/app/core/shared/item.resource-type.ts | 2 +- .../form/builder/form-builder.service.spec.ts | 38 +++++++++---------- .../workspaceitem-actions.component.ts | 2 +- src/app/thumbnail/thumbnail.component.ts | 33 ++++++++++++---- 14 files changed, 55 insertions(+), 41 deletions(-) diff --git a/src/app/core/cache/builders/remote-data-build.service.ts b/src/app/core/cache/builders/remote-data-build.service.ts index a35998375c..f2dc5e4c6e 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core'; import { combineLatest as observableCombineLatest, Observable, of as observableOf, race as observableRace } from 'rxjs'; import { distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators'; import { - hasNoValue, hasValue, hasValueOperator, isEmpty, @@ -14,7 +13,6 @@ import { FollowLinkConfig } from '../../../shared/utils/follow-link-config.model import { PaginatedList } from '../../data/paginated-list'; import { RemoteData } from '../../data/remote-data'; import { RemoteDataError } from '../../data/remote-data-error'; -import { GetRequest } from '../../data/request.models'; import { RequestEntry } from '../../data/request.reducer'; import { RequestService } from '../../data/request.service'; import { @@ -136,7 +134,7 @@ export class RemoteDataBuildService { getResourceLinksFromResponse(), switchMap((resourceUUIDs: string[]) => { return this.objectCache.getList(resourceUUIDs).pipe( - map((objs: Array) => { + map((objs: T[]) => { return objs.map((obj: T) => { return this.build(obj, ...linksToFollow); }); diff --git a/src/app/core/cache/object-cache.service.ts b/src/app/core/cache/object-cache.service.ts index 269f61e847..53894df5f1 100644 --- a/src/app/core/cache/object-cache.service.ts +++ b/src/app/core/cache/object-cache.service.ts @@ -187,7 +187,7 @@ export class ObjectCacheService { * The type of the objects to get * @return Observable> */ - getList(selfLinks: string[]): Observable> { + getList(selfLinks: string[]): Observable { return observableCombineLatest( selfLinks.map((selfLink: string) => this.getObjectBySelfLink(selfLink)) ); diff --git a/src/app/core/data/data.service.spec.ts b/src/app/core/data/data.service.spec.ts index ddb77496e3..347dfa83a4 100644 --- a/src/app/core/data/data.service.spec.ts +++ b/src/app/core/data/data.service.spec.ts @@ -19,6 +19,7 @@ import { createSuccessfulRemoteDataObject$ } from '../../shared/testing/utils'; const endpoint = 'https://rest.api/core'; +/* tslint:disable:max-classes-per-file */ class TestService extends DataService { constructor( @@ -39,7 +40,6 @@ class TestService extends DataService { return observableOf(endpoint); } } - class DummyChangeAnalyzer implements ChangeAnalyzer { diff(object1: Item, object2: Item): Operation[] { return compare((object1 as any).metadata, (object2 as any).metadata); @@ -198,3 +198,4 @@ describe('DataService', () => { }); }); }); +/* tslint:enable:max-classes-per-file */ diff --git a/src/app/core/data/default-change-analyzer.service.ts b/src/app/core/data/default-change-analyzer.service.ts index d8cfb999dc..20218925fb 100644 --- a/src/app/core/data/default-change-analyzer.service.ts +++ b/src/app/core/data/default-change-analyzer.service.ts @@ -12,9 +12,6 @@ import { ChangeAnalyzer } from './change-analyzer'; */ @Injectable() export class DefaultChangeAnalyzer implements ChangeAnalyzer { - constructor() { - } - /** * Compare the metadata of two CacheableObject and return the differences as * a JsonPatch Operation Array diff --git a/src/app/core/data/entity-type-data.service.ts b/src/app/core/data/entity-type-data.service.ts index db958fe680..80b6beed81 100644 --- a/src/app/core/data/entity-type-data.service.ts +++ b/src/app/core/data/entity-type-data.service.ts @@ -18,6 +18,7 @@ import { RemoteData } from './remote-data'; import { FindListOptions } from './request.models'; import { RequestService } from './request.service'; +/* tslint:disable:max-classes-per-file */ class DataServiceImpl extends DataService { protected linkPath = 'entitytypes'; @@ -71,3 +72,4 @@ export class ItemTypeDataService { return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow); } } +/* tslint:enable:max-classes-per-file */ diff --git a/src/app/core/data/license-data.service.ts b/src/app/core/data/license-data.service.ts index fbdc44f233..24b77a41a6 100644 --- a/src/app/core/data/license-data.service.ts +++ b/src/app/core/data/license-data.service.ts @@ -18,6 +18,7 @@ import { RemoteData } from './remote-data'; import { FindListOptions } from './request.models'; import { RequestService } from './request.service'; +/* tslint:disable:max-classes-per-file */ class DataServiceImpl extends DataService { protected linkPath = ''; @@ -59,3 +60,4 @@ export class LicenseDataService { return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow); } } +/* tslint:enable:max-classes-per-file */ diff --git a/src/app/core/data/relationship-type.service.spec.ts b/src/app/core/data/relationship-type.service.spec.ts index 2322a692a7..0a86b4bc61 100644 --- a/src/app/core/data/relationship-type.service.spec.ts +++ b/src/app/core/data/relationship-type.service.spec.ts @@ -78,7 +78,6 @@ describe('RelationshipTypeService', () => { requestService, rdbService, null, - null, halService, objectCache, null, diff --git a/src/app/core/data/relationship.service.spec.ts b/src/app/core/data/relationship.service.spec.ts index 9dd9530fda..caf1e87469 100644 --- a/src/app/core/data/relationship.service.spec.ts +++ b/src/app/core/data/relationship.service.spec.ts @@ -104,7 +104,6 @@ describe('RelationshipService', () => { requestService, rdbService, null, - null, halService, objectCache, null, diff --git a/src/app/core/shared/content-source.model.ts b/src/app/core/shared/content-source.model.ts index 9e93e9d529..82cacd91ed 100644 --- a/src/app/core/shared/content-source.model.ts +++ b/src/app/core/shared/content-source.model.ts @@ -16,7 +16,7 @@ export enum ContentSourceHarvestType { /** * A model class that holds information about the Content Source of a Collection */ -export class ContentSource implements HALResource{ +export class ContentSource implements HALResource { /** * Unique identifier, this is necessary to store the ContentSource in FieldUpdates * Because the ContentSource coming from the REST API doesn't have a UUID, we're using the selflink diff --git a/src/app/core/shared/dspace-object.model.ts b/src/app/core/shared/dspace-object.model.ts index 781588e575..2e1afe9c8a 100644 --- a/src/app/core/shared/dspace-object.model.ts +++ b/src/app/core/shared/dspace-object.model.ts @@ -62,7 +62,6 @@ export class DSpaceObject extends ListableObject implements CacheableObject { * A shorthand to set this DSpaceObject's self link */ set self(v: string) { - debugger; this._links.self = { href: v }; diff --git a/src/app/core/shared/item.resource-type.ts b/src/app/core/shared/item.resource-type.ts index c21b83fde9..8371f6b9b5 100644 --- a/src/app/core/shared/item.resource-type.ts +++ b/src/app/core/shared/item.resource-type.ts @@ -1,4 +1,4 @@ -import { ResourceType } from "./resource-type"; +import { ResourceType } from './resource-type'; /** * The resource type for Item. diff --git a/src/app/shared/form/builder/form-builder.service.spec.ts b/src/app/shared/form/builder/form-builder.service.spec.ts index 2702f72d26..972abb68b5 100644 --- a/src/app/shared/form/builder/form-builder.service.spec.ts +++ b/src/app/shared/form/builder/form-builder.service.spec.ts @@ -276,7 +276,7 @@ describe('FormBuilderService test suite', () => { { fields: [ { - input: {type: 'lookup'}, + input: { type: 'lookup' }, label: 'Journal', mandatory: 'false', repeatable: false, @@ -291,7 +291,7 @@ describe('FormBuilderService test suite', () => { languageCodes: [] } as FormFieldModel, { - input: {type: 'onebox'}, + input: { type: 'onebox' }, label: 'Issue', mandatory: 'false', repeatable: false, @@ -304,7 +304,7 @@ describe('FormBuilderService test suite', () => { languageCodes: [] } as FormFieldModel, { - input: {type: 'name'}, + input: { type: 'name' }, label: 'Name', mandatory: 'false', repeatable: false, @@ -322,24 +322,24 @@ describe('FormBuilderService test suite', () => { fields: [ { hints: 'If the item has any identification numbers or codes associated with↵ it, please enter the types and the actual numbers or codes.', - input: {type: 'onebox'}, + input: { type: 'onebox' }, label: 'Identifiers', languageCodes: [], mandatory: 'false', repeatable: false, selectableMetadata: [ - {metadata: 'dc.identifier.issn', label: 'ISSN'}, - {metadata: 'dc.identifier.other', label: 'Other'}, - {metadata: 'dc.identifier.ismn', label: 'ISMN'}, - {metadata: 'dc.identifier.govdoc', label: 'Gov\'t Doc #'}, - {metadata: 'dc.identifier.uri', label: 'URI'}, - {metadata: 'dc.identifier.isbn', label: 'ISBN'}, - {metadata: 'dc.identifier.doi', label: 'DOI'}, - {metadata: 'dc.identifier.pmid', label: 'PubMed ID'}, - {metadata: 'dc.identifier.arxiv', label: 'arXiv'} + { metadata: 'dc.identifier.issn', label: 'ISSN' }, + { metadata: 'dc.identifier.other', label: 'Other' }, + { metadata: 'dc.identifier.ismn', label: 'ISMN' }, + { metadata: 'dc.identifier.govdoc', label: 'Gov\'t Doc #' }, + { metadata: 'dc.identifier.uri', label: 'URI' }, + { metadata: 'dc.identifier.isbn', label: 'ISBN' }, + { metadata: 'dc.identifier.doi', label: 'DOI' }, + { metadata: 'dc.identifier.pmid', label: 'PubMed ID' }, + { metadata: 'dc.identifier.arxiv', label: 'arXiv' } ] }, { - input: {type: 'onebox'}, + input: { type: 'onebox' }, label: 'Publisher', mandatory: 'false', repeatable: false, @@ -356,7 +356,7 @@ describe('FormBuilderService test suite', () => { { fields: [ { - input: {type: 'onebox'}, + input: { type: 'onebox' }, label: 'Conference', mandatory: 'false', repeatable: false, @@ -374,13 +374,13 @@ describe('FormBuilderService test suite', () => { } as FormRowModel ], self: { - href: 'testFormConfiguration.url' -}, + href: 'testFormConfiguration.url' + }, type: 'submissionform', _links: { self: { - href: 'testFormConfiguration.url' -} + href: 'testFormConfiguration.url' + } } } as any; }); diff --git a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts index 59c1ae9a0e..5f2f31c53e 100644 --- a/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts +++ b/src/app/shared/mydspace-actions/workspaceitem/workspaceitem-actions.component.ts @@ -58,7 +58,7 @@ export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent