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

feat(resources): add onNavigate function property, remove targetLink property #185

Merged
merged 2 commits into from
Jan 29, 2025

Conversation

jusa3
Copy link
Collaborator

@jusa3 jusa3 commented Dec 13, 2024

BREAKING CHANGE

Before:
The target link requested an URL as a string for rendering static links. It concatenates targetLink with "ontologies/" + value + "/" to create the link's href. Only routes such as targetlink/ontologies/ontologyId/ can be used.

After:
This function renders a clickable link () that doesn't navigate to a URL directly. Instead, it executes a callback function onNavigate when clicked. If the onNavigate function is provided, it invokes this function with the ontologyId as an argument. Dynamic routes such as .../ontologies/ontologyId/value can be used.

Same behavior as the onNavigateToEntity and onNavigateToOntology functions already implemented for other widgets.

Example in a consuming app:

targetLink: "https://www.ebi.ac.uk/ols4/ontologies/"

vs.

onNavigate={(ontologyId) => {
          navigate(`/ontologies/${ontologyId}/tab/`);
        }}

…property

the targetLink property doesn't allow for navigation based on the ontologyId

Breaking change
@jusa3 jusa3 requested a review from rombaum December 13, 2024 14:36
@jusa3 jusa3 marked this pull request as ready for review December 13, 2024 14:36
@rombaum rombaum assigned rombaum and unassigned rombaum Jan 10, 2025
@jusa3 jusa3 requested review from rombaum and removed request for rombaum January 21, 2025 14:32
@jusa3 jusa3 merged commit ade1ac0 into main Jan 29, 2025
2 checks passed
@jusa3 jusa3 deleted the feat/onNavigate-for-resources branch January 29, 2025 09:07
@jusa3
Copy link
Collaborator Author

jusa3 commented Jan 29, 2025

🎉 This PR is included in version 3.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@jusa3 jusa3 added the released label Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants