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

ROR Integration - Identifier Visualization #2719

Merged
merged 9 commits into from
Feb 14, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
</ds-generic-item-page-field>
</div>
<div class="col-xs-12 col-md-7">
<ds-generic-item-page-field
vins01-4science marked this conversation as resolved.
Show resolved Hide resolved
[fields]="['organization.identifier.ror']"
[img]="'./assets/images/ror-icon.svg'"
[item]="object"
[label]="'orgunit.page.ror'"
[urlRegex]="'(.*)ror.org'"
>
</ds-generic-item-page-field>
<ds-related-items
[parentItem]="object"
[relationType]="'isPublicationOfOrgUnit'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<!--
Choose a template. Priority: markdown, link, browse link.
-->
<ng-container *ngTemplateOutlet="(renderMarkdown ? markdown : (hasLink(mdValue) ? link : (hasBrowseDefinition() ? browselink : simple)));
context: {value: mdValue.value}">
<ng-container *ngTemplateOutlet="(renderMarkdown ? markdown : (hasLink(mdValue) ? (img != null ? linkImg : link) : (hasBrowseDefinition() ? browselink : simple)));
context: {value: mdValue.value, img}">
</ng-container>
<span class="separator" *ngIf="!last" [innerHTML]="separator"></span>
</ng-container>
Expand All @@ -23,6 +23,14 @@
</a>
</ng-template>

<!-- Render value as a link with icon -->
<ng-template #linkImg let-img="img" let-value="value">
<a [href]="value" class="dont-break-out ds-simple-metadata-link" target="_blank">
<img alt="metadata logo" height="24" src="{{img}}"/>
vins01-4science marked this conversation as resolved.
Show resolved Hide resolved
{{value}}
</a>
</ng-template>

