diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa9eaa3..d529fce 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -45,6 +45,8 @@ jobs: run: bundle install - name: Prepare SQLite run: RAILS_ENV=test bundle exec rake db:migrate --trace + - name: Precompile assets + run: RAILS_ENV=test bundle exec rails app:assets:clobber app:assets:precompile - name: Run tests run: bundle exec rails test diff --git a/CHANGELOG.md b/CHANGELOG.md index 6943646..cb19bc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## [Unreleased] -* no unreleased changes +### Changed +* new views with bootstrap 5 styles +* switch to bootstrap-icons as glyphicon no longer available in bootstrap 5 ## 2.3.2 / 2024-11-21 ### Fixed diff --git a/app/helpers/ndr_error/application_helper.rb b/app/helpers/ndr_error/application_helper.rb index 546a728..92915ea 100644 --- a/app/helpers/ndr_error/application_helper.rb +++ b/app/helpers/ndr_error/application_helper.rb @@ -2,11 +2,6 @@ module NdrError # Application-wide helpers. # TODO: await ndr_ui gem! module ApplicationHelper - # Bootstrap icon tag. - def glyphicon_tag(type) - content_tag(:span, '', class: "glyphicon glyphicon-#{type}") - end - # Pagination helper for will_paginate: def pagination_summary_for(collection) page = collection.current_page diff --git a/app/helpers/ndr_error/errors_helper.rb b/app/helpers/ndr_error/errors_helper.rb index 4296571..9b28641 100644 --- a/app/helpers/ndr_error/errors_helper.rb +++ b/app/helpers/ndr_error/errors_helper.rb @@ -56,9 +56,9 @@ def downstream_fingerprint_link(print) bootstrap_list_link_to hash + ' - ' + text, error_fingerprint_path(print) end - def ticket_link_for(fingerprint, small = false) - text = glyphicon_tag('asterisk') + ' View ticket' - css = 'btn btn-default' + def ticket_link_for(fingerprint, small = false) # rubocop:disable Style/OptionalBooleanParameter + text = "#{bootstrap_icon_tag('asterisk', :bi)} View ticket" + css = 'btn btn-outline-secondary' css << ' btn-xs' if small url = fingerprint.ticket_url @@ -66,15 +66,15 @@ def ticket_link_for(fingerprint, small = false) end def edit_button_for(fingerprint) - css = 'btn btn-default' - text = glyphicon_tag('pencil') + ' Edit Ticket' + css = 'btn btn-outline-secondary' + text = "#{bootstrap_icon_tag('pencil', :bi)} Edit Ticket" link_to(text, edit_error_fingerprint_path(fingerprint), class: css) end def purge_button_for(fingerprint) css = 'btn btn-danger' - text = glyphicon_tag('trash icon-white') + ' Purge' + text = "#{bootstrap_icon_tag('trash-fill', :bi)} Purge" options = { 'method' => :delete, @@ -86,18 +86,18 @@ def purge_button_for(fingerprint) end def previous_button_for(error) - css = 'btn btn-default' + css = 'btn btn-outline-secondary' css << ' disabled' if error.nil? - text = glyphicon_tag('chevron-left') + text = bootstrap_icon_tag('chevron-left', :bi) path = error.nil? ? '#' : error_fingerprint_path(error.error_fingerprint, log_id: error) link_to(text, path, class: css) end def next_button_for(error) - css = 'btn btn-default' + css = 'btn btn-outline-secondary' css << ' disabled' if error.nil? - text = glyphicon_tag('chevron-right') + text = bootstrap_icon_tag('chevron-right', :bi) path = error.nil? ? '#' : error_fingerprint_path(error.error_fingerprint, log_id: error) link_to(text, path, class: css) diff --git a/app/views/layouts/ndr_error/ndr_error.html.erb b/app/views/layouts/ndr_error/ndr_error.html.erb index ea98962..0e829f2 100644 --- a/app/views/layouts/ndr_error/ndr_error.html.erb +++ b/app/views/layouts/ndr_error/ndr_error.html.erb @@ -8,19 +8,14 @@
- <%= form.submit 'Update', class: 'btn btn-primary' %> - <%= link_to 'Cancel', error_fingerprint_path(@fingerprint), class: 'btn btn-default' %> + <%= link_to 'Cancel', error_fingerprint_path(@fingerprint), class: 'btn btn-outline-secondary' %> <% end %> diff --git a/app/views/ndr_error/errors/index.html.erb b/app/views/ndr_error/errors/index.html.erb index 1652f48..244b32b 100644 --- a/app/views/ndr_error/errors/index.html.erb +++ b/app/views/ndr_error/errors/index.html.erb @@ -5,16 +5,14 @@ %>