diff --git a/app/controllers/notification_controller.rb b/app/controllers/notification_controller.rb index 011acb4..70aa0d9 100644 --- a/app/controllers/notification_controller.rb +++ b/app/controllers/notification_controller.rb @@ -1,9 +1,7 @@ COUNT ||= 0 class NotificationController < ApplicationController - def index - logger.info 'index' - end + def index; end def show_notice flash.alert = %w[titi toto] if params[:multiple] == 'true' @@ -17,7 +15,7 @@ class NotificationController < ApplicationController def turbo_notice COUNT += 1 - # TODO: render_stream (partial + flash -> flash.now + optional replace|append) + # TODO: render_stream (partial + flash -> flash.now + optional replace|append + notice|alert) flash.now[:notice] = "coucou ##{COUNT}" render turbo_stream: [ turbo_stream.replace(:flash, partial: 'layouts/components/flash') diff --git a/app/javascript/controllers/flash_controller.js b/app/javascript/controllers/flash_controller.js index 75d8bb6..def2cc8 100644 --- a/app/javascript/controllers/flash_controller.js +++ b/app/javascript/controllers/flash_controller.js @@ -14,7 +14,7 @@ export default class FlashController extends Controller { static targets = ['flashItem'] connect() { - if (FlashController.should_popup) { this.buildPopupFromWithin() } + if (FlashController.should_popup) { this.buildPopupsFromWithin() } } enable() { FlashController.should_popup = true } @@ -27,7 +27,7 @@ export default class FlashController extends Controller { textNotice(message) { return `${this.iconNotice()}