From 2a9b35fa0660521f61d7bd2fb8f41f8654cbb3c5 Mon Sep 17 00:00:00 2001 From: dnoneill Date: Fri, 10 Jan 2025 11:40:31 -0500 Subject: [PATCH 1/2] migrate secondary-btns to primary --- app/assets/stylesheets/spotlight/_curation.scss | 2 +- app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss | 4 ++-- app/components/spotlight/bulk_action_component.rb | 2 +- app/components/spotlight/save_search_component.rb | 2 +- app/views/shared/_site_sidebar.html.erb | 2 +- app/views/spotlight/admin_users/index.html.erb | 6 +++--- app/views/spotlight/catalog/_admin_header.html.erb | 2 +- app/views/spotlight/exhibits/_delete.html.erb | 2 +- .../metadata_configurations/_metadata_field.html.erb | 2 +- app/views/spotlight/resources/upload/_form.html.erb | 2 +- app/views/spotlight/roles/index.html.erb | 2 +- app/views/spotlight/shared/_dd3_item.html.erb | 2 +- .../sir_trevor/blocks/_solr_documents_block.html.erb | 2 +- .../sir_trevor/blocks/_uploaded_items_block.html.erb | 2 +- lib/generators/spotlight/scaffold_resource_generator.rb | 2 +- 15 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/assets/stylesheets/spotlight/_curation.scss b/app/assets/stylesheets/spotlight/_curation.scss index 25520a1a2..16ea2da0f 100644 --- a/app/assets/stylesheets/spotlight/_curation.scss +++ b/app/assets/stylesheets/spotlight/_curation.scss @@ -21,7 +21,7 @@ } input[type='submit'] { @extend .btn; - @extend .btn-secondary; + @extend .btn-primary; @extend .btn-sm; } display: none; diff --git a/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss b/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss index c30a14b12..a5df56534 100644 --- a/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss +++ b/app/assets/stylesheets/spotlight/_sir-trevor_overrides.scss @@ -75,8 +75,8 @@ .st-block-controls__button { @extend .btn; - @extend .btn-secondary; - @extend .btn-outline-secondary; + @extend .btn-primary; + @extend .btn-outline-primary; border: 1px solid $gray-700; diff --git a/app/components/spotlight/bulk_action_component.rb b/app/components/spotlight/bulk_action_component.rb index 1fb9faebc..0450ae7ef 100644 --- a/app/components/spotlight/bulk_action_component.rb +++ b/app/components/spotlight/bulk_action_component.rb @@ -3,7 +3,7 @@ module Spotlight # Displays the "Bulk actions" button and dropdown class BulkActionComponent < ViewComponent::Base - def initialize(bulk_actions:, button_classes: 'btn btn-secondary dropdown-toggle') + def initialize(bulk_actions:, button_classes: 'btn btn-primary dropdown-toggle') @bulk_actions = bulk_actions @button_classes = button_classes super diff --git a/app/components/spotlight/save_search_component.rb b/app/components/spotlight/save_search_component.rb index 5294e3542..cd2b3e988 100644 --- a/app/components/spotlight/save_search_component.rb +++ b/app/components/spotlight/save_search_component.rb @@ -3,7 +3,7 @@ module Spotlight # Displays the "Save this search" button and modal class SaveSearchComponent < ViewComponent::Base - def initialize(button_classes: 'btn btn-secondary') + def initialize(button_classes: 'btn btn-outline-primary') @button_classes = button_classes super end diff --git a/app/views/shared/_site_sidebar.html.erb b/app/views/shared/_site_sidebar.html.erb index 810fe2d18..10c8c4025 100644 --- a/app/views/shared/_site_sidebar.html.erb +++ b/app/views/shared/_site_sidebar.html.erb @@ -14,6 +14,6 @@ <% end %> diff --git a/app/views/spotlight/admin_users/index.html.erb b/app/views/spotlight/admin_users/index.html.erb index 93b00e2ad..549658015 100644 --- a/app/views/spotlight/admin_users/index.html.erb +++ b/app/views/spotlight/admin_users/index.html.erb @@ -45,7 +45,7 @@
- <%= link_to(t('.create'), 'javascript:;', class: 'btn btn-secondary', data: { behavior: 'new-user' }) %> + <%= link_to(t('.create'), 'javascript:;', class: 'btn btn-primary', data: { behavior: 'new-user' }) %>
@@ -54,7 +54,7 @@

<%= t :'.admins_curators' %>

-
@@ -89,7 +89,7 @@ <% else %> <%= link_to(t('.update'), admin_user_path(user), data: { method: :patch, turbo_method: :patch }, - class: 'btn btn-sm btn-secondary') %> + class: 'btn btn-sm btn-primary') %> <% end %> diff --git a/app/views/spotlight/catalog/_admin_header.html.erb b/app/views/spotlight/catalog/_admin_header.html.erb index 41b81eb2e..9e0a55212 100644 --- a/app/views/spotlight/catalog/_admin_header.html.erb +++ b/app/views/spotlight/catalog/_admin_header.html.erb @@ -6,7 +6,7 @@
<%= link_to t('.reindex'), reindex_all_exhibit_resources_path(current_exhibit), data: { method: :post, turbo_method: :post }, - class: 'btn btn-secondary' %> + class: 'btn btn-outline-primary' %> <% if Spotlight::Engine.config.resource_partials.any? %> <%= link_to t('.new_resource'), new_exhibit_resource_path(current_exhibit), class: 'btn btn-primary' %> <% end %> diff --git a/app/views/spotlight/exhibits/_delete.html.erb b/app/views/spotlight/exhibits/_delete.html.erb index c2702fc33..5acd4b4ad 100644 --- a/app/views/spotlight/exhibits/_delete.html.erb +++ b/app/views/spotlight/exhibits/_delete.html.erb @@ -4,7 +4,7 @@

