Skip to content
This repository has been archived by the owner on Mar 24, 2020. It is now read-only.

Commit

Permalink
Fix the collection item view
Browse files Browse the repository at this point in the history
Add test

Remove the embedded html tags from the note field

Remove tab

Fix layout issue

Fix space issue

Fix space issue
  • Loading branch information
VivianChu committed Dec 10, 2017
1 parent 9a65f19 commit 3a81220
Show file tree
Hide file tree
Showing 6 changed files with 1,634 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def field_with_highlighting document, field, sep=field_value_separator
#Snippets for no default indexed fields
if(hitsonly && highlight_values != nil && highlight_values.count > 0)
highlight_values.collect! {|m|m.length < blacklight_config.hlMaxFragsize || m.ends_with?(".") ? m : m+ " ..."}
return highlight_values.join(sep).html_safe
return strip_tags(highlight_values.join(sep))
end
highlight_values = document[field] if (highlight_values.nil? || highlight_values.count==0)
elsif field.to_s.index('_json_')
Expand Down
41 changes: 41 additions & 0 deletions spec/features/dams_collections_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -302,4 +302,45 @@
visit osf_api_dams_collection_path @provCollection2.pid
expect(page).to have_content('{"name":"UC San Diego Library"}')
end
end

feature 'Visitor wants to look at the collection item view search results' do
before do
@unit = DamsUnit.create(pid: 'bb45454545')
@unit.damsMetadata.content = File.new('spec/fixtures/damsUnit.rdf.xml').read
@unit.save!
@aCollection = DamsAssembledCollection.create(pid: "xx4473712z", visibility: "public")
@aCollection.damsMetadata.content = File.new('spec/fixtures/soccomCollection.rdf.xml').read
@aCollection.save!
@soccomObj1 = DamsObject.create(pid: "xx2801340v")
@soccomObj1.damsMetadata.content = File.new('spec/fixtures/soccomObject1.rdf.xml').read
@soccomObj1.save!
@soccomObj2 = DamsObject.create(pid: "xx47126209")
@soccomObj2.damsMetadata.content = File.new('spec/fixtures/soccomObject2.rdf.xml').read
@soccomObj2.save!
@soccomObj3 = DamsObject.create(pid: "xx66239018")
@soccomObj3.damsMetadata.content = File.new('spec/fixtures/soccomObject3.rdf.xml').read
@soccomObj3.save!
solr_index (@unit.pid)
solr_index (@aCollection.pid)
solr_index (@soccomObj1.pid)
solr_index (@soccomObj2.pid)
solr_index (@soccomObj3.pid)
end
after do
@aCollection.delete
@unit.delete
@soccomObj1.delete
@soccomObj2.delete
@soccomObj3.delete
end
scenario 'should see the collection item result page with correct indentation' do
visit catalog_index_path( {:q => "#{@aCollection.pid}", 'sort' => 'title_ssi asc'} )
expect(page).to have_content('Showing results for 1 - 4 of 4')
expect(page).to have_selector('div h3 a[data-counter="1"]', :text => 'SOCCOM float data - Snapshot 2016-12-28')
expect(page).to have_selector('div h3 a[data-counter="2"]', :text => 'SOCCOM float data - Snapshot 2017-03-08')
expect(page).to have_selector('div h3 a[data-counter="3"]', :text => 'SOCCOM float data - Snapshot 2016-11-28')
expect(page).to have_selector('div h3 a[data-counter="4"]', :text => 'Southern Ocean Carbon and Climate Observations and Modeling (SOCCOM) Float Data Archive')
end

end
109 changes: 109 additions & 0 deletions spec/fixtures/soccomCollection.rdf.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
<rdf:RDF
xmlns:mads="http://www.loc.gov/mads/rdf/v1#"
xmlns:damsid="http://library.ucsd.edu/ark:/20775/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:dams="http://library.ucsd.edu/ontology/dams#">
<dams:AssembledCollection rdf:about="http://library.ucsd.edu/ark:/20775/xx4473712z">
<dams:title>
<mads:Title>
<mads:authoritativeLabel>Southern Ocean Carbon and Climate Observations and Modeling (SOCCOM) Float Data Archive</mads:authoritativeLabel>
<mads:elementList rdf:parseType="Collection">
<mads:MainTitleElement>
<mads:elementValue>Southern Ocean Carbon and Climate Observations and Modeling (SOCCOM) Float Data Archive</mads:elementValue>
</mads:MainTitleElement>
</mads:elementList>
</mads:Title>
</dams:title>
<dams:relatedResource>
<dams:RelatedResource>
<dams:type>related</dams:type>
<dams:description>SOCCOM website</dams:description>
<dams:uri rdf:resource="https://soccom.princeton.edu/"/>
</dams:RelatedResource>
</dams:relatedResource>
<dams:visibility>public</dams:visibility>
<dams:unit rdf:resource="http://library.ucsd.edu/ark:/20775/bb45454545"/>
<dams:note>
<dams:Note>
<rdf:value>Johnson, Kenneth S; Riser, Stephen C; Boss, Emmanuel S; Talley, Lynne D; Sarmiento, Jorge L; Swift, Dana D; Plant, Josh N; Maurer, Tanya L; Key, Robert M; Williams, Nancy L; Wanninkhof, Richard H; Dickson, Andrew G; Feely, Richard A; Russell, Joellen L (2017): Southern Ocean Carbon and Climate Observations and Modeling (SOCCOM) Float Data Archive. UC San Diego Library Digital Collections. http://doi.org/10.6075/J0TX3C9X</rdf:value>
<dams:type>preferred citation</dams:type>
</dams:Note>
</dams:note>
<dams:typeOfResource>data</dams:typeOfResource>
<dams:scopeContentNote>
<dams:ScopeContentNote>
<rdf:value>Biogeochemical profiling floats in the Southern Ocean deployed by the SOCCOM program.</rdf:value>
<dams:type>scopeAndContent</dams:type>
<dams:displayLabel>Scope and Contents</dams:displayLabel>
</dams:ScopeContentNote>
</dams:scopeContentNote>

