From e02f78569a30b78fec9697aca18b0388cb0a5b83 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 29 Sep 2023 08:33:39 +0800 Subject: [PATCH 1/3] FIX: explicitly order submission list for specs --- lib/custom_wizard/submission.rb | 2 ++ lib/custom_wizard/subscription.rb | 2 +- spec/serializers/custom_wizard/submission_serializer_spec.rb | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/custom_wizard/submission.rb b/lib/custom_wizard/submission.rb index ae616b0b..7387902e 100644 --- a/lib/custom_wizard/submission.rb +++ b/lib/custom_wizard/submission.rb @@ -131,6 +131,8 @@ class CustomWizard::Submission params[:key] = list_actor_id if list_actor_id query = PluginStoreRow.where(params) + query = query.order(order_by) if order_by + result = OpenStruct.new(submissions: [], total: nil) query.each do |record| diff --git a/lib/custom_wizard/subscription.rb b/lib/custom_wizard/subscription.rb index ee72b7f8..23de1808 100644 --- a/lib/custom_wizard/subscription.rb +++ b/lib/custom_wizard/subscription.rb @@ -157,7 +157,7 @@ class CustomWizard::Subscription return :none unless subscribed? return :business if business? return :standard if standard? - return :community if community? + :community if community? end def subscribed? diff --git a/spec/serializers/custom_wizard/submission_serializer_spec.rb b/spec/serializers/custom_wizard/submission_serializer_spec.rb index 2fa000e8..d81cfb15 100644 --- a/spec/serializers/custom_wizard/submission_serializer_spec.rb +++ b/spec/serializers/custom_wizard/submission_serializer_spec.rb @@ -40,7 +40,7 @@ describe CustomWizard::SubmissionSerializer do it "should return field values, types and labels" do wizard = CustomWizard::Wizard.create(template_json["id"]) - list = CustomWizard::Submission.list(wizard, page: 0) + list = CustomWizard::Submission.list(wizard, page: 0, order_by: 'id') json_array = ActiveModel::ArraySerializer.new( list.submissions, From 98b2d85e63d924df58509c79a546a2dcc18e8eb2 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 29 Sep 2023 08:36:51 +0800 Subject: [PATCH 2/3] Bump version --- plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 7d3f7679..497a1461 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.4.23 +# version: 2.4.24 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos # url: https://github.com/paviliondev/discourse-custom-wizard # contact_emails: development@pavilion.tech From cef2cc1b65b67fb80e88c1ddc7b6053d54120517 Mon Sep 17 00:00:00 2001 From: Robert <35533304+merefield@users.noreply.github.com> Date: Wed, 4 Oct 2023 16:57:09 +0100 Subject: [PATCH 3/3] bump patch --- plugin.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.rb b/plugin.rb index 3a84371b..680c7191 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.4.24 +# version: 2.4.25 # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos # url: https://github.com/paviliondev/discourse-custom-wizard # contact_emails: development@pavilion.tech