Skip to content

Commit

Permalink
Replace waveband with SelectPluginComponent
Browse files Browse the repository at this point in the history
  • Loading branch information
duytnguyendtn committed Oct 11, 2024
1 parent 3715e4b commit 5d7424f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions jdaviz/configs/default/plugins/virtual_observatory/vo_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
AddResultsMixin,
TableMixin,
ViewerSelect,
SelectPluginComponent,
UnitSelectPluginComponent,
)

Expand All @@ -36,7 +37,7 @@ class VoPlugin(PluginTemplateMixin, AddResultsMixin, TableMixin):
viewer_items = List([]).tag(sync=True)
viewer_selected = Unicode().tag(sync=True)

wavebands = List().tag(sync=True)
wavebands_items = List().tag(sync=True)
waveband_selected = Any().tag(sync=True) # Any to accept Nonetype
resource_filter_coverage = Bool(False).tag(sync=True)
resources = List([]).tag(sync=True)
Expand Down Expand Up @@ -67,9 +68,12 @@ def __init__(self, *args, **kwargs):
self.radius_unit.choices = ["deg", "rad", "arcmin", "arcsec"]

# Waveband properties to filter available registry resources
self.wavebands = [
self.wavebands = SelectPluginComponent(
self, items="wavebands_items", selected="waveband_selected"
)
self.wavebands.choices = (
w.lower() for w in vocabularies.get_vocabulary("messenger")["terms"]
]
)
self.waveband_selected = None

self._full_registry_results = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
v-model="waveband_selected"
:menu-props="{ left: true }"
attach
:items="wavebands"
:items="wavebands_items.map(i => i.label)"
label="Resource Waveband"
hint="Select a spectral waveband to filter your surveys"
persistent-hint
Expand Down

0 comments on commit 5d7424f

Please sign in to comment.