Skip to content

Commit 8f9164a

Browse files
committed
update resolver presentation to conform to modern service (DLC-1052)
- update resolver cleaning in SolrDocument - update resolver links in static source
1 parent 55f8050 commit 8f9164a

File tree

6 files changed

+36
-13
lines changed

6 files changed

+36
-13
lines changed

app/helpers/dcv/dcv_url_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def library_policies_url
8787
end
8888

8989
def terms_of_use_url
90-
'https://library.columbia.edu/resolve/lweb0208'
90+
'https://resolver.library.columbia.edu/lweb0208'
9191
end
9292

9393
def site_edit_link(sep: ' | ', **link_opts)

app/models/solr_document.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ def clean_resolver(link_src)
9696
if link_src
9797
link_uri = URI(link_src)
9898
if link_uri.path == "/cgi-bin/cul/resolve" && link_uri.host == "www.columbia.edu"
99-
return "https://library.columbia.edu/resolve/#{link_uri.query}"
99+
return "https://resolver.library.columbia.edu/#{link_uri.query}"
100+
end
101+
if link_uri.host == "library.columbia.edu" && link_uri.path =~ /^\/resolve\/([^\/]+)/
102+
return "https://resolver.library.columbia.edu/#{$1}"
100103
end
101104
end
102105
link_src

app/views/catalog/_secondary_nav.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</li>
1717
</ul>
1818
<ul class="nav nav-pills">
19-
<li class="nav-item"><a onclick="window.open(this.href);return false;" data-toggle="tooltip" data-placement="bottom" href="https://library.columbia.edu/resolve/lweb0164" title="See All Digital Collections" class="nav-link">All Collections <i class="fa fa-external-link"></i></a></li>
19+
<li class="nav-item"><a onclick="window.open(this.href);return false;" data-toggle="tooltip" data-placement="bottom" href="https://resolver.library.columbia.edu/lweb0164" title="See All Digital Collections" class="nav-link">All Collections <i class="fa fa-external-link"></i></a></li>
2020
<%- if params[:action] == 'home' && @subsite.persistent_url -%>
2121
<li class="nav-item"><button data-copy="<%= @subsite.persistent_url %>" title="Click to copy to clipboard" class="btn btn-secondary nav-link mx-auto" onclick="clipboardFromElement(this);"><span class="fa fa-copy"></span> Permanent URL</button></li>
2222
<%- elsif @document&.has_persistent_url? -%>

app/views/sites/edit.html.erb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,14 @@
176176
<span id="tooltip-nav-menu-label" title="Link Group Label">The label for this group of links, which will be presented as a drop-down menu if there are multiple links. If the group has only one link, the group label will not be displayed and the link will be presented directly in the site navigation bar.</span>
177177
<span id="tooltip-nav-link-label" title="Link Label">The label used for a link in a drop-down menu or, if it is the only link in a group, the site navigation bar.</span>
178178
<span id="tooltip-nav-link" title="Link To">The URL associated with this link. Full URLs will indicate that they are links to external resources. If a page slug is given and the link is marked as internal, a link to the named page will be built.</span>
179-
<span id="tooltip-layout" title="Site Layout">The overall layout of markup for the site, governing the homepage and any configured site pages. "DLC default" defers to the design team's default configurations. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
180-
<span id="tooltip-palette" title="Site Palette">The color scheme for the site, governing the homepage and any configured site pages. "DLC default" defers to the design team's default configurations. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
181-
<span id="tooltip-search-type" title="Search Type">The search type for the site indicates how search results should be presented. "Catalog" indicates that search results should be presented in the context of filters on the general DLC catalog. "Local" indicates that search results should be presented as an isolated corpus, with the configured site layout and palettes. "Custom" indicates that a developer-implemented custom site provides this site's search, and should generally not be selected. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
182-
<span id="tooltip-homepage-facets" title="Show Homepage Facets">Configures the display of a facet panel on the site homepage, if supported by the configured layout. Facets are determined by the general DLC Catalog facets, but limited to facets for which the site's content has two or more values. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
183-
<span id="tooltip-images-portrait" title="Portrait Layout Images">Configures the repository PIDs of images for the site homepage, where supported by the configured layout. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
184-
<span id="tooltip-images-signature" title="Signature Layout Images">Manages the design assets for a site homepage configured with the signature layout. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
185-
<span id="tooltip-images-signature-banner" title="Signature Banner Image">The banner image for a site homepage configured with the signature layout. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
186-
<span id="tooltip-images-signature-watermark" title="Signature/Watermark Image">The signature/watermark image for a site homepage configured with the signature layout. This is an SVG that is overlaid on the banner image. See the <a href="https://library.columbia.edu/resolve/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
179+
<span id="tooltip-layout" title="Site Layout">The overall layout of markup for the site, governing the homepage and any configured site pages. "DLC default" defers to the design team's default configurations. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
180+
<span id="tooltip-palette" title="Site Palette">The color scheme for the site, governing the homepage and any configured site pages. "DLC default" defers to the design team's default configurations. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
181+
<span id="tooltip-search-type" title="Search Type">The search type for the site indicates how search results should be presented. "Catalog" indicates that search results should be presented in the context of filters on the general DLC catalog. "Local" indicates that search results should be presented as an isolated corpus, with the configured site layout and palettes. "Custom" indicates that a developer-implemented custom site provides this site's search, and should generally not be selected. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
182+
<span id="tooltip-homepage-facets" title="Show Homepage Facets">Configures the display of a facet panel on the site homepage, if supported by the configured layout. Facets are determined by the general DLC Catalog facets, but limited to facets for which the site's content has two or more values. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
183+
<span id="tooltip-images-portrait" title="Portrait Layout Images">Configures the repository PIDs of images for the site homepage, where supported by the configured layout. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
184+
<span id="tooltip-images-signature" title="Signature Layout Images">Manages the design assets for a site homepage configured with the signature layout. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
185+
<span id="tooltip-images-signature-banner" title="Signature Banner Image">The banner image for a site homepage configured with the signature layout. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
186+
<span id="tooltip-images-signature-watermark" title="Signature/Watermark Image">The signature/watermark image for a site homepage configured with the signature layout. This is an SVG that is overlaid on the banner image. See the <a href="https://resolver.library.columbia.edu/dlc-editor-docs" target="_blank">site editor documentation</a> for details.</span>
187187
</div>
188188
<%- buffer = "" %>
189189
<%- form_for(@subsite, builder: ::ValueIndexableFormBuilder) do |site_form| %>

