diff --git a/Gemfile b/Gemfile index cf5d2d6155..670a476caf 100644 --- a/Gemfile +++ b/Gemfile @@ -101,8 +101,6 @@ gem 'redis' gem 'sidekiq' gem 'sidekiq-scheduler' -gem "stimulus_reflex" - gem "turbo_power" gem "turbo-rails" diff --git a/Gemfile.lock b/Gemfile.lock index e2ec853230..69389e95a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -969,7 +969,6 @@ DEPENDENCIES spring-commands-rspec spring-commands-rubocop state_machines-activerecord - stimulus_reflex stimulus_reflex_testing! stringex (~> 2.8.5) stripe diff --git a/app/components/confirm_modal_component.rb b/app/components/confirm_modal_component.rb index 7dd75eb10a..eacd392d72 100644 --- a/app/components/confirm_modal_component.rb +++ b/app/components/confirm_modal_component.rb @@ -4,7 +4,6 @@ class ConfirmModalComponent < ModalComponent # @param actions_alignment_class [String] possible classes: 'justify-space-around', 'justify-end' def initialize( id:, - reflex: nil, controller: nil, message: nil, confirm_actions: nil, @@ -16,7 +15,6 @@ class ConfirmModalComponent < ModalComponent ) super(id:, close_button: true) @confirm_actions = confirm_actions - @reflex = reflex @form_url = form_url @controller = controller @message = message diff --git a/app/components/confirm_modal_component/confirm_modal_component.html.haml b/app/components/confirm_modal_component/confirm_modal_component.html.haml index d73415fa96..269ac4b3e6 100644 --- a/app/components/confirm_modal_component/confirm_modal_component.html.haml +++ b/app/components/confirm_modal_component/confirm_modal_component.html.haml @@ -1,4 +1,4 @@ -%div{ id: @id, "data-controller": "modal #{@controller}", "data-action": "keyup@document->modal#closeIfEscapeKey", "data-#{@controller}-reflex-value": @reflex } +%div{ id: @id, "data-controller": "modal #{@controller}", "data-action": "keyup@document->modal#closeIfEscapeKey" } .reveal-modal-bg.fade{ "data-modal-target": "background", "data-action": "click->modal#close" } .reveal-modal.fade.tiny.modal-component{ "data-modal-target": "modal" } - if @confirm_actions diff --git a/app/reflexes/application_reflex.rb b/app/reflexes/application_reflex.rb deleted file mode 100644 index 42981e5361..0000000000 --- a/app/reflexes/application_reflex.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -class ApplicationReflex < StimulusReflex::Reflex - # Put application-wide Reflex behavior and callbacks in this file. - # - # Learn more at: https://docs.stimulusreflex.com/rtfm/reflex-classes - # - # For code examples, considerations and caveats, see: - # https://docs.stimulusreflex.com/rtfm/patterns#internationalization - include CanCan::ControllerAdditions - - delegate :current_user, to: :connection - - before_reflex do - I18n.locale = current_user.locale - end - - private - - def current_ability - Spree::Ability.new(current_user) - end - - def morph_admin_flashes - morph "#flashes", render(partial: "admin/shared/flashes", locals: { flashes: flash }) - end -end diff --git a/app/reflexes/concerns/enterprise_concern.rb b/app/reflexes/concerns/enterprise_concern.rb deleted file mode 100644 index f508652fbd..0000000000 --- a/app/reflexes/concerns/enterprise_concern.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -module EnterpriseConcern - extend ActiveSupport::Concern - - included do - before_reflex do - @enterprise = Enterprise.find_by(permalink: params[:id]) - authorize! :update, @enterprise - end - end -end diff --git a/app/reflexes/example_reflex.rb b/app/reflexes/example_reflex.rb deleted file mode 100644 index 85ba85fd80..0000000000 --- a/app/reflexes/example_reflex.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true - -class ExampleReflex < ApplicationReflex - # Add Reflex methods in this file. - # - # All Reflex instances include CableReady::Broadcaster and expose the following properties: - # - # - connection - the ActionCable connection - # - channel - the ActionCable channel - # - request - an ActionDispatch::Request proxy for the socket connection - # - session - the ActionDispatch::Session store for the current visitor - # - flash - the ActionDispatch::Flash::FlashHash for the current request - # - url - the URL of the page that triggered the reflex - # - params - parameters from the element's closest form (if any) - # - element - a Hash like object that represents the HTML element that triggered the reflex - # - signed - use a signed Global ID to map dataset attribute to a model - # eg. element.signed[:foo] - # - unsigned - use an unsigned Global ID to map dataset attribute to a model - # eg. element.unsigned[:foo] - # - cable_ready - a special cable_ready that can broadcast to the current visitor - # (no brackets needed) - # - reflex_id - a UUIDv4 that uniquely identies each Reflex - # - tab_id - a UUIDv4 that uniquely identifies the browser tab - # - # Example: - # - # before_reflex do - # # throw :abort # this will prevent the Reflex from continuing - # # learn more about callbacks at https://docs.stimulusreflex.com/rtfm/lifecycle - # end - # - # def example(argument=true) - # # Your logic here... - # # Any declared instance variables will be made available to the Rails controller and view. - # end - # - # Learn more at: https://docs.stimulusreflex.com/rtfm/reflex-classes -end diff --git a/app/views/admin/enterprises/form/_business_details.html.haml b/app/views/admin/enterprises/form/_business_details.html.haml index 75d5aa857b..8a6a7ac312 100644 --- a/app/views/admin/enterprises/form/_business_details.html.haml +++ b/app/views/admin/enterprises/form/_business_details.html.haml @@ -36,7 +36,7 @@ = f.label :terms_and_conditions, t('.terms_and_conditions') %i.text-big.icon-question-sign{ "data-controller": "help-modal-link", "data-action": "click->help-modal-link#open", "data-help-modal-link-target-value": "terms_and_conditions_info_modal" } - .omega.eight.columns#terms_and_conditions{data: { 'reflex-root': '#terms_and_conditions' } } + .omega.eight.columns#terms_and_conditions - if @enterprise.terms_and_conditions.attached? = link_to "#{@enterprise.terms_and_conditions.blob.filename} #{ t('.uploaded_on') } #{@enterprise.terms_and_conditions.blob.created_at}", url_for(@enterprise.terms_and_conditions), target: '_blank' %div diff --git a/config/initializers/stimulus_reflex.rb b/config/initializers/stimulus_reflex.rb deleted file mode 100644 index 4e21afdc55..0000000000 --- a/config/initializers/stimulus_reflex.rb +++ /dev/null @@ -1,32 +0,0 @@ -# frozen_string_literal: true - -StimulusReflex.configure do |config| - - config.on_failed_sanity_checks = :warn - - # Enable/disable exiting / warning when the sanity checks fail options: - # `:exit` or `:warn` or `:ignore` - - # config.on_failed_sanity_checks = :exit - - # Override the parent class that the StimulusReflex ActionCable channel inherits from - - # config.parent_channel = "ApplicationCable::Channel" - - # Customize server-side Reflex logging format, with optional colorization: - # Available tokens: session_id, session_id_full, reflex_info, operation, reflex_id, reflex_id_full, mode, selector, operation_counter, connection_id, connection_id_full, timestamp - # Available colors: red, green, yellow, blue, magenta, cyan, white - # You can also use attributes from your ActionCable Connection's identifiers that resolve to valid ActiveRecord models - # eg. if your connection is `identified_by :current_user` and your User model has an email attribute, you can access r.email (it will display `-` if the user isn't logged in) - # Learn more at: https://docs.stimulusreflex.com/troubleshooting#stimulusreflex-logging - - # config.logging = proc { "[#{session_id}] #{operation_counter.magenta} #{reflex_info.green} -> #{selector.cyan} via #{mode} Morph (#{operation.yellow})" } - - # Optimized for speed, StimulusReflex doesn't enable Rack middleware by default. - # If you are using Page Morphs and your app uses Rack middleware to rewrite part of the request path, you must enable those middleware modules in StimulusReflex. - # - # Learn more about registering Rack middleware in Rails here: https://guides.rubyonrails.org/rails_on_rack.html#configuring-middleware-stack - - # config.middleware.use FirstRackMiddleware - # config.middleware.use SecondRackMiddleware -end diff --git a/package.json b/package.json index 3cb7496f98..7a22c42681 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ "shortcut-buttons-flatpickr": "^0.4.0", "stimulus": "^3.2.2", "stimulus-flatpickr": "^1.4.0", - "stimulus_reflex": "3.5.1", "tom-select": "^2.3.1", "trix": "^2.1.7", "turbo_power": "^0.7.0",