-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Turbolinks with Turbo (and upgrade Stimulus) (#1181)
# What it does * Replaces Turbolinks in the app with the newer version of the library, Turbo. * Upgrades Stimulus to the latest version * Replaces our PortalRendering code with equivalent Turbo-based code. Fixes #1184. # Why it is important Turbolinks is EOLed, and we need to upgrade to Turbo to get back on a supported library. And by using Turbo instead of custom code, we have less to maintain and it's easier for contributors to understand how things work as there are many resources out there for learning Turbo. # Implementation notes * This is based on the main parts of #810, without the use of real-time Turbo Streams as that requires Redis. We can add that later if needed, but I don't want to pull in that dependency as a part of this. # Your bandwidth for additional changes to this PR _Please choose one of the following to help the project maintainers provide the appropriate level of support:_ - [x] I have the time and interest to make additional changes to this PR based on feedback. - [ ] I am interested in feedback but don't need to make the changes myself. - [ ] I don't have time or interest in making additional changes to this work. - [ ] Other or not sure (please describe): --------- Co-authored-by: derrick lannaman <derrick.lannaman@powerhrg.com>
- Loading branch information
1 parent
21caabf
commit ddf61a1
Showing
191 changed files
with
924 additions
and
838 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
tbody tr { | ||
.drag-handle { | ||
cursor: grab; | ||
width: 36px; | ||
} | ||
&.notified { | ||
background: $gray-color-light; | ||
|
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 |
---|---|---|
|
@@ -684,9 +684,7 @@ form.membership-amount { | |
} | ||
} | ||
|
||
.button_to { | ||
display: inline; | ||
} | ||
|
||
|
||
.columns { | ||
margin-top: 0 !important; | ||
|
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
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
24 changes: 20 additions & 4 deletions
24
app/controllers/admin/appointment_completions_controller.rb
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 |
---|---|---|
@@ -1,19 +1,35 @@ | ||
module Admin | ||
class AppointmentCompletionsController < BaseController | ||
before_action :are_appointments_enabled? | ||
include ActionView::RecordIdentifier | ||
|
||
include PortalRendering | ||
before_action :are_appointments_enabled? | ||
|
||
def create | ||
@appointment = Appointment.find(params[:appointment_id]) | ||
@appointment.update!(completed_at: Time.current, staff_updating: true) | ||
render_to_portal("admin/appointments/appointment", table_row: true, locals: {appointment: @appointment}) | ||
|
||
render_appointment_to_turbo_stream | ||
end | ||
|
||
def destroy | ||
@appointment = Appointment.find(params[:appointment_id]) | ||
@appointment.update!(completed_at: nil, staff_updating: true) | ||
render_to_portal("admin/appointments/appointment", table_row: true, locals: {appointment: @appointment}) | ||
|
||
render_appointment_to_turbo_stream | ||
end | ||
|
||
private | ||
|
||
def render_appointment_to_turbo_stream | ||
respond_to do |format| | ||
format.turbo_stream { | ||
render turbo_stream: | ||
turbo_stream.replace( | ||
dom_id(@appointment), | ||
render_to_string(partial: "admin/appointments/appointment", locals: {appointment: @appointment}) | ||
) | ||
} | ||
end | ||
end | ||
end | ||
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
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
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
Oops, something went wrong.