From cab3fb6a2bafebfa8392ecb8c940e9b9fbda24fc Mon Sep 17 00:00:00 2001 From: Kirk Wang Date: Wed, 20 Mar 2024 21:25:49 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=81=20Change=20glyphicon=20to=20font?= =?UTF-8?q?=20awesome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hyrax 4+ applications use font awesome and not glyphicon. This commit will convert all glyphicon to font awesome. --- app/assets/javascripts/bulkrax/datatables.js | 2 +- .../concerns/bulkrax/datatables_behavior.rb | 26 +++++++++---------- .../bulkrax/entries/_parsed_metadata.html.erb | 4 +-- .../bulkrax/entries/_raw_metadata.html.erb | 4 +-- .../importers/_browse_everything.html.erb | 4 +-- app/views/bulkrax/importers/show.html.erb | 2 +- .../upload_corrected_entries.html.erb | 4 +-- .../bulkrax/shared/_bulkrax_errors.html.erb | 2 +- .../shared/_bulkrax_field_mapping.html.erb | 2 +- .../bulkrax/datatables_behavior_spec.rb | 14 +++++----- 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/assets/javascripts/bulkrax/datatables.js b/app/assets/javascripts/bulkrax/datatables.js index eabd2f716..9e80d348e 100644 --- a/app/assets/javascripts/bulkrax/datatables.js +++ b/app/assets/javascripts/bulkrax/datatables.js @@ -133,7 +133,7 @@ function refreshLink() { refreshLink.onclick = function() { this.api().ajax.reload(null, false) }.bind(this) - refreshLink.classList.value = 'glyphicon glyphicon-refresh' + refreshLink.classList.value = 'fa fa-refresh' refreshLink.style.marginLeft = '10px' document.querySelector('div.dataTables_filter').firstChild.append(refreshLink) } diff --git a/app/controllers/concerns/bulkrax/datatables_behavior.rb b/app/controllers/concerns/bulkrax/datatables_behavior.rb index 240d0bf43..46cbecb4d 100644 --- a/app/controllers/concerns/bulkrax/datatables_behavior.rb +++ b/app/controllers/concerns/bulkrax/datatables_behavior.rb @@ -145,37 +145,37 @@ def format_entries(entries, item) def entry_util_links(e, item) links = [] - links << view_context.link_to(view_context.raw(''), view_context.item_entry_path(item, e)) - links << "" if view_context.an_importer?(item) - links << view_context.link_to(view_context.raw(''), view_context.item_entry_path(item, e), method: :delete, data: { confirm: 'This will delete the entry and any work associated with it. Are you sure?' }) + links << view_context.link_to(view_context.raw(''), view_context.item_entry_path(item, e)) + links << "" if view_context.an_importer?(item) + links << view_context.link_to(view_context.raw(''), view_context.item_entry_path(item, e), method: :delete, data: { confirm: 'This will delete the entry and any work associated with it. Are you sure?' }) links.join(" ") end def status_message_for(e) if e.status_message == "Complete" - " #{e.status_message}" + " #{e.status_message}" elsif e.status_message == "Pending" - " #{e.status_message}" + " #{e.status_message}" elsif e.status_message == "Skipped" - " #{e.status_message}" + " #{e.status_message}" else - " #{e.status_message}" + " #{e.status_message}" end end def importer_util_links(i) links = [] - links << view_context.link_to(view_context.raw(''), importer_path(i)) - links << view_context.link_to(view_context.raw(''), edit_importer_path(i)) - links << view_context.link_to(view_context.raw(''), i, method: :delete, data: { confirm: 'Are you sure?' }) + links << view_context.link_to(view_context.raw(''), importer_path(i)) + links << view_context.link_to(view_context.raw(''), edit_importer_path(i)) + links << view_context.link_to(view_context.raw(''), i, method: :delete, data: { confirm: 'Are you sure?' }) links.join(" ") end def exporter_util_links(i) links = [] - links << view_context.link_to(view_context.raw(''), exporter_path(i)) - links << view_context.link_to(view_context.raw(''), edit_exporter_path(i), data: { turbolinks: false }) - links << view_context.link_to(view_context.raw(''), i, method: :delete, data: { confirm: 'Are you sure?' }) + links << view_context.link_to(view_context.raw(''), exporter_path(i)) + links << view_context.link_to(view_context.raw(''), edit_exporter_path(i), data: { turbolinks: false }) + links << view_context.link_to(view_context.raw(''), i, method: :delete, data: { confirm: 'Are you sure?' }) links.join(" ") end diff --git a/app/views/bulkrax/entries/_parsed_metadata.html.erb b/app/views/bulkrax/entries/_parsed_metadata.html.erb index f75984507..027fac627 100644 --- a/app/views/bulkrax/entries/_parsed_metadata.html.erb +++ b/app/views/bulkrax/entries/_parsed_metadata.html.erb @@ -5,7 +5,7 @@ Parsed Metadata: - +
@@ -16,4 +16,4 @@
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/bulkrax/entries/_raw_metadata.html.erb b/app/views/bulkrax/entries/_raw_metadata.html.erb index 3728816d4..f55627a9e 100644 --- a/app/views/bulkrax/entries/_raw_metadata.html.erb +++ b/app/views/bulkrax/entries/_raw_metadata.html.erb @@ -5,7 +5,7 @@ Raw Metadata: - +
@@ -16,4 +16,4 @@
-<% end %> \ No newline at end of file +<% end %> diff --git a/app/views/bulkrax/importers/_browse_everything.html.erb b/app/views/bulkrax/importers/_browse_everything.html.erb index 4df8ef451..e8c6ddd1a 100644 --- a/app/views/bulkrax/importers/_browse_everything.html.erb +++ b/app/views/bulkrax/importers/_browse_everything.html.erb @@ -3,10 +3,10 @@ f = "#{form.lookup_action}_importer" f = "#{f}_#{@importer.id}" unless @importer.new_record? %> -
+
diff --git a/app/views/bulkrax/importers/show.html.erb b/app/views/bulkrax/importers/show.html.erb index 26f384153..85478b8d8 100644 --- a/app/views/bulkrax/importers/show.html.erb +++ b/app/views/bulkrax/importers/show.html.erb @@ -45,7 +45,7 @@ Parser fields: - +
diff --git a/app/views/bulkrax/importers/upload_corrected_entries.html.erb b/app/views/bulkrax/importers/upload_corrected_entries.html.erb index 02ea16de5..6ac4b928e 100644 --- a/app/views/bulkrax/importers/upload_corrected_entries.html.erb +++ b/app/views/bulkrax/importers/upload_corrected_entries.html.erb @@ -7,7 +7,7 @@

