0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-14 13:52:54 +01:00

Merge branch 'main' into subscription_client_update

Dieser Commit ist enthalten in:
Angus McLeod 2023-03-09 09:07:59 +01:00
Commit e422867729
2 geänderte Dateien mit 8 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -72,7 +72,7 @@ const field = {
required: null, required: null,
type: null, type: null,
condition: null, condition: null,
tag_groups: null tag_groups: null,
}, },
types: {}, types: {},
mapped: ["prefill", "content", "condition", "index"], mapped: ["prefill", "content", "condition", "index"],
@ -242,6 +242,10 @@ const custom_field = {
type: ["string", "boolean", "integer", "json"], type: ["string", "boolean", "integer", "json"],
}; };
export function buildFieldTypes(types) {
wizardSchema.field.types = types;
}
field.type = Object.keys(field.types); field.type = Object.keys(field.types);
action.type = Object.keys(action.types); action.type = Object.keys(action.types);
@ -261,7 +265,7 @@ export function buildFieldValidations(validations) {
export function filterValues(currentWizard, feature, attribute, values = null) { export function filterValues(currentWizard, feature, attribute, values = null) {
values = values || wizardSchema[feature][attribute]; values = values || wizardSchema[feature][attribute];
if (currentWizard.allowGuests) { if (currentWizard && currentWizard.allowGuests) {
const filteredFeature = wizardSchema.filters.allow_guests[feature]; const filteredFeature = wizardSchema.filters.allow_guests[feature];
if (filteredFeature) { if (filteredFeature) {
const filtered = filteredFeature[attribute]; const filtered = filteredFeature[attribute];

Datei anzeigen

@ -1,5 +1,5 @@
import DiscourseRoute from "discourse/routes/discourse"; 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 EmberObject, { set } from "@ember/object";
import { A } from "@ember/array"; import { A } from "@ember/array";
import { all } from "rsvp"; import { all } from "rsvp";
@ -11,6 +11,7 @@ export default DiscourseRoute.extend({
}, },
afterModel(model) { afterModel(model) {
buildFieldTypes(model.field_types);
buildFieldValidations(model.realtime_validations); buildFieldValidations(model.realtime_validations);
return all([ return all([