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

allow downstream apps to override docs link #2416

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

kecnry
Copy link
Member

@kecnry kecnry commented Sep 1, 2023

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

  • Is a change log needed? If yes, is it added to 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, maintainer
    should 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.

  • Are two approvals required? Branch protection rule does not check for the second approval. If a second approval is not necessary, please apply the trivial label.
  • Do the proposed changes actually accomplish desired goals? Also manually run the affected example notebooks, if necessary.
  • Do the proposed changes follow the STScI Style Guides?
  • Are tests added/updated as required? If so, do they follow the STScI Style Guides?
  • Are docs added/updated as required? If so, do they follow the STScI Style Guides?
  • Did the CI pass? If not, are the failures related?
  • Is a milestone set? Set this to bugfix milestone if this is a bug fix and needs to be released ASAP; otherwise, set this to the next major release milestone.
  • After merge, any internal documentations need updating (e.g., JIRA, Innerspace)?

@kecnry kecnry added no-changelog-entry-needed changelog bot directive plugin Label for plugins common to multiple configurations labels Sep 1, 2023
@kecnry kecnry added this to the 3.7 milestone Sep 1, 2023
@kecnry kecnry marked this pull request as ready for review September 1, 2023 14:17
@@ -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'"
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Member Author

@kecnry kecnry Sep 13, 2023

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 🤔 🐱

Copy link
Contributor

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
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Patch coverage is 100.00% of modified lines.

Files Changed Coverage
jdaviz/core/template_mixin.py 100.00%

📢 Thoughts on this report? Let us know!.

@kecnry kecnry added trivial Only needs one approval instead of two and removed Ready for final review labels Sep 1, 2023
@kecnry kecnry merged commit 96e8a6c into spacetelescope:main Sep 1, 2023
24 of 26 checks passed
@kecnry kecnry deleted the downstream-plugin-links branch September 1, 2023 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cubeviz imviz mosviz no-changelog-entry-needed changelog bot directive plugin Label for plugins common to multiple configurations specviz specviz2d trivial Only needs one approval instead of two
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants