0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-09-19 15:21:11 +02:00
Dieser Commit ist enthalten in:
Angus McLeod 2024-07-09 11:26:34 +02:00
Ursprung 54a9e9470e
Commit 7bb26d0d5c
8 geänderte Dateien mit 21 neuen und 18 gelöschten Zeilen

Datei anzeigen

@ -36,6 +36,6 @@ export default Component.extend({
showLogin() { showLogin() {
cookie("destination_url", getURL(`/w/${this.get("wizardId")}`)); cookie("destination_url", getURL(`/w/${this.get("wizardId")}`));
getOwner(this).lookup("route:application").send("showLogin"); getOwner(this).lookup("route:application").send("showLogin");
} },
}, },
}); });

Datei anzeigen

@ -5,7 +5,6 @@ import { computed } from "@ember/object";
import UndoChanges from "../mixins/undo-changes"; import UndoChanges from "../mixins/undo-changes";
import Component from "@ember/component"; import Component from "@ember/component";
import I18n from "I18n"; import I18n from "I18n";
import { WIZARD_USER } from "./wizard-user-chooser";
export default Component.extend(UndoChanges, { export default Component.extend(UndoChanges, {
componentType: "action", componentType: "action",

Datei anzeigen

@ -121,9 +121,13 @@ export default Component.extend({
guestGroup: computed("options.guestGroup", "inputType", function () { guestGroup: computed("options.guestGroup", "inputType", function () {
return this.optionEnabled("guestGroup"); return this.optionEnabled("guestGroup");
}), }),
includeMessageableGroups: computed("options.includeMessageableGroups", "inputType", function () { includeMessageableGroups: computed(
return this.optionEnabled("includeMessageableGroups"); "options.includeMessageableGroups",
}), "inputType",
function () {
return this.optionEnabled("includeMessageableGroups");
}
),
userEnabled: computed("options.userSelection", "inputType", function () { userEnabled: computed("options.userSelection", "inputType", function () {
return this.optionEnabled("userSelection"); return this.optionEnabled("userSelection");
}), }),
@ -358,10 +362,10 @@ export default Component.extend({
@discourseComputed("includeMessageableGroups", "options.userLimit") @discourseComputed("includeMessageableGroups", "options.userLimit")
userOptions(includeMessageableGroups, userLimit) { userOptions(includeMessageableGroups, userLimit) {
const opts = { const opts = {
includeMessageableGroups includeMessageableGroups,
} };
if (userLimit) { if (userLimit) {
opts.maximum = userLimit opts.maximum = userLimit;
} }
return opts; return opts;
}, },

Datei anzeigen

@ -34,7 +34,7 @@ export default Component.extend({
context: options.context || null, context: options.context || null,
guestGroup: options.guestGroup || false, guestGroup: options.guestGroup || false,
includeMessageableGroups: options.includeMessageableGroups || false, includeMessageableGroups: options.includeMessageableGroups || false,
userLimit: options.userLimit || null userLimit: options.userLimit || null,
}; };
let inputTypes = ["key", "value", "output"]; let inputTypes = ["key", "value", "output"];

Datei anzeigen

@ -1,4 +1,5 @@
import UserChooserComponent from "select-kit/components/user-chooser"; import UserChooserComponent from "select-kit/components/user-chooser";
import I18n from "I18n";
export const WIZARD_USER = "wizard-user"; export const WIZARD_USER = "wizard-user";
@ -14,7 +15,10 @@ export default UserChooserComponent.extend({
}, },
modifyNoSelection() { modifyNoSelection() {
return this.defaultItem(WIZARD_USER, I18n.t("admin.wizard.action.poster.wizard_user")); return this.defaultItem(
WIZARD_USER,
I18n.t("admin.wizard.action.poster.wizard_user")
);
}, },
selectKitOptions: { selectKitOptions: {
@ -28,7 +32,6 @@ export default UserChooserComponent.extend({
return; return;
} }
return superPromise.then((results) => { return superPromise.then((results) => {
console.log(results)
if (!results || results.length === 0) { if (!results || results.length === 0) {
return; return;
} }

Datei anzeigen

@ -100,7 +100,7 @@ const action = {
custom_fields: null, custom_fields: null,
skip_redirect: null, skip_redirect: null,
suppress_notifications: null, suppress_notifications: null,
poster: 'wizard-user', poster: "wizard-user",
guest_email: null, guest_email: null,
add_event: null, add_event: null,
add_location: null, add_location: null,
@ -113,7 +113,7 @@ const action = {
skip_redirect: null, skip_redirect: null,
custom_fields: null, custom_fields: null,
required: null, required: null,
poster: 'wizard-user', poster: "wizard-user",
guest_email: null, guest_email: null,
recipient: null, recipient: null,
suppress_notifications: null, suppress_notifications: null,

Datei anzeigen

@ -1,9 +1,6 @@
<div>{{text}}</div> <div>{{text}}</div>
<div class="no-access-gutter"> <div class="no-access-gutter">
<a <a class="return-to-site" {{action "skip"}}>
class="return-to-site"
{{action "skip"}}
>
{{i18n "wizard.return_to_site" siteName=siteName}} {{i18n "wizard.return_to_site" siteName=siteName}}
</a> </a>
{{#if showLoginButton}} {{#if showLoginButton}}

Datei anzeigen

@ -110,7 +110,7 @@
property="poster" property="poster"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
textSelection='key,value' textSelection="key,value"
wizardFieldSelection=true wizardFieldSelection=true
userSelection="output" userSelection="output"
outputDefaultSelection="user" outputDefaultSelection="user"