<!-- Render simple value in a span -->
<ng-template #simple let-value="value">
<span class="dont-break-out preserve-line-breaks">{{value}}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export class MetadataValuesComponent implements OnChanges {

@Input() browseDefinition?: BrowseDefinition;

@Input() img?: string;
vins01-4science marked this conversation as resolved.
Show resolved Hide resolved

ngOnChanges(changes: SimpleChanges): void {
this.renderMarkdown = !!this.appConfig.markdown.enabled && this.enableMarkdown;
}
Expand Down
33 changes: 24 additions & 9 deletions src/app/item-page/item-shared.module.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,31 @@
import { RelatedEntitiesSearchComponent } from './simple/related-entities/related-entities-search/related-entities-search.component';
import {
RelatedEntitiesSearchComponent
} from './simple/related-entities/related-entities-search/related-entities-search.component';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CommonModule, NgOptimizedImage } from '@angular/common';
import { SearchModule } from '../shared/search/search.module';
import { SharedModule } from '../shared/shared.module';
import { TranslateModule } from '@ngx-translate/core';
import { DYNAMIC_FORM_CONTROL_MAP_FN } from '@ng-dynamic-forms/core';
import { dsDynamicFormControlMapFn } from '../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component';
import { TabbedRelatedEntitiesSearchComponent } from './simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component';
import { ItemVersionsDeleteModalComponent } from './versions/item-versions-delete-modal/item-versions-delete-modal.component';
import { ItemVersionsSummaryModalComponent } from './versions/item-versions-summary-modal/item-versions-summary-modal.component';
import {
dsDynamicFormControlMapFn
} from '../shared/form/builder/ds-dynamic-form-ui/ds-dynamic-form-control-container.component';
import {
TabbedRelatedEntitiesSearchComponent
} from './simple/related-entities/tabbed-related-entities-search/tabbed-related-entities-search.component';
import {
ItemVersionsDeleteModalComponent
} from './versions/item-versions-delete-modal/item-versions-delete-modal.component';
import {
ItemVersionsSummaryModalComponent
} from './versions/item-versions-summary-modal/item-versions-summary-modal.component';
import { MetadataValuesComponent } from './field-components/metadata-values/metadata-values.component';
import { GenericItemPageFieldComponent } from './simple/field-components/specific-field/generic/generic-item-page-field.component';
import { MetadataRepresentationListComponent } from './simple/metadata-representation-list/metadata-representation-list.component';
import {
GenericItemPageFieldComponent
} from './simple/field-components/specific-field/generic/generic-item-page-field.component';
import {
MetadataRepresentationListComponent
} from './simple/metadata-representation-list/metadata-representation-list.component';
import { RelatedItemsComponent } from './simple/related-items/related-items-component';
import {
ThemedMetadataRepresentationListComponent
Expand Down Expand Up @@ -42,7 +56,8 @@ const COMPONENTS = [
CommonModule,
SearchModule,
SharedModule,
TranslateModule
TranslateModule,
NgOptimizedImage
],
exports: [
...COMPONENTS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,7 @@ export class GenericItemPageFieldComponent extends ItemPageFieldComponent {
*/
@Input() urlRegex?: string;

@Input() img?: string;
vins01-4science marked this conversation as resolved.
Show resolved Hide resolved


}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
[enableMarkdown]="enableMarkdown"
[urlRegex]="urlRegex"
[browseDefinition]="browseDefinition|async"
[img]="img"
></ds-metadata-values>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ export class ItemPageFieldComponent {
*/
urlRegex?: string;

img?: string;
vins01-4science marked this conversation as resolved.
Show resolved Hide resolved

/**
* Return browse definition that matches any field used in this component if it is configured as a browse
* link in dspace.cfg (webui.browse.link.<n>)
Expand Down
22 changes: 22 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3114,6 +3114,8 @@

"orgunit.page.titleprefix": "Organizational Unit: ",

"orgunit.page.ror": "ROR Identifier",

"pagination.options.description": "Pagination options",

"pagination.results-per-page": "Results Per Page",
Expand Down Expand Up @@ -4074,6 +4076,8 @@

"submission.import-external.source.lcname": "Library of Congress Names",

"submission.import-external.source.ror": "Research Organization Registry (ROR)",

"submission.import-external.preview.title": "Item Preview",

"submission.import-external.preview.title.Publication": "Publication Preview",
Expand Down Expand Up @@ -4166,6 +4170,8 @@

"submission.sections.describe.relationship-lookup.external-source.import-modal.head.arxiv": "Importing from arXiv",

"submission.sections.describe.relationship-lookup.external-source.import-modal.head.ror": "Import from ROR",

"submission.sections.describe.relationship-lookup.external-source.import-modal.import": "Import",

"submission.sections.describe.relationship-lookup.external-source.import-modal.Journal.title": "Import Remote Journal",
Expand All @@ -4188,6 +4194,12 @@

"submission.sections.describe.relationship-lookup.external-source.import-modal.select": "Select a local match:",

"submission.sections.describe.relationship-lookup.external-source.import-modal.isOrgUnitOfProject.title": "Import Remote Organization",

"submission.sections.describe.relationship-lookup.external-source.import-modal.isOrgUnitOfProject.added.local-entity": "Successfully added local organization to the selection",

"submission.sections.describe.relationship-lookup.external-source.import-modal.isOrgUnitOfProject.added.new-entity": "Successfully imported and added external organization to the selection",

"submission.sections.describe.relationship-lookup.search-tab.deselect-all": "Deselect all",

"submission.sections.describe.relationship-lookup.search-tab.deselect-page": "Deselect page",
Expand Down Expand Up @@ -4244,6 +4256,8 @@

"submission.sections.describe.relationship-lookup.search-tab.tab-title.arxiv": "arXiv ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.ror": "ROR ({{ count }})",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.isFundingAgencyOfPublication": "Search for Funding Agencies",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.isFundingOfPublication": "Search for Funding",
Expand All @@ -4258,6 +4272,8 @@

"submission.sections.describe.relationship-lookup.search-tab.tab-title.isPublicationOfAuthor": "Publication of the Author",

"submission.sections.describe.relationship-lookup.search-tab.tab-title.isOrgUnitOfProject": "OrgUnit of the Project",

"submission.sections.describe.relationship-lookup.selection-tab.title.openAIREFunding": "Funding OpenAIRE API",

"submission.sections.describe.relationship-lookup.selection-tab.title.isProjectOfPublication": "Project",
Expand Down Expand Up @@ -4304,6 +4320,8 @@

"submission.sections.describe.relationship-lookup.title.isPublicationOfAuthor": "Publication",

"submission.sections.describe.relationship-lookup.title.isOrgUnitOfProject": "OrgUnit",

"submission.sections.describe.relationship-lookup.search-tab.toggle-dropdown": "Toggle dropdown",

"submission.sections.describe.relationship-lookup.selection-tab.settings": "Settings",
Expand Down Expand Up @@ -4366,6 +4384,8 @@

"submission.sections.describe.relationship-lookup.selection-tab.title.wos": "Search Results",

"submission.sections.describe.relationship-lookup.selection-tab.title.ror": "Search Results",

"submission.sections.describe.relationship-lookup.selection-tab.title": "Search Results",

"submission.sections.describe.relationship-lookup.name-variant.notification.content": "Would you like to save \"{{ value }}\" as a name variant for this person so you and others can reuse it for future submissions? If you don't you can still use it for this submission.",
Expand Down Expand Up @@ -4836,6 +4856,8 @@

"supervision.search.results.head": "Workflow and Workspace tasks",

"orgunit.search.results.head": "Organizational Unit Search Results",

vins01-4science marked this conversation as resolved.
Show resolved Hide resolved
"workflow-item.edit.breadcrumbs": "Edit workflowitem",

"workflow-item.edit.title": "Edit workflowitem",
Expand Down
16 changes: 16 additions & 0 deletions src/assets/images/ror-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading