mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
@@ -19,7 +19,7 @@ export class NormalizedBitstream extends NormalizedDSpaceObject {
|
||||
* The relative path to this Bitstream's file
|
||||
*/
|
||||
@autoserialize
|
||||
retrieve: string;
|
||||
content: string;
|
||||
|
||||
/**
|
||||
* The mime type of this Bitstream
|
||||
|
@@ -37,6 +37,6 @@ export class Bitstream extends DSpaceObject {
|
||||
/**
|
||||
* The URL to retrieve this Bitstream's file
|
||||
*/
|
||||
retrieve: string;
|
||||
content: string;
|
||||
|
||||
}
|
||||
|
@@ -23,13 +23,13 @@ describe('Item', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
const thumbnail = {
|
||||
retrieve: thumbnailPath
|
||||
content: thumbnailPath
|
||||
};
|
||||
|
||||
bitstreams = [{
|
||||
retrieve: bitstream1Path
|
||||
content: bitstream1Path
|
||||
}, {
|
||||
retrieve: bitstream2Path
|
||||
content: bitstream2Path
|
||||
}];
|
||||
|
||||
remoteDataThumbnail = createRemoteDataObject(thumbnail);
|
||||
@@ -73,7 +73,7 @@ describe('Item', () => {
|
||||
it('should return the thumbnail of this item', () => {
|
||||
const path: string = thumbnailPath;
|
||||
const bitstream: Observable<Bitstream> = item.getThumbnail();
|
||||
bitstream.map((b) => expect(b.retrieve).toBe(path));
|
||||
bitstream.map((b) => expect(b.content).toBe(path));
|
||||
});
|
||||
});
|
||||
|
||||
@@ -91,7 +91,7 @@ describe('Item', () => {
|
||||
files.subscribe(
|
||||
(array) => array.forEach(
|
||||
(file) => {
|
||||
expect(file.retrieve).toBe(paths[index]);
|
||||
expect(file.content).toBe(paths[index]);
|
||||
index++;
|
||||
}
|
||||
)
|
||||
|
@@ -21,7 +21,7 @@
|
||||
</dl>
|
||||
</div>
|
||||
<div class="col-2">
|
||||
<a [href]="file.retrieve" [download]="file.name">
|
||||
<a [href]="file.content" [download]="file.name">
|
||||
{{"item.page.filesection.download" | translate}}
|
||||
</a>
|
||||
</div>
|
||||
|
@@ -1,6 +1,6 @@
|
||||
<ds-metadata-field-wrapper [label]="label | translate">
|
||||
<div class="file-section">
|
||||
<a *ngFor="let file of (files | async); let last=last;" [href]="file?.retrieve" [download]="file?.name">
|
||||
<a *ngFor="let file of (files | async); let last=last;" [href]="file?.content" [download]="file?.name">
|
||||
<span>{{file?.name}}</span>
|
||||
<span>({{(file?.sizeBytes) | dsFileSize }})</span>
|
||||
<span *ngIf="!last" innerHTML="{{separator}}"></span>
|
||||
|
@@ -1,3 +1,3 @@
|
||||
<div *ngIf="logo" class="dso-logo">
|
||||
<img [src]="logo.retrieve" class="img-responsive" [attr.alt]="alternateText ? alternateText : null" (error)="errorHandler($event)"/>
|
||||
<img [src]="logo.content" class="img-responsive" [attr.alt]="alternateText ? alternateText : null" (error)="errorHandler($event)"/>
|
||||
</div>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
<div class="thumbnail">
|
||||
<img *ngIf="thumbnail" [src]="thumbnail.retrieve" (error)="errorHandler($event)"/>
|
||||
<img *ngIf="thumbnail" [src]="thumbnail.content" (error)="errorHandler($event)"/>
|
||||
<img *ngIf="!thumbnail" [src]="holderSource | dsSafeUrl"/>
|
||||
</div>
|
||||
|
@@ -27,10 +27,10 @@ describe('ThumbnailComponent', () => {
|
||||
|
||||
it('should display image', () => {
|
||||
comp.thumbnail = new Bitstream();
|
||||
comp.thumbnail.retrieve = 'test.url';
|
||||
comp.thumbnail.content = 'test.url';
|
||||
fixture.detectChanges();
|
||||
const image: HTMLElement = de.query(By.css('img')).nativeElement;
|
||||
expect(image.getAttribute('src')).toBe(comp.thumbnail.retrieve);
|
||||
expect(image.getAttribute('src')).toBe(comp.thumbnail.content);
|
||||
});
|
||||
|
||||
it('should display placeholder', () => {
|
||||
|
Reference in New Issue
Block a user