mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
fix lint errors
This commit is contained in:
@@ -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<T>) => {
|
||||
map((objs: T[]) => {
|
||||
return objs.map((obj: T) => {
|
||||
return this.build<T>(obj, ...linksToFollow);
|
||||
});
|
||||
|
2
src/app/core/cache/object-cache.service.ts
vendored
2
src/app/core/cache/object-cache.service.ts
vendored
@@ -187,7 +187,7 @@ export class ObjectCacheService {
|
||||
* The type of the objects to get
|
||||
* @return Observable<Array<T>>
|
||||
*/
|
||||
getList<T extends CacheableObject>(selfLinks: string[]): Observable<Array<T>> {
|
||||
getList<T extends CacheableObject>(selfLinks: string[]): Observable<T[]> {
|
||||
return observableCombineLatest(
|
||||
selfLinks.map((selfLink: string) => this.getObjectBySelfLink<T>(selfLink))
|
||||
);
|
||||
|
@@ -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<any> {
|
||||
|
||||
constructor(
|
||||
@@ -39,7 +40,6 @@ class TestService extends DataService<any> {
|
||||
return observableOf(endpoint);
|
||||
}
|
||||
}
|
||||
|
||||
class DummyChangeAnalyzer implements ChangeAnalyzer<Item> {
|
||||
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 */
|
||||
|
@@ -12,9 +12,6 @@ import { ChangeAnalyzer } from './change-analyzer';
|
||||
*/
|
||||
@Injectable()
|
||||
export class DefaultChangeAnalyzer<T extends CacheableObject> implements ChangeAnalyzer<T> {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare the metadata of two CacheableObject and return the differences as
|
||||
* a JsonPatch Operation Array
|
||||
|
@@ -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<ItemType> {
|
||||
protected linkPath = 'entitytypes';
|
||||
|
||||
@@ -71,3 +72,4 @@ export class ItemTypeDataService {
|
||||
return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow);
|
||||
}
|
||||
}
|
||||
/* tslint:enable:max-classes-per-file */
|
||||
|
@@ -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<License> {
|
||||
protected linkPath = '';
|
||||
|
||||
@@ -59,3 +60,4 @@ export class LicenseDataService {
|
||||
return this.dataService.findAllByHref(href, findListOptions, ...linksToFollow);
|
||||
}
|
||||
}
|
||||
/* tslint:enable:max-classes-per-file */
|
||||
|
@@ -78,7 +78,6 @@ describe('RelationshipTypeService', () => {
|
||||
requestService,
|
||||
rdbService,
|
||||
null,
|
||||
null,
|
||||
halService,
|
||||
objectCache,
|
||||
null,
|
||||
|
@@ -104,7 +104,6 @@ describe('RelationshipService', () => {
|
||||
requestService,
|
||||
rdbService,
|
||||
null,
|
||||
null,
|
||||
halService,
|
||||
objectCache,
|
||||
null,
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
};
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { ResourceType } from "./resource-type";
|
||||
import { ResourceType } from './resource-type';
|
||||
|
||||
/**
|
||||
* The resource type for Item.
|
||||
|
@@ -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;
|
||||
});
|
||||
|
@@ -58,7 +58,7 @@ export class WorkspaceitemActionsComponent extends MyDSpaceActionsComponent<Work
|
||||
console.log('ngOnInit', this.object);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Delete the target workspaceitem object
|
||||
*/
|
||||
public confirmDiscard(content) {
|
||||
|
@@ -2,6 +2,9 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Bitstream } from '../core/shared/bitstream.model';
|
||||
import { hasValue } from '../shared/empty.util';
|
||||
|
||||
/**
|
||||
* A fallback placeholder image as a base64 string
|
||||
*/
|
||||
const placeholder = 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2293%22%20height%3D%22120%22%20viewBox%3D%220%200%2093%20120%22%20preserveAspectRatio%3D%22none%22%3E%3C!--%0ASource%20URL%3A%20holder.js%2F93x120%3Ftext%3DNo%20Thumbnail%0ACreated%20with%20Holder.js%202.8.2.%0ALearn%20more%20at%20http%3A%2F%2Fholderjs.com%0A(c)%202012-2015%20Ivan%20Malopinsky%20-%20http%3A%2F%2Fimsky.co%0A--%3E%3Cdefs%3E%3Cstyle%20type%3D%22text%2Fcss%22%3E%3C!%5BCDATA%5B%23holder_1543e460b05%20text%20%7B%20fill%3A%23AAAAAA%3Bfont-weight%3Abold%3Bfont-family%3AArial%2C%20Helvetica%2C%20Open%20Sans%2C%20sans-serif%2C%20monospace%3Bfont-size%3A10pt%20%7D%20%5D%5D%3E%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22holder_1543e460b05%22%3E%3Crect%20width%3D%2293%22%20height%3D%22120%22%20fill%3D%22%23FFFFFF%22%2F%3E%3Cg%3E%3Ctext%20x%3D%2235.6171875%22%20y%3D%2257%22%3ENo%3C%2Ftext%3E%3Ctext%20x%3D%2210.8125%22%20y%3D%2272%22%3EThumbnail%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fg%3E%3C%2Fsvg%3E';
|
||||
|
||||
/**
|
||||
@@ -9,7 +12,6 @@ const placeholder = 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3
|
||||
* One input parameter of type Bitstream is expected.
|
||||
* If no Bitstream is provided, a holderjs image will be rendered instead.
|
||||
*/
|
||||
|
||||
@Component({
|
||||
selector: 'ds-thumbnail',
|
||||
styleUrls: ['./thumbnail.component.scss'],
|
||||
@@ -17,6 +19,25 @@ const placeholder = 'data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3
|
||||
})
|
||||
export class ThumbnailComponent implements OnInit {
|
||||
|
||||
/**
|
||||
* The thumbnail Bitstream
|
||||
*/
|
||||
@Input() thumbnail: Bitstream;
|
||||
|
||||
/**
|
||||
* The default image, used if the thumbnail isn't set or can't be downloaded
|
||||
*/
|
||||
@Input() defaultImage? = placeholder;
|
||||
|
||||
/**
|
||||
* The src attribute used in the template to render the image.
|
||||
*/
|
||||
src: string;
|
||||
|
||||
/**
|
||||
* Initialize the thumbnail.
|
||||
* Use a default image if no actual image is available.
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
if (hasValue(this.thumbnail) && hasValue(this.thumbnail._links) && hasValue(this.thumbnail._links.content) && this.thumbnail._links.content.href) {
|
||||
this.src = this.thumbnail._links.content.href;
|
||||
@@ -25,15 +46,11 @@ export class ThumbnailComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
@Input() thumbnail: Bitstream;
|
||||
|
||||
/**
|
||||
* The default 'holder.js' image
|
||||
* Handle image download errors.
|
||||
* If the image can't be found, use the defaultImage instead.
|
||||
* If that also can't be found, use the base64 placeholder.
|
||||
*/
|
||||
@Input() defaultImage? = placeholder;
|
||||
|
||||
src: string;
|
||||
|
||||
errorHandler(event) {
|
||||
if (event.currentTarget.src !== this.defaultImage) {
|
||||
event.currentTarget.src = this.defaultImage;
|
||||
|
Reference in New Issue
Block a user