Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-05-18 15:00:05 +02:00
Commits vergleichen
26 Commits
880d73730e
...
0a04884f5e
Autor | SHA1 | Datum | |
---|---|---|---|
0a04884f5e | |||
0d0fb83bd1 | |||
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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import Component from "@ember/component";
|
||||
import { equal } from "@ember/object/computed";
|
||||
import { ajax, getToken } from "discourse/lib/ajax";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
|
||||
export default Component.extend({
|
||||
classNames: ["validator"],
|
||||
|
@ -20,7 +20,6 @@ export default Component.extend({
|
|||
return ajax("/realtime-validations", {
|
||||
data: {
|
||||
type: this.get("type"),
|
||||
authenticity_token: getToken(),
|
||||
...params,
|
||||
},
|
||||
});
|
||||
|
|
|
@ -35,13 +35,12 @@ export default Component.extend({
|
|||
}
|
||||
|
||||
const validationBuffer = cloneJSON(this.get("field.validations"));
|
||||
let bufferCategories;
|
||||
if (
|
||||
validationBuffer.similar_topics &&
|
||||
(bufferCategories = validationBuffer.similar_topics.categories)
|
||||
) {
|
||||
const categories = Category.findByIds(bufferCategories);
|
||||
validationBuffer.similar_topics.categories = categories;
|
||||
let bufferCategories = validationBuffer.similar_topics?.categories || [];
|
||||
if (bufferCategories) {
|
||||
validationBuffer.similar_topics.categories =
|
||||
Category.findByIds(bufferCategories);
|
||||
} else {
|
||||
validationBuffer.similar_topics.categories = [];
|
||||
}
|
||||
this.set("validationBuffer", validationBuffer);
|
||||
},
|
||||
|
|
|
@ -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: {},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<a href={{topic.url}} target="_blank" rel="noopener noreferrer">
|
||||
<span class="title">{{html-safe topic.fancy_title}}</span>
|
||||
<div class="blurb">{{date-node topic.created_at}}
|
||||
<div class="blurb"><RelativeDate @date={{@topic.created_at}} />
|
||||
-
|
||||
{{html-safe topic.blurb}}</div>
|
||||
</a>
|
|
@ -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}}
|
||||
|
|
|
@ -18,13 +18,14 @@
|
|||
}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
{{category-selector
|
||||
categories=(get
|
||||
this (concat "validationBuffer." type ".categories")
|
||||
)
|
||||
onChange=(action "updateValidationCategories" type props)
|
||||
<CategorySelector
|
||||
@categories={{get
|
||||
this
|
||||
(concat "validationBuffer." type ".categories")
|
||||
}}
|
||||
@onChange={{action "updateValidationCategories" type props}}
|
||||
class="wizard"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="validation-section">
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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]
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ class CustomWizard::RealtimeValidation::SimilarTopics
|
|||
|
||||
result = CustomWizard::RealtimeValidation::Result.new(:similar_topic)
|
||||
|
||||
if title.length < SiteSetting.min_title_similar_length || !Topic.count_exceeds_minimum?
|
||||
if title.length < SiteSetting.min_title_similar_length
|
||||
return result
|
||||
end
|
||||
|
||||
|
|
|
@ -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.7
|
||||
# version: 2.6.8
|
||||
# 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
|
||||
|
|
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