From 696d152386e4fa18d86e736297b687548e3c414d Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Tue, 22 Oct 2024 10:31:26 -0400 Subject: [PATCH] disable file imports when running on external server (#3239) (#3241) * disable file imports when running on external server --- CHANGES.rst | 2 ++ jdaviz/configs/imviz/plugins/catalogs/catalogs.py | 6 ++++-- jdaviz/configs/imviz/plugins/footprints/footprints.py | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 01003048f7..bf84946ad4 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -12,6 +12,8 @@ Cubeviz Imviz ^^^^^ +- Remove "From File.." option when running on an external server. [#3239] + Mosviz ^^^^^^ diff --git a/jdaviz/configs/imviz/plugins/catalogs/catalogs.py b/jdaviz/configs/imviz/plugins/catalogs/catalogs.py index f02621bd47..8e7cb3703c 100644 --- a/jdaviz/configs/imviz/plugins/catalogs/catalogs.py +++ b/jdaviz/configs/imviz/plugins/catalogs/catalogs.py @@ -34,11 +34,13 @@ class Catalogs(PluginTemplateMixin, ViewerSelectMixin, HasFileImportSelect): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - + cat_options = ['SDSS'] + if not self.app.state.settings.get('server_is_remote', False): + cat_options.append('From File...') self.catalog = FileImportSelectPluginComponent(self, items='catalog_items', selected='catalog_selected', - manual_options=['SDSS', 'From File...']) + manual_options=cat_options) # set the custom file parser for importing catalogs self.catalog._file_parser = self._file_parser diff --git a/jdaviz/configs/imviz/plugins/footprints/footprints.py b/jdaviz/configs/imviz/plugins/footprints/footprints.py index 6df321eef6..2a9df6b781 100644 --- a/jdaviz/configs/imviz/plugins/footprints/footprints.py +++ b/jdaviz/configs/imviz/plugins/footprints/footprints.py @@ -118,7 +118,8 @@ def __init__(self, *args, **kwargs): preset_options = list(preset_regions._instruments.keys()) else: preset_options = ['None'] - preset_options.append('From File...') + if not self.app.state.settings.get('server_is_remote', False): + preset_options.append('From File...') self.preset = FileImportSelectPluginComponent(self, items='preset_items', selected='preset_selected',