0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 02:50:28 +01:00

Final cherry pick fixes

Dieser Commit ist enthalten in:
Angus McLeod 2022-06-15 09:57:20 +02:00
Ursprung 3136b779b4
Commit 7cf99f2391
2 geänderte Dateien mit 21 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -6,7 +6,7 @@ class CustomWizard::WizardController < ::ActionController::Base
include CanonicalURL::ControllerExtensions include CanonicalURL::ControllerExtensions
include GlobalPath include GlobalPath
prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'views')) prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'app', 'views'))
layout :set_wizard_layout layout :set_wizard_layout
before_action :preload_wizard_json before_action :preload_wizard_json
@ -47,10 +47,8 @@ class CustomWizard::WizardController < ::ActionController::Base
result = { success: 'OK' } result = { success: 'OK' }
if current_user && wizard.can_access? if current_user && wizard.can_access?
submission = wizard.current_submission if redirect_to = wizard.current_submission&.redirect_to
result.merge!(redirect_to: redirect_to)
if submission.present? && submission.redirect_to
result.merge!(redirect_to: submission.redirect_to)
end end
wizard.cleanup_on_skip! wizard.cleanup_on_skip!

Datei anzeigen

@ -52,6 +52,24 @@ class ::Sprockets::DirectiveProcessor
end end
end end
## Override necessary due to 'assets/javascripts/wizard', particularly its tests.
def each_globbed_asset
if @path
root_path = "#{File.dirname(@path)}/assets/javascripts/discourse"
Dir.glob(["#{root_path}/**/*"]).sort.each do |f|
f_str = f.to_s
if File.directory?(f)
yield [f, true]
elsif f_str.end_with?(".js.es6") || f_str.end_with?(".hbs") || f_str.end_with?(".hbr")
yield [f, false]
elsif transpile_js && f_str.end_with?(".js")
yield [f, false]
end
end
end
end
after_initialize do after_initialize do
%w[ %w[
../lib/custom_wizard/engine.rb ../lib/custom_wizard/engine.rb