Skip to content

Commit

Permalink
resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
summer-cook committed Jul 31, 2023
2 parents 4d5bacd + 3544bab commit 02d9789
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 141 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ GIT

GIT
remote: https://github.com/samvera/hyrax.git
revision: 8bc9944164fdf8446b22bd4be66e5478292ceaa8
revision: 5a29f010dd34a3cfe37677c0b99759825d6505a1
branch: privkey_for_ga4_3.x
specs:
hyrax (3.6.0)
Expand Down
7 changes: 0 additions & 7 deletions app/models/generic_work.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,5 @@ class GenericWork < ActiveFedora::Base
# including `include ::Hyrax::BasicMetadata`. All properties must
# be declared before their values can be ordered.
include OrderMetadataValues

# These needed to be added again in order to enable destroy for based_near, even though they are in Hyrax::BasicMetadata.
# the OrderAlready OrderMetadataValues above somehow prevents them from running
id_blank = proc { |attributes| attributes[:id].blank? }
class_attribute :controlled_properties
self.controlled_properties = [:based_near]
accepts_nested_attributes_for :based_near, reject_if: id_blank, allow_destroy: true
self.indexer = GenericWorkIndexer
end
106 changes: 24 additions & 82 deletions app/views/hyrax/admin/workflows/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,88 +6,30 @@

<div class="row">
<div class="col-md-12">
<div class="card tabs">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item active">
<a class="nav-link" href="#under-review" role="tab" data-toggle="tab"><%= t('.tabs.under_review') %></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#published" role="tab" data-toggle="tab"><%= t('.tabs.published') %></a>
</li>
</ul>
<div class="tab-content">
<div id="under-review" class="tab-pane active">
<div class="card labels">
<div class="card-body">
<div class="table-responsive">
<table class="table table-sm table-striped datatable">
<thead>
<tr>
<th width="40%">Work</th>
<th width="20%">Depositor</th>
<th width="20%">Submission Date</th>
<th width="20%">Status</th>
</tr>
</thead>
<tbody>
<% @status_list.each do |document| %>
<tr>
<td>
<%= link_to document, [main_app, document] %>
</td>
<td>
<%# OVERRIDE: show the user/depositor's display_name if available %>
<% user = User.find_by(email: document.depositor) %>
<%= user&.display_name.presence %>
</td>
<td>
<%= document.date_modified %>
</td>
<td>
<span class="state state-pending"><%= document.workflow_state %></span>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div id="published" class="tab-pane">
<div class="card labels">
<div class="card-body">
<div class="table-responsive">
<table class="table table-sm table-striped datatable">
<thead>
<tr>
<th width="40%">Work</th>
<th width="20%">Depositor</th>
<th width="20%">Submission Date</th>
<th width="20%">Status</th>
</tr>
</thead>
<tbody>
<% @published_list.each do |document| %>
<tr>
<td>
<%= link_to document, [main_app, document] %>
</td>
<td>
<%# OVERRIDE: show the user/depositor's display_name if available %>
<% user = User.find_by(email: document.depositor) %>
<%= user&.display_name.presence %>
<td>
<%= document.date_modified %>
</td>
<td>
<span class="state state-pending"><%= document.workflow_state %></span>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
<div class="panel panel-default tabs">
<%= render 'tabs' %>
<div class="panel-heading">
<span class="count-display">
<% if @response.viewing_under_review? %>
<%= I18n.t('hyrax.admin.workflows.index.works_under_review', total_count: @response.total_count).html_safe %>
<% else %>
<%= I18n.t('hyrax.admin.workflows.index.works_published', total_count: @response.total_count).html_safe %>
<% end %>
</span>
</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-12">
<div class="sort-toggle mt-2">
<%= form_tag hyrax.admin_workflows_path, method: :get, class: 'per_page' do %>
<fieldset class="col-12">
<legend class="sr-only"><%= t('hyrax.dashboard.my.sr.results_per_page') %></legend>
<%= label_tag :per_page do %>
Show <%= select_tag :per_page, options_for_select(Hyrax.config.range_for_number_of_results_to_display_per_page.map(&:to_s), h(params[:per_page])), title: "entries" %> per page
<% end %>
<%= render_hash_as_hidden_fields(search_state.params_for_search.except(:per_page, :sort, :utf8)) %>
</fieldset>
<% end %>
</div>
</div>
</div>
Expand Down
51 changes: 0 additions & 51 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,57 +113,6 @@
# this security while still going through the captcha workflow.
NegativeCaptcha.test_mode = true

# Uses faster rack_test driver when JavaScript support not needed
Capybara.default_max_wait_time = 8
Capybara.default_driver = :rack_test

ENV['WEB_HOST'] ||= `hostname -s`.strip

if ENV['CHROME_HOSTNAME'].present?
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: {
args: %w[headless disable-gpu no-sandbox whitelisted-ips window-size=1400,1400]
}
)

Capybara.register_driver :chrome do |app|
d = Capybara::Selenium::Driver.new(app,
browser: :remote,
desired_capabilities: capabilities,
url: "http://#{ENV['CHROME_HOSTNAME']}:4444/wd/hub")
# Fix for capybara vs remote files. Selenium handles this for us
d.browser.file_detector = lambda do |args|
str = args.first.to_s
str if File.exist?(str)
end
d
end
Capybara.server_host = '0.0.0.0'
Capybara.server_port = 3001
Capybara.app_host = "http://#{ENV['WEB_HOST']}:#{Capybara.server_port}"
else
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
chromeOptions: {
args: %w[headless disable-gpu]
}
)

Capybara.register_driver :chrome do |app|
Capybara::Selenium::Driver.new(
app,
browser: :chrome,
desired_capabilities: capabilities
)
end
end

Capybara.javascript_driver = :chrome

# This will ensure that a field named email will not be referred to by a
# hash but by test-email instead. A tool like capybara can now bypass
# this security while still going through the captcha workflow.
NegativeCaptcha.test_mode = true

RSpec.configure do |config|
# Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
config.fixture_path = "#{::Rails.root}/spec/fixtures"
Expand Down

0 comments on commit 02d9789

Please sign in to comment.