From 091362cb003c6c96073621da66132bb5a76021e1 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Tue, 14 Mar 2023 16:34:58 +0100 Subject: [PATCH 1/2] Remove subscription requirement for field interpolation. --- lib/custom_wizard/mapper.rb | 2 +- spec/components/custom_wizard/mapper_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/custom_wizard/mapper.rb b/lib/custom_wizard/mapper.rb index 410a50e4..9d26c82e 100644 --- a/lib/custom_wizard/mapper.rb +++ b/lib/custom_wizard/mapper.rb @@ -255,7 +255,7 @@ class CustomWizard::Mapper end end - if opts[:template] && CustomWizard::Subscription.subscribed? + if opts[:template] #&& CustomWizard::Subscription.subscribed? template = Liquid::Template.parse(string) string = template.render(data) end diff --git a/spec/components/custom_wizard/mapper_spec.rb b/spec/components/custom_wizard/mapper_spec.rb index 56778a07..f460cc01 100644 --- a/spec/components/custom_wizard/mapper_spec.rb +++ b/spec/components/custom_wizard/mapper_spec.rb @@ -373,7 +373,7 @@ describe CustomWizard::Mapper do expect(result).to eq(template_params["step_1_field_1"]) end - it "requires a subscription" do + it "does not require a subscription" do template = '{{ "w{step_1_field_1}" | size }}' mapper = create_template_mapper(template_params, user1) result = mapper.interpolate( @@ -383,7 +383,7 @@ describe CustomWizard::Mapper do wizard: true, value: true ) - expect(result).to eq("{{ \"#{template_params["step_1_field_1"]}\" | size }}") + expect(result).to eq("5") end context "with a subscription" do From 3a5430c767c9f7fcefdf198a000c8897c46e7364 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Tue, 14 Mar 2023 16:35:23 +0100 Subject: [PATCH 2/2] Bump version --- plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 54f9eeca..d7ffc7f4 100644 --- a/plugin.rb +++ b/plugin.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true # name: discourse-custom-wizard # about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more. -# version: 2.2.5 +# version: 2.2.6 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever # url: https://github.com/paviliondev/discourse-custom-wizard # contact_emails: development@pavilion.tech