Commits vergleichen
6 Commits
fix-wizard
...
main
Autor | SHA1 | Datum | |
---|---|---|---|
5fe63ec70e | |||
6bc33ebd64 | |||
df456abda0 | |||
df30ce32ee | |||
4750829e1a | |||
49535d88bb |
4 geänderte Dateien mit 34 neuen und 49 gelöschten Zeilen
|
@ -10,19 +10,19 @@ class CustomWizard::Subscription
|
|||
{
|
||||
wizard: {
|
||||
required: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
permitted: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*', "!#{CustomWizard::Wizard::GUEST_GROUP_ID}"]
|
||||
},
|
||||
restart_on_revisit: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -30,19 +30,19 @@ class CustomWizard::Subscription
|
|||
},
|
||||
step: {
|
||||
condition: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
required_data: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
permitted_params: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -50,19 +50,19 @@ class CustomWizard::Subscription
|
|||
},
|
||||
field: {
|
||||
condition: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
type: {
|
||||
none: ['text', 'textarea', 'text_only', 'date', 'time', 'date_time', 'number', 'checkbox', 'dropdown', 'upload'],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
realtime_validations: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -70,7 +70,7 @@ class CustomWizard::Subscription
|
|||
},
|
||||
action: {
|
||||
type: {
|
||||
none: ['create_topic', 'update_profile', 'open_composer', 'route_to'],
|
||||
none: ['*'],
|
||||
standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -78,13 +78,13 @@ class CustomWizard::Subscription
|
|||
},
|
||||
custom_field: {
|
||||
klass: {
|
||||
none: ['topic', 'post'],
|
||||
none: ['*'],
|
||||
standard: ['topic', 'post'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
type: {
|
||||
none: ['string', 'boolean', 'integer'],
|
||||
none: ['*'],
|
||||
standard: ['string', 'boolean', 'integer'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -92,7 +92,7 @@ class CustomWizard::Subscription
|
|||
},
|
||||
api: {
|
||||
all: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: [],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -154,14 +154,11 @@ class CustomWizard::Subscription
|
|||
end
|
||||
|
||||
def type
|
||||
return :none unless subscribed?
|
||||
return :business if business?
|
||||
return :standard if standard?
|
||||
return :community if community?
|
||||
return :business
|
||||
end
|
||||
|
||||
def subscribed?
|
||||
standard? || business? || community?
|
||||
true
|
||||
end
|
||||
|
||||
def standard?
|
||||
|
@ -169,7 +166,7 @@ class CustomWizard::Subscription
|
|||
end
|
||||
|
||||
def business?
|
||||
product_slug === "business"
|
||||
true
|
||||
end
|
||||
|
||||
def community?
|
||||
|
|
|
@ -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.23
|
||||
# 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
|
||||
|
@ -239,11 +239,10 @@ after_initialize do
|
|||
|
||||
on(:before_create_topic) do |topic_params, user|
|
||||
category = topic_params.category
|
||||
wizard_submission_id = topic_params.custom_fields&.[]('wizard_submission_id')
|
||||
if category&.custom_fields&.[]('create_topic_wizard').present? && wizard_submission_id.blank?
|
||||
if category&.custom_fields&.[]('create_topic_wizard').present?
|
||||
raise Discourse::InvalidParameters.new(
|
||||
I18n.t('wizard.error_messages.wizard_replacing_composer')
|
||||
)
|
||||
I18n.t('wizard.error_messages.wizard_replacing_composer')
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ describe CustomWizard::Subscription do
|
|||
|
||||
context "without a subscription client" do
|
||||
it "is not subscribed" do
|
||||
expect(described_class.subscribed?).to eq(false)
|
||||
expect(described_class.subscribed?).to eq(true)
|
||||
end
|
||||
|
||||
it "has none type" do
|
||||
|
|
|
@ -121,19 +121,19 @@ const getUnsubscribedAdminWizards = {
|
|||
subscription_attributes: {
|
||||
wizard: {
|
||||
required: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
permitted: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
restart_on_revisit: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
|
@ -141,19 +141,19 @@ const getUnsubscribedAdminWizards = {
|
|||
},
|
||||
step: {
|
||||
condition: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
required_data: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
permitted_params: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
|
@ -161,30 +161,19 @@ const getUnsubscribedAdminWizards = {
|
|||
},
|
||||
field: {
|
||||
condition: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
type: {
|
||||
none: [
|
||||
"text",
|
||||
"textarea",
|
||||
"text_only",
|
||||
"date",
|
||||
"time",
|
||||
"date_time",
|
||||
"number",
|
||||
"checkbox",
|
||||
"dropdown",
|
||||
"upload",
|
||||
],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
realtime_validations: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ["*"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
|
@ -192,7 +181,7 @@ const getUnsubscribedAdminWizards = {
|
|||
},
|
||||
action: {
|
||||
type: {
|
||||
none: ["create_topic", "update_profile", "open_composer", "route_to"],
|
||||
none: ['*'],
|
||||
standard: [
|
||||
"create_topic",
|
||||
"update_profile",
|
||||
|
@ -208,20 +197,20 @@ const getUnsubscribedAdminWizards = {
|
|||
},
|
||||
custom_field: {
|
||||
klass: {
|
||||
none: ["topic", "post"],
|
||||
none: ['*'],
|
||||
standard: ["topic", "post"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
type: {
|
||||
none: ["string", "boolean", "integer"],
|
||||
none: ['*'],
|
||||
standard: ["string", "boolean", "integer"],
|
||||
business: ["*"],
|
||||
community: ["*"],
|
||||
},
|
||||
},
|
||||
api: {
|
||||
all: { none: [], standard: [], business: ["*"], community: ["*"] },
|
||||
all: { none: ["*"], standard: [], business: ["*"], community: ["*"] },
|
||||
},
|
||||
},
|
||||
subscription_client_installed: false,
|
||||
|
|
Laden …
In neuem Issue referenzieren