From e7f5c48d8cf499024b1efbf6b0a19a1bf4dfb0bf Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Wed, 13 Dec 2023 18:00:06 +0100 Subject: [PATCH 1/8] [CST-12825] Ror integration --- .../org-unit/org-unit.component.html | 8 +++++ .../metadata-values.component.html | 11 +++++-- .../metadata-values.component.ts | 2 ++ src/app/item-page/item-shared.module.ts | 33 ++++++++++++++----- .../generic-item-page-field.component.ts | 2 ++ .../item-page-field.component.html | 1 + .../item-page-field.component.ts | 2 ++ src/assets/i18n/en.json5 | 24 +++++++++++++- src/assets/images/ror-icon.svg | 16 +++++++++ 9 files changed, 87 insertions(+), 12 deletions(-) create mode 100644 src/assets/images/ror-icon.svg diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index c79d19e267c..30bf7c40834 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -14,6 +14,14 @@ > + + diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.html b/src/app/item-page/field-components/metadata-values/metadata-values.component.html index 61088edd164..2f822e11be8 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.html +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.html @@ -3,8 +3,8 @@ - + @@ -23,6 +23,13 @@ + + + + + {{value}} diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts index cbbae9006da..2ec31159bca 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts @@ -55,6 +55,8 @@ export class MetadataValuesComponent implements OnChanges { @Input() browseDefinition?: BrowseDefinition; + @Input() img?: string; + ngOnChanges(changes: SimpleChanges): void { this.renderMarkdown = !!this.appConfig.markdown.enabled && this.enableMarkdown; } diff --git a/src/app/item-page/item-shared.module.ts b/src/app/item-page/item-shared.module.ts index 9c2bbba6194..7a0ac436299 100644 --- a/src/app/item-page/item-shared.module.ts +++ b/src/app/item-page/item-shared.module.ts @@ -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 @@ -42,7 +56,8 @@ const COMPONENTS = [ CommonModule, SearchModule, SharedModule, - TranslateModule + TranslateModule, + NgOptimizedImage ], exports: [ ...COMPONENTS diff --git a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts index 53d2f6aa20d..99a68745c1c 100644 --- a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts @@ -45,5 +45,7 @@ export class GenericItemPageFieldComponent extends ItemPageFieldComponent { */ @Input() urlRegex?: string; + @Input() img?: string; + } diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html index 91d40b0ad70..f45d4657a46 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html @@ -6,5 +6,6 @@ [enableMarkdown]="enableMarkdown" [urlRegex]="urlRegex" [browseDefinition]="browseDefinition|async" + [img]="img" > diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index fc526dabcc5..99e5ae7d36f 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -51,6 +51,8 @@ export class ItemPageFieldComponent { */ urlRegex?: string; + img?: string; + /** * 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.) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 643a3ce0d18..325dc9daab5 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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.", @@ -4836,6 +4856,8 @@ "supervision.search.results.head": "Workflow and Workspace tasks", + "orgunit.search.results.head": "Organizational Unit Search Results", + "workflow-item.edit.breadcrumbs": "Edit workflowitem", "workflow-item.edit.title": "Edit workflowitem", @@ -5294,6 +5316,6 @@ "access-control-option-end-date-note": "Select the date until which the related access condition is applied", - "vocabulary-treeview.search.form.add": "Add", + "vocabulary-treeview.search.form.add": "Add" } diff --git a/src/assets/images/ror-icon.svg b/src/assets/images/ror-icon.svg new file mode 100644 index 00000000000..24735df519b --- /dev/null +++ b/src/assets/images/ror-icon.svg @@ -0,0 +1,16 @@ + + + + + + + + + + + From 56d33387b5d5345ed38c8a8078d3aa2228e855a6 Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Fri, 15 Dec 2023 10:05:03 +0100 Subject: [PATCH 2/8] [CST-12825] Fixes ROR metadata display --- .../item-pages/org-unit/org-unit.component.html | 16 ++++++++-------- .../metadata-values.component.html | 3 ++- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index 30bf7c40834..2fd9031c9b2 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -14,14 +14,6 @@ > - - @@ -40,6 +32,14 @@
+ + From d979ea5c9f4dc8ae8d0020398ea8262c4785ffbb Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Wed, 20 Dec 2023 11:47:33 +0100 Subject: [PATCH 3/8] [CST-12825] Removed unecessary escape --- .../item-pages/org-unit/org-unit.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index 2fd9031c9b2..92a13e96726 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -37,7 +37,7 @@ [img]="'./assets/images/ror-icon.svg'" [item]="object" [label]="'orgunit.page.ror'" - [urlRegex]="'(.*)ror\.org'" + [urlRegex]="'(.*)ror.org'" > Date: Wed, 20 Dec 2023 11:56:25 +0100 Subject: [PATCH 4/8] [CST-12825] Fixes comma in en.json5 --- src/assets/i18n/en.json5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 325dc9daab5..a3a6942909f 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -5316,6 +5316,6 @@ "access-control-option-end-date-note": "Select the date until which the related access condition is applied", - "vocabulary-treeview.search.form.add": "Add" + "vocabulary-treeview.search.form.add": "Add", } From 8f488220fb9734db754442d270813b09cf01fd7e Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Mon, 12 Feb 2024 16:56:06 +0100 Subject: [PATCH 5/8] [#2719][CST-12825] Adds i18n missing keys --- src/assets/i18n/en.json5 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index a3a6942909f..705e791bc69 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -2516,6 +2516,20 @@ "item.preview.oaire.fundingStream": "Funding Stream:", + "item.preview.oairecerif.identifier.url" : "URL", + + "item.preview.organization.address.addressCountry" : "Country", + + "item.preview.organization.foundingDate" : "Founding Date", + + "item.preview.organization.identifier.crossrefid" : "CrossRef ID", + + "item.preview.organization.identifier.isni" : "ISNI", + + "item.preview.organization.identifier.ror" : "ROR ID", + + "item.preview.organization.legalName" : "Legal Name", + "item.select.confirm": "Confirm selected", "item.select.empty": "No items to show", From 5a970775ae6b43142ee65c53a545824e0596a986 Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Tue, 13 Feb 2024 11:16:54 +0100 Subject: [PATCH 6/8] [#2719][CST-12825] Extracts new image-page-field component with css variable --- .../item-pages/org-unit/org-unit.component.html | 10 +++++++--- .../metadata-values/metadata-values.component.html | 7 +++++-- .../metadata-values/metadata-values.component.ts | 6 +++++- src/app/item-page/item-shared.module.ts | 2 ++ .../generic/generic-item-page-field.component.ts | 2 -- .../specific-field/item-page-field.component.html | 1 - .../specific-field/item-page-field.component.ts | 2 -- src/assets/i18n/en.json5 | 2 ++ src/styles/_custom_variables.scss | 3 +++ .../dspace/styles/_theme_css_variable_overrides.scss | 2 ++ 10 files changed, 26 insertions(+), 11 deletions(-) diff --git a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html index 92a13e96726..52df841d3b6 100644 --- a/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html +++ b/src/app/entity-groups/research-entities/item-pages/org-unit/org-unit.component.html @@ -32,14 +32,18 @@
- - + - + {{value}} diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts index 2ec31159bca..0d3cafacce1 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.ts +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.ts @@ -4,6 +4,7 @@ import { APP_CONFIG, AppConfig } from '../../../../config/app-config.interface'; import { BrowseDefinition } from '../../../core/shared/browse-definition.model'; import { hasValue } from '../../../shared/empty.util'; import { VALUE_LIST_BROWSE_DEFINITION } from '../../../core/shared/value-list-browse-definition.resource-type'; +import { ImageField } from '../../simple/field-components/specific-field/img/item-page-img-field.component'; /** * This component renders the configured 'values' into the ds-metadata-field-wrapper component. @@ -55,7 +56,10 @@ export class MetadataValuesComponent implements OnChanges { @Input() browseDefinition?: BrowseDefinition; - @Input() img?: string; + /** + * Optional {@code ImageField} reference that represents an image to be displayed inline. + */ + @Input() img?: ImageField; ngOnChanges(changes: SimpleChanges): void { this.renderMarkdown = !!this.appConfig.markdown.enabled && this.enableMarkdown; diff --git a/src/app/item-page/item-shared.module.ts b/src/app/item-page/item-shared.module.ts index 7a0ac436299..8b7243acde0 100644 --- a/src/app/item-page/item-shared.module.ts +++ b/src/app/item-page/item-shared.module.ts @@ -30,6 +30,7 @@ import { RelatedItemsComponent } from './simple/related-items/related-items-comp import { ThemedMetadataRepresentationListComponent } from './simple/metadata-representation-list/themed-metadata-representation-list.component'; +import { ItemPageImgFieldComponent } from './simple/field-components/specific-field/img/item-page-img-field.component'; const ENTRY_COMPONENTS = [ ItemVersionsDeleteModalComponent, @@ -46,6 +47,7 @@ const COMPONENTS = [ MetadataRepresentationListComponent, ThemedMetadataRepresentationListComponent, RelatedItemsComponent, + ItemPageImgFieldComponent, ]; @NgModule({ diff --git a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts index 99a68745c1c..53d2f6aa20d 100644 --- a/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/generic/generic-item-page-field.component.ts @@ -45,7 +45,5 @@ export class GenericItemPageFieldComponent extends ItemPageFieldComponent { */ @Input() urlRegex?: string; - @Input() img?: string; - } diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html index f45d4657a46..91d40b0ad70 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.html @@ -6,6 +6,5 @@ [enableMarkdown]="enableMarkdown" [urlRegex]="urlRegex" [browseDefinition]="browseDefinition|async" - [img]="img" >
diff --git a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts index 99e5ae7d36f..fc526dabcc5 100644 --- a/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/item-page-field.component.ts @@ -51,8 +51,6 @@ export class ItemPageFieldComponent { */ urlRegex?: string; - img?: string; - /** * 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.) diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index 705e791bc69..c9a74982554 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -2464,6 +2464,8 @@ "item.page.claim.tooltip": "Claim this item as profile", + "item.page.image.alt.ROR": "ROR logo", + "item.preview.dc.identifier.uri": "Identifier:", "item.preview.dc.contributor.author": "Authors:", diff --git a/src/styles/_custom_variables.scss b/src/styles/_custom_variables.scss index ad9a074e1b4..053c84362e8 100644 --- a/src/styles/_custom_variables.scss +++ b/src/styles/_custom_variables.scss @@ -101,4 +101,7 @@ --ds-dso-edit-lang-width: 90px; --ds-dso-edit-actions-width: 173px; --ds-dso-edit-virtual-tooltip-min-width: 300px; + + --ds-item-page-img-field-default-inline-height: 24px; + } diff --git a/src/themes/dspace/styles/_theme_css_variable_overrides.scss b/src/themes/dspace/styles/_theme_css_variable_overrides.scss index 516eff9f7e9..8512514a405 100644 --- a/src/themes/dspace/styles/_theme_css_variable_overrides.scss +++ b/src/themes/dspace/styles/_theme_css_variable_overrides.scss @@ -7,5 +7,7 @@ --ds-home-news-link-color: #{$green}; --ds-home-news-link-hover-color: #{darken($green, 15%)}; --ds-header-navbar-border-bottom-color: #{$green}; + --ds-item-page-img-field-default-inline-height: 24px; + --ds-item-page-img-field-ror-inline-height: var(--ds-item-page-img-field-default-inline-height); } From 26bfc5827891fea00d010afed26326cefc21474a Mon Sep 17 00:00:00 2001 From: Vincenzo Mecca Date: Tue, 13 Feb 2024 13:49:41 +0100 Subject: [PATCH 7/8] [#2719][CST-12825] Refactors item-page-img-field component --- .../metadata-values.component.html | 2 +- .../metadata-values.component.ts | 2 +- .../img/item-page-img-field.component.spec.ts | 84 +++++++++++++++++++ .../img/item-page-img-field.component.ts | 46 ++++++++++ .../item-page-field.component.html | 1 + .../item-page-field.component.ts | 24 ++++++ src/assets/i18n/en.json5 | 14 ++-- 7 files changed, 164 insertions(+), 9 deletions(-) create mode 100644 src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.spec.ts create mode 100644 src/app/item-page/simple/field-components/specific-field/img/item-page-img-field.component.ts diff --git a/src/app/item-page/field-components/metadata-values/metadata-values.component.html b/src/app/item-page/field-components/metadata-values/metadata-values.component.html index 44a3db43cd8..857e82e3fc5 100644 --- a/src/app/item-page/field-components/metadata-values/metadata-values.component.html +++ b/src/app/item-page/field-components/metadata-values/metadata-values.component.html @@ -25,7 +25,7 @@ - +