Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 20:02:54 +01:00
Remove unused ExtraLocaleController extension
Dieser Commit ist enthalten in:
Ursprung
e99d5a86a2
Commit
37c18ff324
3 geänderte Dateien mit 0 neuen und 44 gelöschten Zeilen
|
@ -1,16 +0,0 @@
|
|||
module ExtraLocalesControllerCustomWizard
|
||||
def show
|
||||
if request.referer && URI(request.referer).path.include?('/w/')
|
||||
bundle = params[:bundle]
|
||||
|
||||
if params[:v]&.size == 32
|
||||
hash = ::ExtraLocalesController.bundle_js_hash(bundle)
|
||||
immutable_for(1.year) if hash == params[:v]
|
||||
end
|
||||
|
||||
render plain: ::ExtraLocalesController.bundle_js(bundle), content_type: "application/javascript"
|
||||
else
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
|
@ -76,7 +76,6 @@ after_initialize do
|
|||
../serializers/custom_wizard/wizard_step_serializer.rb
|
||||
../serializers/custom_wizard/wizard_serializer.rb
|
||||
../serializers/custom_wizard/log_serializer.rb
|
||||
../extensions/extra_locales_controller.rb
|
||||
../extensions/invites_controller.rb
|
||||
../extensions/users_controller.rb
|
||||
../extensions/wizard_field.rb
|
||||
|
@ -155,7 +154,6 @@ after_initialize do
|
|||
redirect_to_wizard_if_required if current_user
|
||||
end
|
||||
|
||||
::ExtraLocalesController.prepend ExtraLocalesControllerCustomWizard
|
||||
::InvitesController.prepend InvitesControllerCustomWizard
|
||||
::UsersController.prepend CustomWizardUsersController
|
||||
::Wizard::Field.prepend CustomWizardFieldExtension
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe ExtraLocalesControllerCustomWizard, type: :request do
|
||||
before do
|
||||
CustomWizard::Template.save(
|
||||
JSON.parse(File.open(
|
||||
"#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/wizard.json"
|
||||
).read),
|
||||
skip_jobs: true)
|
||||
end
|
||||
|
||||
before do
|
||||
@controller = ExtraLocalesController.new
|
||||
end
|
||||
|
||||
it "returns locales when requested by wizard" do
|
||||
@controller.request = ActionController::TestRequest.create(@controller.class)
|
||||
@controller.request.env['HTTP_REFERER'] = "/w/super-mega-fun-wizard"
|
||||
|
||||
expect(
|
||||
ExtraLocalesController.url("wizard")
|
||||
).to eq(
|
||||
"#{Discourse.base_path}/extra-locales/wizard?v=#{ExtraLocalesController.bundle_js_hash("wizard")}"
|
||||
)
|
||||
end
|
||||
end
|
Laden …
In neuem Issue referenzieren