From 630fb849fa7ab3185be45c47c9434d5328dfc82e Mon Sep 17 00:00:00 2001 From: wandji20 Date: Sun, 13 Oct 2024 01:22:11 +0100 Subject: [PATCH] remove cable ready from application controller and refactor shared/alert to resend email confirmation with turbo_stream --- app/controllers/application_controller.rb | 1 - app/controllers/concerns/cablecar_responses.rb | 15 --------------- app/views/layouts/_alert.html.haml | 3 ++- 3 files changed, 2 insertions(+), 17 deletions(-) delete mode 100644 app/controllers/concerns/cablecar_responses.rb diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c31e748a30..0e535c0e9f 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,7 +9,6 @@ require 'spree/core/controller_helpers/common' require 'open_food_network/referer_parser' class ApplicationController < ActionController::Base - include CablecarResponses include Pagy::Backend include RequestTimeouts diff --git a/app/controllers/concerns/cablecar_responses.rb b/app/controllers/concerns/cablecar_responses.rb deleted file mode 100644 index b98d158dae..0000000000 --- a/app/controllers/concerns/cablecar_responses.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -module CablecarResponses - extend ActiveSupport::Concern - - included do - include CableReady::Broadcaster - end - - private - - def partial(path, options = {}) - { html: render_to_string(partial: path, **options) } - end -end diff --git a/app/views/layouts/_alert.html.haml b/app/views/layouts/_alert.html.haml index 36db8b7e31..be1bc76ba9 100644 --- a/app/views/layouts/_alert.html.haml +++ b/app/views/layouts/_alert.html.haml @@ -1,5 +1,6 @@ .alert-box{ class: "#{type}" } = message - if local_assigns[:unconfirmed] - %a{ "data-action": "login-modal#resend_confirmation", "data-tab": local_assigns[:tab] } + - params = { spree_user: { email: email }, tab: local_assigns[:tab] } + = link_to spree_user_confirmation_path(params), params:, data: { turbo_method: :post } do = t('devise.confirmations.resend_confirmation_email')