Skip to content

Commit

Permalink
Update settings so that ARCGIS_HIDE and CARTO_HIDE are optional
Browse files Browse the repository at this point in the history
  • Loading branch information
christinach committed Aug 6, 2019
1 parent a77679b commit 62bbc49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/helpers/geoblacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,15 @@ def display_carto
t('geoblacklight.tools.open_carto'),
carto_link(@document.carto_reference),
target: '_blank'
) if @document.carto_reference.present? && Settings.CARTO_DISPLAY
) if @document.carto_reference.present? && !Settings.CARTO_HIDE
end

def display_arcgis
return link_to(
blacklight_icon('esri-globe') + ' ' +
t('geoblacklight.tools.open_arcgis'),
arcgis_link(@document.arcgis_urls)
) if @document.arcgis_urls.present? && Settings.ARCGIS_DISPLAY
) if @document.arcgis_urls.present? && !Settings.ARCGIS_HIDE
end

##
Expand Down
8 changes: 4 additions & 4 deletions lib/generators/geoblacklight/templates/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ APPLICATION_LOGO_URL: 'http://geoblacklight.org/images/geoblacklight-logo.png'
# Carto OneClick Service https://carto.com/engine/open-in-carto/
CARTO_ONECLICK_LINK: 'http://oneclick.carto.com/'

# Display Carto export link
CARTO_DISPLAY: true
# Hide Carto export link
# CARTO_HIDE: true

# Display ArcGIS export link
ARCGIS_DISPLAY: true
# Hide ArcGIS export link
# ARCGIS_HIDE: true

# ArcGIS Online Base URL
ARCGIS_BASE_URL: 'https://www.arcgis.com/home/webmap/viewer.html'
Expand Down
3 changes: 1 addition & 2 deletions spec/features/exports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
end
end
context 'when carto is configured not to display' do
let(:CARTO_DISPLAY) { false }
before do
allow(Settings).to receive(:CARTO_DISPLAY)
allow(Settings).to receive(:CARTO_HIDE).and_return(true)
end
it 'will not display the carto link' do
visit solr_document_path 'tufts-cambridgegrid100-04'
Expand Down

0 comments on commit 62bbc49

Please sign in to comment.