Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
Final cherry pick fixes
Dieser Commit ist enthalten in:
Ursprung
3136b779b4
Commit
7cf99f2391
2 geänderte Dateien mit 21 neuen und 5 gelöschten Zeilen
|
@ -6,7 +6,7 @@ class CustomWizard::WizardController < ::ActionController::Base
|
|||
include CanonicalURL::ControllerExtensions
|
||||
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
|
||||
|
||||
before_action :preload_wizard_json
|
||||
|
@ -47,10 +47,8 @@ class CustomWizard::WizardController < ::ActionController::Base
|
|||
result = { success: 'OK' }
|
||||
|
||||
if current_user && wizard.can_access?
|
||||
submission = wizard.current_submission
|
||||
|
||||
if submission.present? && submission.redirect_to
|
||||
result.merge!(redirect_to: submission.redirect_to)
|
||||
if redirect_to = wizard.current_submission&.redirect_to
|
||||
result.merge!(redirect_to: redirect_to)
|
||||
end
|
||||
|
||||
wizard.cleanup_on_skip!
|
||||
|
|
18
plugin.rb
18
plugin.rb
|
@ -52,6 +52,24 @@ class ::Sprockets::DirectiveProcessor
|
|||
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
|
||||
%w[
|
||||
../lib/custom_wizard/engine.rb
|
||||
|
|
Laden …
In neuem Issue referenzieren