Skip to content

Commit

Permalink
only allow new components for ephemeris queries
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Jul 23, 2024
1 parent b66610a commit 2fa1352
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lcviz/plugins/ephemeris/ephemeris.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,12 +700,12 @@ def vue_adopt_from_catalog(self, *args):

def adopt_from_catalog_in_new_viewer(self, *args):
new_component_label = self.query_result_selected.replace(' ', '')
if len(self._get_phase_viewers(new_component_label)):
if new_component_label in self.component.choices:
# warn the user that an ephemeris component already exists with this label,
# a second won't be added:
self.hub.broadcast(

Check warning on line 706 in lcviz/plugins/ephemeris/ephemeris.py

View check run for this annotation

Codecov / codecov/patch

lcviz/plugins/ephemeris/ephemeris.py#L706

Added line #L706 was not covered by tests
SnackbarMessage(
f"Ephemeris component {new_component_label} already exists, skipping",
f"Ephemeris component {new_component_label} already exists, skipping.",
sender=self, color="warning"
)
)
Expand Down
8 changes: 1 addition & 7 deletions lcviz/plugins/ephemeris/ephemeris.vue
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,9 @@
<j-tooltip :tooltipcontent="'Adopt period and epoch into '+component_selected+' ephemeris.'">
<v-row justify="end">
<v-col>
<div v-if="phase_viewer_exists">
<plugin-action-button
@click="adopt_from_catalog">
Adopt in this viewer
</plugin-action-button>
</div>
<plugin-action-button
@click="adopt_from_catalog_in_new_viewer">
Adopt in a new viewer
Create new component
</plugin-action-button>
</v-col>
</v-row>
Expand Down

0 comments on commit 2fa1352

Please sign in to comment.