Upload only the corrected entries for the <%= @importer.name %> importer. To export failed entries for correction, <%= link_to importer_export_errors_path(@importer.id) do %> - click here + click here <% end %>

Only CSV files are allowed.

@@ -18,7 +18,7 @@
<%= fi.input 'file', as: :file, - label: " Add file...".html_safe, + label: " Add file...".html_safe, label_html: { class: 'btn btn-success' }, diff --git a/app/views/bulkrax/shared/_bulkrax_errors.html.erb b/app/views/bulkrax/shared/_bulkrax_errors.html.erb index c9a6b4128..5cdeba35f 100644 --- a/app/views/bulkrax/shared/_bulkrax_errors.html.erb +++ b/app/views/bulkrax/shared/_bulkrax_errors.html.erb @@ -5,7 +5,7 @@ Errors: - +
diff --git a/app/views/bulkrax/shared/_bulkrax_field_mapping.html.erb b/app/views/bulkrax/shared/_bulkrax_field_mapping.html.erb index b72272c74..23d0422b0 100644 --- a/app/views/bulkrax/shared/_bulkrax_field_mapping.html.erb +++ b/app/views/bulkrax/shared/_bulkrax_field_mapping.html.erb @@ -5,7 +5,7 @@ Field mapping: - +
diff --git a/spec/controllers/concerns/bulkrax/datatables_behavior_spec.rb b/spec/controllers/concerns/bulkrax/datatables_behavior_spec.rb index 41c83c147..abfca8849 100644 --- a/spec/controllers/concerns/bulkrax/datatables_behavior_spec.rb +++ b/spec/controllers/concerns/bulkrax/datatables_behavior_spec.rb @@ -105,9 +105,9 @@ def current_user get :index result = controller.entry_util_links(entry, item) expect(result).to be_a(String) - expect(result).to include('glyphicon-info-sign') - expect(result).to include('glyphicon-repeat') - expect(result).to include('glyphicon-trash') + expect(result).to include('fa-info-circle') + expect(result).to include('fa-repeat') + expect(result).to include('fa-trash') end it 'includes a link to the entry' do @@ -131,28 +131,28 @@ def current_user entry = FactoryBot.create(:bulkrax_entry, importerexporter: item, status_message: 'Complete') get :index result = controller.status_message_for(entry) - expect(result).to include(' Complete') + expect(result).to include(' Complete') end it 'returns a string of HTML with a blue "horizontal ellipsis" icon when status_message is "Pending"' do entry = FactoryBot.create(:bulkrax_entry, importerexporter: item, status_message: 'Pending') get :index result = controller.status_message_for(entry) - expect(result).to include(' Pending') + expect(result).to include(' Pending') end it 'returns a string of HTML with a red "remove" icon when status_message is neither "Complete" nor "Pending"' do entry = FactoryBot.create(:bulkrax_entry, importerexporter: item, status_message: 'Error') get :index result = controller.status_message_for(entry) - expect(result).to include(' Error') + expect(result).to include(' Error') end it 'returns a string of HTML with a red "remove" icon when status_message is "Deleted"' do entry = FactoryBot.create(:bulkrax_entry, importerexporter: item, status_message: 'Deleted') get :index result = controller.status_message_for(entry) - expect(result).to include(' Deleted') + expect(result).to include(' Deleted') end end end