<dams:note>
<dams:Note>
<rdf:value>To develop a new observing system for carbon, nutrients, and oxygen that will complement and expand on the existing observing system for heat and freshwater, the observations team will deploy a large array (~200) of profiling floats with biogeochemical sensors throughout the Southern Ocean. This robotic float observing system will be complemented by shipboard measurements, instrument and sensor development, and data analysis, including state estimation in conjunction with the modeling program.

Principal responsibility for development and deployment of the observing system will be in the hands of the Scripps Institution of Oceanography (Theme 1 Lead Lynne Talley), in partnership with the University of Washington (Co-Lead Steve Riser) and Monterey Bay Aquarium Research Institute (Associate Director Ken Johnson), who together will design and build the floats and participate in analysis of the data. Deployment opportunities with international partners are an important component to the SOCCOM observational program.</rdf:value>
<dams:type>description</dams:type>
</dams:Note>
</dams:note>
<dams:note>
<dams:Note>
<rdf:value>http://doi.org/10.6075/J0TX3C9X</rdf:value>
<dams:displayLabel>DOI</dams:displayLabel>
<dams:type>identifier</dams:type>
</dams:Note>
</dams:note>
<dams:date>
<dams:Date>
<dams:encoding>w3cdtf</dams:encoding>
<dams:beginDate>2014-03-27</dams:beginDate>
<dams:endDate>2017-04-24</dams:endDate>
<dams:type>collected</dams:type>
<rdf:value>27 March 2014 - present</rdf:value>
</dams:Date>
</dams:date>
<dams:note>
<dams:Note>
<rdf:value>6 digital objects.</rdf:value>
<dams:type>extent</dams:type>
</dams:Note>
</dams:note>
<dams:title>
<mads:Title>
<mads:authoritativeLabel>Southern Ocean Carbon and Climate Observations and Modeling (SOCCOM) Float Data Archive</mads:authoritativeLabel>
<mads:elementList rdf:parseType="Collection">
<mads:MainTitleElement>
<mads:elementValue>Southern Ocean Carbon and Climate Observations and Modeling (SOCCOM) Float Data Archive</mads:elementValue>
</mads:MainTitleElement>
</mads:elementList>
</mads:Title>
</dams:title>

<dams:note>
<dams:Note>
<rdf:value>Authors using SOCCOM float data should acknowledge that "Data were collected and made freely available by the Southern Ocean Carbon and Climate Observations and Modeling (SOCCOM) Project funded by the National Science Foundation, Division of Polar Programs (NSF PLR-1425989), supplemented by NASA, and by the International Argo Program and the NOAA programs that contribute to it. The Argo Program is part of the Global Ocean Observing System (http://doi.org/10.17882/42182, http://argo.jcommops.org)". In addition, users should reference the appropriate SOCCOM DOI, as listed on each page under Cite This Work.</rdf:value>
<dams:type>funding</dams:type>
</dams:Note>
</dams:note>
<dams:date>
<dams:Date>
<rdf:value>2017</rdf:value>
<dams:type>issued</dams:type>
</dams:Date>
</dams:date>

<dams:note>
<dams:Note>
<rdf:value>Three different methods for calculating TALK, DIC, and pCO2 are available and described below:
LIAR: Carter, B. R., N. L. Williams, A. R. Gray, and R. A. Feely (2016), Locally interpolated alkalinity regression for global alkalinity estimation, Limnol. Oceanogr. Methods, 14(4), 268-277, https://doi.org/10.1002/lom3.10087.
CANYON: Sauzède;, R., Claustre, H., Pasqueron de Fommervault, O., Bittig, H., Gattuso, J.-P., Legendre, L. and K. Johnson, Estimates of water-column nutrients concentration and carbonate system parameters in the global ocean: A novel approach based on neural networks. Frontiers in Marine Science-Ocean Observation, in revision
MLR:
pH, Nitrate, DIC: Williams, N.L., L. W. Juranek, K.S. Johnson, R. A. Feely, S.C. Riser, L.D. Talley, J.L. Russell, J.L. Sarmiento, R. Wanninkhof, 2016. Empirical Algorithms to Estimate Water Column pH in the Southern Ocean. Geophysical Research Letters, 43, https://doi.org/10.1002/2016GL068539.
TALK: Williams, N. L., et al. (2017), Calculating surface ocean pCO2 from biogeochemical Argo floats equipped with pH: An uncertainty analysis, Global Biogeochem. Cycles, 31, https://doi.org/10.1002/2016GB005541.</rdf:value>
<dams:type>methods</dams:type>
</dams:Note>
</dams:note>

</dams:AssembledCollection>
</rdf:RDF>
Loading

0 comments on commit 3a81220

Please sign in to comment.