diff --git a/Gemfile b/Gemfile index 7e7f5879..b0f1414f 100644 --- a/Gemfile +++ b/Gemfile @@ -14,9 +14,6 @@ gem 'pg' # Use Puma as the app server gem 'puma', '>= 5.0' -# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks -gem 'turbolinks', '~> 5' - # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.7' @@ -116,3 +113,5 @@ gem "local_time", "~> 2.1" gem "cssbundling-rails", "~> 1.1" gem "importmap-rails", "~> 1.1" + +gem "turbo-rails", "~> 2.0" diff --git a/Gemfile.lock b/Gemfile.lock index 7c697003..3afbfa76 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -452,9 +452,9 @@ GEM thor (1.3.2) timecop (0.9.10) timeout (0.4.1) - turbolinks (5.2.1) - turbolinks-source (~> 5.2) - turbolinks-source (5.2.0) + turbo-rails (2.0.11) + actionpack (>= 6.0.0) + railties (>= 6.0.0) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.2.0) @@ -545,7 +545,7 @@ DEPENDENCIES sprockets-rails sqlite3 (~> 1.4) timecop - turbolinks (~> 5) + turbo-rails (~> 2.0) tzinfo-data web-console webdrivers diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss index 101eedac..ac11754e 100644 --- a/app/assets/stylesheets/application.sass.scss +++ b/app/assets/stylesheets/application.sass.scss @@ -1,23 +1,26 @@ // Entrypoint for stylesheet -@import 'bootstrap-overrides'; -@import 'bootstrap/scss/bootstrap'; -@import 'variables'; -@import 'logo'; -@import 'pod-icons'; -@import 'rails_bootstrap_forms'; -@import 'organizations'; -@import 'streams'; -@import 'files'; +@import "bootstrap-overrides"; +@import "bootstrap/scss/bootstrap"; +@import "variables"; +@import "logo"; +@import "pod-icons"; +@import "rails_bootstrap_forms"; +@import "organizations"; +@import "streams"; +@import "files"; // background image for homepage banner #hero .bg-image { width: 100%; height: 100%; position: absolute; - background-image: url('hero.jpg'); + background-image: url("hero.jpg"); background-size: contain; - top: 0; bottom: 0; left: 0; right: 0; - filter:blur(3.5px) brightness(50%) sepia(50%) hue-rotate(160deg); + top: 0; + bottom: 0; + left: 0; + right: 0; + filter: blur(3.5px) brightness(50%) sepia(50%) hue-rotate(160deg); } .direct-upload { @@ -39,7 +42,9 @@ a { padding-left: 0.5rem; opacity: 0; - transition: color .15s ease-in-out,opacity .15s ease-in-out; + transition: + color 0.15s ease-in-out, + opacity 0.15s ease-in-out; } &:hover { a { @@ -57,7 +62,9 @@ min-width: 50px; background: $info; text-align: center; - transition: width 120ms ease-out, opacity 60ms 60ms ease-in; + transition: + width 120ms ease-out, + opacity 60ms 60ms ease-in; transform: translate3d(0, 0, 0); } @@ -73,7 +80,7 @@ border-color: $danger; } -input[type=file][data-direct-upload-url][disabled] { +input[type="file"][data-direct-upload-url][disabled] { display: none; } @@ -148,10 +155,10 @@ input[type=file][data-direct-upload-url][disabled] { font-weight: 500; } -// turbolinks progress bar: render in a more constrasting color, and prevent +// turbo progress bar: render in a more constrasting color, and prevent // layout shift when it appears by absolute-positioning it. see: // https://github.com/pod4lib/aggregator/issues/658 -.turbolinks-progress-bar { +.turbo-progress-bar { position: absolute; z-index: 1; top: 0; diff --git a/app/controllers/allowlisted_jwts_controller.rb b/app/controllers/allowlisted_jwts_controller.rb index 007854b0..608a1a02 100644 --- a/app/controllers/allowlisted_jwts_controller.rb +++ b/app/controllers/allowlisted_jwts_controller.rb @@ -20,7 +20,10 @@ def new; end def create respond_to do |format| if @allowlisted_jwt.save - format.html { redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully created.' } + format.html do + redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully created.', + status: :see_other + end format.json { render :show, status: :created, location: [@organization, @allowlisted_jwt] } else format.html { render :new } @@ -35,7 +38,10 @@ def destroy @allowlisted_jwt.destroy respond_to do |format| - format.html { redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully destroyed.' } + format.html do + redirect_to organization_allowlisted_jwts_path(@organization), notice: 'Token was successfully destroyed.', + status: :see_other + end format.json { head :no_content } end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 83e31620..26f3d5b4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -13,7 +13,7 @@ class ApplicationController < ActionController::Base rescue_from CanCan::AccessDenied do |exception| respond_to do |format| format.json { head :forbidden, content_type: 'text/html' } - format.html { redirect_to main_app.root_url, notice: exception.message } + format.html { redirect_to main_app.root_url, notice: exception.message, status: :see_other } format.js { head :forbidden, content_type: 'text/html' } end end diff --git a/app/controllers/contact_emails_controller.rb b/app/controllers/contact_emails_controller.rb index ccdbe2dc..76034be4 100644 --- a/app/controllers/contact_emails_controller.rb +++ b/app/controllers/contact_emails_controller.rb @@ -25,7 +25,7 @@ def render_or_redirect_with_flash(**messages) end if can? :read, @contact_email.organization - redirect_to @contact_email.organization + redirect_to @contact_email.organization, status: :see_other else render 'confirm' end diff --git a/app/controllers/organization_users_controller.rb b/app/controllers/organization_users_controller.rb index 68eedcd4..3e52d9e0 100644 --- a/app/controllers/organization_users_controller.rb +++ b/app/controllers/organization_users_controller.rb @@ -15,7 +15,9 @@ def update @user.add_role(params[:add_role], @organization) if params[:add_role].present? respond_to do |format| - format.html { redirect_to organization_users_url(@organization), notice: 'User role was successfully updated.' } + format.html do + redirect_to organization_users_url(@organization), notice: 'User role was successfully updated.', status: :see_other + end format.json { head :no_content } end end @@ -26,7 +28,9 @@ def destroy @user.destroy respond_to do |format| - format.html { redirect_to organization_users_url(@organization), notice: 'User was successfully removed.' } + format.html do + redirect_to organization_users_url(@organization), notice: 'User was successfully removed.', status: :see_other + end format.json { head :no_content } end end diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb index eb80e4e1..a9e9bb77 100644 --- a/app/controllers/organizations_controller.rb +++ b/app/controllers/organizations_controller.rb @@ -16,7 +16,7 @@ def index def show # make the org homepage for consumer orgs point to their org details default tab # see https://github.com/pod4lib/aggregator/issues/535#issuecomment-1103234114 - redirect_to organization_users_path(@organization) unless @organization.provider? + redirect_to organization_users_path(@organization), status: :see_other unless @organization.provider? @stream = @organization.default_stream if @organization.provider? @uploads = @organization.default_stream.uploads.active.order(created_at: :desc).page(params[:page]) @@ -30,7 +30,7 @@ def new # GET /organizations/1/provider_details def provider_details # consumer orgs don't have provider details; redirect to org details instead - redirect_to organization_details_organization_path(@organization) unless @organization.provider? + redirect_to organization_details_organization_path(@organization), status: :see_other unless @organization.provider? end # GET /organizations/1/organization_details @@ -43,7 +43,7 @@ def create respond_to do |format| if @organization.save - format.html { redirect_to @organization, notice: 'Organization was successfully created.' } + format.html { redirect_to @organization, notice: 'Organization was successfully created.', status: :see_other } format.json { render :show, status: :created, location: @organization } else format.html { render :new } @@ -71,7 +71,7 @@ def update def destroy @organization.destroy respond_to do |format| - format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.' } + format.html { redirect_to organizations_url, notice: 'Organization was successfully destroyed.', status: :see_other } format.json { head :no_content } end end diff --git a/app/controllers/site_users_controller.rb b/app/controllers/site_users_controller.rb index 9ba36985..1df61404 100644 --- a/app/controllers/site_users_controller.rb +++ b/app/controllers/site_users_controller.rb @@ -13,7 +13,7 @@ def update @user.add_role params[:add_role] if params[:add_role].present? respond_to do |format| - format.html { redirect_to site_users_url, notice: 'User role was successfully updated.' } + format.html { redirect_to site_users_url, notice: 'User role was successfully updated.', status: :see_other } format.json { head :no_content } end end diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index c7d0c841..fdf9a620 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb @@ -32,7 +32,7 @@ def create respond_to do |format| if @stream.save - format.html { redirect_to [@organization, @stream], notice: 'Stream was successfully created.' } + format.html { redirect_to [@organization, @stream], notice: 'Stream was successfully created.', status: :see_other } format.json { render :show, status: :created, location: [@organization, @stream] } else format.html { render :new } @@ -45,7 +45,7 @@ def destroy @stream.destroy respond_to do |format| - format.html { redirect_to organization_streams_path, notice: 'Stream was successfully destroyed.' } + format.html { redirect_to organization_streams_path, notice: 'Stream was successfully destroyed.', status: :see_other } format.json { head :no_content } end end @@ -63,7 +63,7 @@ def make_default @stream.make_default respond_to do |format| - format.html { redirect_to @organization, notice: 'Stream was successfully updated.' } + format.html { redirect_to @organization, notice: 'Stream was successfully updated.', status: :see_other } format.json { render :show, status: :ok, location: @organization } end end diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb index 7ac0473c..80e0f12b 100644 --- a/app/controllers/uploads_controller.rb +++ b/app/controllers/uploads_controller.rb @@ -29,7 +29,7 @@ def new; end def create respond_to do |format| if @upload.save - format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully created.' } + format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully created.', status: :see_other } format.json { render :show, status: :created, location: [@organization, @upload] } else format.html { render :new } @@ -43,7 +43,7 @@ def create def update respond_to do |format| if @upload.update(upload_params) - format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully updated.' } + format.html { redirect_to [@organization, @upload], notice: 'Upload was successfully updated.', status: :see_other } format.json { render :show, status: :ok, location: [@organization, @upload] } else format.html { render :edit } @@ -57,7 +57,9 @@ def update def destroy @upload.destroy respond_to do |format| - format.html { redirect_to organization_uploads_url(@organization), notice: 'Upload was successfully destroyed.' } + format.html do + redirect_to organization_uploads_url(@organization), notice: 'Upload was successfully destroyed.', status: :see_other + end format.json { head :no_content } end end diff --git a/app/javascript/application.js b/app/javascript/application.js index cac3ea2f..8f5cf0e1 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -1,10 +1,7 @@ // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails -import Rails from '@rails/ujs'; -import Turbolinks from 'turbolinks'; import * as ActiveStorage from "@rails/activestorage"; import LocalTime from "local-time" Rails.start(); -Turbolinks.start(); ActiveStorage.start(); LocalTime.start() @@ -13,4 +10,5 @@ import 'direct_uploads'; import 'pod_console'; import 'copy_to_clipboard'; import 'organizations'; -import 'tooltips' \ No newline at end of file +import 'tooltips' +import "@hotwired/turbo-rails" diff --git a/app/javascript/tooltips.js b/app/javascript/tooltips.js index 3d71f0df..6db63712 100644 --- a/app/javascript/tooltips.js +++ b/app/javascript/tooltips.js @@ -1,15 +1,15 @@ import * as bootstrap from 'bootstrap'; // Enable bootstrap tooltips, with localized time content if applicable -document.addEventListener('turbolinks:load', function() { +document.addEventListener('turbo:load', function() { var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')) - var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { + var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) { // Find any hidden time DOM elements within this tooltip var times = [].slice.call(tooltipTriggerEl.querySelectorAll('.hidden-tooltip-time[data-localized]')) var text = "" // Construct the tooltip text // See application_helper.js - times.forEach(function (timeEl) { + times.forEach(function (timeEl) { if (timeEl.classList.contains('default')) { text = text + ("Default since " + timeEl.innerHTML + "
") } diff --git a/app/views/allowlisted_jwts/index.html.erb b/app/views/allowlisted_jwts/index.html.erb index 58b0d675..d83f0421 100644 --- a/app/views/allowlisted_jwts/index.html.erb +++ b/app/views/allowlisted_jwts/index.html.erb @@ -27,7 +27,7 @@ - <%= link_to 'Revoke', [@organization, token], method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger' if can? :destroy, token %> + <%= link_to 'Revoke', [@organization, token], data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-danger' if can? :destroy, token %> <% end %> diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb index 6d7a99e4..85f5241b 100644 --- a/app/views/devise/registrations/edit.html.erb +++ b/app/views/devise/registrations/edit.html.erb @@ -50,5 +50,5 @@

