Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 09:20:29 +01:00
272 Zeilen
6,8 KiB
JSON
272 Zeilen
6,8 KiB
JSON
{
|
|
"id": "super_mega_fun_wizard",
|
|
"name": "Super Mega Fun Wizard",
|
|
"background": "#333333",
|
|
"save_submissions": true,
|
|
"after_signup": false,
|
|
"prompt_completion": false,
|
|
"theme_id": 2,
|
|
"steps": [
|
|
{
|
|
"id": "step_1",
|
|
"title": "Text",
|
|
"raw_description": "Text inputs!",
|
|
"fields": [
|
|
{
|
|
"id": "step_1_field_1",
|
|
"label": "Text",
|
|
"description": "Text field description.",
|
|
"type": "text",
|
|
"min_length": "3",
|
|
"prefill": [
|
|
{
|
|
"type": "assignment",
|
|
"output": "I am prefilled",
|
|
"output_type": "text",
|
|
"output_connector": "set"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "step_1_field_2",
|
|
"label": "Textarea",
|
|
"type": "textarea",
|
|
"min_length": ""
|
|
},
|
|
{
|
|
"id": "step_1_field_4",
|
|
"label": "I'm only text",
|
|
"description": "",
|
|
"type": "text_only"
|
|
}
|
|
],
|
|
"description": "Text inputs!"
|
|
},
|
|
{
|
|
"id": "step_2",
|
|
"title": "Values",
|
|
"raw_description": "Because I couldn't think of another name for this step :)",
|
|
"fields": [
|
|
{
|
|
"id": "step_2_field_1",
|
|
"label": "Date",
|
|
"type": "date",
|
|
"format": "YYYY-MM-DD"
|
|
},
|
|
{
|
|
"id": "step_2_field_2",
|
|
"label": "Time",
|
|
"type": "time",
|
|
"format": "HH:mm"
|
|
},
|
|
{
|
|
"id": "step_2_field_3",
|
|
"label": "Date & Time",
|
|
"type": "date_time",
|
|
"format": ""
|
|
},
|
|
{
|
|
"id": "step_2_field_4",
|
|
"label": "Number",
|
|
"type": "number"
|
|
},
|
|
{
|
|
"id": "step_2_field_5",
|
|
"label": "Checkbox",
|
|
"type": "checkbox"
|
|
}
|
|
],
|
|
"description": "Because I couldn't think of another name for this step :)"
|
|
},
|
|
{
|
|
"id": "step_3",
|
|
"title": "Combo-boxes",
|
|
"raw_description": "Unfortunately not the edible type :sushi: ",
|
|
"fields": [
|
|
{
|
|
"id": "step_3_field_1",
|
|
"label": "Custom Dropdown",
|
|
"type": "dropdown",
|
|
"content": [
|
|
{
|
|
"type": "association",
|
|
"pairs": [
|
|
{
|
|
"index": 0,
|
|
"key": "choice1",
|
|
"key_type": "text",
|
|
"value": "Choice 1",
|
|
"value_type": "text",
|
|
"connector": "equal"
|
|
},
|
|
{
|
|
"index": 1,
|
|
"key": "choice2",
|
|
"key_type": "text",
|
|
"value": "Choice 2",
|
|
"value_type": "text",
|
|
"connector": "association"
|
|
},
|
|
{
|
|
"index": 2,
|
|
"key": "choice3",
|
|
"key_type": "text",
|
|
"value": "Choice 3",
|
|
"value_type": "text",
|
|
"connector": "association"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"description": "Unfortunately not the edible type :sushi: "
|
|
}
|
|
],
|
|
"actions": [
|
|
{
|
|
"id": "action_1",
|
|
"run_after": "step_3",
|
|
"type": "create_topic",
|
|
"skip_redirect": true,
|
|
"post": "step_1_field_2",
|
|
"title": [
|
|
{
|
|
"type": "assignment",
|
|
"output": "step_1_field_1",
|
|
"output_type": "wizard_field",
|
|
"output_connector": "set"
|
|
}
|
|
],
|
|
"category": [
|
|
{
|
|
"type": "assignment",
|
|
"output": "step_3_field_3",
|
|
"output_type": "wizard_field",
|
|
"output_connector": "set"
|
|
}
|
|
],
|
|
"tags": [
|
|
{
|
|
"type": "assignment",
|
|
"output": "step_3_field_2",
|
|
"output_type": "wizard_field",
|
|
"output_connector": "set"
|
|
}
|
|
],
|
|
"custom_fields": [
|
|
{
|
|
"type": "association",
|
|
"pairs": [
|
|
{
|
|
"index": 0,
|
|
"key": "post_field",
|
|
"key_type": "text",
|
|
"value": "Post custom field value",
|
|
"value_type": "text",
|
|
"connector": "association"
|
|
},
|
|
{
|
|
"index": 1,
|
|
"key": "topic.topic_field",
|
|
"key_type": "text",
|
|
"value": "Topic custom field value",
|
|
"value_type": "text",
|
|
"connector": "association"
|
|
},
|
|
{
|
|
"index": 2,
|
|
"key": "topic.topic_json_field{}.key_1",
|
|
"key_type": "text",
|
|
"value": "Key 1 value",
|
|
"value_type": "text",
|
|
"connector": "association"
|
|
},
|
|
{
|
|
"index": 3,
|
|
"key": "topic.topic_json_field{}.key_2",
|
|
"key_type": "text",
|
|
"value": "Key 2 value",
|
|
"value_type": "text",
|
|
"connector": "association"
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"visible": [
|
|
{
|
|
"type": "conditional",
|
|
"output": "true",
|
|
"output_type": "text",
|
|
"output_connector": "then",
|
|
"pairs": [
|
|
{
|
|
"index": 0,
|
|
"key": "name",
|
|
"key_type": "user_field",
|
|
"value": "Angus",
|
|
"value_type": "text",
|
|
"connector": "equal"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "action_4",
|
|
"run_after": "step_2",
|
|
"type": "update_profile",
|
|
"profile_updates": [
|
|
{
|
|
"type": "association",
|
|
"pairs": [
|
|
{
|
|
"index": 0,
|
|
"key": "profile_background",
|
|
"key_type": "user_field",
|
|
"value": "step_2_field_7",
|
|
"value_type": "wizard_field",
|
|
"connector": "association"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "action_3",
|
|
"run_after": "step_2",
|
|
"type": "open_composer",
|
|
"post_builder": true,
|
|
"post_template": "I am interpolating some user fields u{name} u{username} u{email}",
|
|
"title": [
|
|
{
|
|
"type": "assignment",
|
|
"output": "Title of the composer topic",
|
|
"output_type": "text",
|
|
"output_connector": "set"
|
|
}
|
|
],
|
|
"tags": [
|
|
{
|
|
"type": "assignment",
|
|
"output": "tag1",
|
|
"output_type": "text",
|
|
"output_connector": "set"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "action_10",
|
|
"run_after": "step_3",
|
|
"type": "route_to",
|
|
"url": [
|
|
{
|
|
"type": "assignment",
|
|
"output": "https://google.com",
|
|
"output_type": "text",
|
|
"output_connector": "set"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|