-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migration from Webpacker to Importmap (#108)
* refactor: Migrated to importmap instead of webpacker Importmap (https://github.com/rails/importmap-rails) instead of the retired webpacker * Added bootstrap in proper importmap manner * refactor: Removed webpacker gem Removal of gem introduced a couple a breaking issues that were also addressed in this commit: - Turbolinks needed to replaced by turbo - Route to delete needed to follow a new format * fix: Fixed devise config to work with Turbo Devise had issues with Turbo and did'nt work out of the box: heartcombo/devise#5446 Workaround/solution as shown here: https://betterprogramming.pub/devise-auth-setup-in-rails-7-44240aaed4be * fix: Fixed delete format for Program * Undid changes required for windows local running * Removed yarn and webpacker steps from Github tests * Removed webpacker + yarn steps in makefile * Removed yarn and package.json from Dockerfile * fix: Fix to destroy tests failing The addition of the 'Turbo' library changed the way delete alert was shown. For some reason, test was too fast and click action does not work. Adding a 1 second delay before click fixed the test.
- Loading branch information
1 parent
bc2851d
commit b3c43d1
Showing
40 changed files
with
90 additions
and
25,543 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
# Turbo does not work Devise out of the box | ||
# Issue on GitHub: https://github.com/heartcombo/devise/issues/5446 | ||
# Workaround/fix: https://gorails.com/episodes/devise-hotwire-turbo & https://betterprogramming.pub/devise-auth-setup-in-rails-7-44240aaed4be | ||
# | ||
class TurboDeviseController < ApplicationController | ||
class Responder < ActionController::Responder | ||
def to_turbo_stream | ||
controller.render(options.merge(formats: :html)) | ||
rescue ActionView::MissingTemplate => error | ||
if get? | ||
raise error | ||
elsif has_errors? && default_action | ||
render rendering_options.merge(formats: :html, status: :unprocessable_entity) | ||
else | ||
redirect_to navigation_location | ||
end | ||
end | ||
end | ||
|
||
self.responder = Responder | ||
respond_to :html, :turbo_stream | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails | ||
import "@hotwired/turbo-rails" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,12 +4,8 @@ | |
<title>ModuleHandbook</title> | ||
<%= csrf_meta_tags %> | ||
<%= csp_meta_tag %> | ||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> | ||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> | ||
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> | ||
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %> | ||
<script src="/docx/index.js"></script> | ||
<%= javascript_importmap_tags %> | ||
</head> | ||
|
||
<body> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require_relative "../config/application" | ||
require "importmap/commands" |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.