1
0
Fork 0

Commits vergleichen

..

7 Commits

Autor SHA1 Nachricht Datum
5fe63ec70e
test 2023-10-03 20:36:04 +02:00
6bc33ebd64
test 2023-10-03 20:25:00 +02:00
df456abda0
test3 2023-10-03 20:09:53 +02:00
df30ce32ee
test2 2023-10-03 19:54:15 +02:00
4750829e1a
testing 2023-10-03 19:35:16 +02:00
49535d88bb
set default type to business 2023-10-03 18:44:50 +02:00
Angus McLeod
d5aa616ff8 DEV: Add explicit ordering to more specs 2023-09-30 09:46:25 +08:00
7 geänderte Dateien mit 57 neuen und 78 gelöschten Zeilen

Datei anzeigen

@ -107,7 +107,6 @@ const action = {
post: null,
post_builder: null,
post_template: null,
tags: null,
skip_redirect: null,
custom_fields: null,
required: null,

Datei anzeigen

@ -84,28 +84,6 @@
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_topic.tags"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=this.action.tags
property="tags"
onUpdate=(action "mappedFieldUpdated")
options=(hash
tagSelection="output"
outputDefaultSelection="tag"
listSelection="output"
wizardFieldSelection=true
userFieldSelection="key,value"
context="action"
)
}}
</div>
</div>
{{#if this.action.post_builder}}
<div class="setting full">
<div class="setting-label">
@ -146,6 +124,28 @@
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_topic.tags"}}</label>
</div>
<div class="setting-value">
{{wizard-mapper
inputs=this.action.tags
property="tags"
onUpdate=(action "mappedFieldUpdated")
options=(hash
tagSelection="output"
outputDefaultSelection="tag"
listSelection="output"
wizardFieldSelection=true
userFieldSelection="key,value"
context="action"
)
}}
</div>
</div>
<div class="setting full field-mapper-setting">
<div class="setting-label">
<label>{{i18n "admin.wizard.action.create_topic.visible"}}</label>

Datei anzeigen

@ -104,7 +104,6 @@ class CustomWizard::Action
end
params = basic_topic_params
params.delete(:tags) unless user_can_tag
targets = CustomWizard::Mapper.new(
inputs: action['recipient'],
@ -611,10 +610,6 @@ class CustomWizard::Action
user: user
).perform
if tags = action_tags
params[:tags] = tags
end
params[:raw] = action['post_builder'] ?
mapper.interpolate(
action['post_template'],
@ -637,6 +632,10 @@ class CustomWizard::Action
params[:category] = category
end
if tags = action_tags
params[:tags] = tags
end
if public_topic_fields.any?
public_topic_fields.each do |field|
unless action[field].nil? || action[field] == ""
@ -838,9 +837,4 @@ class CustomWizard::Action
@log.join('; ')
)
end
def user_can_tag
allowed_groups =
SiteSetting.pm_tags_allowed_for_groups.split('|').map(&:to_i)
user.groups.pluck(:id).any? { |group| allowed_groups.include?(group) }
end
end

Datei anzeigen

@ -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?

Datei anzeigen

@ -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

Datei anzeigen

@ -24,7 +24,7 @@ describe CustomWizard::SubmissionSerializer do
it 'should return submission attributes' 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,

Datei anzeigen

@ -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,