Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-09 20:02:54 +01:00
merge main and bump patch
Dieser Commit ist enthalten in:
Commit
148e188490
3 geänderte Dateien mit 9 neuen und 3 gelöschten Zeilen
|
@ -72,6 +72,7 @@ const field = {
|
|||
required: null,
|
||||
type: null,
|
||||
condition: null,
|
||||
tag_groups: null,
|
||||
},
|
||||
types: {},
|
||||
mapped: ["prefill", "content", "condition", "index"],
|
||||
|
@ -241,6 +242,10 @@ const custom_field = {
|
|||
type: ["string", "boolean", "integer", "json"],
|
||||
};
|
||||
|
||||
export function buildFieldTypes(types) {
|
||||
wizardSchema.field.types = types;
|
||||
}
|
||||
|
||||
field.type = Object.keys(field.types);
|
||||
action.type = Object.keys(action.types);
|
||||
|
||||
|
@ -260,7 +265,7 @@ export function buildFieldValidations(validations) {
|
|||
export function filterValues(currentWizard, feature, attribute, values = null) {
|
||||
values = values || wizardSchema[feature][attribute];
|
||||
|
||||
if (currentWizard.allowGuests) {
|
||||
if (currentWizard && currentWizard.allowGuests) {
|
||||
const filteredFeature = wizardSchema.filters.allow_guests[feature];
|
||||
if (filteredFeature) {
|
||||
const filtered = filteredFeature[attribute];
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { buildFieldValidations } from "../lib/wizard-schema";
|
||||
import { buildFieldTypes, buildFieldValidations } from "../lib/wizard-schema";
|
||||
import EmberObject, { set } from "@ember/object";
|
||||
import { A } from "@ember/array";
|
||||
import { all } from "rsvp";
|
||||
|
@ -11,6 +11,7 @@ export default DiscourseRoute.extend({
|
|||
},
|
||||
|
||||
afterModel(model) {
|
||||
buildFieldTypes(model.field_types);
|
||||
buildFieldValidations(model.realtime_validations);
|
||||
|
||||
return all([
|
||||
|
|
|
@ -13,7 +13,7 @@ describe CustomWizard::AdminManagerController do
|
|||
template_3["id"] = 'super_mega_fun_wizard_3'
|
||||
@template_array = [template, template_2, template_3]
|
||||
|
||||
FileUtils.mkdir_p(file_from_fixtures_tmp_folder) unless Dir.exists?(file_from_fixtures_tmp_folder)
|
||||
FileUtils.mkdir_p(file_from_fixtures_tmp_folder) unless Dir.exist?(file_from_fixtures_tmp_folder)
|
||||
@tmp_file_path = File.join(file_from_fixtures_tmp_folder, SecureRandom.hex << 'wizards.json')
|
||||
File.write(@tmp_file_path, @template_array.to_json)
|
||||
end
|
||||
|
|
Laden …
In neuem Issue referenzieren