-
Notifications
You must be signed in to change notification settings - Fork 74
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
allow downstream apps to override docs link #2416
Conversation
@@ -1,7 +1,7 @@ | |||
<template> | |||
<j-tray-plugin | |||
description="2D to 1D spectral extraction." | |||
:link="'https://jdaviz.readthedocs.io/en/'+vdocs+'/'+config+'/plugins.html#spectral-extraction'" | |||
:link="docs_link || 'https://jdaviz.readthedocs.io/en/'+vdocs+'/'+config+'/plugins.html#spectral-extraction'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here in Jdaviz, can we just define the URL in the mixin? Then we don't need all the ||
operations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about that, the downside is in order to have access to vdocs
/config
it would need to be in the init, after calling super (I think), which might be a bit more subtle to remember to do for future plugins that this... but I was on the fence, so if you think that would be cleaner, I can easily switch to that instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Maybe this is okay for now then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revisiting this - one advantage to moving the docs link to the plugin class would be that we could programmatically open a new tab from the API... plugin.open_docs()
, or similar 🤔 🐱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
programmatically open a new tab
Oh, dear. Astronomers have enough tabs open as it is. Do we really want to encourage that even more?
Codecov ReportPatch coverage is
📢 Thoughts on this report? Let us know!. |
Description
Similar to #2392, this pull request allows downstream apps which inherit plugins defined in jdaviz to override the "Learn More" link to point to their own docs. If not provided in the plugin class, then the value hardcoded in the .vue file in jdaviz will still apply. This should not affect users of jdaviz in any way.
See spacetelescope/lcviz#43 for how this would be used in lcviz.
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.