From 0a0c6e3303fac8933b5da06c7de377c3b3e5ab66 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Fri, 28 Jul 2017 19:20:43 +0200 Subject: [PATCH 1/2] Rename the HAL link --- .../core/cache/builders/remote-data-build.service.ts | 6 +++--- .../core/cache/models/normalized-bitstream.model.ts | 2 +- src/app/core/shared/bitstream.model.ts | 2 +- src/app/core/shared/item.model.spec.ts | 10 +++++----- .../file-section/full-file-section.component.html | 2 +- .../file-section/file-section.component.html | 2 +- .../comcol-page-logo/comcol-page-logo.component.html | 2 +- src/app/thumbnail/thumbnail.component.html | 2 +- src/app/thumbnail/thumbnail.component.spec.ts | 4 ++-- 9 files changed, 16 insertions(+), 16 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 a413de9b50..be7f4c8085 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -186,10 +186,10 @@ export class RemoteDataBuildService { rdArr.push(this.buildSingle(href, resourceConstructor)); }); - if (isList) { - links[relationship] = this.aggregate(rdArr); - } else if (rdArr.length === 1) { + if (rdArr.length === 1) { links[relationship] = rdArr[0]; + } else { + links[relationship] = this.aggregate(rdArr); } } else { // without the setTimeout, the actions inside requestService.configure diff --git a/src/app/core/cache/models/normalized-bitstream.model.ts b/src/app/core/cache/models/normalized-bitstream.model.ts index 4ac2718056..ba5343e252 100644 --- a/src/app/core/cache/models/normalized-bitstream.model.ts +++ b/src/app/core/cache/models/normalized-bitstream.model.ts @@ -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 diff --git a/src/app/core/shared/bitstream.model.ts b/src/app/core/shared/bitstream.model.ts index b6453206f0..5e4ee929d4 100644 --- a/src/app/core/shared/bitstream.model.ts +++ b/src/app/core/shared/bitstream.model.ts @@ -37,6 +37,6 @@ export class Bitstream extends DSpaceObject { /** * The URL to retrieve this Bitstream's file */ - retrieve: string; + content: string; } diff --git a/src/app/core/shared/item.model.spec.ts b/src/app/core/shared/item.model.spec.ts index 610c3c812c..323cc8ef3f 100644 --- a/src/app/core/shared/item.model.spec.ts +++ b/src/app/core/shared/item.model.spec.ts @@ -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 = 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++; } ) diff --git a/src/app/item-page/full/field-components/file-section/full-file-section.component.html b/src/app/item-page/full/field-components/file-section/full-file-section.component.html index 9a83442dd9..358b658a76 100644 --- a/src/app/item-page/full/field-components/file-section/full-file-section.component.html +++ b/src/app/item-page/full/field-components/file-section/full-file-section.component.html @@ -21,7 +21,7 @@ diff --git a/src/app/item-page/simple/field-components/file-section/file-section.component.html b/src/app/item-page/simple/field-components/file-section/file-section.component.html index aeceeab53a..1d32c8b309 100644 --- a/src/app/item-page/simple/field-components/file-section/file-section.component.html +++ b/src/app/item-page/simple/field-components/file-section/file-section.component.html @@ -1,6 +1,6 @@
- + {{file?.name}} ({{(file?.sizeBytes) | dsFileSize }}) diff --git a/src/app/shared/comcol-page-logo/comcol-page-logo.component.html b/src/app/shared/comcol-page-logo/comcol-page-logo.component.html index 069f748d7a..b47bc72316 100644 --- a/src/app/shared/comcol-page-logo/comcol-page-logo.component.html +++ b/src/app/shared/comcol-page-logo/comcol-page-logo.component.html @@ -1,3 +1,3 @@ diff --git a/src/app/thumbnail/thumbnail.component.html b/src/app/thumbnail/thumbnail.component.html index 669278b416..6221cbaba1 100644 --- a/src/app/thumbnail/thumbnail.component.html +++ b/src/app/thumbnail/thumbnail.component.html @@ -1,4 +1,4 @@
- +
diff --git a/src/app/thumbnail/thumbnail.component.spec.ts b/src/app/thumbnail/thumbnail.component.spec.ts index 8168b55011..fc145d2397 100644 --- a/src/app/thumbnail/thumbnail.component.spec.ts +++ b/src/app/thumbnail/thumbnail.component.spec.ts @@ -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', () => { From ca44ef8ce0b42d19b615ffaf401469349de695ec Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 1 Aug 2017 18:07:46 +0200 Subject: [PATCH 2/2] Merge from remote/master --- src/app/core/cache/builders/remote-data-build.service.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 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 be7f4c8085..a413de9b50 100644 --- a/src/app/core/cache/builders/remote-data-build.service.ts +++ b/src/app/core/cache/builders/remote-data-build.service.ts @@ -186,10 +186,10 @@ export class RemoteDataBuildService { rdArr.push(this.buildSingle(href, resourceConstructor)); }); - if (rdArr.length === 1) { - links[relationship] = rdArr[0]; - } else { + if (isList) { links[relationship] = this.aggregate(rdArr); + } else if (rdArr.length === 1) { + links[relationship] = rdArr[0]; } } else { // without the setTimeout, the actions inside requestService.configure