Cancel account

- <%= button_to "Cancel my account", registration_path(resource_name), id: 'cancel_form', class: 'btn btn-danger', data: { confirm: "Are you sure you want to delete your account?" }, method: :delete %> + <%= button_to "Cancel my account", registration_path(resource_name), id: 'cancel_form', class: 'btn btn-danger', data: { turbo_method: :delete, turbo_confirm: "Are you sure you want to delete your account?" } %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 7ca5139e..fa726b1d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,7 +9,7 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> - <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> + <%= stylesheet_link_tag 'application', media: 'all', 'data-turbo-track': 'reload' %> <%= favicon_link_tag 'favicon.svg' %> <%= content_for(:head) %> <%= javascript_importmap_tags %> diff --git a/app/views/organization_users/index.html.erb b/app/views/organization_users/index.html.erb index 20112d46..9c894e37 100644 --- a/app/views/organization_users/index.html.erb +++ b/app/views/organization_users/index.html.erb @@ -25,15 +25,15 @@
<% if user.roles.map{|r| r['name']}.include? "owner" %> - <%= link_to '', organization_user_path(@organization, user, remove_role: 'owner'), method: :patch, data: { confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input checked', title: t('organization_users.index.remove_owner') %> + <%= link_to '', organization_user_path(@organization, user, remove_role: 'owner'), data: { turbo_method: :patch, turbo_confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input checked', title: t('organization_users.index.remove_owner') %> <% else %> - <%= link_to '', organization_user_path(@organization, user, add_role: 'owner'), method: :patch, data: { confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input', title: t('organization_users.index.add_owner') %> + <%= link_to '', organization_user_path(@organization, user, add_role: 'owner'), data: { turbo_method: :patch, turbo_confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input', title: t('organization_users.index.add_owner') %> <% end %>
- <%= link_to t('organization_users.index.remove_user'), organization_user_path(@organization, user), method: :delete, data: { confirm: t('organization_users.index.confirm_action') }, class: 'btn btn-danger btn-sm' %> + <%= link_to t('organization_users.index.remove_user'), organization_user_path(@organization, user), data: { turbo_method: :delete, turbo_confirm: t('organization_users.index.confirm_action') }, class: 'btn btn-danger btn-sm' %> <% else %> diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb index 20ded826..b5683630 100644 --- a/app/views/organizations/index.html.erb +++ b/app/views/organizations/index.html.erb @@ -31,7 +31,7 @@ <% if can? :manage, Organization %> <%= link_to 'Edit', organization_details_organization_path(organization), class: 'btn btn-secondary btn-sm' if can? :edit, organization %> - <%= link_to 'Delete', organization, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' if can? :destroy, organization %> + <%= link_to 'Delete', organization, data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' if can? :destroy, organization %> <% end %> @@ -81,7 +81,7 @@ <% if can? :manage, Organization %> <%= link_to 'Edit', organization_details_organization_path(organization), class: 'btn btn-secondary btn-sm' if can? :edit, organization %> - <%= link_to 'Delete', organization, method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' if can? :destroy, organization %> + <%= link_to 'Delete', organization, data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' if can? :destroy, organization %> <% end %> diff --git a/app/views/shared/_nav.html.erb b/app/views/shared/_nav.html.erb index 8bc9bed2..a9926704 100644 --- a/app/views/shared/_nav.html.erb +++ b/app/views/shared/_nav.html.erb @@ -17,12 +17,12 @@ <% end %> <% if can? :read, :pages_data %> <% end %> <% if can? :manage, :dashboard_controller %> <% end %> <% if can? :manage, User %> @@ -35,7 +35,7 @@ <% if current_user && current_user.has_role?(:admin) %> <%= t('.is_admin') %> <% end %> - + diff --git a/app/views/site_users/index.html.erb b/app/views/site_users/index.html.erb index d43f4aa4..50327916 100644 --- a/app/views/site_users/index.html.erb +++ b/app/views/site_users/index.html.erb @@ -22,10 +22,10 @@
<% if user.has_role? :admin %> - <%= link_to '', site_user_path(user, remove_role: 'admin'), method: :patch, data: { confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input checked', title: t('.remove_admin') %> + <%= link_to '', site_user_path(user, remove_role: 'admin'), data: { turbo_method: :patch, turbo_confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input checked', title: t('.remove_admin') %> <% else %> - <%= link_to '', site_user_path(user, add_role: 'admin'), method: :patch, data: { confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input', title: t('.add_admin') %> + <%= link_to '', site_user_path(user, add_role: 'admin'), data: { turbo_method: :patch, turbo_confirm: t('organization_users.index.confirm_action') }, class: 'form-check-input', title: t('.add_admin') %> <% end %>
diff --git a/app/views/streams/_header.html.erb b/app/views/streams/_header.html.erb index 7c348f79..06ad9701 100644 --- a/app/views/streams/_header.html.erb +++ b/app/views/streams/_header.html.erb @@ -9,6 +9,6 @@
<%= link_to t('.upload'), new_organization_upload_path(stream.organization, stream: (stream.default? ? nil : stream.friendly_id)), class: 'btn btn-primary' if can? :create, stream.uploads.build %> - <%= link_to t('.reanalyze'), reanalyze_organization_stream_path(stream.organization, stream), method: :post, class: 'btn btn-secondary align-self-center' if can?(:manage, stream) %> + <%= link_to t('.reanalyze'), reanalyze_organization_stream_path(stream.organization, stream), data: { turbo_method: :post }, class: 'btn btn-secondary align-self-center' if can?(:manage, stream) %>
diff --git a/app/views/streams/index.html.erb b/app/views/streams/index.html.erb index 68ccee28..ce32d675 100644 --- a/app/views/streams/index.html.erb +++ b/app/views/streams/index.html.erb @@ -28,8 +28,8 @@ <%= stream.files.size %> <%= number_to_human_size stream.files.sum { |file| file.blob.byte_size } %> - <%= link_to 'Make default', make_default_organization_streams_path(@organization, stream: stream.slug), method: :post, class: 'btn btn-sm btn-secondary' if !stream.default? && can?(:update, stream) %> - <%= link_to 'Delete', [@organization, stream], method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' if can? :destroy, stream %> + <%= link_to 'Make default', make_default_organization_streams_path(@organization, stream: stream.slug), data: { turbo_method: :post }, class: 'btn btn-sm btn-secondary' if !stream.default? && can?(:update, stream) %> + <%= link_to 'Delete', [@organization, stream], data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-sm btn-danger' if can? :destroy, stream %> <% end %> diff --git a/app/views/streams/profile.html.erb b/app/views/streams/profile.html.erb index 33e18744..447c2671 100644 --- a/app/views/streams/profile.html.erb +++ b/app/views/streams/profile.html.erb @@ -9,7 +9,7 @@
No MARC profiling data found.
- <%= link_to 'Re-analyze', reanalyze_organization_stream_path(@organization, @stream), method: :post, class: 'btn btn-secondary align-self-center mt-3' if can?(:reanalyze, @stream) %> + <%= link_to 'Re-analyze', reanalyze_organization_stream_path(@organization, @stream), data: { turbo_method: :post }, class: 'btn btn-secondary align-self-center mt-3' if can?(:reanalyze, @stream) %>
<% end %> <% end %> diff --git a/app/views/uploads/index.html.erb b/app/views/uploads/index.html.erb index 3dd43a91..d0da83b1 100644 --- a/app/views/uploads/index.html.erb +++ b/app/views/uploads/index.html.erb @@ -27,7 +27,7 @@ <%= link_to upload.name, [@organization, upload] %> <%= local_time(upload.created_at, format: datetime_display_format()) %> <%= link_to upload.stream.display_name, organization_stream_path(upload.stream.organization, upload.stream) %> - <%= link_to 'Delete', [@organization, upload], method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' if can? :destroy, upload %> + <%= link_to 'Delete', [@organization, upload], data: { turbo_method: :delete, turbo_confirm: 'Are you sure?' }, class: 'btn btn-danger btn-sm' if can? :destroy, upload %> <% end %> diff --git a/config/importmap.rb b/config/importmap.rb index 3467ec83..28a5a885 100644 --- a/config/importmap.rb +++ b/config/importmap.rb @@ -1,10 +1,9 @@ # Pin npm packages by running ./bin/importmap pin "application", preload: true -pin "turbolinks", to: "https://ga.jspm.io/npm:turbolinks@5.2.0/dist/turbolinks.js" pin "@rails/activestorage", to: "https://ga.jspm.io/npm:@rails/activestorage@7.0.4-1/app/assets/javascripts/activestorage.esm.js" pin "@popperjs/core", to: "https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/esm/popper.min.js", preload: true pin "bootstrap", to: "https://ga.jspm.io/npm:bootstrap@5.2.3/dist/js/bootstrap.esm.min.js", preload: true pin "local-time", to: "https://ga.jspm.io/npm:local-time@2.1.0/app/assets/javascripts/local-time.js" pin_all_from File.expand_path("../app/javascript", __dir__) -pin "@rails/ujs", to: "https://ga.jspm.io/npm:@rails/ujs@7.0.4-2/lib/assets/compiled/rails-ujs.js" +pin "@hotwired/turbo-rails", to: "turbo.min.js" diff --git a/spec/requests/data_spec.rb b/spec/requests/data_spec.rb index d5707235..032827c0 100644 --- a/spec/requests/data_spec.rb +++ b/spec/requests/data_spec.rb @@ -20,7 +20,7 @@ get data_url expect(response).not_to be_successful # redirect to login - expect(response).to have_http_status(:found) + expect(response).to have_http_status(:see_other) end it 'renders a successful response when logged in' do diff --git a/spec/views/organization_users/index.html.erb_spec.rb b/spec/views/organization_users/index.html.erb_spec.rb index 5bb7e5cb..96b9b9eb 100644 --- a/spec/views/organization_users/index.html.erb_spec.rb +++ b/spec/views/organization_users/index.html.erb_spec.rb @@ -48,12 +48,12 @@ it 'renders a link to delete the member account' do render - expect(rendered).to have_css("a[href='#{organization_user_path(organization, member)}'][data-method='delete']") + expect(rendered).to have_css("a[href='#{organization_user_path(organization, member)}'][data-turbo-method='delete']") end it 'renders a link to delete the owner account' do render - expect(rendered).to have_css("a[href='#{organization_user_path(organization, owner)}'][data-method='delete']") + expect(rendered).to have_css("a[href='#{organization_user_path(organization, owner)}'][data-turbo-method='delete']") end it 'renders a link to invite new user' do