JCU/Port CitacePRO citation widget from customer/mendelu#1356
Conversation
Adds the CitacePRO citation widget to the item page for JCU, mirroring the customer/mendelu implementation. - New standalone ItemPageCitationFieldComponent (ds-item-page-citation-field): reads citace.pro.url / citace.pro.university / citace.pro.allowed via ConfigurationDataService and embeds the CitacePRO iframe (<url>:<university>:<handle>) with a disclaimer, shown only when citace.pro.allowed = true. - Wired into publication + untyped-item item views (base app and themes/custom). - Added item.page.citace-pro.disclaimer to en/cs i18n. Ported from dataquest-dev/dspace-angular #1161 (initial component + wiring), #1166 (always-render fix), #1167 (only the citation spec tweak, not the unrelated bundled UI files), and #1264 (disclaimer text + i18n). Requires the backend citace.pro.* config exposed via REST (dataquest-dev/DSpace feature/jcu-citacepro). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The "These citations were generated by software ... ČSN ISO 690" disclaimer shown under the CitacePRO iframe is mendelu-specific and not wanted for JCU. - Remove the <p> disclaimer from item-page-citation.component.html - Drop the now-unused TranslateModule import from the component - Remove item.page.citace-pro.disclaimer from en.json5 and cs.json5 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Ports the CitacePRO citation iframe widget into the JCU frontend item pages, exposing it as a reusable field component and wiring it into both base and custom-theme publication/untyped item views.
Changes:
- Added
ds-item-page-citation-fieldstandalone field component that builds an iframe URL from REST config (citace.pro.*) and a handle. - Inserted the new field into simple item page templates for
PublicationandUntypedItem. - Registered the component in the corresponding base app and
themes/customitem-type components’imports.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/app/item-page/simple/field-components/specific-field/citation/item-page-citation.component.ts | New CitacePRO field component (config fetch + URL composition). |
| src/app/item-page/simple/field-components/specific-field/citation/item-page-citation.component.html | Renders gated iframe when allowed + URL is available. |
| src/app/item-page/simple/field-components/specific-field/citation/item-page-citation.component.scss | Styling file added for the new component. |
| src/app/item-page/simple/field-components/specific-field/citation/item-page-citation.component.spec.ts | Unit test for the new component. |
| src/app/item-page/simple/item-types/publication/publication.component.ts | Imports/registers the new citation field component. |
| src/app/item-page/simple/item-types/publication/publication.component.html | Adds the citation field into the publication view layout. |
| src/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts | Imports/registers the new citation field component. |
| src/app/item-page/simple/item-types/untyped-item/untyped-item.component.html | Adds the citation field into the untyped-item view layout. |
| src/themes/custom/app/item-page/simple/item-types/publication/publication.component.ts | Adds the citation field to custom-theme publication component imports. |
| src/themes/custom/app/item-page/simple/item-types/untyped-item/untyped-item.component.ts | Adds the citation field to custom-theme untyped-item component imports. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address the failing CI and the Copilot review on PR #1356: - publication.component.spec.ts: provide ConfigurationDataServiceStub (same pattern as the passing untyped-item spec). PublicationComponent now renders ds-item-page-citation-field, whose ngOnInit called the real ConfigurationDataService against the spec's bare HALEndpointService stub (this.halService.getEndpoint is not a function), failing all 12 PublicationComponent tests on CI. - item-page-citation.component.ts: allow only http(s) base URLs before bypassSecurityTrustResourceUrl, so a bad citace.pro.url config value (e.g. javascript:) can never be trusted as iframe src. - item-page-citation.component.html: add an accessibility title to the iframe, and shrink the wrapper spacing mb-5 pb-4 -> mb-2. The large spacing was inherited from mendelu where a disclaimer paragraph sat under the iframe; JCU dropped the disclaimer, which left ~72px of empty space between the citation and the abstract. Iframe untouched. - item-page-citation.component.spec.ts: name-based config mock and behavior assertions (allowed=true -> URL composed + iframe rendered with title; allowed=false -> hidden; non-http(s)/missing config -> null), replacing the existence-only checks. - item-page-citation.component.scss: removed; it contained only a comment and was never referenced by the component (styleUrls). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

What is CitacePRO?
CitacePRO is a Czech citation-generation service. On an item page it renders a citation for the item (composed by CitacePRO from the metadata it harvests via OAI‑PMH from the institution's public repository) together with a "Uložit do Citace PRO" button, inside an embedded
<iframe>.This PR ports the CitacePRO item‑page widget from
customer/mendelutocustomer/jcu, adapted for JCU.What was ported
ItemPageCitationFieldComponent(ds-item-page-citation-field) undersrc/app/item-page/simple/field-components/specific-field/citation/(.ts,.html,.scss,.spec.ts).citace.pro.url,citace.pro.university,citace.pro.allowedviaConfigurationDataService(REST/config/properties/*).<url>:<university>:<handle>and shows the iframe only whencitace.pro.allowed = true.customtheme:src/app/item-page/simple/item-types/publication/publication.component.{ts,html}src/app/item-page/simple/item-types/untyped-item/untyped-item.component.{ts,html}src/themes/custom/app/.../publication/publication.component.tsand.../untyped-item/untyped-item.component.ts(they reuse the base HTML, so they only need the component registered inimports).JCU adaptations vs. mendelu
TranslateModuleis not imported by the component).standalone: trueon the component (JCU'sdspace-angular-ts/no-default-standalone-valuelint rule flags it; theimportsarray keeps the component standalone).Source (customer/mendelu)
Branch: https://github.com/dataquest-dev/dspace-angular/tree/customer/mendelu
BehaviorSubject+getFirstCompletedRemoteData)item-page-citation.component.spec.tschange was taken; the other 17 files in that PR are unrelated UI fixes and were left out.Also not ported (unrelated refactor bundled into #1161): the
contact-page.component.tsAsyncPipe → CommonModuleswap.Backend dependency
Requires the CitacePRO config exposed over REST — see the companion backend PR (dataquest-dev/DSpace, branch
feature/jcu-citacepro). Without it the widget stays hidden (fails closed).citace.pro.universityis currently a placeholder on the backend (dspace.jcu.cz). CitacePRO composes the citation from what it has harvested under this identifier from JCU's production repository, so live citation content will only appear once the real JCU CitacePRO-registered host is set and JCU's repo is harvested by CitacePRO. The DSpace-side integration (widget, URL composition, allowed-flag gating) is complete and works regardless.Verification
ng serve) recompiled cleanly —✔ Compiled successfully, no new warnings for the ported files.http://localhost:4000on item pages —ds-item-page-citation-fieldpresent, iframesrc="https://www.citacepro.com/api/dspace/citace/oai:dspace.jcu.cz:<handle>", no disclaimer paragraph. Console shows no citace-related errors.eslintin the FE container, on the changed files): passes.