diff --git a/src/app/core/shared/collection.model.ts b/src/app/core/shared/collection.model.ts index 1505359cfd..3eb9a128d7 100644 --- a/src/app/core/shared/collection.model.ts +++ b/src/app/core/shared/collection.model.ts @@ -78,14 +78,13 @@ export class Collection extends DSpaceObject implements ChildHALResource { * A string representing the unique handle of this Collection */ get handle(): string { - const metadataValue = this.firstMetadataValue('dc.identifier.uri'); - return metadataValue ? metadataValue : this._handle; + return this.firstMetadataValue('dc.identifier.uri'); } set handle(value: string) { this._handle = value; } - + /** * The introductory text of this Collection * Corresponds to the metadata field dc.description diff --git a/src/app/core/shared/community.model.ts b/src/app/core/shared/community.model.ts index 06f7b70c01..4943ff37d9 100644 --- a/src/app/core/shared/community.model.ts +++ b/src/app/core/shared/community.model.ts @@ -67,8 +67,7 @@ export class Community extends DSpaceObject implements ChildHALResource { * A string representing the unique handle of this Community */ get handle(): string { - const metadataValue = this.firstMetadataValue('dc.identifier.uri'); - return metadataValue ? metadataValue : this._handle; + return this.firstMetadataValue('dc.identifier.uri'); } set handle(value: string) { diff --git a/src/app/shared/comcol-page-handle/comcol-page-handle.component.spec.ts b/src/app/shared/comcol-page-handle/comcol-page-handle.component.spec.ts index e059cb7044..9c4c31a8e8 100644 --- a/src/app/shared/comcol-page-handle/comcol-page-handle.component.spec.ts +++ b/src/app/shared/comcol-page-handle/comcol-page-handle.component.spec.ts @@ -39,7 +39,7 @@ describe('ComcolPageHandleComponent', () => { }); describe('should create a link pointing the handle', () => { - + it('should use the content if it includes the http protocol', () => { component.content = handleWithProtocol; fixture.detectChanges(); @@ -48,15 +48,6 @@ describe('ComcolPageHandleComponent', () => { expect(link.nativeElement.getAttribute('href')).toBe(handleWithProtocol); expect(link.nativeElement.innerHTML).toBe(handleWithProtocol); }); - - it('should combine the base uri to the content if it doesnt include the http protocol', () => { - component.content = handleWithoutProtocol; - fixture.detectChanges(); - const link = fixture.debugElement.query(By.css('a')); - expect(link.nativeElement.getAttribute('href')).toBe(handleWithoutProtocolUIURLCombined); - expect(link.nativeElement.innerHTML).toBe(handleWithoutProtocolUIURLCombined); - }); - }); - -}); \ No newline at end of file + +}); diff --git a/src/app/shared/comcol-page-handle/comcol-page-handle.component.ts b/src/app/shared/comcol-page-handle/comcol-page-handle.component.ts index bea3f51e28..53487c872c 100644 --- a/src/app/shared/comcol-page-handle/comcol-page-handle.component.ts +++ b/src/app/shared/comcol-page-handle/comcol-page-handle.component.ts @@ -21,7 +21,6 @@ export class ComcolPageHandleComponent { @Input() content: string; public getHandle(): string { - return this.content.includes('http') ? this.content - : new UIURLCombiner('/handle/', this.content).toString(); - }} - + return this.content; + } +}