0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-26 02:50:28 +01:00
Dieser Commit ist enthalten in:
Angus McLeod 2022-03-16 12:46:16 +01:00
Ursprung 8893e6caf1
Commit 835600c054
59 geänderte Dateien mit 1635 neuen und 1564 gelöschten Zeilen

Datei anzeigen

@ -64,7 +64,7 @@ export default {
this.set("customWizardCriticalNotices", criticalNotices); this.set("customWizardCriticalNotices", criticalNotices);
} }
}); });
} },
}); });
api.modifyClass("component:d-navigation", { api.modifyClass("component:d-navigation", {

Datei anzeigen

@ -1,6 +1,6 @@
import { import {
default as computed, default as computed,
observes observes,
} from "discourse-common/utils/decorators"; } from "discourse-common/utils/decorators";
import { renderAvatar } from "discourse/helpers/user-avatar"; import { renderAvatar } from "discourse/helpers/user-avatar";
import userSearch from "../lib/user-search"; import userSearch from "../lib/user-search";

Datei anzeigen

@ -1,7 +1,7 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/field-validators', layoutName: "wizard/templates/components/field-validators",
actions: { actions: {
perform() { perform() {

Datei anzeigen

@ -10,7 +10,7 @@ import { dasherize } from "@ember/string";
export default WizardFieldValidator.extend({ export default WizardFieldValidator.extend({
classNames: ["similar-topics-validator"], classNames: ["similar-topics-validator"],
layoutName: 'wizard/templates/components/similar-topics-validator', layoutName: "wizard/templates/components/similar-topics-validator",
similarTopics: null, similarTopics: null,
hasInput: notEmpty("field.value"), hasInput: notEmpty("field.value"),
hasSimilarTopics: notEmpty("similarTopics"), hasSimilarTopics: notEmpty("similarTopics"),

Datei anzeigen

@ -6,7 +6,7 @@ import { getToken } from "wizard/lib/ajax";
export default Component.extend({ export default Component.extend({
classNames: ["validator"], classNames: ["validator"],
classNameBindings: ["isValid", "isInvalid"], classNameBindings: ["isValid", "isInvalid"],
layoutName: 'wizard/templates/components/validator', layoutName: "wizard/templates/components/validator",
validMessageKey: null, validMessageKey: null,
invalidMessageKey: null, invalidMessageKey: null,
isValid: null, isValid: null,

Datei anzeigen

@ -13,7 +13,7 @@ import { uploadIcon } from "discourse/lib/uploads";
import { dasherize } from "@ember/string"; import { dasherize } from "@ember/string";
export default ComposerEditor.extend({ export default ComposerEditor.extend({
layoutName: 'wizard/templates/components/wizard-composer-editor', layoutName: "wizard/templates/components/wizard-composer-editor",
classNameBindings: ["fieldClass"], classNameBindings: ["fieldClass"],
allowUpload: true, allowUpload: true,
showLink: false, showLink: false,

Datei anzeigen

@ -2,7 +2,7 @@ import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
classNames: ["wizard-composer-hyperlink"], classNames: ["wizard-composer-hyperlink"],
layoutName: 'wizard/templates/components/wizard-composer-hyperlink', layoutName: "wizard/templates/components/wizard-composer-hyperlink",
actions: { actions: {
addLink() { addLink() {

Datei anzeigen

@ -3,7 +3,7 @@ import discourseComputed from "discourse-common/utils/decorators";
export default DateInput.extend({ export default DateInput.extend({
useNativePicker: false, useNativePicker: false,
layoutName: 'wizard/templates/components/wizard-date-input', layoutName: "wizard/templates/components/wizard-date-input",
@discourseComputed() @discourseComputed()
placeholder() { placeholder() {

Datei anzeigen

@ -2,7 +2,7 @@ import DateTimeInput from "discourse/components/date-time-input";
import discourseComputed from "discourse-common/utils/decorators"; import discourseComputed from "discourse-common/utils/decorators";
export default DateTimeInput.extend({ export default DateTimeInput.extend({
layoutName: 'wizard/templates/components/wizard-date-time-input', layoutName: "wizard/templates/components/wizard-date-time-input",
@discourseComputed("timeFirst", "tabindex") @discourseComputed("timeFirst", "tabindex")
timeTabindex(timeFirst, tabindex) { timeTabindex(timeFirst, tabindex) {

Datei anzeigen

@ -2,7 +2,7 @@ import { observes } from "discourse-common/utils/decorators";
import Category from "discourse/models/category"; import Category from "discourse/models/category";
export default Ember.Component.extend({ export default Ember.Component.extend({
layoutName: 'wizard/templates/components/wizard-field-category', layoutName: "wizard/templates/components/wizard-field-category",
didInsertElement() { didInsertElement() {
const property = this.field.property || "id"; const property = this.field.property || "id";

Datei anzeigen

@ -1,5 +1,5 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-checkbox' layoutName: "wizard/templates/components/wizard-field-checkbox",
}); });

Datei anzeigen

@ -7,7 +7,7 @@ import { ajax } from "discourse/lib/ajax";
import { on } from "discourse-common/utils/decorators"; import { on } from "discourse-common/utils/decorators";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-composer-preview', layoutName: "wizard/templates/components/wizard-field-composer-preview",
@on("init") @on("init")
updatePreview() { updatePreview() {

Datei anzeigen

@ -5,7 +5,7 @@ import {
import EmberObject from "@ember/object"; import EmberObject from "@ember/object";
export default Ember.Component.extend({ export default Ember.Component.extend({
layoutName: 'wizard/templates/components/wizard-field-composer', layoutName: "wizard/templates/components/wizard-field-composer",
showPreview: false, showPreview: false,
classNameBindings: [ classNameBindings: [

Datei anzeigen

@ -2,7 +2,7 @@ import Component from "@ember/component";
import { observes } from "discourse-common/utils/decorators"; import { observes } from "discourse-common/utils/decorators";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-date-time', layoutName: "wizard/templates/components/wizard-field-date-time",
@observes("dateTime") @observes("dateTime")
setValue() { setValue() {

Datei anzeigen

@ -2,7 +2,7 @@ import Component from "@ember/component";
import { observes } from "discourse-common/utils/decorators"; import { observes } from "discourse-common/utils/decorators";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-date', layoutName: "wizard/templates/components/wizard-field-date",
@observes("date") @observes("date")
setValue() { setValue() {

Datei anzeigen

@ -1,7 +1,7 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-dropdown', layoutName: "wizard/templates/components/wizard-field-dropdown",
keyPress(e) { keyPress(e) {
e.stopPropagation(); e.stopPropagation();

Datei anzeigen

@ -1,5 +1,5 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-group' layoutName: "wizard/templates/components/wizard-field-group",
}); });

Datei anzeigen

@ -1,5 +1,5 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-number' layoutName: "wizard/templates/components/wizard-field-number",
}); });

Datei anzeigen

@ -1,5 +1,5 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-tag' layoutName: "wizard/templates/components/wizard-field-tag",
}); });

Datei anzeigen

@ -1,7 +1,7 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-text', layoutName: "wizard/templates/components/wizard-field-text",
keyPress(e) { keyPress(e) {
e.stopPropagation(); e.stopPropagation();

Datei anzeigen

@ -1,7 +1,7 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-textarea', layoutName: "wizard/templates/components/wizard-field-textarea",
keyPress(e) { keyPress(e) {
e.stopPropagation(); e.stopPropagation();

Datei anzeigen

@ -2,7 +2,7 @@ import Component from "@ember/component";
import { observes } from "discourse-common/utils/decorators"; import { observes } from "discourse-common/utils/decorators";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-time', layoutName: "wizard/templates/components/wizard-field-time",
@observes("time") @observes("time")
setValue() { setValue() {

Datei anzeigen

@ -3,7 +3,7 @@ import Component from "@ember/component";
import { computed } from "@ember/object"; import { computed } from "@ember/object";
export default Component.extend(UppyUploadMixin, { export default Component.extend(UppyUploadMixin, {
layoutName: 'wizard/templates/components/wizard-field-upload', layoutName: "wizard/templates/components/wizard-field-upload",
classNames: ["wizard-field-upload"], classNames: ["wizard-field-upload"],
classNameBindings: ["isImage"], classNameBindings: ["isImage"],
uploading: false, uploading: false,

Datei anzeigen

@ -1,5 +1,5 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-url' layoutName: "wizard/templates/components/wizard-field-url",
}); });

Datei anzeigen

@ -1,5 +1,5 @@
import Component from "@ember/component"; import Component from "@ember/component";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field-user-selector' layoutName: "wizard/templates/components/wizard-field-user-selector",
}); });

Datei anzeigen

@ -4,8 +4,13 @@ import discourseComputed from "discourse-common/utils/decorators";
import { cook } from "discourse/plugins/discourse-custom-wizard/wizard/lib/text-lite"; import { cook } from "discourse/plugins/discourse-custom-wizard/wizard/lib/text-lite";
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-field', layoutName: "wizard/templates/components/wizard-field",
classNameBindings: [":wizard-field", "typeClasses", "field.invalid", "field.id"], classNameBindings: [
":wizard-field",
"typeClasses",
"field.invalid",
"field.id",
],
@discourseComputed("field.type", "field.id") @discourseComputed("field.type", "field.id")
typeClasses: (type, id) => typeClasses: (type, id) =>

Datei anzeigen

@ -3,7 +3,7 @@ import { computed } from "@ember/object";
import { makeArray } from "discourse-common/lib/helpers"; import { makeArray } from "discourse-common/lib/helpers";
export default ComboBox.extend({ export default ComboBox.extend({
layoutName: 'wizard/templates/components/wizard-group-selector', layoutName: "wizard/templates/components/wizard-group-selector",
content: computed("groups.[]", "field.content.[]", function () { content: computed("groups.[]", "field.content.[]", function () {
const whitelist = makeArray(this.field.content); const whitelist = makeArray(this.field.content);
return this.groups return this.groups

Datei anzeigen

@ -4,17 +4,17 @@ import Component from "@ember/component";
import { dasherize } from "@ember/string"; import { dasherize } from "@ember/string";
export default Component.extend({ export default Component.extend({
classNameBindings: [':wizard-no-access', 'reasonClass'], classNameBindings: [":wizard-no-access", "reasonClass"],
layoutName: 'wizard/templates/components/wizard-no-access', layoutName: "wizard/templates/components/wizard-no-access",
@discourseComputed('reason') @discourseComputed("reason")
reasonClass(reason) { reasonClass(reason) {
return dasherize(reason); return dasherize(reason);
}, },
@discourseComputed @discourseComputed
siteName() { siteName() {
return (this.siteSettings.title || ''); return this.siteSettings.title || "";
}, },
actions: { actions: {

Datei anzeigen

@ -4,7 +4,7 @@ import { observes } from "discourse-common/utils/decorators";
export default Component.extend({ export default Component.extend({
classNames: ["wizard-similar-topics"], classNames: ["wizard-similar-topics"],
layoutName: 'wizard/templates/components/wizard-similar-topics', layoutName: "wizard/templates/components/wizard-similar-topics",
showTopics: true, showTopics: true,
didInsertElement() { didInsertElement() {

Datei anzeigen

@ -12,7 +12,7 @@ import CustomWizard from "../models/wizard";
const alreadyWarned = {}; const alreadyWarned = {};
export default Component.extend({ export default Component.extend({
layoutName: 'wizard/templates/components/wizard-step', layoutName: "wizard/templates/components/wizard-step",
classNameBindings: [":wizard-step", "step.id"], classNameBindings: [":wizard-step", "step.id"],
saving: null, saving: null,
@ -27,7 +27,7 @@ export default Component.extend({
}, },
@discourseComputed("step.index", "wizard.required") @discourseComputed("step.index", "wizard.required")
showQuitButton: (index, required) => (index === 0 && !required), showQuitButton: (index, required) => index === 0 && !required,
showNextButton: not("step.final"), showNextButton: not("step.final"),
showDoneButton: alias("step.final"), showDoneButton: alias("step.final"),

Datei anzeigen

@ -1,5 +1,5 @@
import TimeInput from "discourse/components/time-input"; import TimeInput from "discourse/components/time-input";
export default TimeInput.extend({ export default TimeInput.extend({
layoutName: 'wizard/templates/components/wizard-time-input' layoutName: "wizard/templates/components/wizard-time-input",
}); });

Datei anzeigen

@ -6,19 +6,19 @@ const reasons = {
noWizard: "none", noWizard: "none",
requiresLogin: "requires_login", requiresLogin: "requires_login",
notPermitted: "not_permitted", notPermitted: "not_permitted",
completed: "completed" completed: "completed",
} };
export default Controller.extend({ export default Controller.extend({
noAccess: or('noWizard', 'requiresLogin', 'notPermitted', 'completed'), noAccess: or("noWizard", "requiresLogin", "notPermitted", "completed"),
@discourseComputed('noAccessReason') @discourseComputed("noAccessReason")
noAccessI18nKey(reason) { noAccessI18nKey(reason) {
return reason ? `wizard.${reasons[reason]}` : 'wizard.none'; return reason ? `wizard.${reasons[reason]}` : "wizard.none";
}, },
@discourseComputed @discourseComputed
noAccessReason() { noAccessReason() {
return Object.keys(reasons).find(reason => this.get(reason)); return Object.keys(reasons).find((reason) => this.get(reason));
} },
}); });

Datei anzeigen

@ -3,10 +3,10 @@ export default {
const { createHelperContext } = requirejs("discourse-common/lib/helpers"); const { createHelperContext } = requirejs("discourse-common/lib/helpers");
createHelperContext({ createHelperContext({
siteSettings: container.lookup('site-settings:main'), siteSettings: container.lookup("site-settings:main"),
site: container.lookup("site:main"), site: container.lookup("site:main"),
session: container.lookup("session:main"), session: container.lookup("session:main"),
capabilities: container.lookup("capabilities:main"), capabilities: container.lookup("capabilities:main"),
}); });
} },
} };

Datei anzeigen

@ -1,5 +1,5 @@
export default { export default {
run(app, container) { run(app) {
const Store = requirejs("discourse/services/store").default; const Store = requirejs("discourse/services/store").default;
const Site = requirejs( const Site = requirejs(
"discourse/plugins/discourse-custom-wizard/wizard/models/site" "discourse/plugins/discourse-custom-wizard/wizard/models/site"
@ -7,7 +7,9 @@ export default {
const Session = requirejs("discourse/models/session").default; const Session = requirejs("discourse/models/session").default;
const RestAdapter = requirejs("discourse/adapters/rest").default; const RestAdapter = requirejs("discourse/adapters/rest").default;
const messageBus = requirejs("message-bus-client").default; const messageBus = requirejs("message-bus-client").default;
const sniffCapabilites = requirejs("discourse/pre-initializers/sniff-capabilities").default; const sniffCapabilites = requirejs(
"discourse/pre-initializers/sniff-capabilities"
).default;
const site = Site.current(); const site = Site.current();
const session = Session.current(); const session = Session.current();
@ -17,26 +19,35 @@ export default {
["site:main", site, false], ["site:main", site, false],
["session:main", session, false], ["session:main", session, false],
["service:store", Store, true], ["service:store", Store, true],
["adapter:rest", RestAdapter, true] ["adapter:rest", RestAdapter, true],
]; ];
registrations.forEach(registration => { registrations.forEach((registration) => {
if (!app.hasRegistration(registration[0])) { if (!app.hasRegistration(registration[0])) {
app.register(registration[0], registration[1], { instantiate: registration[2] }); app.register(registration[0], registration[1], {
instantiate: registration[2],
});
} }
}); });
const targets = ["controller", "component", "route", "model", "adapter", "mixin"]; const targets = [
"controller",
"component",
"route",
"model",
"adapter",
"mixin",
];
const injections = [ const injections = [
["siteSettings", "site-settings:main"], ["siteSettings", "site-settings:main"],
["messageBus", "message-bus:main"], ["messageBus", "message-bus:main"],
["site", "site:main"], ["site", "site:main"],
["session", "session:main"], ["session", "session:main"],
["store", "service:store"], ["store", "service:store"],
["appEvents", "service:app-events"] ["appEvents", "service:app-events"],
]; ];
injections.forEach(injection => { injections.forEach((injection) => {
targets.forEach((t) => app.inject(t, injection[0], injection[1])); targets.forEach((t) => app.inject(t, injection[0], injection[1]));
}); });
@ -45,5 +56,5 @@ export default {
} }
site.set("can_create_tag", false); site.set("can_create_tag", false);
} },
} };

Datei anzeigen

@ -1,11 +1,13 @@
export default { export default {
run(app, container) { run(app, container) {
const getToken = requirejs("wizard/lib/ajax").getToken; const getToken = requirejs("wizard/lib/ajax").getToken;
const isTesting = requirejs("discourse-common/config/environment").isTesting; const isTesting = requirejs("discourse-common/config/environment")
.isTesting;
if (!isTesting) { if (!isTesting()) {
// Add a CSRF token to all AJAX requests // Add a CSRF token to all AJAX requests
let token = getToken(); let token = getToken();
const session = container.lookup("session:main");
session.set("csrfToken", token); session.set("csrfToken", token);
let callbacks = $.Callbacks(); let callbacks = $.Callbacks();
$.ajaxPrefilter(callbacks.fire); $.ajaxPrefilter(callbacks.fire);
@ -140,5 +142,5 @@ export default {
return resArray; return resArray;
}; };
} }
} },
}; };

Datei anzeigen

@ -1,10 +1,14 @@
export default { export default {
run(app, container) { run(app, container) {
const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars").default; const RawHandlebars = requirejs("discourse-common/lib/raw-handlebars")
.default;
const Handlebars = requirejs("handlebars").default; const Handlebars = requirejs("handlebars").default;
const registerRawHelpers = requirejs("discourse-common/lib/raw-handlebars-helpers").registerRawHelpers; const registerRawHelpers = requirejs(
"discourse-common/lib/raw-handlebars-helpers"
).registerRawHelpers;
const { registerHelpers } = requirejs("discourse-common/lib/helpers"); const { registerHelpers } = requirejs("discourse-common/lib/helpers");
const jqueryPlugins = requirejs("discourse/initializers/jquery-plugins").default; const jqueryPlugins = requirejs("discourse/initializers/jquery-plugins")
.default;
Object.keys(Ember.TEMPLATES).forEach((k) => { Object.keys(Ember.TEMPLATES).forEach((k) => {
if (k.indexOf("select-kit") === 0) { if (k.indexOf("select-kit") === 0) {
@ -22,5 +26,5 @@ export default {
registerRawHelpers(RawHandlebars, Handlebars); registerRawHelpers(RawHandlebars, Handlebars);
registerHelpers(app); registerHelpers(app);
jqueryPlugins.initialize(container, app); jqueryPlugins.initialize(container, app);
} },
} };

Datei anzeigen

@ -1,7 +1,8 @@
export default { export default {
name: "custom-wizard", name: "custom-wizard",
initialize(app) { initialize(app) {
const isTesting = requirejs("discourse-common/config/environment").isTesting; const isTesting = requirejs("discourse-common/config/environment")
.isTesting;
const isWizard = window.location.pathname.indexOf("/w/") > -1; const isWizard = window.location.pathname.indexOf("/w/") > -1;
if (!isWizard && !isTesting()) { if (!isWizard && !isTesting()) {
@ -9,14 +10,17 @@ export default {
} }
const container = app.__container__; const container = app.__container__;
const setDefaultOwner = requirejs("discourse-common/lib/get-owner").setDefaultOwner; const setDefaultOwner = requirejs("discourse-common/lib/get-owner")
.setDefaultOwner;
setDefaultOwner(container); setDefaultOwner(container);
if (!isTesting()) { if (!isTesting()) {
const PreloadStore = requirejs("discourse/lib/preload-store").default; const PreloadStore = requirejs("discourse/lib/preload-store").default;
let preloaded; let preloaded;
const preloadedDataElement = document.getElementById("data-preloaded-wizard"); const preloadedDataElement = document.getElementById(
"data-preloaded-wizard"
);
if (preloadedDataElement) { if (preloadedDataElement) {
preloaded = JSON.parse(preloadedDataElement.dataset.preloadedWizard); preloaded = JSON.parse(preloadedDataElement.dataset.preloadedWizard);
} }
@ -28,7 +32,8 @@ export default {
app.SiteSettings = PreloadStore.get("siteSettings"); app.SiteSettings = PreloadStore.get("siteSettings");
} }
const setEnvironment = requirejs("discourse-common/config/environment").setEnvironment; const setEnvironment = requirejs("discourse-common/config/environment")
.setEnvironment;
const setupData = document.getElementById("data-discourse-setup").dataset; const setupData = document.getElementById("data-discourse-setup").dataset;
setEnvironment(setupData.environment); setEnvironment(setupData.environment);
@ -37,13 +42,15 @@ export default {
session.set("highlightJsPath", setupData.highlightJsPath); session.set("highlightJsPath", setupData.highlightJsPath);
[ [
'register-files', "register-files",
'inject-objects', "inject-objects",
'create-contexts', "create-contexts",
'patch-components' "patch-components",
].forEach(fileName => { ].forEach((fileName) => {
const initializer = requirejs(`discourse/plugins/discourse-custom-wizard/wizard/lib/initialize/${fileName}`).default; const initializer = requirejs(
`discourse/plugins/discourse-custom-wizard/wizard/lib/initialize/${fileName}`
).default;
initializer.run(app, container); initializer.run(app, container);
}); });
} },
}; };

Datei anzeigen

@ -75,5 +75,5 @@ export default EmberObject.extend(ValidState, {
this.setValid(valid); this.setValid(valid);
return valid; return valid;
} },
}); });

Datei anzeigen

@ -71,11 +71,7 @@ export default EmberObject.extend(ValidState, {
type: "PUT", type: "PUT",
data: { fields }, data: { fields },
}).catch((response) => { }).catch((response) => {
if ( if (response && response.responseJSON && response.responseJSON.errors) {
response &&
response.responseJSON &&
response.responseJSON.errors
) {
let wizardErrors = []; let wizardErrors = [];
response.responseJSON.errors.forEach((err) => { response.responseJSON.errors.forEach((err) => {
if (err.field === wizardId) { if (err.field === wizardId) {

Datei anzeigen

@ -26,7 +26,7 @@ export default Route.extend({
}, },
renderTemplate() { renderTemplate() {
this.render('wizard/templates/step'); this.render("wizard/templates/step");
}, },
setupController(controller, model) { setupController(controller, model) {

Datei anzeigen

@ -4,7 +4,13 @@ import Route from "@ember/routing/route";
export default Route.extend({ export default Route.extend({
beforeModel() { beforeModel() {
const wizard = getCachedWizard(); const wizard = getCachedWizard();
if (wizard && wizard.user && wizard.permitted && !wizard.completed && wizard.start) { if (
wizard &&
wizard.user &&
wizard.permitted &&
!wizard.completed &&
wizard.start
) {
this.replaceWith("step", wizard.start); this.replaceWith("step", wizard.start);
} }
}, },
@ -14,7 +20,7 @@ export default Route.extend({
}, },
renderTemplate() { renderTemplate() {
this.render('wizard/templates/wizard-index'); this.render("wizard/templates/wizard-index");
}, },
setupController(controller, model) { setupController(controller, model) {
@ -39,5 +45,5 @@ export default Route.extend({
} else { } else {
controller.set("noWizard", true); controller.set("noWizard", true);
} }
} },
}); });

Datei anzeigen

@ -1,5 +1,4 @@
import { findCustomWizard, updateCachedWizard } from "../models/wizard"; import { findCustomWizard, updateCachedWizard } from "../models/wizard";
import { ajax } from "wizard/lib/ajax";
import WizardI18n from "../lib/wizard-i18n"; import WizardI18n from "../lib/wizard-i18n";
import Route from "@ember/routing/route"; import Route from "@ember/routing/route";
import { scheduleOnce } from "@ember/runloop"; import { scheduleOnce } from "@ember/runloop";
@ -20,7 +19,7 @@ export default Route.extend({
const title = WizardI18n("wizard.incomplete_submission.title", { const title = WizardI18n("wizard.incomplete_submission.title", {
date: moment(wizardModel.submission_last_updated_at).format( date: moment(wizardModel.submission_last_updated_at).format(
"MMMM Do YYYY" "MMMM Do YYYY"
) ),
}); });
const buttons = [ const buttons = [
@ -49,7 +48,7 @@ export default Route.extend({
}, },
renderTemplate() { renderTemplate() {
this.render('wizard/templates/wizard'); this.render("wizard/templates/wizard");
}, },
setupController(controller, model) { setupController(controller, model) {

Datei anzeigen

@ -1,27 +1,18 @@
import { import { click, fillIn, triggerKeyEvent, visit } from "@ember/test-helpers";
visit,
click,
fillIn,
triggerKeyEvent
} from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { exists } from "../helpers/test"; import { exists } from "../helpers/test";
import acceptance, { import acceptance, {
query,
count, count,
query,
server,
visible, visible,
server
} from "../helpers/acceptance"; } from "../helpers/acceptance";
import { import { allFieldsWizard, getWizard } from "../helpers/wizard";
allFieldsWizard,
getWizard
} from "../helpers/wizard";
import tagsJson from "../fixtures/tags"; import tagsJson from "../fixtures/tags";
import usersJson from "../fixtures/users"; import usersJson from "../fixtures/users";
import { response } from "../pretender"; import { response } from "../pretender";
acceptance("Field | Fields", [ getWizard(allFieldsWizard) ], acceptance("Field | Fields", [getWizard(allFieldsWizard)], function () {
function(hooks) {
test("Text", async function (assert) { test("Text", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(exists(".wizard-field.text-field input.wizard-focusable")); assert.ok(exists(".wizard-field.text-field input.wizard-focusable"));
@ -29,18 +20,33 @@ acceptance("Field | Fields", [ getWizard(allFieldsWizard) ],
test("Textarea", async function (assert) { test("Textarea", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.textarea-field textarea.wizard-focusable")); assert.ok(
visible(".wizard-field.textarea-field textarea.wizard-focusable")
);
}); });
test("Composer", async function (assert) { test("Composer", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.composer-field .wizard-field-composer textarea")); assert.ok(
assert.strictEqual(count(".wizard-field.composer-field .d-editor-button-bar button"), 8); visible(".wizard-field.composer-field .wizard-field-composer textarea")
);
assert.strictEqual(
count(".wizard-field.composer-field .d-editor-button-bar button"),
8
);
assert.ok(visible(".wizard-btn.toggle-preview")); assert.ok(visible(".wizard-btn.toggle-preview"));
await fillIn(".wizard-field.composer-field .wizard-field-composer textarea", "Input in composer"); await fillIn(
".wizard-field.composer-field .wizard-field-composer textarea",
"Input in composer"
);
await click(".wizard-btn.toggle-preview"); await click(".wizard-btn.toggle-preview");
assert.strictEqual(query('.wizard-field.composer-field .wizard-field-composer .d-editor-preview-wrapper p').textContent.trim(), "Input in composer"); assert.strictEqual(
query(
".wizard-field.composer-field .wizard-field-composer .d-editor-preview-wrapper p"
).textContent.trim(),
"Input in composer"
);
}); });
test("Text Only", async function (assert) { test("Text Only", async function (assert) {
@ -58,16 +64,26 @@ acceptance("Field | Fields", [ getWizard(allFieldsWizard) ],
test("Time", async function (assert) { test("Time", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.time-field .d-time-input .select-kit")); assert.ok(visible(".wizard-field.time-field .d-time-input .select-kit"));
await click(".wizard-field.time-field .d-time-input .select-kit .select-kit-header"); await click(
".wizard-field.time-field .d-time-input .select-kit .select-kit-header"
);
assert.ok(visible(".wizard-field.time-field .select-kit-collection")); assert.ok(visible(".wizard-field.time-field .select-kit-collection"));
}); });
test("Date Time", async function (assert) { test("Date Time", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.date-time-field .d-date-time-input .select-kit")); assert.ok(
await click(".wizard-field.date-time-field .d-date-input input.date-picker"); visible(".wizard-field.date-time-field .d-date-time-input .select-kit")
assert.ok(visible(".wizard-field.date-time-field .d-date-input .pika-single")); );
await click(".wizard-field.date-time-field .d-time-input .select-kit .select-kit-header"); await click(
".wizard-field.date-time-field .d-date-input input.date-picker"
);
assert.ok(
visible(".wizard-field.date-time-field .d-date-input .pika-single")
);
await click(
".wizard-field.date-time-field .d-time-input .select-kit .select-kit-header"
);
assert.ok(visible(".wizard-field.date-time-field .select-kit-collection")); assert.ok(visible(".wizard-field.date-time-field .select-kit-collection"));
}); });
@ -88,7 +104,9 @@ acceptance("Field | Fields", [ getWizard(allFieldsWizard) ],
test("Upload", async function (assert) { test("Upload", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.upload-field label.wizard-btn-upload-file")); assert.ok(
visible(".wizard-field.upload-field label.wizard-btn-upload-file")
);
assert.ok(exists(".wizard-field.upload-field input.hidden-upload-field")); assert.ok(exists(".wizard-field.upload-field input.hidden-upload-field"));
}); });
@ -96,40 +114,60 @@ acceptance("Field | Fields", [ getWizard(allFieldsWizard) ],
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.dropdown-field .single-select-header")); assert.ok(visible(".wizard-field.dropdown-field .single-select-header"));
await click(".wizard-field.dropdown-field .select-kit-header"); await click(".wizard-field.dropdown-field .select-kit-header");
assert.strictEqual(count(".wizard-field.dropdown-field .select-kit-collection li"), 3); assert.strictEqual(
count(".wizard-field.dropdown-field .select-kit-collection li"),
3
);
}); });
test("Tag", async function (assert) { test("Tag", async function (assert) {
server.get("/tags/filter/search", () => (response(200, { results: tagsJson['tags']}))); server.get("/tags/filter/search", () =>
response(200, { results: tagsJson["tags"] })
);
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.tag-field .multi-select-header")); assert.ok(visible(".wizard-field.tag-field .multi-select-header"));
await click(".wizard-field.tag-field .select-kit-header"); await click(".wizard-field.tag-field .select-kit-header");
assert.strictEqual(count(".wizard-field.tag-field .select-kit-collection li"), 2); assert.strictEqual(
count(".wizard-field.tag-field .select-kit-collection li"),
2
);
}); });
test("Category", async function (assert) { test("Category", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.category-field .multi-select-header")); assert.ok(visible(".wizard-field.category-field .multi-select-header"));
await click(".wizard-field.category-field .select-kit-header"); await click(".wizard-field.category-field .select-kit-header");
assert.strictEqual(count(".wizard-field.category-field .select-kit-collection li"), 5); assert.strictEqual(
count(".wizard-field.category-field .select-kit-collection li"),
5
);
}); });
test("Group", async function (assert) { test("Group", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible(".wizard-field.group-field .single-select-header")); assert.ok(visible(".wizard-field.group-field .single-select-header"));
await click(".wizard-field.group-field .select-kit-header"); await click(".wizard-field.group-field .select-kit-header");
assert.strictEqual(count(".wizard-field.group-field .select-kit-collection li"), 10); assert.strictEqual(
count(".wizard-field.group-field .select-kit-collection li"),
10
);
}); });
test("User", async function (assert) { test("User", async function (assert) {
server.get("/u/search/users", () => (response(200, usersJson))); server.get("/u/search/users", () => response(200, usersJson));
await visit("/wizard"); await visit("/wizard");
await fillIn(".wizard-field.user-selector-field input.ember-text-field", "a"); await fillIn(
await triggerKeyEvent(".wizard-field.user-selector-field input.ember-text-field", "keyup", "a".charCodeAt(0)); ".wizard-field.user-selector-field input.ember-text-field",
"a"
);
await triggerKeyEvent(
".wizard-field.user-selector-field input.ember-text-field",
"keyup",
"a".charCodeAt(0)
);
assert.ok(visible(".wizard-field.user-selector-field .ac-wrap")); assert.ok(visible(".wizard-field.user-selector-field .ac-wrap"));
// TODO: add assertion for ac results. autocomplete does not appear in time. // TODO: add assertion for ac results. autocomplete does not appear in time.
}); });
} });
);

Datei anzeigen

@ -1,47 +1,41 @@
import { visit, click } from "@ember/test-helpers"; import { click, visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { exists } from "../helpers/test"; import { exists } from "../helpers/test";
import acceptance, { import acceptance, { count, query, visible } from "../helpers/acceptance";
query, import { getWizard, stepNotPermitted, wizard } from "../helpers/wizard";
count, import { saveStep, update } from "../helpers/step";
visible
} from "../helpers/acceptance";
import {
stepNotPermitted,
wizard,
getWizard
} from "../helpers/wizard";
import {
saveStep,
update
} from "../helpers/step";
acceptance("Step | Not permitted", [ getWizard(stepNotPermitted) ], acceptance("Step | Not permitted", [getWizard(stepNotPermitted)], function () {
function(hooks) {
test("Shows not permitted message", async function (assert) { test("Shows not permitted message", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(exists(".step-message.not-permitted")); assert.ok(exists(".step-message.not-permitted"));
}); });
} });
);
acceptance("Step | Step", [ getWizard(wizard), saveStep(update) ], acceptance("Step | Step", [getWizard(wizard), saveStep(update)], function () {
function(hooks) {
test("Renders the step", async function (assert) { test("Renders the step", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.strictEqual(query('.wizard-step-title p').textContent.trim(), "Text"); assert.strictEqual(
assert.strictEqual(query('.wizard-step-description p').textContent.trim(), "Text inputs!"); query(".wizard-step-title p").textContent.trim(),
assert.strictEqual(query('.wizard-step-description p').textContent.trim(), "Text inputs!"); "Text"
assert.strictEqual(count('.wizard-step-form .wizard-field'), 6); );
assert.ok(visible('.wizard-step-footer .wizard-progress'), true); assert.strictEqual(
assert.ok(visible('.wizard-step-footer .wizard-buttons'), true); query(".wizard-step-description p").textContent.trim(),
"Text inputs!"
);
assert.strictEqual(
query(".wizard-step-description p").textContent.trim(),
"Text inputs!"
);
assert.strictEqual(count(".wizard-step-form .wizard-field"), 6);
assert.ok(visible(".wizard-step-footer .wizard-progress"), true);
assert.ok(visible(".wizard-step-footer .wizard-buttons"), true);
}); });
test("Goes to the next step", async function (assert) { test("Goes to the next step", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible('.wizard-step.step_1'), true); assert.ok(visible(".wizard-step.step_1"), true);
await click('.wizard-btn.next'); await click(".wizard-btn.next");
assert.ok(visible('.wizard-step.step_2'), true); assert.ok(visible(".wizard-step.step_2"), true);
}); });
} });
);

Datei anzeigen

@ -1,30 +1,26 @@
import { visit } from "@ember/test-helpers"; import { visit } from "@ember/test-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { exists } from "../helpers/test"; import { exists } from "../helpers/test";
import acceptance, { import acceptance, { count, query, visible } from "../helpers/acceptance";
query,
count,
visible
} from "../helpers/acceptance";
import { import {
getWizard,
wizard,
wizardCompleted,
wizardNoUser, wizardNoUser,
wizardNotPermitted, wizardNotPermitted,
wizardCompleted,
wizard,
getWizard
} from "../helpers/wizard"; } from "../helpers/wizard";
acceptance("Wizard | Not logged in", [ getWizard(wizardNoUser) ], acceptance("Wizard | Not logged in", [getWizard(wizardNoUser)], function () {
function(hooks) {
test("Wizard no access requires login", async function (assert) { test("Wizard no access requires login", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(exists(".wizard-no-access.requires-login")); assert.ok(exists(".wizard-no-access.requires-login"));
}); });
} });
);
acceptance("Wizard | Not permitted", [ getWizard(wizardNotPermitted) ], acceptance(
function(hooks) { "Wizard | Not permitted",
[getWizard(wizardNotPermitted)],
function () {
test("Wizard no access not permitted", async function (assert) { test("Wizard no access not permitted", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(exists(".wizard-no-access.not-permitted")); assert.ok(exists(".wizard-no-access.not-permitted"));
@ -32,20 +28,17 @@ acceptance("Wizard | Not permitted", [ getWizard(wizardNotPermitted) ],
} }
); );
acceptance("Wizard | Completed", [ getWizard(wizardCompleted) ], acceptance("Wizard | Completed", [getWizard(wizardCompleted)], function () {
function(hooks) {
test("Wizard no access completed", async function (assert) { test("Wizard no access completed", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(exists(".wizard-no-access.completed")); assert.ok(exists(".wizard-no-access.completed"));
}); });
} });
);
acceptance("Wizard | Wizard", [ getWizard(wizard) ], acceptance("Wizard | Wizard", [getWizard(wizard)], function () {
function(hooks) {
test("Starts", async function (assert) { test("Starts", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(query('.wizard-column'), true); assert.ok(query(".wizard-column"), true);
}); });
test("Applies the body background color", async function (assert) { test("Applies the body background color", async function (assert) {
@ -55,18 +48,26 @@ acceptance("Wizard | Wizard", [ getWizard(wizard) ],
test("Renders the wizard form", async function (assert) { test("Renders the wizard form", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.ok(visible('.wizard-column-contents .wizard-step'), true); assert.ok(visible(".wizard-column-contents .wizard-step"), true);
assert.ok(visible('.wizard-footer img'), true); assert.ok(visible(".wizard-footer img"), true);
}); });
test("Renders the first step", async function (assert) { test("Renders the first step", async function (assert) {
await visit("/wizard"); await visit("/wizard");
assert.strictEqual(query('.wizard-step-title p').textContent.trim(), "Text"); assert.strictEqual(
assert.strictEqual(query('.wizard-step-description p').textContent.trim(), "Text inputs!"); query(".wizard-step-title p").textContent.trim(),
assert.strictEqual(query('.wizard-step-description p').textContent.trim(), "Text inputs!"); "Text"
assert.strictEqual(count('.wizard-step-form .wizard-field'), 6); );
assert.ok(visible('.wizard-step-footer .wizard-progress'), true); assert.strictEqual(
assert.ok(visible('.wizard-step-footer .wizard-buttons'), true); query(".wizard-step-description p").textContent.trim(),
"Text inputs!"
);
assert.strictEqual(
query(".wizard-step-description p").textContent.trim(),
"Text inputs!"
);
assert.strictEqual(count(".wizard-step-form .wizard-field"), 6);
assert.ok(visible(".wizard-step-footer .wizard-progress"), true);
assert.ok(visible(".wizard-step-footer .wizard-buttons"), true);
}); });
} });
);

Datei anzeigen

@ -1,209 +1,221 @@
export default { export default {
"categories": [ categories: [
{ {
"id": 1, id: 1,
"name": "Uncategorized", name: "Uncategorized",
"color": "0088CC", color: "0088CC",
"text_color": "FFFFFF", text_color: "FFFFFF",
"slug": "uncategorized", slug: "uncategorized",
"topic_count": 1, topic_count: 1,
"post_count": 1, post_count: 1,
"position": 0, position: 0,
"description": "Topics that don't need a category, or don't fit into any other existing category.", description:
"description_text": "Topics that don't need a category, or don't fit into any other existing category.", "Topics that don't need a category, or don't fit into any other existing category.",
"description_excerpt": "Topics that don't need a category, or don't fit into any other existing category.", description_text:
"topic_url": "/t/", "Topics that don't need a category, or don't fit into any other existing category.",
"read_restricted": false, description_excerpt:
"permission": 1, "Topics that don't need a category, or don't fit into any other existing category.",
"notification_level": 0, topic_url: "/t/",
"topic_template": null, read_restricted: false,
"has_children": false, permission: 1,
"sort_order": null, notification_level: 0,
"sort_ascending": null, topic_template: null,
"show_subcategory_list": false, has_children: false,
"num_featured_topics": 3, sort_order: null,
"default_view": null, sort_ascending: null,
"subcategory_list_style": "rows_with_featured_topics", show_subcategory_list: false,
"default_top_period": "all", num_featured_topics: 3,
"default_list_filter": "all", default_view: null,
"minimum_required_tags": 0, subcategory_list_style: "rows_with_featured_topics",
"navigate_to_first_post_after_read": false, default_top_period: "all",
"custom_fields": { default_list_filter: "all",
"create_topic_wizard": null minimum_required_tags: 0,
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
}, },
"allowed_tags": [], allowed_tags: [],
"allowed_tag_groups": [], allowed_tag_groups: [],
"allow_global_tags": false, allow_global_tags: false,
"min_tags_from_required_group": 1, min_tags_from_required_group: 1,
"required_tag_group_name": null, required_tag_group_name: null,
"read_only_banner": null, read_only_banner: null,
"uploaded_logo": null, uploaded_logo: null,
"uploaded_background": null, uploaded_background: null,
"can_edit": true can_edit: true,
}, },
{ {
"id": 2, id: 2,
"name": "Site Feedback", name: "Site Feedback",
"color": "808281", color: "808281",
"text_color": "FFFFFF", text_color: "FFFFFF",
"slug": "site-feedback", slug: "site-feedback",
"topic_count": 20, topic_count: 20,
"post_count": 21, post_count: 21,
"position": 1, position: 1,
"description": "<p>Discussion about this site, its organization, how it works, and how we can improve it.</p>", description:
"description_text": "Discussion about this site, its organization, how it works, and how we can improve it.", "<p>Discussion about this site, its organization, how it works, and how we can improve it.</p>",
"description_excerpt": "Discussion about this site, its organization, how it works, and how we can improve it.", description_text:
"topic_url": "/t/about-the-site-feedback-category/1", "Discussion about this site, its organization, how it works, and how we can improve it.",
"read_restricted": false, description_excerpt:
"permission": 1, "Discussion about this site, its organization, how it works, and how we can improve it.",
"notification_level": 0, topic_url: "/t/about-the-site-feedback-category/1",
"topic_template": null, read_restricted: false,
"has_children": false, permission: 1,
"sort_order": null, notification_level: 0,
"sort_ascending": null, topic_template: null,
"show_subcategory_list": false, has_children: false,
"num_featured_topics": 3, sort_order: null,
"default_view": null, sort_ascending: null,
"subcategory_list_style": "rows_with_featured_topics", show_subcategory_list: false,
"default_top_period": "all", num_featured_topics: 3,
"default_list_filter": "all", default_view: null,
"minimum_required_tags": 0, subcategory_list_style: "rows_with_featured_topics",
"navigate_to_first_post_after_read": false, default_top_period: "all",
"custom_fields": { default_list_filter: "all",
"create_topic_wizard": null minimum_required_tags: 0,
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
}, },
"allowed_tags": [], allowed_tags: [],
"allowed_tag_groups": [], allowed_tag_groups: [],
"allow_global_tags": false, allow_global_tags: false,
"min_tags_from_required_group": 1, min_tags_from_required_group: 1,
"required_tag_group_name": null, required_tag_group_name: null,
"read_only_banner": null, read_only_banner: null,
"uploaded_logo": null, uploaded_logo: null,
"uploaded_background": null, uploaded_background: null,
"can_edit": true can_edit: true,
}, },
{ {
"id": 3, id: 3,
"name": "Staff", name: "Staff",
"color": "E45735", color: "E45735",
"text_color": "FFFFFF", text_color: "FFFFFF",
"slug": "staff", slug: "staff",
"topic_count": 4, topic_count: 4,
"post_count": 7, post_count: 7,
"position": 2, position: 2,
"description": "<p>Private category for staff discussions. Topics are only visible to admins and moderators.</p>", description:
"description_text": "Private category for staff discussions. Topics are only visible to admins and moderators.", "<p>Private category for staff discussions. Topics are only visible to admins and moderators.</p>",
"description_excerpt": "Private category for staff discussions. Topics are only visible to admins and moderators.", description_text:
"topic_url": "/t/about-the-staff-category/2", "Private category for staff discussions. Topics are only visible to admins and moderators.",
"read_restricted": true, description_excerpt:
"permission": 1, "Private category for staff discussions. Topics are only visible to admins and moderators.",
"notification_level": 0, topic_url: "/t/about-the-staff-category/2",
"topic_template": null, read_restricted: true,
"has_children": false, permission: 1,
"sort_order": null, notification_level: 0,
"sort_ascending": null, topic_template: null,
"show_subcategory_list": false, has_children: false,
"num_featured_topics": 3, sort_order: null,
"default_view": null, sort_ascending: null,
"subcategory_list_style": "rows_with_featured_topics", show_subcategory_list: false,
"default_top_period": "all", num_featured_topics: 3,
"default_list_filter": "all", default_view: null,
"minimum_required_tags": 0, subcategory_list_style: "rows_with_featured_topics",
"navigate_to_first_post_after_read": false, default_top_period: "all",
"custom_fields": { default_list_filter: "all",
"create_topic_wizard": null minimum_required_tags: 0,
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
}, },
"allowed_tags": [], allowed_tags: [],
"allowed_tag_groups": [], allowed_tag_groups: [],
"allow_global_tags": false, allow_global_tags: false,
"min_tags_from_required_group": 1, min_tags_from_required_group: 1,
"required_tag_group_name": null, required_tag_group_name: null,
"read_only_banner": null, read_only_banner: null,
"uploaded_logo": null, uploaded_logo: null,
"uploaded_background": null, uploaded_background: null,
"can_edit": true can_edit: true,
}, },
{ {
"id": 4, id: 4,
"name": "Lounge", name: "Lounge",
"color": "A461EF", color: "A461EF",
"text_color": "652D90", text_color: "652D90",
"slug": "lounge", slug: "lounge",
"topic_count": 1, topic_count: 1,
"post_count": 1, post_count: 1,
"position": 3, position: 3,
"description": "<p>A category exclusive to members with trust level 3 and higher.</p>", description:
"description_text": "A category exclusive to members with trust level 3 and higher.", "<p>A category exclusive to members with trust level 3 and higher.</p>",
"description_excerpt": "A category exclusive to members with trust level 3 and higher.", description_text:
"topic_url": "/t/about-the-lounge-category/3", "A category exclusive to members with trust level 3 and higher.",
"read_restricted": true, description_excerpt:
"permission": 1, "A category exclusive to members with trust level 3 and higher.",
"notification_level": 0, topic_url: "/t/about-the-lounge-category/3",
"topic_template": null, read_restricted: true,
"has_children": false, permission: 1,
"sort_order": null, notification_level: 0,
"sort_ascending": null, topic_template: null,
"show_subcategory_list": false, has_children: false,
"num_featured_topics": 3, sort_order: null,
"default_view": null, sort_ascending: null,
"subcategory_list_style": "rows_with_featured_topics", show_subcategory_list: false,
"default_top_period": "all", num_featured_topics: 3,
"default_list_filter": "all", default_view: null,
"minimum_required_tags": 0, subcategory_list_style: "rows_with_featured_topics",
"navigate_to_first_post_after_read": false, default_top_period: "all",
"custom_fields": { default_list_filter: "all",
"create_topic_wizard": null minimum_required_tags: 0,
navigate_to_first_post_after_read: false,
custom_fields: {
create_topic_wizard: null,
}, },
"allowed_tags": [], allowed_tags: [],
"allowed_tag_groups": [], allowed_tag_groups: [],
"allow_global_tags": false, allow_global_tags: false,
"min_tags_from_required_group": 1, min_tags_from_required_group: 1,
"required_tag_group_name": null, required_tag_group_name: null,
"read_only_banner": null, read_only_banner: null,
"uploaded_logo": null, uploaded_logo: null,
"uploaded_background": null, uploaded_background: null,
"can_edit": true can_edit: true,
}, },
{ {
"id": 5, id: 5,
"name": "Custom Categories", name: "Custom Categories",
"color": "0088CC", color: "0088CC",
"text_color": "FFFFFF", text_color: "FFFFFF",
"slug": "custom-category", slug: "custom-category",
"topic_count": 0, topic_count: 0,
"post_count": 0, post_count: 0,
"position": 10, position: 10,
"description": "Description of custom category", description: "Description of custom category",
"description_text": "Description of custom category", description_text: "Description of custom category",
"description_excerpt": "Description of custom category", description_excerpt: "Description of custom category",
"topic_url": "/t/about-the-custom-category/5", topic_url: "/t/about-the-custom-category/5",
"read_restricted": false, read_restricted: false,
"permission": 1, permission: 1,
"notification_level": 0, notification_level: 0,
"topic_template": null, topic_template: null,
"has_children": false, has_children: false,
"sort_order": null, sort_order: null,
"sort_ascending": null, sort_ascending: null,
"show_subcategory_list": false, show_subcategory_list: false,
"num_featured_topics": 3, num_featured_topics: 3,
"default_view": null, default_view: null,
"subcategory_list_style": "rows_with_featured_topics", subcategory_list_style: "rows_with_featured_topics",
"default_top_period": "all", default_top_period: "all",
"default_list_filter": "all", default_list_filter: "all",
"minimum_required_tags": 0, minimum_required_tags: 0,
"navigate_to_first_post_after_read": false, navigate_to_first_post_after_read: false,
"custom_fields": { custom_fields: {
"create_topic_wizard": null create_topic_wizard: null,
}, },
"allowed_tags": [], allowed_tags: [],
"allowed_tag_groups": [], allowed_tag_groups: [],
"allow_global_tags": false, allow_global_tags: false,
"min_tags_from_required_group": 1, min_tags_from_required_group: 1,
"required_tag_group_name": null, required_tag_group_name: null,
"read_only_banner": null, read_only_banner: null,
"uploaded_logo": null, uploaded_logo: null,
"uploaded_background": null, uploaded_background: null,
"can_edit": true can_edit: true,
} },
] ],
} };

Datei anzeigen

@ -1,313 +1,313 @@
export default { export default {
"groups": [ groups: [
{ {
"id": 1, id: 1,
"automatic": true, automatic: true,
"name": "admins", name: "admins",
"display_name": "admins", display_name: "admins",
"user_count": 1, user_count: 1,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 0, id: 0,
"automatic": true, automatic: true,
"name": "everyone", name: "everyone",
"display_name": "everyone", display_name: "everyone",
"user_count": 0, user_count: 0,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 3, visibility_level: 3,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 15, id: 15,
"automatic": false, automatic: false,
"name": "custom_group", name: "custom_group",
"user_count": 1, user_count: 1,
"mentionable_level": 1, mentionable_level: 1,
"messageable_level": 2, messageable_level: 2,
"visibility_level": 3, visibility_level: 3,
"primary_group": false, primary_group: false,
"title": "Custom Group", title: "Custom Group",
"grant_trust_level": 3, grant_trust_level: 3,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": "I am prefilled", full_name: "I am prefilled",
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 99, members_visibility_level: 99,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 2, id: 2,
"automatic": true, automatic: true,
"name": "moderators", name: "moderators",
"display_name": "moderators", display_name: "moderators",
"user_count": 0, user_count: 0,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 99, messageable_level: 99,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 2, default_notification_level: 2,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 3, id: 3,
"automatic": true, automatic: true,
"name": "staff", name: "staff",
"display_name": "staff", display_name: "staff",
"user_count": 1, user_count: 1,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 10, id: 10,
"automatic": true, automatic: true,
"name": "trust_level_0", name: "trust_level_0",
"display_name": "trust_level_0", display_name: "trust_level_0",
"user_count": 2, user_count: 2,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 11, id: 11,
"automatic": true, automatic: true,
"name": "trust_level_1", name: "trust_level_1",
"display_name": "trust_level_1", display_name: "trust_level_1",
"user_count": 2, user_count: 2,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 12, id: 12,
"automatic": true, automatic: true,
"name": "trust_level_2", name: "trust_level_2",
"display_name": "trust_level_2", display_name: "trust_level_2",
"user_count": 1, user_count: 1,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 13, id: 13,
"automatic": true, automatic: true,
"name": "trust_level_3", name: "trust_level_3",
"display_name": "trust_level_3", display_name: "trust_level_3",
"user_count": 1, user_count: 1,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
}, },
{ {
"id": 14, id: 14,
"automatic": true, automatic: true,
"name": "trust_level_4", name: "trust_level_4",
"display_name": "trust_level_4", display_name: "trust_level_4",
"user_count": 0, user_count: 0,
"mentionable_level": 0, mentionable_level: 0,
"messageable_level": 0, messageable_level: 0,
"visibility_level": 1, visibility_level: 1,
"primary_group": false, primary_group: false,
"title": null, title: null,
"grant_trust_level": null, grant_trust_level: null,
"incoming_email": null, incoming_email: null,
"has_messages": false, has_messages: false,
"flair_url": null, flair_url: null,
"flair_bg_color": null, flair_bg_color: null,
"flair_color": null, flair_color: null,
"bio_raw": null, bio_raw: null,
"bio_cooked": null, bio_cooked: null,
"bio_excerpt": null, bio_excerpt: null,
"public_admission": false, public_admission: false,
"public_exit": false, public_exit: false,
"allow_membership_requests": false, allow_membership_requests: false,
"full_name": null, full_name: null,
"default_notification_level": 3, default_notification_level: 3,
"membership_request_template": null, membership_request_template: null,
"members_visibility_level": 0, members_visibility_level: 0,
"can_see_members": true, can_see_members: true,
"can_admin_group": true, can_admin_group: true,
"publish_read_state": false publish_read_state: false,
} },
] ],
} };

Datei anzeigen

@ -1,283 +1,294 @@
export default { export default {
"default_locale": "en", default_locale: "en",
"title": "Discourse", title: "Discourse",
"short_site_description": "", short_site_description: "",
"exclude_rel_nofollow_domains": "", exclude_rel_nofollow_domains: "",
"logo": "/images/discourse-logo-sketch.png", logo: "/images/discourse-logo-sketch.png",
"logo_small": "/images/discourse-logo-sketch-small.png", logo_small: "/images/discourse-logo-sketch-small.png",
"digest_logo": "", digest_logo: "",
"mobile_logo": "", mobile_logo: "",
"logo_dark": "", logo_dark: "",
"logo_small_dark": "", logo_small_dark: "",
"mobile_logo_dark": "", mobile_logo_dark: "",
"large_icon": "", large_icon: "",
"favicon": "", favicon: "",
"apple_touch_icon": "", apple_touch_icon: "",
"display_local_time_in_user_card": false, display_local_time_in_user_card: false,
"allow_user_locale": false, allow_user_locale: false,
"set_locale_from_accept_language_header": false, set_locale_from_accept_language_header: false,
"support_mixed_text_direction": false, support_mixed_text_direction: false,
"suggested_topics": 5, suggested_topics: 5,
"ga_universal_tracking_code": "", ga_universal_tracking_code: "",
"ga_universal_domain_name": "auto", ga_universal_domain_name: "auto",
"gtm_container_id": "", gtm_container_id: "",
"top_menu": "categories|latest", top_menu: "categories|latest",
"post_menu": "read|like|share|flag|edit|bookmark|delete|admin|reply", post_menu: "read|like|share|flag|edit|bookmark|delete|admin|reply",
"post_menu_hidden_items": "flag|bookmark|edit|delete|admin", post_menu_hidden_items: "flag|bookmark|edit|delete|admin",
"share_links": "twitter|facebook|email", share_links: "twitter|facebook|email",
"share_quote_visibility": "anonymous", share_quote_visibility: "anonymous",
"share_quote_buttons": "twitter|email", share_quote_buttons: "twitter|email",
"desktop_category_page_style": "categories_and_latest_topics", desktop_category_page_style: "categories_and_latest_topics",
"category_colors": "BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|E45735", category_colors:
"category_style": "bullet", "BF1E2E|F1592A|F7941D|9EB83B|3AB54A|12A89D|25AAE2|0E76BD|652D90|92278F|ED207B|8C6238|231F20|808281|B3B5B4|E45735",
"max_category_nesting": 2, category_style: "bullet",
"enable_mobile_theme": true, max_category_nesting: 2,
"enable_direct_s3_uploads": false, enable_mobile_theme: true,
"enable_upload_debug_mode": false, enable_direct_s3_uploads: false,
"default_dark_mode_color_scheme_id": 1, enable_upload_debug_mode: false,
"relative_date_duration": 30, default_dark_mode_color_scheme_id: 1,
"fixed_category_positions": false, relative_date_duration: 30,
"fixed_category_positions_on_create": false, fixed_category_positions: false,
"enable_badges": true, fixed_category_positions_on_create: false,
"enable_badge_sql": true, enable_badges: true,
"max_favorite_badges": 2, enable_badge_sql: true,
"enable_whispers": false, max_favorite_badges: 2,
"enable_bookmarks_with_reminders": true, enable_whispers: false,
"push_notifications_prompt": true, enable_bookmarks_with_reminders: true,
"vapid_public_key_bytes": "4|29|219|88|202|66|198|62|182|204|66|176|229|200|131|26|141|21|178|231|150|161|2|128|228|200|179|126|118|232|196|19|232|76|108|189|54|211|210|155|55|228|173|112|38|158|114|127|18|95|7|56|110|183|192|92|43|0|243|249|233|89|9|207|255", push_notifications_prompt: true,
"invite_only": false, vapid_public_key_bytes:
"login_required": false, "4|29|219|88|202|66|198|62|182|204|66|176|229|200|131|26|141|21|178|231|150|161|2|128|228|200|179|126|118|232|196|19|232|76|108|189|54|211|210|155|55|228|173|112|38|158|114|127|18|95|7|56|110|183|192|92|43|0|243|249|233|89|9|207|255",
"must_approve_users": false, invite_only: false,
"enable_local_logins": true, login_required: false,
"enable_local_logins_via_email": true, must_approve_users: false,
"allow_new_registrations": true, enable_local_logins: true,
"enable_signup_cta": true, enable_local_logins_via_email: true,
"facebook_app_id": "", allow_new_registrations: true,
"auth_skip_create_confirm": false, enable_signup_cta: true,
"auth_overrides_email": false, facebook_app_id: "",
"enable_discourse_connect": true, auth_skip_create_confirm: false,
"discourse_connect_overrides_avatar": false, auth_overrides_email: false,
"hide_email_address_taken": false, enable_discourse_connect: true,
"min_username_length": 3, discourse_connect_overrides_avatar: false,
"max_username_length": 20, hide_email_address_taken: false,
"unicode_usernames": false, min_username_length: 3,
"min_password_length": 10, max_username_length: 20,
"min_admin_password_length": 15, unicode_usernames: false,
"email_editable": true, min_password_length: 10,
"logout_redirect": "", min_admin_password_length: 15,
"full_name_required": false, email_editable: true,
"enable_names": true, logout_redirect: "",
"invite_expiry_days": 90, full_name_required: false,
"invites_per_page": 40, enable_names: true,
"delete_user_max_post_age": 60, invite_expiry_days: 90,
"delete_all_posts_max": 15, invites_per_page: 40,
"prioritize_username_in_ux": true, delete_user_max_post_age: 60,
"enable_user_directory": true, delete_all_posts_max: 15,
"allow_anonymous_posting": false, prioritize_username_in_ux: true,
"anonymous_posting_min_trust_level": 1, enable_user_directory: true,
"allow_users_to_hide_profile": true, allow_anonymous_posting: false,
"hide_user_profiles_from_public": false, anonymous_posting_min_trust_level: 1,
"allow_featured_topic_on_user_profiles": true, allow_users_to_hide_profile: true,
"hide_suspension_reasons": false, hide_user_profiles_from_public: false,
"ignored_users_count_message_threshold": 5, allow_featured_topic_on_user_profiles: true,
"ignored_users_message_gap_days": 365, hide_suspension_reasons: false,
"user_selected_primary_groups": false, ignored_users_count_message_threshold: 5,
"gravatar_name": "Gravatar", ignored_users_message_gap_days: 365,
"gravatar_base_url": "www.gravatar.com", user_selected_primary_groups: false,
"gravatar_login_url": "/emails", gravatar_name: "Gravatar",
"enable_group_directory": true, gravatar_base_url: "www.gravatar.com",
"enable_category_group_moderation": false, gravatar_login_url: "/emails",
"min_post_length": 20, enable_group_directory: true,
"min_first_post_length": 20, enable_category_group_moderation: false,
"min_personal_message_post_length": 10, min_post_length: 20,
"max_post_length": 32000, min_first_post_length: 20,
"topic_featured_link_enabled": true, min_personal_message_post_length: 10,
"min_topic_views_for_delete_confirm": 5000, max_post_length: 32000,
"min_topic_title_length": 15, topic_featured_link_enabled: true,
"max_topic_title_length": 255, min_topic_views_for_delete_confirm: 5000,
"enable_filtered_replies_view": false, min_topic_title_length: 15,
"min_personal_message_title_length": 2, max_topic_title_length: 255,
"allow_uncategorized_topics": true, enable_filtered_replies_view: false,
"min_title_similar_length": 10, min_personal_message_title_length: 2,
"enable_personal_messages": true, allow_uncategorized_topics: true,
"edit_history_visible_to_public": true, min_title_similar_length: 10,
"delete_removed_posts_after": 24, enable_personal_messages: true,
"traditional_markdown_linebreaks": false, edit_history_visible_to_public: true,
"enable_markdown_typographer": true, delete_removed_posts_after: 24,
"enable_markdown_linkify": true, traditional_markdown_linebreaks: false,
"markdown_linkify_tlds": "com|net|org|io|onion|co|tv|ru|cn|us|uk|me|de|fr|fi|gov", enable_markdown_typographer: true,
"markdown_typographer_quotation_marks": "“|”||", enable_markdown_linkify: true,
"enable_rich_text_paste": true, markdown_linkify_tlds:
"suppress_reply_directly_below": true, "com|net|org|io|onion|co|tv|ru|cn|us|uk|me|de|fr|fi|gov",
"suppress_reply_directly_above": true, markdown_typographer_quotation_marks: "“|”||",
"max_reply_history": 1, enable_rich_text_paste: true,
"enable_mentions": true, suppress_reply_directly_below: true,
"here_mention": "here", suppress_reply_directly_above: true,
"newuser_max_embedded_media": 1, max_reply_history: 1,
"newuser_max_attachments": 0, enable_mentions: true,
"show_pinned_excerpt_mobile": true, here_mention: "here",
"show_pinned_excerpt_desktop": true, newuser_max_embedded_media: 1,
"display_name_on_posts": false, newuser_max_attachments: 0,
"show_time_gap_days": 7, show_pinned_excerpt_mobile: true,
"short_progress_text_threshold": 10000, show_pinned_excerpt_desktop: true,
"default_code_lang": "auto", display_name_on_posts: false,
"autohighlight_all_code": false, show_time_gap_days: 7,
"highlighted_languages": "apache|bash|cs|cpp|css|coffeescript|diff|xml|http|ini|json|java|javascript|makefile|markdown|nginx|objectivec|ruby|perl|php|python|sql|handlebars", short_progress_text_threshold: 10000,
"show_copy_button_on_codeblocks": false, default_code_lang: "auto",
"enable_emoji": true, autohighlight_all_code: false,
"enable_emoji_shortcuts": true, highlighted_languages:
"emoji_set": "twitter", "apache|bash|cs|cpp|css|coffeescript|diff|xml|http|ini|json|java|javascript|makefile|markdown|nginx|objectivec|ruby|perl|php|python|sql|handlebars",
"emoji_autocomplete_min_chars": 0, show_copy_button_on_codeblocks: false,
"enable_inline_emoji_translation": false, enable_emoji: true,
"code_formatting_style": "code-fences", enable_emoji_shortcuts: true,
"allowed_href_schemes": "", emoji_set: "twitter",
"watched_words_regular_expressions": false, emoji_autocomplete_min_chars: 0,
"enable_diffhtml_preview": false, enable_inline_emoji_translation: false,
"enable_fast_edit": true, code_formatting_style: "code-fences",
"old_post_notice_days": 14, allowed_href_schemes: "",
"blur_tl0_flagged_posts_media": true, watched_words_regular_expressions: false,
"email_time_window_mins": 10, enable_diffhtml_preview: false,
"disable_digest_emails": false, enable_fast_edit: true,
"email_in": false, old_post_notice_days: 14,
"enable_imap": false, blur_tl0_flagged_posts_media: true,
"enable_smtp": false, email_time_window_mins: 10,
"disable_emails": "no", disable_digest_emails: false,
"bounce_score_threshold": 4, email_in: false,
"enable_secondary_emails": true, enable_imap: false,
"max_image_size_kb": 4096, enable_smtp: false,
"max_attachment_size_kb": 4096, disable_emails: "no",
"authorized_extensions": "jpg|jpeg|png|gif|heic|heif|webp", bounce_score_threshold: 4,
"authorized_extensions_for_staff": "", enable_secondary_emails: true,
"max_image_width": 690, max_image_size_kb: 4096,
"max_image_height": 500, max_attachment_size_kb: 4096,
"prevent_anons_from_downloading_files": false, authorized_extensions: "jpg|jpeg|png|gif|heic|heif|webp",
"secure_media": false, authorized_extensions_for_staff: "",
"enable_s3_uploads": false, max_image_width: 690,
"allow_profile_backgrounds": true, max_image_height: 500,
"allow_uploaded_avatars": "0", prevent_anons_from_downloading_files: false,
"default_avatars": "", secure_media: false,
"external_system_avatars_enabled": true, enable_s3_uploads: false,
"external_system_avatars_url": "/letter_avatar_proxy/v4/letter/{first_letter}/{color}/{size}.png", allow_profile_backgrounds: true,
"external_emoji_url": "", allow_uploaded_avatars: "0",
"selectable_avatars_mode": "disabled", default_avatars: "",
"selectable_avatars": "", external_system_avatars_enabled: true,
"allow_staff_to_upload_any_file_in_pm": true, external_system_avatars_url:
"simultaneous_uploads": 5, "/letter_avatar_proxy/v4/letter/{first_letter}/{color}/{size}.png",
"composer_media_optimization_image_enabled": true, external_emoji_url: "",
"composer_media_optimization_image_bytes_optimization_threshold": 524288, selectable_avatars_mode: "disabled",
"composer_media_optimization_image_resize_dimensions_threshold": 1920, selectable_avatars: "",
"composer_media_optimization_image_resize_width_target": 1920, allow_staff_to_upload_any_file_in_pm: true,
"composer_media_optimization_image_resize_pre_multiply": false, simultaneous_uploads: 5,
"composer_media_optimization_image_resize_linear_rgb": false, composer_media_optimization_image_enabled: true,
"composer_media_optimization_image_encode_quality": 75, composer_media_optimization_image_bytes_optimization_threshold: 524288,
"composer_media_optimization_debug_mode": false, composer_media_optimization_image_resize_dimensions_threshold: 1920,
"min_trust_level_to_allow_profile_background": 0, composer_media_optimization_image_resize_width_target: 1920,
"min_trust_level_to_allow_user_card_background": 0, composer_media_optimization_image_resize_pre_multiply: false,
"min_trust_level_to_allow_ignore": 2, composer_media_optimization_image_resize_linear_rgb: false,
"tl1_requires_read_posts": 30, composer_media_optimization_image_encode_quality: 75,
"tl3_links_no_follow": false, composer_media_optimization_debug_mode: false,
"enforce_second_factor": "no", min_trust_level_to_allow_profile_background: 0,
"moderators_change_post_ownership": false, min_trust_level_to_allow_user_card_background: 0,
"moderators_view_emails": false, min_trust_level_to_allow_ignore: 2,
"use_admin_ip_allowlist": false, tl1_requires_read_posts: 30,
"allowed_iframes": "https://www.google.com/maps/embed?|https://www.openstreetmap.org/export/embed.html?|https://calendar.google.com/calendar/embed?|https://codepen.io/|https://www.instagram.com|http://localhost:3000/discobot/certificate.svg", tl3_links_no_follow: false,
"can_permanently_delete": false, enforce_second_factor: "no",
"max_oneboxes_per_post": 50, moderators_change_post_ownership: false,
"reviewable_claiming": "disabled", moderators_view_emails: false,
"reviewable_default_topics": false, use_admin_ip_allowlist: false,
"reviewable_default_visibility": "low", allowed_iframes:
"alert_admins_if_errors_per_minute": 0, "https://www.google.com/maps/embed?|https://www.openstreetmap.org/export/embed.html?|https://calendar.google.com/calendar/embed?|https://codepen.io/|https://www.instagram.com|http://localhost:3000/discobot/certificate.svg",
"alert_admins_if_errors_per_hour": 0, can_permanently_delete: false,
"max_prints_per_hour_per_user": 5, max_oneboxes_per_post: 50,
"invite_link_max_redemptions_limit": 5000, reviewable_claiming: "disabled",
"invite_link_max_redemptions_limit_users": 10, reviewable_default_topics: false,
"enable_long_polling": true, reviewable_default_visibility: "low",
"enable_chunked_encoding": true, alert_admins_if_errors_per_minute: 0,
"long_polling_base_url": "/", alert_admins_if_errors_per_hour: 0,
"background_polling_interval": 60000, max_prints_per_hour_per_user: 5,
"polling_interval": 3000, invite_link_max_redemptions_limit: 5000,
"anon_polling_interval": 25000, invite_link_max_redemptions_limit_users: 10,
"flush_timings_secs": 60, enable_long_polling: true,
"verbose_localization": false, enable_chunked_encoding: true,
"max_new_topics": 500, long_polling_base_url: "/",
"enable_safe_mode": true, background_polling_interval: 60000,
"tos_url": "", polling_interval: 3000,
"privacy_policy_url": "", anon_polling_interval: 25000,
"faq_url": "", flush_timings_secs: 60,
"enable_backups": true, verbose_localization: false,
"backup_location": "local", max_new_topics: 500,
"maximum_backups": 5, enable_safe_mode: true,
"use_pg_headlines_for_excerpt": false, tos_url: "",
"min_search_term_length": 3, privacy_policy_url: "",
"log_search_queries": true, faq_url: "",
"version_checks": true, enable_backups: true,
"suppress_uncategorized_badge": true, backup_location: "local",
"header_dropdown_category_count": 8, maximum_backups: 5,
"slug_generation_method": "ascii", use_pg_headlines_for_excerpt: false,
"summary_timeline_button": false, min_search_term_length: 3,
"topic_views_heat_low": 1000, log_search_queries: true,
"topic_views_heat_medium": 2000, version_checks: true,
"topic_views_heat_high": 3500, suppress_uncategorized_badge: true,
"topic_post_like_heat_low": 0.5, header_dropdown_category_count: 8,
"topic_post_like_heat_medium": 1, slug_generation_method: "ascii",
"topic_post_like_heat_high": 2, summary_timeline_button: false,
"history_hours_low": 12, topic_views_heat_low: 1000,
"history_hours_medium": 24, topic_views_heat_medium: 2000,
"history_hours_high": 48, topic_views_heat_high: 3500,
"cold_age_days_low": 14, topic_post_like_heat_low: 0.5,
"cold_age_days_medium": 90, topic_post_like_heat_medium: 1,
"cold_age_days_high": 180, topic_post_like_heat_high: 2,
"global_notice": "", history_hours_low: 12,
"show_create_topics_notice": true, history_hours_medium: 24,
"bootstrap_mode_min_users": 50, history_hours_high: 48,
"bootstrap_mode_enabled": true, cold_age_days_low: 14,
"automatically_unpin_topics": true, cold_age_days_medium: 90,
"read_time_word_count": 500, cold_age_days_high: 180,
"topic_page_title_includes_category": true, global_notice: "",
"svg_icon_subset": "", show_create_topics_notice: true,
"allow_bulk_invite": true, bootstrap_mode_min_users: 50,
"disable_mailing_list_mode": true, bootstrap_mode_enabled: true,
"default_topics_automatic_unpin": true, automatically_unpin_topics: true,
"mute_all_categories_by_default": false, read_time_word_count: 500,
"tagging_enabled": true, topic_page_title_includes_category: true,
"tag_style": "simple", svg_icon_subset: "",
"max_tags_per_topic": 5, allow_bulk_invite: true,
"max_tag_length": 20, disable_mailing_list_mode: true,
"min_trust_level_to_tag_topics": "0", default_topics_automatic_unpin: true,
"max_tag_search_results": 5, mute_all_categories_by_default: false,
"max_tags_in_filter_list": 30, tagging_enabled: true,
"tags_sort_alphabetically": false, tag_style: "simple",
"tags_listed_by_group": false, max_tags_per_topic: 5,
"suppress_overlapping_tags_in_list": false, max_tag_length: 20,
"remove_muted_tags_from_latest": "always", min_trust_level_to_tag_topics: "0",
"force_lowercase_tags": true, max_tag_search_results: 5,
"dashboard_hidden_reports": "", max_tags_in_filter_list: 30,
"dashboard_visible_tabs": "moderation|security|reports", tags_sort_alphabetically: false,
"dashboard_general_tab_activity_metrics": "page_view_total_reqs|visits|time_to_first_response|likes|flags|user_to_user_private_messages_with_replies", tags_listed_by_group: false,
"discourse_narrative_bot_enabled": true, suppress_overlapping_tags_in_list: false,
"details_enabled": true, remove_muted_tags_from_latest: "always",
"custom_wizard_enabled": true, force_lowercase_tags: true,
"wizard_redirect_exclude_paths": "admin", dashboard_hidden_reports: "",
"wizard_recognised_image_upload_formats": "jpg|jpeg|png|gif", dashboard_visible_tabs: "moderation|security|reports",
"wizard_important_notices_on_dashboard": true, dashboard_general_tab_activity_metrics:
"discourse_local_dates_email_format": "YYYY-MM-DDTHH:mm:ss[Z]", "page_view_total_reqs|visits|time_to_first_response|likes|flags|user_to_user_private_messages_with_replies",
"discourse_local_dates_enabled": true, discourse_narrative_bot_enabled: true,
"discourse_local_dates_default_formats": "LLL|LTS|LL|LLLL", details_enabled: true,
"discourse_local_dates_default_timezones": "Europe/Paris|America/Los_Angeles", custom_wizard_enabled: true,
"poll_enabled": true, wizard_redirect_exclude_paths: "admin",
"poll_maximum_options": 20, wizard_recognised_image_upload_formats: "jpg|jpeg|png|gif",
"poll_minimum_trust_level_to_create": 1, wizard_important_notices_on_dashboard: true,
"poll_groupable_user_fields": "", discourse_local_dates_email_format: "YYYY-MM-DDTHH:mm:ss[Z]",
"poll_export_data_explorer_query_id": -16, discourse_local_dates_enabled: true,
"presence_enabled": true, discourse_local_dates_default_formats: "LLL|LTS|LL|LLLL",
"presence_max_users_shown": 5, discourse_local_dates_default_timezones: "Europe/Paris|America/Los_Angeles",
"available_locales": "[{\"name\":\"اللغة العربية\",\"value\":\"ar\"},{\"name\":\"беларуская мова\",\"value\":\"be\"},{\"name\":\"български език\",\"value\":\"bg\"},{\"name\":\"bosanski jezik\",\"value\":\"bs_BA\"},{\"name\":\"català\",\"value\":\"ca\"},{\"name\":\"čeština\",\"value\":\"cs\"},{\"name\":\"dansk\",\"value\":\"da\"},{\"name\":\"Deutsch\",\"value\":\"de\"},{\"name\":\"ελληνικά\",\"value\":\"el\"},{\"name\":\"English (US)\",\"value\":\"en\"},{\"name\":\"English (UK)\",\"value\":\"en_GB\"},{\"name\":\"Español\",\"value\":\"es\"},{\"name\":\"eesti\",\"value\":\"et\"},{\"name\":\"فارسی\",\"value\":\"fa_IR\"},{\"name\":\"suomi\",\"value\":\"fi\"},{\"name\":\"Français\",\"value\":\"fr\"},{\"name\":\"galego\",\"value\":\"gl\"},{\"name\":\"עברית\",\"value\":\"he\"},{\"name\":\"magyar\",\"value\":\"hu\"},{\"name\":\"Հայերեն\",\"value\":\"hy\"},{\"name\":\"Indonesian\",\"value\":\"id\"},{\"name\":\"Italiano\",\"value\":\"it\"},{\"name\":\"日本語\",\"value\":\"ja\"},{\"name\":\"한국어\",\"value\":\"ko\"},{\"name\":\"lietuvių kalba\",\"value\":\"lt\"},{\"name\":\"latviešu valoda\",\"value\":\"lv\"},{\"name\":\"Norsk bokmål\",\"value\":\"nb_NO\"},{\"name\":\"Nederlands\",\"value\":\"nl\"},{\"name\":\"polski\",\"value\":\"pl_PL\"},{\"name\":\"Português\",\"value\":\"pt\"},{\"name\":\"Português (BR)\",\"value\":\"pt_BR\"},{\"name\":\"limba română\",\"value\":\"ro\"},{\"name\":\"Русский\",\"value\":\"ru\"},{\"name\":\"slovenčina\",\"value\":\"sk\"},{\"name\":\"slovenščina\",\"value\":\"sl\"},{\"name\":\"Shqip\",\"value\":\"sq\"},{\"name\":\"српски језик\",\"value\":\"sr\"},{\"name\":\"svenska\",\"value\":\"sv\"},{\"name\":\"Kiswahili\",\"value\":\"sw\"},{\"name\":\"తెలుగు\",\"value\":\"te\"},{\"name\":\"ไทย\",\"value\":\"th\"},{\"name\":\"Türkçe\",\"value\":\"tr_TR\"},{\"name\":\"українська мова\",\"value\":\"uk\"},{\"name\":\"اردو\",\"value\":\"ur\"},{\"name\":\"Việt Nam\",\"value\":\"vi\"},{\"name\":\"简体中文\",\"value\":\"zh_CN\"},{\"name\":\"繁體中文\",\"value\":\"zh_TW\"}]", poll_enabled: true,
"require_invite_code": false, poll_maximum_options: 20,
"site_logo_url": "http://localhost:3000/images/discourse-logo-sketch.png", poll_minimum_trust_level_to_create: 1,
"site_logo_small_url": "http://localhost:3000/images/discourse-logo-sketch-small.png", poll_groupable_user_fields: "",
"site_mobile_logo_url": "http://localhost:3000/images/discourse-logo-sketch.png", poll_export_data_explorer_query_id: -16,
"site_favicon_url": "http://localhost:3000/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_32x32.png", presence_enabled: true,
"site_logo_dark_url": "", presence_max_users_shown: 5,
"site_logo_small_dark_url": "", available_locales:
"site_mobile_logo_dark_url": "" '[{"name":"اللغة العربية","value":"ar"},{"name":"беларуская мова","value":"be"},{"name":"български език","value":"bg"},{"name":"bosanski jezik","value":"bs_BA"},{"name":"català","value":"ca"},{"name":"čeština","value":"cs"},{"name":"dansk","value":"da"},{"name":"Deutsch","value":"de"},{"name":"ελληνικά","value":"el"},{"name":"English (US)","value":"en"},{"name":"English (UK)","value":"en_GB"},{"name":"Español","value":"es"},{"name":"eesti","value":"et"},{"name":"فارسی","value":"fa_IR"},{"name":"suomi","value":"fi"},{"name":"Français","value":"fr"},{"name":"galego","value":"gl"},{"name":"עברית","value":"he"},{"name":"magyar","value":"hu"},{"name":"Հայերեն","value":"hy"},{"name":"Indonesian","value":"id"},{"name":"Italiano","value":"it"},{"name":"日本語","value":"ja"},{"name":"한국어","value":"ko"},{"name":"lietuvių kalba","value":"lt"},{"name":"latviešu valoda","value":"lv"},{"name":"Norsk bokmål","value":"nb_NO"},{"name":"Nederlands","value":"nl"},{"name":"polski","value":"pl_PL"},{"name":"Português","value":"pt"},{"name":"Português (BR)","value":"pt_BR"},{"name":"limba română","value":"ro"},{"name":"Русский","value":"ru"},{"name":"slovenčina","value":"sk"},{"name":"slovenščina","value":"sl"},{"name":"Shqip","value":"sq"},{"name":"српски језик","value":"sr"},{"name":"svenska","value":"sv"},{"name":"Kiswahili","value":"sw"},{"name":"తెలుగు","value":"te"},{"name":"ไทย","value":"th"},{"name":"Türkçe","value":"tr_TR"},{"name":"українська мова","value":"uk"},{"name":"اردو","value":"ur"},{"name":"Việt Nam","value":"vi"},{"name":"简体中文","value":"zh_CN"},{"name":"繁體中文","value":"zh_TW"}]',
} require_invite_code: false,
site_logo_url: "http://localhost:3000/images/discourse-logo-sketch.png",
site_logo_small_url:
"http://localhost:3000/images/discourse-logo-sketch-small.png",
site_mobile_logo_url:
"http://localhost:3000/images/discourse-logo-sketch.png",
site_favicon_url:
"http://localhost:3000/uploads/default/optimized/1X/_129430568242d1b7f853bb13ebea28b3f6af4e7_2_32x32.png",
site_logo_dark_url: "",
site_logo_small_dark_url: "",
site_mobile_logo_dark_url: "",
};

Datei anzeigen

@ -1,22 +1,22 @@
export default { export default {
"tags": [ tags: [
{ {
"id": "tag1", id: "tag1",
"text": "tag1", text: "tag1",
"name": "tag1", name: "tag1",
"description": null, description: null,
"count": 1, count: 1,
"pm_count": 0, pm_count: 0,
"target_tag": null target_tag: null,
}, },
{ {
"id": "tag2", id: "tag2",
"text": "tag2", text: "tag2",
"name": "tag2", name: "tag2",
"description": null, description: null,
"count": 1, count: 1,
"pm_count": 0, pm_count: 0,
"target_tag": null target_tag: null,
} },
] ],
} };

Datei anzeigen

@ -1,5 +1,5 @@
export default { export default {
"final": false, final: false,
"next_step_id": "step_2", next_step_id: "step_2",
"wizard": {} wizard: {},
} };

Datei anzeigen

@ -30,5 +30,5 @@ export default {
title_count_mode: "notifications", title_count_mode: "notifications",
timezone: "Australia/Perth", timezone: "Australia/Perth",
skip_new_user_tips: false, skip_new_user_tips: false,
can_review: true can_review: true,
} };

Datei anzeigen

@ -1,14 +1,14 @@
export default { export default {
"users": [ users: [
{ {
"username": "angus", username: "angus",
"name": "Angus", name: "Angus",
"avatar_template": "/user_avatar/localhost/angus/{size}/12_2.png" avatar_template: "/user_avatar/localhost/angus/{size}/12_2.png",
}, },
{ {
"username": "angus_2", username: "angus_2",
"name": "Angus 2", name: "Angus 2",
"avatar_template": "/letter_avatar_proxy/v4/letter/a/e9a140/{size}.png" avatar_template: "/letter_avatar_proxy/v4/letter/a/e9a140/{size}.png",
} },
] ],
} };

Datei anzeigen

@ -1,469 +1,471 @@
export default { export default {
"id": "wizard", id: "wizard",
"name": "Wizard", name: "Wizard",
"start": "step_1", start: "step_1",
"background": "#333333", background: "#333333",
"submission_last_updated_at": "2022-03-15T21:11:01+01:00", submission_last_updated_at: "2022-03-15T21:11:01+01:00",
"theme_id": 2, theme_id: 2,
"required": false, required: false,
"permitted": true, permitted: true,
"uncategorized_category_id": 1, uncategorized_category_id: 1,
"categories": [], categories: [],
"subscribed": false, subscribed: false,
"resume_on_revisit": false, resume_on_revisit: false,
"steps": [ steps: [
{ {
"id": "step_1", id: "step_1",
"index": 0, index: 0,
"next": "step_2", next: "step_2",
"description": "<p>Text inputs!</p>", description: "<p>Text inputs!</p>",
"title": "Text", title: "Text",
"permitted": true, permitted: true,
"permitted_message": null, permitted_message: null,
"final": false, final: false,
"fields": [ fields: [
{ {
"id": "step_1_field_1", id: "step_1_field_1",
"index": 0, index: 0,
"type": "text", type: "text",
"required": false, required: false,
"value": "I am prefilled", value: "I am prefilled",
"label": "<p>Text</p>", label: "<p>Text</p>",
"description": "Text field description.", description: "Text field description.",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 1, tabindex: 1,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_1", stepId: "step_1",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_1_field_2", id: "step_1_field_2",
"index": 0, index: 0,
"type": "textarea", type: "textarea",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Textarea</p>", label: "<p>Textarea</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 2, tabindex: 2,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_1", stepId: "step_1",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_1_field_3", id: "step_1_field_3",
"index": 2, index: 2,
"type": "composer", type: "composer",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Composer</p>", label: "<p>Composer</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 3, tabindex: 3,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_1", stepId: "step_1",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_1_field_4", id: "step_1_field_4",
"index": 3, index: 3,
"type": "text_only", type: "text_only",
"required": false, required: false,
"value": null, value: null,
"label": "<p>Im only text</p>", label: "<p>Im only text</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 4, tabindex: 4,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_1", stepId: "step_1",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_1_field_5", id: "step_1_field_5",
"index": 4, index: 4,
"type": "composer_preview", type: "composer_preview",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Im a preview</p>", label: "<p>Im a preview</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": "<p>I am prefilled</p>", preview_template: "<p>I am prefilled</p>",
"tabindex": 5, tabindex: 5,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_1", stepId: "step_1",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_1_field_6", id: "step_1_field_6",
"index": 5, index: 5,
"type": "composer_preview", type: "composer_preview",
"required": false, required: false,
"value": "", value: "",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": "<p>This is the preview of the composer</p>", preview_template: "<p>This is the preview of the composer</p>",
"tabindex": 6, tabindex: 6,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_1", stepId: "step_1",
"_validState": 0 _validState: 0,
} },
], ],
"_validState": 0, _validState: 0,
"wizardId": "super_mega_fun_wizard" wizardId: "super_mega_fun_wizard",
}, },
{ {
"id": "step_2", id: "step_2",
"index": 1, index: 1,
"next": "step_3", next: "step_3",
"previous": "step_1", previous: "step_1",
"description": "<p>Because I couldnt think of another name for this step <img src=\"/images/emoji/twitter/slight_smile.png?v=12\" title=\":slight_smile:\" class=\"emoji\" alt=\":slight_smile:\" loading=\"lazy\" width=\"20\" height=\"20\"></p>", description:
"title": "Values", '<p>Because I couldnt think of another name for this step <img src="/images/emoji/twitter/slight_smile.png?v=12" title=":slight_smile:" class="emoji" alt=":slight_smile:" loading="lazy" width="20" height="20"></p>',
"permitted": true, title: "Values",
"permitted_message": null, permitted: true,
"final": false, permitted_message: null,
"fields": [ final: false,
fields: [
{ {
"id": "step_2_field_1", id: "step_2_field_1",
"index": 0, index: 0,
"type": "date", type: "date",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Date</p>", label: "<p>Date</p>",
"file_types": null, file_types: null,
"format": "YYYY-MM-DD", format: "YYYY-MM-DD",
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 1, tabindex: 1,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_2", stepId: "step_2",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_2_field_2", id: "step_2_field_2",
"index": 0, index: 0,
"type": "time", type: "time",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Time</p>", label: "<p>Time</p>",
"file_types": null, file_types: null,
"format": "HH:mm", format: "HH:mm",
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 2, tabindex: 2,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_2", stepId: "step_2",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_2_field_3", id: "step_2_field_3",
"index": 2, index: 2,
"type": "date_time", type: "date_time",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Date &amp; Time</p>", label: "<p>Date &amp; Time</p>",
"file_types": null, file_types: null,
"format": "", format: "",
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 3, tabindex: 3,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_2", stepId: "step_2",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_2_field_4", id: "step_2_field_4",
"index": 3, index: 3,
"type": "number", type: "number",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Number</p>", label: "<p>Number</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 5, tabindex: 5,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_2", stepId: "step_2",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_2_field_5", id: "step_2_field_5",
"index": 4, index: 4,
"type": "checkbox", type: "checkbox",
"required": false, required: false,
"value": false, value: false,
"label": "<p>Checkbox</p>", label: "<p>Checkbox</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 6, tabindex: 6,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_2", stepId: "step_2",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_2_field_6", id: "step_2_field_6",
"index": 5, index: 5,
"type": "url", type: "url",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Url</p>", label: "<p>Url</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 7, tabindex: 7,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_2", stepId: "step_2",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_2_field_7", id: "step_2_field_7",
"index": 6, index: 6,
"type": "upload", type: "upload",
"required": false, required: false,
"value": "", value: "",
"label": "<p>Upload</p>", label: "<p>Upload</p>",
"file_types": ".jpg,.jpeg,.png", file_types: ".jpg,.jpeg,.png",
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 8, tabindex: 8,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_2", stepId: "step_2",
"_validState": 0 _validState: 0,
} },
], ],
"_validState": 0, _validState: 0,
"wizardId": "super_mega_fun_wizard" wizardId: "super_mega_fun_wizard",
}, },
{ {
"id": "step_3", id: "step_3",
"index": 2, index: 2,
"previous": "step_2", previous: "step_2",
"description": "<p>Unfortunately not the edible type <img src=\"/images/emoji/twitter/sushi.png?v=12\" title=\":sushi:\" class=\"emoji\" alt=\":sushi:\" loading=\"lazy\" width=\"20\" height=\"20\"></p>", description:
"title": "Combo-boxes", '<p>Unfortunately not the edible type <img src="/images/emoji/twitter/sushi.png?v=12" title=":sushi:" class="emoji" alt=":sushi:" loading="lazy" width="20" height="20"></p>',
"permitted": true, title: "Combo-boxes",
"permitted_message": null, permitted: true,
"final": true, permitted_message: null,
"fields": [ final: true,
fields: [
{ {
"id": "step_3_field_1", id: "step_3_field_1",
"index": 0, index: 0,
"type": "dropdown", type: "dropdown",
"required": false, required: false,
"value": "choice1", value: "choice1",
"label": "<p>Custom Dropdown</p>", label: "<p>Custom Dropdown</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": [ content: [
{ {
"id": "one", id: "one",
"name": "One" name: "One",
}, },
{ {
"id": "two", id: "two",
"name": "Two" name: "Two",
} },
], ],
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 1, tabindex: 1,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_3", stepId: "step_3",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_3_field_2", id: "step_3_field_2",
"index": 0, index: 0,
"type": "tag", type: "tag",
"required": false, required: false,
"value": null, value: null,
"label": "<p>Tag</p>", label: "<p>Tag</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 2, tabindex: 2,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_3", stepId: "step_3",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_3_field_3", id: "step_3_field_3",
"index": 2, index: 2,
"type": "category", type: "category",
"required": false, required: false,
"value": null, value: null,
"label": "<p>Category</p>", label: "<p>Category</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": 1, limit: 1,
"property": "id", property: "id",
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 3, tabindex: 3,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_3", stepId: "step_3",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_3_field_4", id: "step_3_field_4",
"index": 3, index: 3,
"type": "group", type: "group",
"required": false, required: false,
"value": null, value: null,
"label": "<p>Group</p>", label: "<p>Group</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 4, tabindex: 4,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_3", stepId: "step_3",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_3_field_5", id: "step_3_field_5",
"index": 4, index: 4,
"type": "user_selector", type: "user_selector",
"required": false, required: false,
"value": null, value: null,
"label": "<p>User Selector</p>", label: "<p>User Selector</p>",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 5, tabindex: 5,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_3", stepId: "step_3",
"_validState": 0 _validState: 0,
}, },
{ {
"id": "step_3_field_6", id: "step_3_field_6",
"index": 5, index: 5,
"type": "user_selector", type: "user_selector",
"required": false, required: false,
"value": null, value: null,
"label": "<p>Conditional User Selector</p>", label: "<p>Conditional User Selector</p>",
"description": "Shown when checkbox in step_2_field_5 is true", description: "Shown when checkbox in step_2_field_5 is true",
"file_types": null, file_types: null,
"format": null, format: null,
"limit": null, limit: null,
"property": null, property: null,
"content": null, content: null,
"validations": {}, validations: {},
"max_length": null, max_length: null,
"char_counter": null, char_counter: null,
"preview_template": null, preview_template: null,
"tabindex": 6, tabindex: 6,
"wizardId": "super_mega_fun_wizard", wizardId: "super_mega_fun_wizard",
"stepId": "step_3", stepId: "step_3",
"_validState": 0 _validState: 0,
} },
], ],
"_validState": 0, _validState: 0,
"wizardId": "super_mega_fun_wizard" wizardId: "super_mega_fun_wizard",
} },
], ],
"groups": [] groups: [],
} };

Datei anzeigen

@ -6,18 +6,20 @@ let server;
let app; let app;
function acceptance(name, requests, cb) { function acceptance(name, requests, cb) {
module(`Acceptance: ${name}`, function(hooks) { module(`Acceptance: ${name}`, function (hooks) {
hooks.beforeEach(function() { hooks.beforeEach(function () {
server = setupPretender(function(pretender) { server = setupPretender(function (pretender) {
requests.forEach(req => { requests.forEach((req) => {
pretender[req.verb](req.path, () => (response(req.status, req.response))); pretender[req.verb](req.path, () =>
response(req.status, req.response)
);
}); });
return pretender; return pretender;
}); });
app = startApp(); app = startApp();
}); });
hooks.afterEach(function() { hooks.afterEach(function () {
app.destroy(); app.destroy();
server.shutdown(); server.shutdown();
}); });
@ -28,9 +30,7 @@ function acceptance(name, requests, cb) {
export default acceptance; export default acceptance;
export { export { server };
server
};
// The discourse/test/helpers/qunit-helpers file has many functions and imports // The discourse/test/helpers/qunit-helpers file has many functions and imports
// we don't need, so there will be some duplciation here. // we don't need, so there will be some duplciation here.

Datei anzeigen

@ -1,6 +1,12 @@
const CustomWizard = requirejs("discourse/plugins/discourse-custom-wizard/wizard/application").default; const CustomWizard = requirejs(
const initializer = requirejs("discourse/plugins/discourse-custom-wizard/wizard/lib/initialize/wizard").default; "discourse/plugins/discourse-custom-wizard/wizard/application"
const siteSettings = requirejs("discourse/plugins/discourse-custom-wizard/wizard/tests/fixtures/site-settings").default; ).default;
const initializer = requirejs(
"discourse/plugins/discourse-custom-wizard/wizard/lib/initialize/wizard"
).default;
const siteSettings = requirejs(
"discourse/plugins/discourse-custom-wizard/wizard/tests/fixtures/site-settings"
).default;
const { cloneJSON } = requirejs("discourse-common/lib/object").default; const { cloneJSON } = requirejs("discourse-common/lib/object").default;
let app; let app;

Datei anzeigen

@ -5,16 +5,13 @@ import wizardJson from "../fixtures/wizard";
const update = cloneJSON(updateJson); const update = cloneJSON(updateJson);
update.wizard = cloneJSON(wizardJson); update.wizard = cloneJSON(wizardJson);
const saveStep = function(response) { const saveStep = function (response) {
return { return {
verb: "put", verb: "put",
path: '/w/wizard/steps/:step_id', path: "/w/wizard/steps/:step_id",
status: 200, status: 200,
response response,
} };
} };
export { export { saveStep, update };
saveStep,
update
}

Datei anzeigen

@ -2,6 +2,4 @@ function exists(selector) {
return document.querySelector(selector) !== null; return document.querySelector(selector) !== null;
} }
export { export { exists };
exists
}

Datei anzeigen

@ -26,20 +26,20 @@ const allFieldsWizard = cloneJSON(wizard);
allFieldsWizard.steps[0].fields = [ allFieldsWizard.steps[0].fields = [
...allFieldsWizard.steps[0].fields, ...allFieldsWizard.steps[0].fields,
...allFieldsWizard.steps[1].fields, ...allFieldsWizard.steps[1].fields,
...allFieldsWizard.steps[2].fields ...allFieldsWizard.steps[2].fields,
]; ];
allFieldsWizard.steps = [cloneJSON(allFieldsWizard.steps[0])]; allFieldsWizard.steps = [cloneJSON(allFieldsWizard.steps[0])];
allFieldsWizard.categories = cloneJSON(categoriesJson['categories']); allFieldsWizard.categories = cloneJSON(categoriesJson["categories"]);
allFieldsWizard.groups = cloneJSON(groupsJson['groups']); allFieldsWizard.groups = cloneJSON(groupsJson["groups"]);
const getWizard = function(response) { const getWizard = function (response) {
return { return {
verb: "get", verb: "get",
path: "/w/wizard", path: "/w/wizard",
status: 200, status: 200,
response response,
} };
} };
export { export {
getWizard, getWizard,
@ -48,5 +48,5 @@ export {
wizardCompleted, wizardCompleted,
stepNotPermitted, stepNotPermitted,
allFieldsWizard, allFieldsWizard,
wizard wizard,
} };

Datei anzeigen

@ -1,23 +1,5 @@
import Pretender from "pretender"; import Pretender from "pretender";
function parsePostData(query) {
const result = {};
query.split("&").forEach(function (part) {
const item = part.split("=");
const firstSeg = decodeURIComponent(item[0]);
const m = /^([^\[]+)\[([^\]]+)\]/.exec(firstSeg);
const val = decodeURIComponent(item[1]).replace(/\+/g, " ");
if (m) {
result[m[1]] = result[m[1]] || {};
result[m[1]][m[2]] = val;
} else {
result[firstSeg] = val;
}
});
return result;
}
function response(code, obj) { function response(code, obj) {
if (typeof code === "object") { if (typeof code === "object") {
obj = code; obj = code;
@ -42,7 +24,7 @@ export default function (cb) {
return body; return body;
}; };
server.unhandledRequest = function (verb, path, request) { server.unhandledRequest = function (verb, path) {
const error = const error =
"Unhandled request in test environment: " + path + " (" + verb + ")"; "Unhandled request in test environment: " + path + " (" + verb + ")";
window.console.error(error); window.console.error(error);