Commits vergleichen
9 Commits
main
...
fix-wizard
Autor | SHA1 | Datum | |
---|---|---|---|
|
a5af0b109d | ||
|
4ce82b0d17 | ||
|
6294f6f9c0 | ||
|
98391b565e | ||
|
779912332a | ||
|
1d2f75951f | ||
|
3433bd4141 | ||
|
dae803bf20 | ||
|
24d7ca646a |
4 geänderte Dateien mit 49 neuen und 34 gelöschten Zeilen
|
@ -10,19 +10,19 @@ class CustomWizard::Subscription
|
||||||
{
|
{
|
||||||
wizard: {
|
wizard: {
|
||||||
required: {
|
required: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
permitted: {
|
permitted: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*', "!#{CustomWizard::Wizard::GUEST_GROUP_ID}"]
|
community: ['*', "!#{CustomWizard::Wizard::GUEST_GROUP_ID}"]
|
||||||
},
|
},
|
||||||
restart_on_revisit: {
|
restart_on_revisit: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -30,19 +30,19 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
step: {
|
step: {
|
||||||
condition: {
|
condition: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
required_data: {
|
required_data: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
permitted_params: {
|
permitted_params: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -50,19 +50,19 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
field: {
|
field: {
|
||||||
condition: {
|
condition: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ['text', 'textarea', 'text_only', 'date', 'time', 'date_time', 'number', 'checkbox', 'dropdown', 'upload'],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
realtime_validations: {
|
realtime_validations: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -70,7 +70,7 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
action: {
|
action: {
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ['create_topic', 'update_profile', 'open_composer', 'route_to'],
|
||||||
standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'],
|
standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -78,13 +78,13 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
custom_field: {
|
custom_field: {
|
||||||
klass: {
|
klass: {
|
||||||
none: ['*'],
|
none: ['topic', 'post'],
|
||||||
standard: ['topic', 'post'],
|
standard: ['topic', 'post'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ['string', 'boolean', 'integer'],
|
||||||
standard: ['string', 'boolean', 'integer'],
|
standard: ['string', 'boolean', 'integer'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -92,7 +92,7 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
api: {
|
api: {
|
||||||
all: {
|
all: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: [],
|
standard: [],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -154,11 +154,14 @@ class CustomWizard::Subscription
|
||||||
end
|
end
|
||||||
|
|
||||||
def type
|
def type
|
||||||
return :business
|
return :none unless subscribed?
|
||||||
|
return :business if business?
|
||||||
|
return :standard if standard?
|
||||||
|
return :community if community?
|
||||||
end
|
end
|
||||||
|
|
||||||
def subscribed?
|
def subscribed?
|
||||||
true
|
standard? || business? || community?
|
||||||
end
|
end
|
||||||
|
|
||||||
def standard?
|
def standard?
|
||||||
|
@ -166,7 +169,7 @@ class CustomWizard::Subscription
|
||||||
end
|
end
|
||||||
|
|
||||||
def business?
|
def business?
|
||||||
true
|
product_slug === "business"
|
||||||
end
|
end
|
||||||
|
|
||||||
def community?
|
def community?
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
# name: discourse-custom-wizard
|
# name: discourse-custom-wizard
|
||||||
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
|
# 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
|
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
|
||||||
# url: https://github.com/paviliondev/discourse-custom-wizard
|
# url: https://github.com/paviliondev/discourse-custom-wizard
|
||||||
# contact_emails: development@pavilion.tech
|
# contact_emails: development@pavilion.tech
|
||||||
|
@ -239,10 +239,11 @@ after_initialize do
|
||||||
|
|
||||||
on(:before_create_topic) do |topic_params, user|
|
on(:before_create_topic) do |topic_params, user|
|
||||||
category = topic_params.category
|
category = topic_params.category
|
||||||
if category&.custom_fields&.[]('create_topic_wizard').present?
|
wizard_submission_id = topic_params.custom_fields&.[]('wizard_submission_id')
|
||||||
|
if category&.custom_fields&.[]('create_topic_wizard').present? && wizard_submission_id.blank?
|
||||||
raise Discourse::InvalidParameters.new(
|
raise Discourse::InvalidParameters.new(
|
||||||
I18n.t('wizard.error_messages.wizard_replacing_composer')
|
I18n.t('wizard.error_messages.wizard_replacing_composer')
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -24,7 +24,7 @@ describe CustomWizard::Subscription do
|
||||||
|
|
||||||
context "without a subscription client" do
|
context "without a subscription client" do
|
||||||
it "is not subscribed" do
|
it "is not subscribed" do
|
||||||
expect(described_class.subscribed?).to eq(true)
|
expect(described_class.subscribed?).to eq(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has none type" do
|
it "has none type" do
|
||||||
|
|
|
@ -121,19 +121,19 @@ const getUnsubscribedAdminWizards = {
|
||||||
subscription_attributes: {
|
subscription_attributes: {
|
||||||
wizard: {
|
wizard: {
|
||||||
required: {
|
required: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
permitted: {
|
permitted: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
restart_on_revisit: {
|
restart_on_revisit: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
|
@ -141,19 +141,19 @@ const getUnsubscribedAdminWizards = {
|
||||||
},
|
},
|
||||||
step: {
|
step: {
|
||||||
condition: {
|
condition: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
required_data: {
|
required_data: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
permitted_params: {
|
permitted_params: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
|
@ -161,19 +161,30 @@ const getUnsubscribedAdminWizards = {
|
||||||
},
|
},
|
||||||
field: {
|
field: {
|
||||||
condition: {
|
condition: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: [
|
||||||
|
"text",
|
||||||
|
"textarea",
|
||||||
|
"text_only",
|
||||||
|
"date",
|
||||||
|
"time",
|
||||||
|
"date_time",
|
||||||
|
"number",
|
||||||
|
"checkbox",
|
||||||
|
"dropdown",
|
||||||
|
"upload",
|
||||||
|
],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
realtime_validations: {
|
realtime_validations: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ["*"],
|
standard: ["*"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
|
@ -181,7 +192,7 @@ const getUnsubscribedAdminWizards = {
|
||||||
},
|
},
|
||||||
action: {
|
action: {
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ["create_topic", "update_profile", "open_composer", "route_to"],
|
||||||
standard: [
|
standard: [
|
||||||
"create_topic",
|
"create_topic",
|
||||||
"update_profile",
|
"update_profile",
|
||||||
|
@ -197,20 +208,20 @@ const getUnsubscribedAdminWizards = {
|
||||||
},
|
},
|
||||||
custom_field: {
|
custom_field: {
|
||||||
klass: {
|
klass: {
|
||||||
none: ['*'],
|
none: ["topic", "post"],
|
||||||
standard: ["topic", "post"],
|
standard: ["topic", "post"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ["string", "boolean", "integer"],
|
||||||
standard: ["string", "boolean", "integer"],
|
standard: ["string", "boolean", "integer"],
|
||||||
business: ["*"],
|
business: ["*"],
|
||||||
community: ["*"],
|
community: ["*"],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
api: {
|
api: {
|
||||||
all: { none: ["*"], standard: [], business: ["*"], community: ["*"] },
|
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
subscription_client_installed: false,
|
subscription_client_installed: false,
|
||||||
|
|
Laden …
In neuem Issue referenzieren