<%= t(:".warning_html", export_link: link_to(t(:'spotlight.exhibits.export.download'), spotlight.edit_exhibit_path(current_exhibit, anchor: 'export'))) %>

- <%= delete_link current_exhibit, class: 'btn btn-secondary' %> + <%= delete_link current_exhibit, class: 'btn btn-primary' %>
diff --git a/app/views/spotlight/metadata_configurations/_metadata_field.html.erb b/app/views/spotlight/metadata_configurations/_metadata_field.html.erb index 5723c6718..42f34f6d3 100644 --- a/app/views/spotlight/metadata_configurations/_metadata_field.html.erb +++ b/app/views/spotlight/metadata_configurations/_metadata_field.html.erb @@ -14,7 +14,7 @@
<% if default_field_label %>
- <%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn btn-secondary btn-sm #{'d-none' if config.display_label == default_field_label}" %> + <%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn btn-primary btn-sm #{'d-none' if config.display_label == default_field_label}" %>
<% end %> diff --git a/app/views/spotlight/resources/upload/_form.html.erb b/app/views/spotlight/resources/upload/_form.html.erb index eb9901f16..cd9c86e6d 100644 --- a/app/views/spotlight/resources/upload/_form.html.erb +++ b/app/views/spotlight/resources/upload/_form.html.erb @@ -13,7 +13,7 @@
<%= hidden_field_tag :tab, 'upload', id: nil %> <%= cancel_link @resource, :back, class: 'btn btn-link', role: 'button' %> - <%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-secondary' %> + <%= f.submit t('.add_item_and_continue'), name: 'add-and-continue', class: 'btn btn-outline-primary' %> <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
diff --git a/app/views/spotlight/roles/index.html.erb b/app/views/spotlight/roles/index.html.erb index df7b7bf89..ad2231f62 100644 --- a/app/views/spotlight/roles/index.html.erb +++ b/app/views/spotlight/roles/index.html.erb @@ -55,7 +55,7 @@
- <%= exhibit_create_link Spotlight::Role.new, '#', class: 'btn btn-secondary', data: {behavior: 'new-user'} %> + <%= exhibit_create_link Spotlight::Role.new, '#', class: 'btn btn-primary', data: {behavior: 'new-user'} %>
<% end %> diff --git a/app/views/spotlight/shared/_dd3_item.html.erb b/app/views/spotlight/shared/_dd3_item.html.erb index 84a8d7e65..f9679def1 100644 --- a/app/views/spotlight/shared/_dd3_item.html.erb +++ b/app/views/spotlight/shared/_dd3_item.html.erb @@ -33,7 +33,7 @@ <% if default_value %>
- <%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn restore-default btn-secondary btn-sm #{'d-none' if label.blank? || label == default_value}" %> + <%= button_tag t(:'.restore_default'), data: {:"restore-default" => true}, class: "btn restore-default btn-primary btn-sm #{'d-none' if label.blank? || label == default_value}" %>
<% end %> diff --git a/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb b/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb index 14ad44645..314b871e2 100644 --- a/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb +++ b/app/views/spotlight/sir_trevor/blocks/_solr_documents_block.html.erb @@ -26,7 +26,7 @@ <% end %> <% if solr_documents_block.zpr_link? && block_options[:iiif_tilesource].present? %> - + <% end %> diff --git a/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb b/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb index b892c01a2..816d3e442 100644 --- a/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb +++ b/app/views/spotlight/sir_trevor/blocks/_uploaded_items_block.html.erb @@ -19,7 +19,7 @@ <% end %> <% if uploaded_items_block.zpr_link? %> - <%= button_tag t('.zpr_link_html', title: file[:caption]), class: 'btn btn-secondary zpr-link', data: { 'iiif-tilesource' => { type: 'image', url: file[:url] }.to_json } %> + <%= button_tag t('.zpr_link_html', title: file[:caption]), class: 'btn btn-primary zpr-link', data: { 'iiif-tilesource' => { type: 'image', url: file[:url] }.to_json } %> <% end %> diff --git a/lib/generators/spotlight/scaffold_resource_generator.rb b/lib/generators/spotlight/scaffold_resource_generator.rb index 0128e63fd..6ade68593 100644 --- a/lib/generators/spotlight/scaffold_resource_generator.rb +++ b/lib/generators/spotlight/scaffold_resource_generator.rb @@ -38,7 +38,7 @@ def create_form <%= f.text_field :url %>
- <%= cancel_link @resource, :back, class: 'btn btn-secondary' %> + <%= cancel_link @resource, :back, class: 'btn btn-primary' %> <%= f.submit t('.add_item'), class: 'btn btn-primary' %>
From d26b9f8f587b6cae48bd08b3739709ee15267e62 Mon Sep 17 00:00:00 2001 From: dnoneill Date: Fri, 10 Jan 2025 11:46:15 -0500 Subject: [PATCH 2/2] fix rubocop error --- app/jobs/concerns/spotlight/job_tracking.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/concerns/spotlight/job_tracking.rb b/app/jobs/concerns/spotlight/job_tracking.rb index d7da0aa2e..73f2c454a 100644 --- a/app/jobs/concerns/spotlight/job_tracking.rb +++ b/app/jobs/concerns/spotlight/job_tracking.rb @@ -44,7 +44,7 @@ def initialize_job_tracker!(**params) end def finalize_job_tracker! - return unless job_tracker.status == 'in_progress' || job_tracker.status == 'enqueued' + return unless %w[in_progress enqueued].include?(job_tracker.status) job_tracker.update( status: @failed ? 'failed' : 'completed',