app/views/sites/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ featured_proj = controller.digital_projects.select { |proj| proj[:facet_value].p
3232
<% @browse_lists.each do |facet_name, data| %>
3333
<li class="nav-item"><a href="#tab_<%= facet_name %>" data-toggle="tab" class="nav-link"><%= data['display_label'] %></a></li>
3434
<% end %>
35-
<li class="float-right non-tab"><a onclick="window.open(this.href);return false;" data-toggle="tooltip" data-placement="top" href="https://library.columbia.edu/resolve/lweb0164" title="See All Digital Collections">All Collections <i class="fa fa-external-link"></i></a></li>
35+
<li class="float-right non-tab"><a onclick="window.open(this.href);return false;" data-toggle="tooltip" data-placement="top" href="https://resolver.library.columbia.edu/lweb0164" title="See All Digital Collections">All Collections <i class="fa fa-external-link"></i></a></li>
3636
</ul>
3737

3838
<!-- Tab panes -->

spec/models/solr_document_spec.rb

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
include_context "indexed with a resolver source uri"
1111
it { is_expected.to have_persistent_url }
1212
context 'that is an old resolver' do
13-
let(:resolver_url) { "https://library.columbia.edu/resolve/#{resolver_key}" }
13+
let(:resolver_url) { "https://resolver.library.columbia.edu/#{resolver_key}" }
1414
it { is_expected.to satisfy {|doc| doc.persistent_url == resolver_url} }
1515
end
1616
end
@@ -79,4 +79,24 @@
7979
end
8080
end
8181
end
82+
describe '#clean_resolver' do
83+
let(:rkey) { 'lweb0138' }
84+
let(:cgi_http) { "http://www.columbia.edu/cgi-bin/cul/resolve?#{rkey}" }
85+
let(:cgi_https) { "https://www.columbia.edu/cgi-bin/cul/resolve?#{rkey}" }
86+
let(:lweb_http) { "https://library.columbia.edu/resolve/#{rkey}" }
87+
let(:lweb_https) { "https://library.columbia.edu/resolve/#{rkey}" }
88+
let(:current_https) { "https://resolver.library.columbia.edu/#{rkey}" }
89+
let(:na_https) { "https://nothing.library.columbia.edu/#{rkey}" }
90+
it 'cleans cgi style' do
91+
expect(solr_document.clean_resolver(cgi_http)).to eql(current_https)
92+
expect(solr_document.clean_resolver(cgi_https)).to eql(current_https)
93+
end
94+
it 'cleans lweb style' do
95+
expect(solr_document.clean_resolver(lweb_http)).to eql(current_https)
96+
expect(solr_document.clean_resolver(lweb_https)).to eql(current_https)
97+
end
98+
it 'passes others through' do
99+
expect(solr_document.clean_resolver(na_https)).to eql(na_https)
100+
end
101+
end
82102
end

0 commit comments

Comments
 (0)