Skip to content

Add component for source nanopub link#356

Open
ashleycaselli wants to merge 2 commits intomasterfrom
chore/source-np-component
Open

Add component for source nanopub link#356
ashleycaselli wants to merge 2 commits intomasterfrom
chore/source-np-component

Conversation

@ashleycaselli
Copy link
Member

@ashleycaselli ashleycaselli commented Feb 5, 2026

This pull request introduces a new reusable SourceNanopub component for displaying links to source nanopublications, and updates the codebase to use this component throughout the UI. It also standardizes the way nanopublication links are rendered in both the Java and HTML files, replacing inline link logic with the new component for improved maintainability and consistency.

Componentization and UI consistency:

  • Added a new SourceNanopub component (SourceNanopub.java and SourceNanopub.html) to encapsulate the logic for displaying a link to a source nanopublication, supporting additional CSS classes for styling.
  • Updated all relevant HTML templates to replace direct <a> tags for nanopublication links with <wicket:container wicket:id="np">[np]</wicket:container>, delegating rendering to the new SourceNanopub component.

Java code refactoring:

  • Replaced direct instantiations of BookmarkablePageLink for nanopublication links in multiple components and pages (ItemListElement, QueryResultList, QueryResultTable, QueryResultPlainParagraph, QueryResultNanopubSet, MaintainedResourcePage, ResourcePartPage, SpacePage) with the new SourceNanopub component, ensuring a single point of maintenance for nanopublication link behavior and styling.

Type and API improvements:

  • Changed the return type of ViewDisplay.getNanopubId() from String to IRI to better reflect the underlying data and improve type safety.

Imports and minor cleanups:

  • Cleaned up and reorganized imports in several files to remove unused imports and ensure consistency after refactoring.

These changes make the codebase more maintainable, ensure a consistent user interface for nanopublication links, and improve type safety for nanopublication identifiers.

@ashleycaselli ashleycaselli requested a review from tkuhn February 5, 2026 07:20
@tkuhn
Copy link
Contributor

tkuhn commented Feb 5, 2026

I am now getting a strange UI situation with this branch for my own profile page (the horizontal line extending too much):

image

Not sure the error is in this code, but it currently shows fine in the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants