Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Researcher profile tab #95

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<!-- From upstream DSpace 7 https://github.com/DSpace/dspace-angular/pull/2866/files -->
<ds-metadata-field-wrapper [label]="label | translate">
<a class="dont-break-out" *ngFor="let mdValue of mdValues; let last=last;" [href]="mdValue.value">
<a class="dont-break-out" *ngFor="let mdValue of mdValues; let last=last;" [href]="mdValue.value" [target]="linkTarget">
{{ linktext || mdValue.value }}<span *ngIf="!last" [innerHTML]="separator"></span>
</a>
</ds-metadata-field-wrapper>
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ describe('MetadataUriValuesComponent', () => {
const separators = fixture.debugElement.queryAll(By.css('a span'));
expect(separators.length).toBe(mockMetadata.length - 1);
});
// From upstream DSpace 7 https://github.com/DSpace/dspace-angular/pull/2866/files
it('should contain the correct target attribute for metadata links', () => {
const links = fixture.debugElement.queryAll(By.css('a'));
for (const link of links) {
expect(link.nativeElement.getAttribute('target')).toBe('_blank');
}
});
// END of upstream addition

describe('when linktext is defined', () => {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,12 @@ export class MetadataUriValuesComponent extends MetadataValuesComponent {
* The label for this iteration of metadata values
*/
@Input() label: string;

// From upstream DSpace 7 https://github.com/DSpace/dspace-angular/pull/2866/files
/**
* The target attribute for the metadata links.
* Defaults to '_blank' to open links in a new window/tab.
*/
@Input() linkTarget = '_blank';
// END of upstream additions
}
Loading