Merge pull request #131 from 4Science/retrieve

Rename the HAL link
This commit is contained in:
Art Lowel
2017-08-03 21:20:44 +02:00
committed by GitHub
8 changed files with 13 additions and 13 deletions

View File

@@ -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

View File

@@ -37,6 +37,6 @@ export class Bitstream extends DSpaceObject {
/**
* The URL to retrieve this Bitstream's file
*/
retrieve: string;
content: string;
}

View File

@@ -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++;
}
)

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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>

View File

@@ -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', () => {