Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-05-19 23:40:07 +02:00
Commits vergleichen
27 Commits
f13376cffa
...
11ea613188
Autor | SHA1 | Datum | |
---|---|---|---|
11ea613188 | |||
ca1aae4050 | |||
140f11ecc6 | |||
2b96fc53fc | |||
908bca742f | |||
7b3d848df0 | |||
007ab7ac37 | |||
9c43f89cd3 | |||
ac5d41d914 | |||
bafb09a502 | |||
092fd10c38 | |||
235ff68133 | |||
12bdf642f4 | |||
0d5c9393b2 | |||
30b2651490 | |||
3ac50bc300 | |||
654a00d84b | |||
dc9df6c8fd | |||
34229abf09 | |||
1255d05d21 | |||
e07a5ac59b | |||
ac71bb90a5 | |||
de48cd1c55 | |||
7d0bde23be | |||
17f7ecc0dd | |||
359d8131f7 | |||
233e091bbb |
|
@ -166,7 +166,10 @@ class CustomWizard::AdminWizardController < CustomWizard::AdminController
|
|||
visibility_level: mapped_params,
|
||||
members_visibility_level: mapped_params,
|
||||
add_event: mapped_params,
|
||||
add_location: mapped_params
|
||||
add_location: mapped_params,
|
||||
public_exit: mapped_params,
|
||||
public_admission: mapped_params,
|
||||
primary_group: mapped_params
|
||||
]
|
||||
)
|
||||
end
|
||||
|
|
|
@ -173,6 +173,9 @@ const action = {
|
|||
visibility_level: null,
|
||||
members_visibility_level: null,
|
||||
custom_fields: null,
|
||||
public_exit: true,
|
||||
public_admission: true,
|
||||
primary_group: true,
|
||||
},
|
||||
},
|
||||
mapped: [
|
||||
|
@ -205,6 +208,9 @@ const action = {
|
|||
"members_visibility_level",
|
||||
"add_event",
|
||||
"add_location",
|
||||
"public_exit",
|
||||
"public_admission",
|
||||
"primary_group",
|
||||
],
|
||||
required: ["id", "type"],
|
||||
dependent: {},
|
||||
|
|
|
@ -740,6 +740,60 @@
|
|||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.public_exit"}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.public_exit
|
||||
property="public_exit"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
textSelection=true
|
||||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.public_admission"}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.public_admission
|
||||
property="public_admission"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
textSelection=true
|
||||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.primary_group"}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.primary_group
|
||||
property="primary_group"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
textSelection=true
|
||||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if createCategory}}
|
||||
|
|
|
@ -383,6 +383,9 @@ de:
|
|||
messageable_level: Nachrichtbare Ebene
|
||||
visibility_level: Sichtbarkeitsstufe
|
||||
members_visibility_level: Sichtbarkeitsstufe der Mitglieder
|
||||
public_exit: Erlaube Gruppenaustritt
|
||||
public_admission: Erlaube der Gruppe beizutreten
|
||||
primary_group: Primäre Gruppe
|
||||
custom_field:
|
||||
nav_label: "Benutzerdefinierte Felder"
|
||||
add: "Hinzufügen"
|
||||
|
|
|
@ -429,6 +429,9 @@ en:
|
|||
messageable_level: Messageable Level
|
||||
visibility_level: Visibility Level
|
||||
members_visibility_level: Members Visibility Level
|
||||
public_exit: Allow Group exit
|
||||
public_admission: Allow Group joining
|
||||
primary_group: Primary Group
|
||||
|
||||
custom_field:
|
||||
nav_label: "Custom Fields"
|
||||
|
|
|
@ -425,7 +425,7 @@ class CustomWizard::Action
|
|||
).perform
|
||||
end
|
||||
|
||||
if action['code']
|
||||
if action['code'].present?
|
||||
@submission.fields[action['code']] = SecureRandom.hex(8)
|
||||
url += "&#{action['code']}=#{@submission.fields[action['code']]}"
|
||||
end
|
||||
|
@ -666,6 +666,9 @@ class CustomWizard::Action
|
|||
visibility_level
|
||||
members_visibility_level
|
||||
grant_trust_level
|
||||
public_exit
|
||||
public_admission
|
||||
primary_group
|
||||
).each do |attr|
|
||||
input = action[attr]
|
||||
|
||||
|
|
|
@ -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.6.3
|
||||
# version: 2.6.4
|
||||
# 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
|
||||
|
|
|
@ -212,11 +212,23 @@ describe CustomWizard::Action do
|
|||
end
|
||||
end
|
||||
|
||||
it 're-routes a user' do
|
||||
wizard = CustomWizard::Builder.new(@template[:id], user).build
|
||||
updater = wizard.create_updater(wizard.steps.last.id, {})
|
||||
updater.update
|
||||
expect(updater.result[:redirect_on_next]).to eq("https://google.com")
|
||||
context "route to action" do
|
||||
it 're-routes a user' do
|
||||
wizard = CustomWizard::Builder.new(@template[:id], user).build
|
||||
updater = wizard.create_updater(wizard.steps.last.id, {})
|
||||
updater.update
|
||||
expect(updater.result[:redirect_on_next]).to eq("https://google.com")
|
||||
end
|
||||
|
||||
it "works if the code field has a blank string" do
|
||||
wizard_template[:actions].last[:code] = " "
|
||||
update_template(wizard_template)
|
||||
|
||||
wizard = CustomWizard::Builder.new(@template[:id], user).build
|
||||
updater = wizard.create_updater(wizard.steps.last.id, {})
|
||||
updater.update
|
||||
expect(updater.result[:redirect_on_next]).to eq("https://google.com")
|
||||
end
|
||||
end
|
||||
|
||||
context "standard subscription actions" do
|
||||
|
|
26
spec/fixtures/actions/create_group.json
gevendort
26
spec/fixtures/actions/create_group.json
gevendort
|
@ -100,5 +100,29 @@
|
|||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
],
|
||||
"public_exit": [
|
||||
{
|
||||
"type": "assignment",
|
||||
"output": "false",
|
||||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
],
|
||||
"public_admission": [
|
||||
{
|
||||
"type": "assignment",
|
||||
"output": "false",
|
||||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
],
|
||||
"primary_group": [
|
||||
{
|
||||
"type": "assignment",
|
||||
"output": "false",
|
||||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
26
spec/fixtures/actions/create_group_bad_user.json
gevendort
26
spec/fixtures/actions/create_group_bad_user.json
gevendort
|
@ -100,5 +100,29 @@
|
|||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
],
|
||||
"public_exit": [
|
||||
{
|
||||
"type": "assignment",
|
||||
"output": "false",
|
||||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
],
|
||||
"public_admission": [
|
||||
{
|
||||
"type": "assignment",
|
||||
"output": "false",
|
||||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
],
|
||||
"primary_group": [
|
||||
{
|
||||
"type": "assignment",
|
||||
"output": "false",
|
||||
"output_type": "text",
|
||||
"output_connector": "set"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Laden …
In neuem Issue referenzieren