From c3b78802b454536feb92d74b9f41291642532909 Mon Sep 17 00:00:00 2001 From: Jesiel Viana Date: Thu, 16 Oct 2025 16:45:20 -0300 Subject: [PATCH 1/4] add bibliography component to item page --- src/app/core/data-services-map.ts | 2 + .../core/data/bibliography-data.service.ts | 37 ++++++ src/app/core/provide-core.ts | 2 + .../bibliography/bibliography-data.model.ts | 42 +++++++ .../shared/bibliography/bibliography.model.ts | 9 ++ .../bibliography.resource-type.ts | 9 ++ src/app/core/shared/item.model.ts | 5 +- src/app/core/shared/listable.module.ts | 2 + .../item-page-bibliography.component.html | 53 ++++++++ .../item-page-bibliography.component.spec.ts | 116 ++++++++++++++++++ .../item-page-bibliography.component.ts | 69 +++++++++++ .../publication/publication.component.html | 1 + .../publication/publication.component.ts | 2 + .../untyped-item/untyped-item.component.html | 1 + .../untyped-item/untyped-item.component.ts | 4 +- src/assets/i18n/en.json5 | 22 ++++ src/assets/i18n/es.json5 | 20 +++ src/assets/i18n/pt-BR.json5 | 21 ++++ .../publication/publication.component.ts | 2 + .../untyped-item/untyped-item.component.ts | 2 + 20 files changed, 418 insertions(+), 3 deletions(-) create mode 100644 src/app/core/data/bibliography-data.service.ts create mode 100644 src/app/core/shared/bibliography/bibliography-data.model.ts create mode 100644 src/app/core/shared/bibliography/bibliography.model.ts create mode 100644 src/app/core/shared/bibliography/bibliography.resource-type.ts create mode 100644 src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.html create mode 100644 src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts create mode 100644 src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts diff --git a/src/app/core/data-services-map.ts b/src/app/core/data-services-map.ts index c9ebbc5ffc3..7215c6a5271 100644 --- a/src/app/core/data-services-map.ts +++ b/src/app/core/data-services-map.ts @@ -68,6 +68,7 @@ import { SUPERVISION_ORDER } from './supervision-order/models/supervision-order. import { CLAIMED_TASK } from './tasks/models/claimed-task-object.resource-type'; import { POOL_TASK } from './tasks/models/pool-task-object.resource-type'; import { WORKFLOW_ACTION } from './tasks/models/workflow-action-object.resource-type'; +import { BIBLIOGRAPHY } from './shared/bibliography/bibliography.resource-type'; export const LAZY_DATA_SERVICES: LazyDataServicesMap = new Map([ [AUTHORIZATION.value, () => import('./data/feature-authorization/authorization-data.service').then(m => m.AuthorizationDataService)], @@ -88,6 +89,7 @@ export const LAZY_DATA_SERVICES: LazyDataServicesMap = new Map([ [SUBSCRIPTION.value, () => import('../shared/subscriptions/subscriptions-data.service').then(m => m.SubscriptionsDataService)], [COMMUNITY.value, () => import('./data/community-data.service').then(m => m.CommunityDataService)], [VOCABULARY.value, () => import('./submission/vocabularies/vocabulary.data.service').then(m => m.VocabularyDataService)], + [BIBLIOGRAPHY.value, () => import('./data/bibliography-data.service').then(m => m.ItemBibliographyService)], [BUNDLE.value, () => import('./data/bundle-data.service').then(m => m.BundleDataService)], [CONFIG_PROPERTY.value, () => import('./data/configuration-data.service').then(m => m.ConfigurationDataService)], [POOL_TASK.value, () => import('./tasks/pool-task-data.service').then(m => m.PoolTaskDataService)], diff --git a/src/app/core/data/bibliography-data.service.ts b/src/app/core/data/bibliography-data.service.ts new file mode 100644 index 00000000000..ae9fc3fc82e --- /dev/null +++ b/src/app/core/data/bibliography-data.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core'; +import { + map, + Observable, +} from 'rxjs'; + +import { RemoteDataBuildService } from '../cache/builders/remote-data-build.service'; +import { ObjectCacheService } from '../cache/object-cache.service'; +import { BibliographyData } from '../shared/bibliography/bibliography-data.model'; +import { HALEndpointService } from '../shared/hal-endpoint.service'; +import { Item } from '../shared/item.model'; +import { getFirstCompletedRemoteData } from '../shared/operators'; +import { BaseDataService } from './base/base-data.service'; +import { RequestService } from './request.service'; + + + + +@Injectable({ providedIn: 'root' }) +export class ItemBibliographyService extends BaseDataService { + + constructor( + protected requestService: RequestService, + protected rdbService: RemoteDataBuildService, + protected objectCache: ObjectCacheService, + protected halService: HALEndpointService, + ) { + super('bibliographies', requestService, rdbService, objectCache, halService); + } + + getBibliographies(item: Item): Observable { + return this.findByHref(item._links.bibliography.href).pipe( + getFirstCompletedRemoteData(), + map(res => res.payload), + ); + } +} diff --git a/src/app/core/provide-core.ts b/src/app/core/provide-core.ts index a3f88788f54..104c7055b58 100644 --- a/src/app/core/provide-core.ts +++ b/src/app/core/provide-core.ts @@ -58,6 +58,7 @@ import { OrcidQueue } from './orcid/model/orcid-queue.model'; import { ResearcherProfile } from './profile/model/researcher-profile.model'; import { ResourcePolicy } from './resource-policy/models/resource-policy.model'; import { Authorization } from './shared/authorization.model'; +import { BibliographyData } from './shared/bibliography/bibliography-data.model'; import { Bitstream } from './shared/bitstream.model'; import { BitstreamFormat } from './shared/bitstream-format.model'; import { BrowseDefinition } from './shared/browse-definition.model'; @@ -131,6 +132,7 @@ export const models = [ Root, DSpaceObject, + BibliographyData, Bundle, Bitstream, BitstreamFormat, diff --git a/src/app/core/shared/bibliography/bibliography-data.model.ts b/src/app/core/shared/bibliography/bibliography-data.model.ts new file mode 100644 index 00000000000..a06f31ecec9 --- /dev/null +++ b/src/app/core/shared/bibliography/bibliography-data.model.ts @@ -0,0 +1,42 @@ +import { + autoserialize, + deserialize, +} from 'cerialize'; +import { typedObject } from 'src/app/core/cache/builders/build-decorators'; +import { DSpaceObject } from 'src/app/core/shared/dspace-object.model'; +import { HALLink } from 'src/app/core/shared/hal-link.model'; +import { ResourceType } from 'src/app/core/shared/resource-type'; +import { excludeFromEquals } from 'src/app/core/utilities/equals.decorators'; + +import { Bibliography } from './bibliography.model'; +import { BIBLIOGRAPHY } from './bibliography.resource-type'; + +/** + * Class representing a DSpace Version + */ +@typedObject +export class BibliographyData extends DSpaceObject { + static type = BIBLIOGRAPHY; + + /** + * The type for this IdentifierData + */ + @excludeFromEquals + @autoserialize + type: ResourceType; + + /** + * The + */ + @autoserialize + bibliographies: Bibliography[]; + + /** + * The {@link HALLink}s for this IdentifierData + */ + @deserialize + _links: { + self: HALLink; + }; + +} diff --git a/src/app/core/shared/bibliography/bibliography.model.ts b/src/app/core/shared/bibliography/bibliography.model.ts new file mode 100644 index 00000000000..752623e01fd --- /dev/null +++ b/src/app/core/shared/bibliography/bibliography.model.ts @@ -0,0 +1,9 @@ +import { autoserialize } from 'cerialize'; + +export class Bibliography { + @autoserialize + style: string; + + @autoserialize + value: string; +} diff --git a/src/app/core/shared/bibliography/bibliography.resource-type.ts b/src/app/core/shared/bibliography/bibliography.resource-type.ts new file mode 100644 index 00000000000..c5c2018c01c --- /dev/null +++ b/src/app/core/shared/bibliography/bibliography.resource-type.ts @@ -0,0 +1,9 @@ +import { ResourceType } from 'src/app/core/shared/resource-type'; + +/** + * The resource type for Bibliography + * + * Needs to be in a separate file to prevent circular + * dependencies in webpack. + */ +export const BIBLIOGRAPHY = new ResourceType('bibliography'); diff --git a/src/app/core/shared/item.model.ts b/src/app/core/shared/item.model.ts index d6066f098c0..2240e3b9044 100644 --- a/src/app/core/shared/item.model.ts +++ b/src/app/core/shared/item.model.ts @@ -82,6 +82,7 @@ export class Item extends DSpaceObject implements ChildHALResource, HandleObject mappedCollections: HALLink; relationships: HALLink; bundles: HALLink; + bibliography: HALLink; owningCollection: HALLink; templateItemOf: HALLink; version: HALLink; @@ -130,8 +131,8 @@ export class Item extends DSpaceObject implements ChildHALResource, HandleObject * The access status for this Item * Will be undefined unless the access status {@link HALLink} has been resolved. */ - @link(ACCESS_STATUS, false, 'accessStatus') - accessStatus?: Observable>; + @link(ACCESS_STATUS, false, 'accessStatus') + accessStatus?: Observable>; /** * The identifier data for this Item diff --git a/src/app/core/shared/listable.module.ts b/src/app/core/shared/listable.module.ts index 295e84905b9..6853d9e9047 100644 --- a/src/app/core/shared/listable.module.ts +++ b/src/app/core/shared/listable.module.ts @@ -3,6 +3,7 @@ import { NgModule } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { RouterModule } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ItemPageBibliographyComponent } from 'src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component'; import { CollectionAdminSearchResultGridElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/collection-search-result/collection-admin-search-result-grid-element.component'; import { CommunityAdminSearchResultGridElementComponent } from '../../admin/admin-search-page/admin-search-results/admin-search-result-grid-element/community-search-result/community-admin-search-result-grid-element.component'; @@ -219,6 +220,7 @@ const ENTRY_COMPONENTS = [ TruncatableComponent, TruncatablePartComponent, ThumbnailComponent, + ItemPageBibliographyComponent, BadgesComponent, ThemedBadgesComponent, ItemDetailPreviewComponent, diff --git a/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.html b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.html new file mode 100644 index 00000000000..0303431a399 --- /dev/null +++ b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.html @@ -0,0 +1,53 @@ + + + {{ "item.cite.open-modal" | translate }} + + + + + + + + + diff --git a/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts new file mode 100644 index 00000000000..aee3d8e5087 --- /dev/null +++ b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts @@ -0,0 +1,116 @@ +import { NO_ERRORS_SCHEMA } from '@angular/core'; +import { + ComponentFixture, + fakeAsync, + TestBed, + tick, + waitForAsync, +} from '@angular/core/testing'; +import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { + TranslateLoader, + TranslateModule, +} from '@ngx-translate/core'; +import { + delay, + of, + throwError, +} from 'rxjs'; + +import { ItemBibliographyService } from '../../../../../core/data/bibliography-data.service'; +import { Bibliography } from '../../../../../core/shared/bibliography/bibliography.model'; +import { BibliographyData } from '../../../../../core/shared/bibliography/bibliography-data.model'; +import { Item } from '../../../../../core/shared/item.model'; +import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock'; +import { ItemPageBibliographyComponent } from './item-page-bibliography.component'; + +describe('ItemPageBibliographyComponent', () => { + let component: ItemPageBibliographyComponent; + let fixture: ComponentFixture; + let mockService: jasmine.SpyObj; + let mockModalService: jasmine.SpyObj; + let testItem: Item; + + beforeEach(waitForAsync(() => { + mockService = jasmine.createSpyObj('ItemBibliographyService', ['getBibliographies']); + mockModalService = jasmine.createSpyObj('NgbModal', ['open']); + + void TestBed.configureTestingModule({ + imports: [ + ItemPageBibliographyComponent, + TranslateModule.forRoot({ + loader: { provide: TranslateLoader, useClass: TranslateLoaderMock }, + }), + ], + providers: [ + { provide: ItemBibliographyService, useValue: mockService }, + { provide: NgbModal, useValue: mockModalService }, + ], + schemas: [NO_ERRORS_SCHEMA], + }) + .overrideComponent(ItemPageBibliographyComponent, { + set: { providers: [{ provide: NgbModal, useValue: mockModalService }] }, + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ItemPageBibliographyComponent); + component = fixture.componentInstance; + testItem = new Item(); + component.item = testItem; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); + + it('should load bibliographies and open modal', fakeAsync(() => { + const mockBibliographies: Bibliography[] = [ + { style: 'bibtex', value: '@article{test}' }, + { style: 'apa', value: 'Author, 2025' }, + ]; + const mockData = { bibliographies: mockBibliographies }; + mockService.getBibliographies.and.returnValue(of(mockData as BibliographyData).pipe(delay(0))); + const modalContent = {}; + + component.openModal(modalContent); + expect(component.loading).toBeTrue(); + expect(component.error).toBeFalse(); + + tick(); + expect(component.bibliographies).toEqual(mockBibliographies); + expect(component.loading).toBeFalse(); + expect(mockModalService.open).toHaveBeenCalledWith(modalContent, { size: 'lg' }); + })); + + it('should handle error when loading bibliographies', fakeAsync(() => { + const mockError = new Error('Failed'); + mockService.getBibliographies.and.returnValue(throwError(() => mockError)); + const modalContent = {}; + + component.openModal(modalContent); + tick(); + + expect(component.loading).toBeFalse(); + expect(component.error).toBeTrue(); + expect(mockModalService.open).not.toHaveBeenCalled(); + })); + + it('should copy text to clipboard', () => { + const text = 'Some text to copy'; + spyOn(navigator.clipboard, 'writeText').and.returnValue(Promise.resolve()); + + component.copyToClipboard(text); + expect(navigator.clipboard.writeText).toHaveBeenCalledWith(text); + }); + + it('should copy HTML text to clipboard as plain text', () => { + const htmlText = '

HTML text

'; + spyOn(navigator.clipboard, 'writeText').and.returnValue(Promise.resolve()); + + component.copyToClipboard(htmlText); + expect(navigator.clipboard.writeText).toHaveBeenCalledWith('HTML text'); + }); +}); diff --git a/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts new file mode 100644 index 00000000000..4441cbad184 --- /dev/null +++ b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts @@ -0,0 +1,69 @@ +import { + Component, + Input, +} from '@angular/core'; +import { + NgbModal, + NgbModalModule, +} from '@ng-bootstrap/ng-bootstrap'; +import { TranslateModule } from '@ngx-translate/core'; +import { Item } from '../../../../../core/shared/item.model'; + +import { Bibliography } from '../../../../../core/shared/bibliography/bibliography.model'; +import { BibliographyData } from '../../../../../core/shared/bibliography/bibliography-data.model'; +import { ItemBibliographyService } from '../../../../../core/data/bibliography-data.service'; + + +@Component({ + selector: 'ds-item-page-bibliography', + templateUrl: './item-page-bibliography.component.html', + standalone: true, + imports: [ + NgbModalModule, + TranslateModule, + ], +}) +export class ItemPageBibliographyComponent { + @Input() item: Item; + bibliographies: Bibliography[] = []; + loading = false; + error = false; + + constructor( + private bibliographyService: ItemBibliographyService, + private modalService: NgbModal, + ) { + } + + openModal(content: any) { + this.loading = true; + this.error = false; + + this.bibliographyService.getBibliographies(this.item).subscribe({ + next: (bibliographyData: BibliographyData) => { + this.bibliographies = bibliographyData?.bibliographies || []; + this.loading = false; + this.modalService.open(content, { size: 'lg' }); + }, + error: (err) => { + this.loading = false; + this.error = true; + console.error(err); + } + }); + } + + copyToClipboard(value: string) { + const tempElement = document.createElement('div'); + tempElement.innerHTML = value; + const plainText = tempElement.textContent || tempElement.innerText || ''; + + navigator.clipboard.writeText(plainText).then( + () => { + }, + (err) => { + console.error('Could not copy text: ', err); + }, + ); + } +} diff --git a/src/app/item-page/simple/item-types/publication/publication.component.html b/src/app/item-page/simple/item-types/publication/publication.component.html index a294cc025bc..678c19645d4 100644 --- a/src/app/item-page/simple/item-types/publication/publication.component.html +++ b/src/app/item-page/simple/item-types/publication/publication.component.html @@ -53,6 +53,7 @@ [fields]="['dc.publisher']" [label]="'publication.page.publisher'"> +
+
diff --git a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts index a5b7f396ce4..4d08a62e56d 100644 --- a/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts +++ b/src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -18,6 +18,7 @@ import { ThemedMediaViewerComponent } from '../../../media-viewer/themed-media-v import { MiradorViewerComponent } from '../../../mirador-viewer/mirador-viewer.component'; import { ThemedFileSectionComponent } from '../../field-components/file-section/themed-file-section.component'; import { ItemPageAbstractFieldComponent } from '../../field-components/specific-field/abstract/item-page-abstract-field.component'; +import { ItemPageBibliographyComponent } from '../../field-components/specific-field/bibliography/item-page-bibliography.component'; import { ItemPageCcLicenseFieldComponent } from '../../field-components/specific-field/cc-license/item-page-cc-license-field.component'; import { ItemPageDateFieldComponent } from '../../field-components/specific-field/date/item-page-date-field.component'; import { GenericItemPageFieldComponent } from '../../field-components/specific-field/generic/generic-item-page-field.component'; @@ -45,6 +46,7 @@ import { ItemComponent } from '../shared/item.component'; GenericItemPageFieldComponent, GeospatialItemPageFieldComponent, ItemPageAbstractFieldComponent, + ItemPageBibliographyComponent, ItemPageCcLicenseFieldComponent, ItemPageDateFieldComponent, ItemPageUriFieldComponent, @@ -60,4 +62,4 @@ import { ItemComponent } from '../shared/item.component'; TranslateModule, ], }) -export class UntypedItemComponent extends ItemComponent {} +export class UntypedItemComponent extends ItemComponent { } diff --git a/src/assets/i18n/en.json5 b/src/assets/i18n/en.json5 index c0b620d24d7..49a7ee5d7e1 100644 --- a/src/assets/i18n/en.json5 +++ b/src/assets/i18n/en.json5 @@ -7213,4 +7213,26 @@ "item.preview.organization.address.addressLocality": "City", "item.preview.organization.alternateName": "Alternative name", + + "item.cite.open-modal": "Cite", + + "item.cite.modal.title": "Cite", + + "item.cite.modal.close": "Close", + + "item.cite.modal.copy": "Copy", + + // TODO New key - Add a translation + "item.cite.modal.error": "Error", + + "modern-language-association": "MLA", + + "apa": "APA", + + "vancouver": "Vancouver", + + "bibtex": "BibTeX", + + "instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt": "ABNT", + } diff --git a/src/assets/i18n/es.json5 b/src/assets/i18n/es.json5 index 7f1b2f4d6f6..29ca8cf2004 100644 --- a/src/assets/i18n/es.json5 +++ b/src/assets/i18n/es.json5 @@ -10975,5 +10975,25 @@ // TODO New key - Add a translation "file-download-link.request-copy": "Request a copy of ", + "item.cite.open-modal": "Cita", + + "item.cite.modal.title": "Cita", + + "item.cite.modal.close": "Cerrar", + + "item.cite.modal.copy": "Copiar", + + // TODO New key - Add a translation + "item.cite.modal.error": "Error", + + "modern-language-association": "MLA", + + "apa": "APA", + + "vancouver": "Vancouver", + + "bibtex": "BibTeX", + + "instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt": "ABNT", } diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index 7d35b5ccfe8..159c1454a6a 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -11144,4 +11144,25 @@ "item.preview.organization.address.addressLocality": "Cidade", "item.preview.organization.alternateName": "Nome alternativo", + + "item.cite.open-modal": "Citar", + + "item.cite.modal.title": "Citar", + + "item.cite.modal.close": "Fechar", + + "item.cite.modal.copy": "Copiar", + + // TODO New key - Add a translation + "item.cite.modal.error": "Erro", + + "modern-language-association": "MLA", + + "apa": "APA", + + "vancouver": "Vancouver", + + "bibtex": "BibTeX", + + "instituto-brasileiro-de-informacao-em-ciencia-e-tecnologia-abnt": "ABNT", } diff --git a/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts b/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts index 02d00262618..6df6fcf772d 100644 --- a/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts +++ b/src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts @@ -5,6 +5,7 @@ import { } from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ItemPageBibliographyComponent } from 'src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component'; import { Context } from '../../../../../../../app/core/shared/context.model'; import { ViewMode } from '../../../../../../../app/core/shared/view-mode.model'; @@ -43,6 +44,7 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the GenericItemPageFieldComponent, GeospatialItemPageFieldComponent, ItemPageAbstractFieldComponent, + ItemPageBibliographyComponent, ItemPageDateFieldComponent, ItemPageUriFieldComponent, MetadataFieldWrapperComponent, diff --git a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts index 381cdf7b2f1..c086bf73cec 100644 --- a/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts +++ b/src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts @@ -5,6 +5,7 @@ import { } from '@angular/core'; import { RouterLink } from '@angular/router'; import { TranslateModule } from '@ngx-translate/core'; +import { ItemPageBibliographyComponent } from 'src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component'; import { Context } from '../../../../../../../app/core/shared/context.model'; import { Item } from '../../../../../../../app/core/shared/item.model'; @@ -47,6 +48,7 @@ import { ThemedThumbnailComponent } from '../../../../../../../app/thumbnail/the GenericItemPageFieldComponent, GeospatialItemPageFieldComponent, ItemPageAbstractFieldComponent, + ItemPageBibliographyComponent, ItemPageCcLicenseFieldComponent, ItemPageDateFieldComponent, ItemPageUriFieldComponent, From 567ac241e7d26c7ad13392d70a4af46d06712e45 Mon Sep 17 00:00:00 2001 From: Jesiel Viana Date: Fri, 17 Oct 2025 09:48:16 -0300 Subject: [PATCH 2/4] fix lint --- .../bibliography/item-page-bibliography.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts index 4441cbad184..e910c480574 100644 --- a/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts +++ b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.ts @@ -7,11 +7,11 @@ import { NgbModalModule, } from '@ng-bootstrap/ng-bootstrap'; import { TranslateModule } from '@ngx-translate/core'; -import { Item } from '../../../../../core/shared/item.model'; +import { ItemBibliographyService } from '../../../../../core/data/bibliography-data.service'; import { Bibliography } from '../../../../../core/shared/bibliography/bibliography.model'; import { BibliographyData } from '../../../../../core/shared/bibliography/bibliography-data.model'; -import { ItemBibliographyService } from '../../../../../core/data/bibliography-data.service'; +import { Item } from '../../../../../core/shared/item.model'; @Component({ @@ -45,11 +45,11 @@ export class ItemPageBibliographyComponent { this.loading = false; this.modalService.open(content, { size: 'lg' }); }, - error: (err) => { + error: (err: unknown) => { this.loading = false; this.error = true; console.error(err); - } + }, }); } From 9aba56af949b569addd1de2935088c3bd195db08 Mon Sep 17 00:00:00 2001 From: Jesiel Viana Date: Fri, 17 Oct 2025 09:59:01 -0300 Subject: [PATCH 3/4] fix lint --- src/app/core/data-services-map.ts | 2 +- src/assets/i18n/pt-BR.json5 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/core/data-services-map.ts b/src/app/core/data-services-map.ts index 7215c6a5271..30a2c594900 100644 --- a/src/app/core/data-services-map.ts +++ b/src/app/core/data-services-map.ts @@ -38,6 +38,7 @@ import { ORCID_QUEUE } from './orcid/model/orcid-queue.resource-type'; import { RESEARCHER_PROFILE } from './profile/model/researcher-profile.resource-type'; import { RESOURCE_POLICY } from './resource-policy/models/resource-policy.resource-type'; import { AUTHORIZATION } from './shared/authorization.resource-type'; +import { BIBLIOGRAPHY } from './shared/bibliography/bibliography.resource-type'; import { BITSTREAM } from './shared/bitstream.resource-type'; import { BITSTREAM_FORMAT } from './shared/bitstream-format.resource-type'; import { BROWSE_DEFINITION } from './shared/browse-definition.resource-type'; @@ -68,7 +69,6 @@ import { SUPERVISION_ORDER } from './supervision-order/models/supervision-order. import { CLAIMED_TASK } from './tasks/models/claimed-task-object.resource-type'; import { POOL_TASK } from './tasks/models/pool-task-object.resource-type'; import { WORKFLOW_ACTION } from './tasks/models/workflow-action-object.resource-type'; -import { BIBLIOGRAPHY } from './shared/bibliography/bibliography.resource-type'; export const LAZY_DATA_SERVICES: LazyDataServicesMap = new Map([ [AUTHORIZATION.value, () => import('./data/feature-authorization/authorization-data.service').then(m => m.AuthorizationDataService)], diff --git a/src/assets/i18n/pt-BR.json5 b/src/assets/i18n/pt-BR.json5 index 159c1454a6a..dd21ca16320 100644 --- a/src/assets/i18n/pt-BR.json5 +++ b/src/assets/i18n/pt-BR.json5 @@ -11145,7 +11145,7 @@ "item.preview.organization.alternateName": "Nome alternativo", - "item.cite.open-modal": "Citar", + "item.cite.open-modal": "Citar", "item.cite.modal.title": "Citar", From 0e05b217e58db59181481f2b2e83a04ac80ac8d2 Mon Sep 17 00:00:00 2001 From: Jesiel Viana Date: Tue, 11 Nov 2025 10:07:11 -0300 Subject: [PATCH 4/4] fix import --- .../bibliography/item-page-bibliography.component.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts index aee3d8e5087..0eefe7cf21a 100644 --- a/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts +++ b/src/app/item-page/simple/field-components/specific-field/bibliography/item-page-bibliography.component.spec.ts @@ -6,6 +6,7 @@ import { tick, waitForAsync, } from '@angular/core/testing'; +import { TranslateLoaderMock } from '@dspace/core/testing/translate-loader.mock'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; import { TranslateLoader, @@ -21,7 +22,6 @@ import { ItemBibliographyService } from '../../../../../core/data/bibliography-d import { Bibliography } from '../../../../../core/shared/bibliography/bibliography.model'; import { BibliographyData } from '../../../../../core/shared/bibliography/bibliography-data.model'; import { Item } from '../../../../../core/shared/item.model'; -import { TranslateLoaderMock } from '../../../../../shared/testing/translate-loader.mock'; import { ItemPageBibliographyComponent } from './item-page-bibliography.component'; describe('ItemPageBibliographyComponent', () => {