Skip to content

Commit 7cf99f2

Browse files
committed
Final cherry pick fixes
1 parent 3136b77 commit 7cf99f2

File tree

2 files changed

+21
-5
lines changed

2 files changed

+21
-5
lines changed

app/controllers/custom_wizard/wizard.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class CustomWizard::WizardController < ::ActionController::Base
66
include CanonicalURL::ControllerExtensions
77
include GlobalPath
88

9-
prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'views'))
9+
prepend_view_path(Rails.root.join('plugins', 'discourse-custom-wizard', 'app', 'views'))
1010
layout :set_wizard_layout
1111

1212
before_action :preload_wizard_json
@@ -47,10 +47,8 @@ def skip
4747
result = { success: 'OK' }
4848

4949
if current_user && wizard.can_access?
50-
submission = wizard.current_submission
51-
52-
if submission.present? && submission.redirect_to
53-
result.merge!(redirect_to: submission.redirect_to)
50+
if redirect_to = wizard.current_submission&.redirect_to
51+
result.merge!(redirect_to: redirect_to)
5452
end
5553

5654
wizard.cleanup_on_skip!

plugin.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,24 @@ def process_require_tree_discourse_directive(path = ".")
5252
end
5353
end
5454

55+
## Override necessary due to 'assets/javascripts/wizard', particularly its tests.
56+
def each_globbed_asset
57+
if @path
58+
root_path = "#{File.dirname(@path)}/assets/javascripts/discourse"
59+
60+
Dir.glob(["#{root_path}/**/*"]).sort.each do |f|
61+
f_str = f.to_s
62+
if File.directory?(f)
63+
yield [f, true]
64+
elsif f_str.end_with?(".js.es6") || f_str.end_with?(".hbs") || f_str.end_with?(".hbr")
65+
yield [f, false]
66+
elsif transpile_js && f_str.end_with?(".js")
67+
yield [f, false]
68+
end
69+
end
70+
end
71+
end
72+
5573
after_initialize do
5674
%w[
5775
../lib/custom_wizard/engine.rb

0 commit comments

Comments
 (0)