Skip to content

Commit

Permalink
Merge bc91e62 into 81c669b
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Jul 27, 2018
2 parents 81c669b + bc91e62 commit 489ef0c
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 10 deletions.
9 changes: 0 additions & 9 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,3 @@ Style/StringLiterals:
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals
Enabled: true
EnforcedStyle: single_quotes

Style/DotPosition:
Description: Checks the position of the dot in multi-line method calls.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains
Enabled: true
EnforcedStyle: leading
SupportedStyles:
- leading
- trailing
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
*/
#metadata-container {
height: 1024px;
height: calc(100vh - 260px);

ul {
margin-top: 0;
Expand Down Expand Up @@ -35,4 +35,9 @@
div > dl > dt {
font-size: 22px;
}

iframe {
height: 100%;
width: 100%;
}
}
1 change: 1 addition & 0 deletions config/locales/geoblacklight.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ en:
iso19139: 'ISO 19139'
mods: 'MODS'
fgdc: 'FGDC'
html: 'HTML'
feature_layer: 'ArcGIS Feature Layer'
tiled_map_layer: 'ArcGIS Tiled Map Layer'
dynamic_map_layer: 'ArcGIS Dynamic Map Layer'
Expand Down
1 change: 1 addition & 0 deletions lib/generators/geoblacklight/templates/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ METADATA_SHOWN:
- 'mods'
- 'fgdc'
- 'iso19139'
- 'html'

# (For external Download) timeout and open_timeout parameters for Faraday
TIMEOUT_DOWNLOAD: 16
Expand Down
1 change: 1 addition & 0 deletions lib/geoblacklight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module Geoblacklight
require 'geoblacklight/metadata'
require 'geoblacklight/metadata/base'
require 'geoblacklight/metadata/fgdc'
require 'geoblacklight/metadata/html'
require 'geoblacklight/metadata/iso19139'
require 'geoblacklight/metadata_transformer'
require 'geoblacklight/metadata_transformer/base'
Expand Down
13 changes: 13 additions & 0 deletions lib/geoblacklight/metadata/html.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Geoblacklight
module Metadata
class Html < Base
def transform
ActionController::Base.helpers.content_tag(:iframe,
'',
src: @reference.endpoint,
scrolling: 'yes',
frameborder: 0)
end
end
end
end
42 changes: 42 additions & 0 deletions spec/fixtures/solr_documents/cornell_html_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"geoblacklight_version": "1.0",
"dc_identifier_s": "https://cugir.library.cornell.edu/catalog/cugir-007741",
"dc_title_s": "Air Monitoring Stations, Adirondack Park, 2000",
"dc_description_s": " This dataset shows the location of each ambient air quality monitoring station currently being operated by the Bureau of Air Quality Surveillance (BAQS), Division of Air Resources, New York State Department of Environmental Conservation.",
"dc_rights_s": "Public",
"dct_provenance_s": "Cornell",
"dct_references_s": "{\"http://schema.org/downloadUrl\":\"https://s3.amazonaws.com/cugir-data/00/77/41/cugir-007741.zip\",\"http://www.opengis.net/cat/csw/csdgm\":\"https://s3.amazonaws.com/cugir-data/00/77/41/fgdc.xml\",\"http://www.w3.org/1999/xhtml\":\"https://s3.amazonaws.com/cugir-data/00/77/41/fgdc.html\",\"http://www.opengis.net/def/serviceType/ogc/wfs\":\"https://cugir.library.cornell.edu/geoserver/cugir/wfs\",\"http://www.opengis.net/def/serviceType/ogc/wms\":\"https://cugir.library.cornell.edu/geoserver/cugir/wms\"}",
"cugir_addl_downloads_s": "{}",
"layer_id_s": "cugir007741",
"layer_slug_s": "cugir-007741",
"dc_type_s": "Dataset",
"dc_format_s": "Shapefile",
"cugir_filesize_s": "0.07 MB",
"layer_geom_type_s": "Point",
"layer_modified_dt": "2017-10-05T00:00:00Z",
"dc_creator_sm": [
"New York State Department of Energy Conservation Bureau of Air Quality Surveillance"
],
"dc_publisher_sm": [
"Geographic Data Presentation Form: Map"
],
"dc_subject_sm": [
"environment",
"Air quality monitoring stations",
"Air quality management",
"Air--Pollution--Measurement",
"New York State--Dept Energy Conservation"
],
"cugir_category_sm": [
"environment",
"climate"
],
"dct_spatial_sm": [
"New York"
],
"dct_issued_s": "2000-06-00",
"dct_temporal_sm": [
"-Pres"
],
"solr_geom": "ENVELOPE(-74.989258, -73.858335, 44.67778, 43.452994)"
}
18 changes: 18 additions & 0 deletions spec/lib/geoblacklight/metadata/html_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'spec_helper'

describe Geoblacklight::Metadata::Html do
let(:url) { 'https://s3.amazonaws.com/cugir-data/00/77/41/fgdc.html' }
let(:metadata) do
described_class.new(
Geoblacklight::Reference.new(
['http://www.w3.org/1999/xhtml', url]
)
)
end

describe '#transform' do
it 'renders an iframe with the html endpoint' do
expect(metadata.transform).to include('iframe', url)
end
end
end
9 changes: 9 additions & 0 deletions spec/lib/geoblacklight/metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@
end
end

context 'with an html metadata reference' do
before do
allow(reference).to receive(:type).and_return('html')
end
it 'constructs an Geoblacklight::Metadata::Html instance' do
expect(described_class.instance(reference)).to be_a Geoblacklight::Metadata::Html
end
end

context 'with another metadata reference' do
before do
allow(reference).to receive(:type).and_return('unsupported')
Expand Down

0 comments on commit 489ef0c

Please sign in to comment.