Repository navigation
Conversation
|
I'm working on testing this PR. First pass wasn't successful. Trying again with zeroed out data dir. |
ssciolla
left a comment
There was a problem hiding this comment.
I started going through this, but am not finished yet. Comments are mostly cleanup. Feel a little iffy on the platform-checking stuff -- maybe we just don't support generate when it's not on Linux/in a container?
rshiggin
left a comment
There was a problem hiding this comment.
My testing was successful, once I'd zeroed out and recreated the XML and PDF derivatives.
It's iffy in the long tradition of platform |
|
|
||
| doc.css("#summary dl").first << fragment.css("dl#ead_author_block dt,dl#ead_author_block dd") | ||
| if (contents_el = doc.css("div.al-contents").first) | ||
| doc.css("html").first["class"] = "" |
There was a problem hiding this comment.
Was there a class that needed to be removed?
There was a problem hiding this comment.
OTOB there are no-js classes until javascript loads. Do the updated styles use this for anything? Undocumented, and early PDFs were turning out blank.
ssciolla
left a comment
There was a problem hiding this comment.
Sorry, more irksome comments. Going to run it now and then likely approve.
| <% if component.collection_has_requestable_components? %> | ||
| <% if component.is_checkbox_requestable? %> | ||
| <div class="checkbox request-checkbox"> | ||
| <label class="btn btn-outline-secondary btn-outline-request contents-action"> | ||
| <input type="checkbox" name="Request" value="<%= component.id %>"> | ||
| <input type="hidden" name="Request" value="<%= component.id %>"> | ||
| <input type="hidden" name="ItemSubTitle_<%= component.id %>" value="<%= component.aeon_item_sub_title_value %>"> | ||
| <input type="hidden" name="ItemVolume_<%= component.id %>" value="<%= component.aeon_item_volume_value %>"> | ||
| <input type="hidden" name="ItemCitation_<%= component.id %>" value="<%= component.aeon_item_citation_value %>"> | ||
| <% if component.aeon_item_sub_title_value.present? %> | ||
| <span class="request-checkbox-label" aria-hidden="true"><%= component.aeon_item_sub_title_value %></span> | ||
| <% end %> | ||
| <span class="visually-hidden">Request "<%= component.aeon_item_sub_title_visually_hidden %>"</span> | ||
| </label> | ||
| </div> | ||
| <% else %> | ||
| <%# <span style="padding: 0.375rem 1rem;"><i class="text-blended fas fa-circle"></i></span> %> | ||
| <% end %> | ||
| <% end %> |
There was a problem hiding this comment.
If fragment stuff is only ever used by the HTML and PDF derivatives, then do we need the Aeon stuff in there?
And can we remove the else if it's commented out?
There was a problem hiding this comment.
That's a great question, and IMHO beyond the scope of this PR. But I am team "time we spend on this wkhtmltopdf code is better spent figuring out what can replace it."
| # desc 'Generate packages for indexed finding aids via background jobs' | ||
| # task generate_enqueue: :environment do | ||
| # args = {} | ||
| # if ENV['REPOSITORY_ID'] | ||
| # repository_config = Arclight::Repository.find_by(slug: ENV['REPOSITORY_ID']) | ||
| # args[:repository_ssm] = repository_config.name | ||
| # elsif ENV['EADID'] | ||
| # args[:eadid] = ENV['EADID'] | ||
| # end | ||
| # args[:format] = ENV['FORMAT'] || 'html' | ||
| # Package::Queue.new.setup(**args) | ||
| # end |
There was a problem hiding this comment.
| # desc 'Generate packages for indexed finding aids via background jobs' | |
| # task generate_enqueue: :environment do | |
| # args = {} | |
| # if ENV['REPOSITORY_ID'] | |
| # repository_config = Arclight::Repository.find_by(slug: ENV['REPOSITORY_ID']) | |
| # args[:repository_ssm] = repository_config.name | |
| # elsif ENV['EADID'] | |
| # args[:eadid] = ENV['EADID'] | |
| # end | |
| # args[:format] = ENV['FORMAT'] || 'html' | |
| # Package::Queue.new.setup(**args) | |
| # end |
There was a problem hiding this comment.
I left this here in case this functionality would be useful in the future. ¯_(ツ)_/¯
There was a problem hiding this comment.
Hm, okay, your call. By now you know I'm on team "no commented code."
| raise "Please specify your EAD ID, ex. EADID=<id>" unless ENV["EADID"] | ||
|
|
||
| identifier = ENV["EADID"] |
There was a problem hiding this comment.
Not very important, but you could just use a positional argument over an environment variable here and below.
There was a problem hiding this comment.
These were inherited from the original rake tasks; we're still doing this with index_dir, etc. aren't we?
There was a problem hiding this comment.
Yes, we are, but we probably won't use index_dir that much from now on, since we also want to create HTML and PDF. This is probably a matter of preference, but I find the positional argument a bit more explicit. Like the difference between passing a value into a function versus depending on a variable in global scope.
| to_field "has_online_content_ssim", extract_xpath(".//dao") do |_record, accumulator| | ||
| accumulator.replace([ accumulator.any? ]) | ||
| end |
There was a problem hiding this comment.
I see below you added another to_field definition for has_online_content_ssim. Do we need both? Is this important for the PR? (not sure)
There was a problem hiding this comment.
Nope. Removed, and simplified the total_digital_object_count_isim to match what has_online_content_ssim is currently doing.
| expect(doc.xpath('//div[@id="summary"]//dl/dd[contains(., "Finding Aid written by E. A. Document")]').first).to be_truthy | ||
| # expect(doc.xpath('//div[@id="summary"]//dl/dd[contains(., "Finding Aid written by E. A. Document")]').first).to be_truthy | ||
| # expect(doc.css(".access-preview-snippet #toc").first).to be_truthy |
There was a problem hiding this comment.
Can we restore this assertion somehow?
There was a problem hiding this comment.
Noticed the generated PDF has a duplicated title on each item, plus a checkbox at the beginning. I don't think we need the checkbox in the PDF — something related to the new print.scss?
Tips for running the rake tass
find data/pdf -type f | xargs rmSummary
Adds/updates Arclight fragment rendering and utility styling for component details/print views in:
Adds a print stylesheet and asset manifest/config adjustments for the new UI output:
Updates catalog/solr/EAD config plumbing for the new component/package behavior: