Commits vergleichen
244 Commits
subscripti
...
main
Autor | SHA1 | Datum | |
---|---|---|---|
5fe63ec70e | |||
6bc33ebd64 | |||
df456abda0 | |||
df30ce32ee | |||
4750829e1a | |||
49535d88bb | |||
|
d5aa616ff8 | ||
|
578c92e90e | ||
|
3d104406fd | ||
|
0eb6fb1ae0 | ||
|
0992e9601c | ||
|
10609f33e2 | ||
|
bb81c5700a | ||
|
03ef41f7f0 | ||
|
bdd290f4e6 | ||
|
2ab15aaf86 | ||
|
de9dccf233 | ||
|
bb3f0c6252 | ||
|
61309fd320 | ||
|
b365b5dd4f | ||
|
de03cbd15a | ||
|
29d7818a4a | ||
|
f2d1437cff | ||
|
9ab4ca21c8 | ||
|
16109b01e7 | ||
|
43cd090b17 | ||
|
5f99dc226a | ||
|
2460685e65 | ||
|
c6fded7113 | ||
|
713c1bcaa5 | ||
|
ffa37e895c | ||
|
22fac139b6 | ||
|
61ea75dcad | ||
|
766d3b5fc9 | ||
|
a786b5956b | ||
|
794b7c9d5c | ||
|
76c359be3b | ||
|
6572b32706 | ||
|
d71d9976b8 | ||
|
27596a1624 | ||
|
3c17ef574e | ||
|
742239b023 | ||
|
33a320021f | ||
|
e6f44b7dfc | ||
|
31f917ec80 | ||
|
6c0d7a671e | ||
|
31b2625a65 | ||
|
bce0acbfd2 | ||
|
b81bc762c7 | ||
|
785bce228e | ||
|
52efc15576 | ||
|
ebc0f706e3 | ||
|
050a38a9d3 | ||
|
8649ab2286 | ||
|
037132fb1a | ||
|
8332818616 | ||
|
36d6f9bc6f | ||
|
121d60330a | ||
|
13a1538eb9 | ||
|
fee56c2d43 | ||
|
da4fe79aea | ||
|
0a450d58f4 | ||
|
b45e01803d | ||
|
b8cfaa7f23 | ||
|
690f12ee3e | ||
|
1f35b80f85 | ||
|
72b1a2aca5 | ||
|
f5129b7ffe | ||
|
a342626267 | ||
|
3fe1a7c7e8 | ||
|
609df33680 | ||
|
ec739d0450 | ||
|
c26a89a78a | ||
|
ec88af0cc0 | ||
|
10d597c495 | ||
|
cc2eb8c742 | ||
|
98fe9ce77f | ||
|
55a4797e4f | ||
|
33da03b63a | ||
|
580889a34e | ||
|
8d32aebf05 | ||
|
b71f627d73 | ||
|
1b93c06188 | ||
|
4449ab7aff | ||
|
1662ff166d | ||
|
270d7926cc | ||
|
a13f7be6a3 | ||
|
f94df66613 | ||
|
5aefa9c544 | ||
|
7861e37224 | ||
|
6a9f93bccb | ||
|
bf2dcdba86 | ||
|
6beccd95f0 | ||
|
603886b394 | ||
|
7fd4d9bd24 | ||
|
0cec743253 | ||
|
ccb7095b00 | ||
|
3189c03fbe | ||
|
c4521b4b92 | ||
|
00a66cd1f9 | ||
|
c495540157 | ||
|
b8965de717 | ||
|
6f4e7015f8 | ||
|
90046f5fe3 | ||
|
ba20a8a195 | ||
|
1f928f0f81 | ||
|
c67d5075cb | ||
|
2737210baf | ||
|
b73cb95e46 | ||
|
a575ffdf76 | ||
|
e51ba49e11 | ||
|
2df920895d | ||
|
39b947d003 | ||
|
10df3208df | ||
|
d74f5cbd89 | ||
|
eadd64bbbc | ||
|
c85be78af5 | ||
|
ebd25f2780 | ||
|
af39c567ea | ||
|
cd6503d425 | ||
|
6e0f10ca0d | ||
|
f8ea421852 | ||
|
f08f9f303f | ||
|
b4d23970bc | ||
|
7561bc8042 | ||
|
d9ace0449f | ||
|
712c15e845 | ||
|
a5179e568b | ||
|
9e65fcb410 | ||
|
29141ab35c | ||
|
a5ebc282cf | ||
|
0602e59d70 | ||
|
78e7ae4e04 | ||
|
c8a19e8c85 | ||
|
298c083624 | ||
|
92b8fdc6d9 | ||
|
61bf199934 | ||
|
86e6945ad4 | ||
|
e7ab0f7143 | ||
|
519e868078 | ||
|
c1f06c6fff | ||
|
42d6e094a2 | ||
|
2fe8501c65 | ||
|
c256a41668 | ||
|
99e747a331 | ||
|
2cb876ac69 | ||
|
acbaebf0aa | ||
|
97db657227 | ||
|
c1ee353470 | ||
|
4bfea70dde | ||
|
12ca60775a | ||
|
4cdfdbf9d5 | ||
|
6dbd8f7c4f | ||
|
49c1848e88 | ||
|
00ba8425e3 | ||
|
705c84dd02 | ||
|
594a226576 | ||
|
b965afa020 | ||
|
92461ad9d3 | ||
|
a4a18115ee | ||
|
dd8b4b8e99 | ||
|
537ffeb883 | ||
|
69dc96562d | ||
|
c83e514de9 | ||
|
887057d0d2 | ||
|
64b1c0264e | ||
|
02a3c426c0 | ||
|
9793ef6453 | ||
|
ed37c13664 | ||
|
e4b9be9393 | ||
|
1a84acec21 | ||
|
d0459575e0 | ||
|
0c08b5c044 | ||
|
b3266c6d18 | ||
|
af064dc655 | ||
|
9ff9844420 | ||
|
63d975eba0 | ||
|
06c812a720 | ||
|
15cc33b8cc | ||
|
54ad75bafd | ||
|
fcb6b2a359 | ||
|
51624ac819 | ||
|
0f59c9092f | ||
|
0b70806b6b | ||
|
014219c038 | ||
|
1254fcfb4e | ||
|
2c52459f29 | ||
|
ebddcb5606 | ||
|
60d50afc54 | ||
|
99c2c2a461 | ||
|
0a5b7411aa | ||
|
c6c4e31ba9 | ||
|
0e5f0fc86d | ||
|
c375c1dcd9 | ||
|
9b8a3589bd | ||
|
e21c3fa296 | ||
|
24a8b95e0b | ||
|
146fd30ab5 | ||
|
e88e83dd80 | ||
|
57f591e488 | ||
|
8103a3b9fa | ||
|
be3a479270 | ||
|
8f42268e88 | ||
|
082139cd97 | ||
|
ded6dacd60 | ||
|
2557d15a0c | ||
|
f0f27769fd | ||
|
828ded7c05 | ||
|
d6b1655a37 | ||
|
fbf7319c36 | ||
|
7c70e8ca75 | ||
|
ac751b269e | ||
|
ff8294b8e9 | ||
|
ced9d768fb | ||
|
2a38aabdca | ||
|
28cf4421d4 | ||
|
c866395495 | ||
|
9a5328a7e9 | ||
|
28bb6f2886 | ||
|
e67cf5001f | ||
|
b7953fb882 | ||
|
9583851501 | ||
|
bd03d62da1 | ||
|
f54025677a | ||
|
0a03817237 | ||
|
039ba8f603 | ||
|
b05cbec277 | ||
|
6026d67b12 | ||
|
a6b6a2c025 | ||
|
06366a1574 | ||
|
8568a1d97f | ||
|
786c5cd6fc | ||
|
9df0fb97d5 | ||
|
0eaf7b7798 | ||
|
fab0095b1f | ||
|
953123fbf8 | ||
|
23fafeaf05 | ||
|
230fe4a51f | ||
|
27186caafc | ||
|
52d308e7b4 | ||
|
09e56499ca | ||
|
71b6a184ca | ||
|
0f9fa5fe94 | ||
|
cc37043195 |
127 geänderte Dateien mit 6574 neuen und 1802 gelöschten Zeilen
|
@ -1,2 +1,3 @@
|
|||
3.1.999: 1f35b80f85e5fd1efb7f4851f0845700432febdc
|
||||
2.7.99: e07a57e398b6b1676ab42a7e34467556fca5416b
|
||||
2.5.1: bb85b3a0d2c0ab6b59bcb405731c39089ec6731c
|
||||
|
|
|
@ -22,7 +22,12 @@ class CustomWizard::AdminSubmissionsController < CustomWizard::AdminController
|
|||
end
|
||||
|
||||
def download
|
||||
send_data submission_list.submissions.to_json,
|
||||
content = ActiveModel::ArraySerializer.new(
|
||||
CustomWizard::Submission.list(@wizard).submissions,
|
||||
each_serializer: CustomWizard::SubmissionSerializer
|
||||
)
|
||||
|
||||
send_data content.to_json,
|
||||
filename: "#{Discourse.current_hostname}-wizard-submissions-#{@wizard.name}.json",
|
||||
content_type: "application/json",
|
||||
disposition: "attachment"
|
||||
|
|
|
@ -7,7 +7,7 @@ import userSearch from "discourse/lib/user-search";
|
|||
import I18n from "I18n";
|
||||
import Handlebars from "handlebars";
|
||||
import { isEmpty } from "@ember/utils";
|
||||
import TextField from "@ember/component/text-field";
|
||||
import TextField from "discourse/components/text-field";
|
||||
|
||||
const template = function (params) {
|
||||
const options = params.options;
|
||||
|
|
|
@ -12,11 +12,15 @@ import { alias } from "@ember/object/computed";
|
|||
import Site from "discourse/models/site";
|
||||
import { uploadIcon } from "discourse/lib/uploads";
|
||||
import { dasherize } from "@ember/string";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import InsertHyperlink from "discourse/components/modal/insert-hyperlink";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
const IMAGE_MARKDOWN_REGEX = /!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
|
||||
const IMAGE_MARKDOWN_REGEX =
|
||||
/!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
|
||||
|
||||
export default ComposerEditor.extend({
|
||||
modal: service(),
|
||||
|
||||
classNameBindings: ["fieldClass"],
|
||||
allowUpload: true,
|
||||
showLink: false,
|
||||
|
@ -116,9 +120,8 @@ export default ComposerEditor.extend({
|
|||
event.target.closest(".button-wrapper").dataset.imageIndex,
|
||||
10
|
||||
);
|
||||
const matchingPlaceholder = this.get("composer.reply").match(
|
||||
IMAGE_MARKDOWN_REGEX
|
||||
);
|
||||
const matchingPlaceholder =
|
||||
this.get("composer.reply").match(IMAGE_MARKDOWN_REGEX);
|
||||
|
||||
this.session.set("wizardEventFieldId", this.field.id);
|
||||
this.appEvents.trigger(
|
||||
|
@ -197,10 +200,8 @@ export default ComposerEditor.extend({
|
|||
if (this._lastSel) {
|
||||
linkText = this._lastSel.value;
|
||||
}
|
||||
|
||||
showModal("insert-hyperlink").setProperties({
|
||||
linkText,
|
||||
toolbarEvent,
|
||||
this.modal.show(InsertHyperlink, {
|
||||
model: { linkText, toolbarEvent },
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import computed from "discourse-common/utils/decorators";
|
||||
import { isLTR, isRTL, siteDir } from "discourse/lib/text-direction";
|
||||
import I18n from "I18n";
|
||||
import TextField from "@ember/component/text-field";
|
||||
import TextField from "discourse/components/text-field";
|
||||
|
||||
export default TextField.extend({
|
||||
attributeBindings: [
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<DModal @closeModal={{@closeModal}} @title={{this.title}}>
|
||||
{{#if loading}}
|
||||
<LoadingSpinner size="large" />
|
||||
{{else}}
|
||||
<div class="edit-directory-columns-container">
|
||||
{{#each @model.columns as |column|}}
|
||||
<div class="edit-directory-column">
|
||||
<div class="left-content">
|
||||
<label class="column-name">
|
||||
<Input @type="checkbox" @checked={{column.enabled}} />
|
||||
{{directory-table-header-title
|
||||
field=column.label
|
||||
translated=true
|
||||
}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
<div class="modal-footer">
|
||||
<DButton
|
||||
class="btn-primary"
|
||||
@label="directory.edit_columns.save"
|
||||
@action={{action "save"}}
|
||||
/>
|
||||
|
||||
<DButton
|
||||
class="btn-secondary reset-to-default"
|
||||
@label="directory.edit_columns.reset_to_default"
|
||||
@action={{action "resetToDefault"}}
|
||||
/>
|
||||
</div>
|
||||
</DModal>
|
|
@ -0,0 +1,15 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { action } from "@ember/object";
|
||||
import I18n from "I18n";
|
||||
|
||||
export default class AdminWizardsColumnComponent extends Component {
|
||||
title = I18n.t("admin.wizard.edit_columns");
|
||||
|
||||
@action save() {
|
||||
this.args.closeModal();
|
||||
}
|
||||
|
||||
@action resetToDefault() {
|
||||
this.args.model.reset();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
<DModal
|
||||
@closeModal={{@closeModal}}
|
||||
class="next-session-time-modal"
|
||||
@title={{this.title}}
|
||||
>
|
||||
<DateTimeInput
|
||||
@date={{this.bufferedDateTime}}
|
||||
@onChange={{action "dateTimeChanged"}}
|
||||
@showTime="true"
|
||||
@clearable="true"
|
||||
/>
|
||||
<div class="modal-footer">
|
||||
<DButton
|
||||
@action={{action "submit"}}
|
||||
class="btn-primary"
|
||||
@label="admin.wizard.after_time_modal.done"
|
||||
@disabled={{this.submitDisabled}}
|
||||
/>
|
||||
</div>
|
||||
</DModal>
|
|
@ -0,0 +1,30 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { action } from "@ember/object";
|
||||
import I18n from "I18n";
|
||||
|
||||
export default class NextSessionScheduledComponent extends Component {
|
||||
@tracked bufferedDateTime;
|
||||
title = I18n.t("admin.wizard.after_time_modal.title");
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.bufferedDateTime = this.args.model.dateTime
|
||||
? moment(this.args.model.dateTime)
|
||||
: moment(Date.now());
|
||||
}
|
||||
|
||||
get submitDisabled() {
|
||||
return moment().isAfter(this.bufferedDateTime);
|
||||
}
|
||||
|
||||
@action submit() {
|
||||
const dateTime = this.bufferedDateTime;
|
||||
this.args.model.update(moment(dateTime).utc().toISOString());
|
||||
this.args.closeModal();
|
||||
}
|
||||
|
||||
@action dateTimeChanged(dateTime) {
|
||||
this.bufferedDateTime = dateTime;
|
||||
}
|
||||
}
|
|
@ -9,8 +9,7 @@
|
|||
value=wizardListVal
|
||||
content=wizardList
|
||||
onChange=(action "changeWizard")
|
||||
options=(hash
|
||||
none="admin.wizard.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.select")
|
||||
}}
|
||||
</div>
|
||||
</section>
|
|
@ -1,7 +1,10 @@
|
|||
{{#each site.complete_custom_wizard as |wizard|}}
|
||||
<div class="row">
|
||||
<div class="alert alert-info alert-wizard">
|
||||
<a href={{wizard.url}}>{{i18n "wizard.complete_custom" name=wizard.name}}</a>
|
||||
<a href={{wizard.url}}>{{i18n
|
||||
"wizard.complete_custom"
|
||||
name=wizard.name
|
||||
}}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
|
@ -4,10 +4,14 @@ import CustomWizardApi from "../models/custom-wizard-api";
|
|||
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
||||
import { and, equal, not } from "@ember/object/computed";
|
||||
import { selectKitContent } from "../lib/wizard";
|
||||
import { underscore } from "@ember/string";
|
||||
import Controller from "@ember/controller";
|
||||
import I18n from "I18n";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default Controller.extend({
|
||||
router: service(),
|
||||
|
||||
queryParams: ["refresh_list"],
|
||||
loadingSubscriptions: false,
|
||||
notAuthorized: not("api.authorized"),
|
||||
|
@ -20,29 +24,8 @@ export default Controller.extend({
|
|||
"application/x-www-form-urlencoded",
|
||||
]),
|
||||
successCodes: selectKitContent([
|
||||
100,
|
||||
101,
|
||||
102,
|
||||
200,
|
||||
201,
|
||||
202,
|
||||
203,
|
||||
204,
|
||||
205,
|
||||
206,
|
||||
207,
|
||||
208,
|
||||
226,
|
||||
300,
|
||||
301,
|
||||
302,
|
||||
303,
|
||||
303,
|
||||
304,
|
||||
305,
|
||||
306,
|
||||
307,
|
||||
308,
|
||||
100, 101, 102, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301,
|
||||
302, 303, 303, 304, 305, 306, 307, 308,
|
||||
]),
|
||||
|
||||
@discourseComputed(
|
||||
|
@ -118,7 +101,7 @@ export default Controller.extend({
|
|||
|
||||
if (authType === "oauth_2") {
|
||||
this.set("authorizing", true);
|
||||
ajax(`/admin/wizards/apis/${name.underscore()}/authorize`)
|
||||
ajax(`/admin/wizards/apis/${underscore(name)}/authorize`)
|
||||
.catch(popupAjaxError)
|
||||
.then((result) => {
|
||||
if (result.success) {
|
||||
|
@ -187,11 +170,11 @@ export default Controller.extend({
|
|||
if (!api[rp]) {
|
||||
let key = rp.replace("auth", "");
|
||||
error = `${I18n.t(
|
||||
`admin.wizard.api.auth.${key.underscore()}`
|
||||
`admin.wizard.api.auth.${underscore(key)}`
|
||||
)} is required for ${authType}`;
|
||||
break;
|
||||
}
|
||||
data[rp.underscore()] = api[rp];
|
||||
data[underscore(rp)] = api[rp];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -221,7 +204,7 @@ export default Controller.extend({
|
|||
|
||||
this.set("updating", true);
|
||||
|
||||
ajax(`/admin/wizards/api/${name.underscore()}`, {
|
||||
ajax(`/admin/wizards/api/${underscore(name)}`, {
|
||||
type: "PUT",
|
||||
data,
|
||||
})
|
||||
|
@ -244,7 +227,7 @@ export default Controller.extend({
|
|||
|
||||
this.set("updating", true);
|
||||
|
||||
ajax(`/admin/wizards/api/${name.underscore()}`, {
|
||||
ajax(`/admin/wizards/api/${underscore(name)}`, {
|
||||
type: "DELETE",
|
||||
})
|
||||
.catch(popupAjaxError)
|
||||
|
@ -262,13 +245,13 @@ export default Controller.extend({
|
|||
return;
|
||||
}
|
||||
|
||||
ajax(`/admin/wizards/api/${name.underscore()}/logs`, {
|
||||
ajax(`/admin/wizards/api/${underscore(name)}/logs`, {
|
||||
type: "DELETE",
|
||||
})
|
||||
.catch(popupAjaxError)
|
||||
.then((result) => {
|
||||
if (result.success) {
|
||||
this.transitionToRoute("adminWizardsApis").then(() => {
|
||||
this.router.transitionTo("adminWizardsApis").then(() => {
|
||||
this.send("refreshModel");
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
import Controller from "@ember/controller";
|
||||
import ModalFunctionality from "discourse/mixins/modal-functionality";
|
||||
|
||||
export default Controller.extend(ModalFunctionality, {
|
||||
actions: {
|
||||
save() {
|
||||
this.send("closeModal");
|
||||
},
|
||||
|
||||
resetToDefault() {
|
||||
this.get("model.reset")();
|
||||
},
|
||||
},
|
||||
});
|
|
@ -2,11 +2,13 @@ import Controller from "@ember/controller";
|
|||
import { empty } from "@ember/object/computed";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import { fmt } from "discourse/lib/computed";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import { inject as service } from "@ember/service";
|
||||
import AdminWizardsColumnsModal from "../components/modal/admin-wizards-columns";
|
||||
import CustomWizardAdmin from "../models/custom-wizard-admin";
|
||||
import { formatModel } from "../lib/wizard-submission";
|
||||
|
||||
export default Controller.extend({
|
||||
modal: service(),
|
||||
downloadUrl: fmt("wizard.id", "/admin/wizards/submissions/%@/download"),
|
||||
noResults: empty("submissions"),
|
||||
page: 0,
|
||||
|
@ -57,7 +59,7 @@ export default Controller.extend({
|
|||
},
|
||||
|
||||
showEditColumnsModal() {
|
||||
return showModal("admin-wizards-columns", {
|
||||
return this.modal.show(AdminWizardsColumnsModal, {
|
||||
model: {
|
||||
columns: this.get("fields"),
|
||||
reset: () => {
|
||||
|
|
|
@ -3,7 +3,8 @@ import {
|
|||
observes,
|
||||
} from "discourse-common/utils/decorators";
|
||||
import { notEmpty } from "@ember/object/computed";
|
||||
import showModal from "discourse/lib/show-modal";
|
||||
import { inject as service } from "@ember/service";
|
||||
import NextSessionScheduledModal from "../components/modal/next-session-scheduled";
|
||||
import { generateId, wizardFieldList } from "../lib/wizard";
|
||||
import { dasherize } from "@ember/string";
|
||||
import { later, scheduleOnce } from "@ember/runloop";
|
||||
|
@ -13,6 +14,7 @@ import I18n from "I18n";
|
|||
import { filterValues } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard-schema";
|
||||
|
||||
export default Controller.extend({
|
||||
modal: service(),
|
||||
hasName: notEmpty("wizard.name"),
|
||||
|
||||
@observes("currentStep")
|
||||
|
@ -126,15 +128,13 @@ export default Controller.extend({
|
|||
},
|
||||
|
||||
setNextSessionScheduled() {
|
||||
let controller = showModal("next-session-scheduled", {
|
||||
this.modal.show(NextSessionScheduledModal, {
|
||||
model: {
|
||||
dateTime: this.wizard.after_time_scheduled,
|
||||
update: (dateTime) =>
|
||||
this.set("wizard.after_time_scheduled", dateTime),
|
||||
},
|
||||
});
|
||||
|
||||
controller.setup();
|
||||
},
|
||||
|
||||
copyUrl() {
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import Controller from "@ember/controller";
|
||||
import getUrl from "discourse-common/lib/get-url";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default Controller.extend({
|
||||
router: service(),
|
||||
wizard: null,
|
||||
step: null,
|
||||
|
||||
|
@ -15,12 +17,12 @@ export default Controller.extend({
|
|||
const wizardId = this.get("wizard.id");
|
||||
window.location.href = getUrl(`/w/${wizardId}/steps/${nextStepId}`);
|
||||
} else {
|
||||
this.transitionToRoute("customWizardStep", nextStepId);
|
||||
this.router.transitionTo("customWizardStep", nextStepId);
|
||||
}
|
||||
},
|
||||
|
||||
goBack() {
|
||||
this.transitionToRoute("customWizardStep", this.get("step.previous"));
|
||||
this.router.transitionTo("customWizardStep", this.get("step.previous"));
|
||||
},
|
||||
|
||||
showMessage(message) {
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
||||
import Controller from "@ember/controller";
|
||||
|
||||
export default Controller.extend({
|
||||
title: "admin.wizard.after_time_modal.title",
|
||||
|
||||
setup() {
|
||||
this.set("bufferedDateTime", moment(this.model.dateTime));
|
||||
},
|
||||
|
||||
@discourseComputed("bufferedDateTime")
|
||||
submitDisabled(dateTime) {
|
||||
return moment().isAfter(dateTime);
|
||||
},
|
||||
|
||||
actions: {
|
||||
submit() {
|
||||
const dateTime = this.get("bufferedDateTime");
|
||||
this.get("model.update")(moment(dateTime).utc().toISOString());
|
||||
this.send("closeModal");
|
||||
},
|
||||
|
||||
dateTimeChanged(dateTime) {
|
||||
this.set("bufferedDateTime", dateTime);
|
||||
},
|
||||
},
|
||||
});
|
|
@ -69,7 +69,10 @@ export default {
|
|||
},
|
||||
|
||||
_wizardInsertText(text, options) {
|
||||
if (this.session.wizardEventFieldId === this.fieldId) {
|
||||
if (
|
||||
this.session.wizardEventFieldId === this.fieldId &&
|
||||
this.element
|
||||
) {
|
||||
this.insertText(text, options);
|
||||
}
|
||||
},
|
||||
|
@ -80,6 +83,16 @@ export default {
|
|||
}
|
||||
},
|
||||
});
|
||||
|
||||
api.modifyClass("component:category-chooser", {
|
||||
categoriesByScope(options = {}) {
|
||||
let categories = this._super(options);
|
||||
|
||||
return categories.filter((category) => {
|
||||
return !category.custom_fields?.create_topic_wizard;
|
||||
});
|
||||
},
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
import ApplicationRoute from "discourse/routes/application";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import { dasherize } from "@ember/string";
|
||||
|
||||
export default {
|
||||
name: "custom-wizard-redirect",
|
||||
after: "message-bus",
|
||||
|
||||
initialize: function (container) {
|
||||
initialize(container) {
|
||||
const messageBus = container.lookup("service:message-bus");
|
||||
const siteSettings = container.lookup("service:site-settings");
|
||||
|
||||
if (!siteSettings.custom_wizard_enabled || !messageBus) {
|
||||
if (!siteSettings.custom_wizard_enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -17,28 +19,27 @@ export default {
|
|||
window.location.href = wizardUrl;
|
||||
});
|
||||
|
||||
ApplicationRoute.reopen({
|
||||
actions: {
|
||||
willTransition(transition) {
|
||||
const redirectToWizard = this.get("currentUser.redirect_to_wizard");
|
||||
const excludedPaths = this.siteSettings.wizard_redirect_exclude_paths
|
||||
withPluginApi("0.8.36", (api) => {
|
||||
api.onAppEvent("page:changed", (data) => {
|
||||
const currentUser = api.getCurrentUser();
|
||||
|
||||
if (currentUser) {
|
||||
const redirectToWizard = currentUser.redirect_to_wizard;
|
||||
const excludedPaths = siteSettings.wizard_redirect_exclude_paths
|
||||
.split("|")
|
||||
.concat(["loading"]);
|
||||
|
||||
if (
|
||||
redirectToWizard &&
|
||||
(!transition.intent.name ||
|
||||
!data.url.includes("ignore_redirect") &&
|
||||
data.currentRouteName !== "customWizardStep" &&
|
||||
!excludedPaths.find((p) => {
|
||||
return transition.intent.name.indexOf(p) > -1;
|
||||
}))
|
||||
return data.currentRouteName.indexOf(p) > -1;
|
||||
})
|
||||
) {
|
||||
transition.abort();
|
||||
window.location = "/w/" + redirectToWizard.dasherize();
|
||||
DiscourseURL.routeTo(`/w/${dasherize(redirectToWizard)}`);
|
||||
}
|
||||
|
||||
return this._super(transition);
|
||||
},
|
||||
},
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import CustomWizardApi from "../models/custom-wizard-api";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model(params) {
|
||||
if (params.name === "create") {
|
||||
return CustomWizardApi.create({ isNew: true });
|
||||
|
@ -10,6 +13,12 @@ export default DiscourseRoute.extend({
|
|||
}
|
||||
},
|
||||
|
||||
afterModel(model) {
|
||||
if (model === null) {
|
||||
return this.router.transitionTo("adminWizardsApi");
|
||||
}
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
controller.set("api", model);
|
||||
},
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import CustomWizardApi from "../models/custom-wizard-api";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model() {
|
||||
return CustomWizardApi.list();
|
||||
},
|
||||
|
@ -25,11 +28,11 @@ export default DiscourseRoute.extend({
|
|||
actions: {
|
||||
changeApi(apiName) {
|
||||
this.controllerFor("adminWizardsApi").set("apiName", apiName);
|
||||
this.transitionTo("adminWizardsApiShow", apiName);
|
||||
this.router.transitionTo("adminWizardsApiShow", apiName);
|
||||
},
|
||||
|
||||
afterDestroy() {
|
||||
this.transitionTo("adminWizardsApi").then(() => this.refresh());
|
||||
this.router.transitionTo("adminWizardsApi").then(() => this.refresh());
|
||||
},
|
||||
|
||||
afterSave(apiName) {
|
||||
|
@ -38,7 +41,7 @@ export default DiscourseRoute.extend({
|
|||
|
||||
createApi() {
|
||||
this.controllerFor("adminWizardsApi").set("apiName", "create");
|
||||
this.transitionTo("adminWizardsApiShow", "create");
|
||||
this.router.transitionTo("adminWizardsApiShow", "create");
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
import CustomWizardLogs from "../models/custom-wizard-logs";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { A } from "@ember/array";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model(params) {
|
||||
return CustomWizardLogs.list(params.wizardId);
|
||||
},
|
||||
|
||||
afterModel(model) {
|
||||
if (model === null) {
|
||||
return this.router.transitionTo("adminWizardsLogs");
|
||||
}
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
controller.setProperties({
|
||||
wizard: model.wizard,
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model() {
|
||||
return ajax(`/admin/wizards/wizard`);
|
||||
},
|
||||
|
@ -18,7 +21,7 @@ export default DiscourseRoute.extend({
|
|||
actions: {
|
||||
changeWizard(wizardId) {
|
||||
this.controllerFor("adminWizardsLogs").set("wizardId", wizardId);
|
||||
this.transitionTo("adminWizardsLogsShow", wizardId);
|
||||
this.router.transitionTo("adminWizardsLogsShow", wizardId);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -2,12 +2,21 @@ import { A } from "@ember/array";
|
|||
import CustomWizardAdmin from "../models/custom-wizard-admin";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { formatModel } from "../lib/wizard-submission";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model(params) {
|
||||
return CustomWizardAdmin.submissions(params.wizardId);
|
||||
},
|
||||
|
||||
afterModel(model) {
|
||||
if (model === null) {
|
||||
return this.router.transitionTo("adminWizardsSubmissions");
|
||||
}
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
const { fields, submissions } = formatModel(model);
|
||||
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model() {
|
||||
return ajax(`/admin/wizards/wizard`);
|
||||
},
|
||||
|
@ -18,7 +21,7 @@ export default DiscourseRoute.extend({
|
|||
actions: {
|
||||
changeWizard(wizardId) {
|
||||
this.controllerFor("adminWizardsSubmissions").set("wizardId", wizardId);
|
||||
this.transitionTo("adminWizardsSubmissionsShow", wizardId);
|
||||
this.router.transitionTo("adminWizardsSubmissionsShow", wizardId);
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -2,8 +2,11 @@ import CustomWizardAdmin from "../models/custom-wizard-admin";
|
|||
import { ajax } from "discourse/lib/ajax";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import I18n from "I18n";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model(params) {
|
||||
if (params.wizardId === "create") {
|
||||
return { create: true };
|
||||
|
@ -14,7 +17,7 @@ export default DiscourseRoute.extend({
|
|||
|
||||
afterModel(model) {
|
||||
if (model.none) {
|
||||
return this.transitionTo("adminWizardsWizard");
|
||||
return this.router.transitionTo("adminWizardsWizard");
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -4,8 +4,11 @@ import EmberObject, { set } from "@ember/object";
|
|||
import { A } from "@ember/array";
|
||||
import { all } from "rsvp";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model() {
|
||||
return ajax("/admin/wizards/wizard");
|
||||
},
|
||||
|
@ -80,14 +83,14 @@ export default DiscourseRoute.extend({
|
|||
this.controllerFor("adminWizardsWizard").set("wizardId", wizardId);
|
||||
|
||||
if (wizardId) {
|
||||
this.transitionTo("adminWizardsWizardShow", wizardId);
|
||||
this.router.transitionTo("adminWizardsWizardShow", wizardId);
|
||||
} else {
|
||||
this.transitionTo("adminWizardsWizard");
|
||||
this.router.transitionTo("adminWizardsWizard");
|
||||
}
|
||||
},
|
||||
|
||||
afterDestroy() {
|
||||
this.transitionTo("adminWizardsWizard").then(() => this.refresh());
|
||||
this.router.transitionTo("adminWizardsWizard").then(() => this.refresh());
|
||||
},
|
||||
|
||||
afterSave(wizardId) {
|
||||
|
@ -96,7 +99,7 @@ export default DiscourseRoute.extend({
|
|||
|
||||
createWizard() {
|
||||
this.controllerFor("adminWizardsWizard").set("wizardId", "create");
|
||||
this.transitionTo("adminWizardsWizardShow", "create");
|
||||
this.router.transitionTo("adminWizardsWizardShow", "create");
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
router: service(),
|
||||
|
||||
model() {
|
||||
return ajax("/admin/wizards");
|
||||
},
|
||||
|
@ -17,7 +20,7 @@ export default DiscourseRoute.extend({
|
|||
|
||||
afterModel(model, transition) {
|
||||
if (transition.targetName === "adminWizards.index") {
|
||||
this.transitionTo("adminWizardsWizard");
|
||||
this.router.transitionTo("adminWizardsWizard");
|
||||
}
|
||||
},
|
||||
});
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
import { getCachedWizard } from "../models/custom-wizard";
|
||||
import Route from "@ember/routing/route";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default Route.extend({
|
||||
router: service(),
|
||||
|
||||
beforeModel() {
|
||||
const wizard = getCachedWizard();
|
||||
if (wizard && wizard.permitted && !wizard.completed && wizard.start) {
|
||||
this.replaceWith("customWizardStep", wizard.start);
|
||||
this.router.replaceWith("customWizardStep", wizard.start);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -3,14 +3,17 @@ import { getCachedWizard } from "../models/custom-wizard";
|
|||
import Route from "@ember/routing/route";
|
||||
import { scrollTop } from "discourse/mixins/scroll-top";
|
||||
import { action } from "@ember/object";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
export default Route.extend({
|
||||
router: service(),
|
||||
|
||||
beforeModel() {
|
||||
const wizard = getCachedWizard();
|
||||
this.set("wizard", wizard);
|
||||
|
||||
if (!wizard || !wizard.permitted || wizard.completed) {
|
||||
this.replaceWith("customWizard");
|
||||
this.router.replaceWith("customWizard");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -27,7 +30,7 @@ export default Route.extend({
|
|||
|
||||
afterModel(model) {
|
||||
if (model.completed) {
|
||||
return this.transitionTo("wizard.index");
|
||||
return this.router.transitionTo("wizard.index");
|
||||
}
|
||||
return model.set("wizardId", this.wizard.id);
|
||||
},
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { findCustomWizard, updateCachedWizard } from "../models/custom-wizard";
|
||||
import I18n from "I18n";
|
||||
import DiscourseRoute from "discourse/routes/discourse";
|
||||
import bootbox from "bootbox";
|
||||
|
||||
export default DiscourseRoute.extend({
|
||||
titleToken() {
|
||||
|
|
|
@ -8,7 +8,12 @@
|
|||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{d-button label="admin.wizard.api.save" action=(action "save") class="btn-primary" disabled=saveDisabled}}
|
||||
{{d-button
|
||||
label="admin.wizard.api.save"
|
||||
action=(action "save")
|
||||
class="btn-primary"
|
||||
disabled=saveDisabled
|
||||
}}
|
||||
|
||||
{{#if showRemove}}
|
||||
{{d-button action=(action "remove") label="admin.wizard.api.remove"}}
|
||||
|
@ -62,10 +67,12 @@
|
|||
<span>{{authErrorMessage}}</span>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{d-button label="admin.wizard.api.auth.btn"
|
||||
{{d-button
|
||||
label="admin.wizard.api.auth.btn"
|
||||
action=(action "authorize")
|
||||
disabled=authDisabled
|
||||
class="btn-primary"}}
|
||||
class="btn-primary"
|
||||
}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
|
@ -99,9 +106,8 @@
|
|||
value=api.authType
|
||||
content=authorizationTypes
|
||||
onChange=(action (mut api.authType))
|
||||
options=(hash
|
||||
none="admin.wizard.api.auth.type_none"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.api.auth.type_none")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -110,9 +116,7 @@
|
|||
<div class="control-group">
|
||||
<label>{{i18n "admin.wizard.api.auth.url"}}</label>
|
||||
<div class="controls">
|
||||
<Input
|
||||
@value={{this.api.authUrl}}
|
||||
/>
|
||||
<Input @value={{this.api.authUrl}} />
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -120,27 +124,21 @@
|
|||
<div class="control-group">
|
||||
<label>{{i18n "admin.wizard.api.auth.token_url"}}</label>
|
||||
<div class="controls">
|
||||
<Input
|
||||
@value={{this.api.tokenUrl}}
|
||||
/>
|
||||
<Input @value={{this.api.tokenUrl}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.wizard.api.auth.client_id"}}</label>
|
||||
<div class="controls">
|
||||
<Input
|
||||
@value={{this.api.clientId}}
|
||||
/>
|
||||
<Input @value={{this.api.clientId}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.wizard.api.auth.client_secret"}}</label>
|
||||
<div class="controls">
|
||||
<Input
|
||||
@value={{this.api.clientSecret}}
|
||||
/>
|
||||
<Input @value={{this.api.clientSecret}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -157,10 +155,18 @@
|
|||
@value={{this.param.value}}
|
||||
placeholder={{i18n "admin.wizard.value"}}
|
||||
/>
|
||||
{{d-button action=(action "removeParam") actionParam=param icon="times"}}
|
||||
{{d-button
|
||||
action=(action "removeParam")
|
||||
actionParam=param
|
||||
icon="times"
|
||||
}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{d-button label="admin.wizard.api.auth.params.new" icon="plus" action=(action "addParam")}}
|
||||
{{d-button
|
||||
label="admin.wizard.api.auth.params.new"
|
||||
icon="plus"
|
||||
action=(action "addParam")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -169,18 +175,14 @@
|
|||
<div class="control-group">
|
||||
<label>{{i18n "admin.wizard.api.auth.username"}}</label>
|
||||
<div class="controls">
|
||||
<Input
|
||||
@value={{this.api.username}}
|
||||
/>
|
||||
<Input @value={{this.api.username}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n "admin.wizard.api.auth.password"}}</label>
|
||||
<div class="controls">
|
||||
<Input
|
||||
@value={{this.api.password}}
|
||||
/>
|
||||
<Input @value={{this.api.password}} />
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -249,7 +251,11 @@
|
|||
</div>
|
||||
|
||||
<div class="wizard-api-endpoints">
|
||||
{{d-button action=(action "addEndpoint") label="admin.wizard.api.endpoint.add" icon="plus"}}
|
||||
{{d-button
|
||||
action=(action "addEndpoint")
|
||||
label="admin.wizard.api.endpoint.add"
|
||||
icon="plus"
|
||||
}}
|
||||
|
||||
{{#if api.endpoints}}
|
||||
<div class="endpoint-list">
|
||||
|
@ -260,41 +266,42 @@
|
|||
<div class="endpoint-">
|
||||
<div class="top">
|
||||
<Input
|
||||
@value={{this.endpoint.name}}
|
||||
@value={{endpoint.name}}
|
||||
placeholder={{i18n "admin.wizard.api.endpoint.name"}}
|
||||
/>
|
||||
<Input
|
||||
@value={{this.endpoint.url}}
|
||||
@value={{endpoint.url}}
|
||||
placeholder={{i18n "admin.wizard.api.endpoint.url"}}
|
||||
class="endpoint-url"
|
||||
/>
|
||||
{{d-button action=(action "removeEndpoint")
|
||||
{{d-button
|
||||
action=(action "removeEndpoint")
|
||||
actionParam=endpoint
|
||||
icon="times"
|
||||
class="remove-endpoint"}}
|
||||
class="remove-endpoint"
|
||||
}}
|
||||
</div>
|
||||
<div class="bottom">
|
||||
{{combo-box
|
||||
content=endpointMethods
|
||||
value=endpoint.method
|
||||
onChange=(action (mut endpoint.method))
|
||||
options=(hash
|
||||
none="admin.wizard.api.endpoint.method"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.api.endpoint.method")
|
||||
}}
|
||||
{{combo-box
|
||||
content=contentTypes
|
||||
value=endpoint.content_type
|
||||
onChange=(action (mut endpoint.content_type))
|
||||
options=(hash
|
||||
none="admin.wizard.api.endpoint.content_type"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.api.endpoint.content_type")
|
||||
}}
|
||||
{{multi-select
|
||||
value=endpoint.success_codes
|
||||
content=successCodes
|
||||
onChange=(action (mut endpoint.success_codes))
|
||||
options=(hash
|
||||
none="admin.wizard.api.endpoint.success_codes"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -312,7 +319,8 @@
|
|||
{{d-button
|
||||
action=(action "clearLogs")
|
||||
class="clear-logs"
|
||||
label="admin.wizard.api.log.clear"}}
|
||||
label="admin.wizard.api.log.clear"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -332,7 +340,10 @@
|
|||
<td>{{logentry.time}}</td>
|
||||
<td class="user-image">
|
||||
<div class="user-image-inner">
|
||||
<a href={{logentry.userpath}} data-user-card={{logentry.username}}>{{avatar logentry imageSize="medium"}}</a>
|
||||
<a
|
||||
href={{logentry.userpath}}
|
||||
data-user-card={{logentry.username}}
|
||||
>{{avatar logentry imageSize="medium"}}</a>
|
||||
</div>
|
||||
</td>
|
||||
<td>{{logentry.status}}</td>
|
||||
|
|
|
@ -3,14 +3,14 @@
|
|||
value=apiName
|
||||
content=apiList
|
||||
onChange=(route-action "changeApi")
|
||||
options=(hash
|
||||
none="admin.wizard.api.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.api.select")
|
||||
}}
|
||||
|
||||
{{d-button
|
||||
action=(route-action "createApi")
|
||||
label="admin.wizard.api.create"
|
||||
icon="plus"}}
|
||||
icon="plus"
|
||||
}}
|
||||
</div>
|
||||
|
||||
<div class="admin-wizard-container">
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
{{d-button
|
||||
label="admin.wizard.custom_field.add"
|
||||
icon="plus"
|
||||
action=(action "addField")}}
|
||||
action=(action "addField")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -14,7 +15,8 @@
|
|||
opts=messageOpts
|
||||
type=messageType
|
||||
url=documentationUrl
|
||||
component="custom_fields"}}
|
||||
component="custom_fields"
|
||||
}}
|
||||
|
||||
<div class="admin-wizard-container">
|
||||
{{#if customFields}}
|
||||
|
@ -32,7 +34,8 @@
|
|||
{{custom-field-input
|
||||
field=field
|
||||
removeField=(action "removeField")
|
||||
saveField=(action "saveField")}}
|
||||
saveField=(action "saveField")
|
||||
}}
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
label="refresh"
|
||||
icon="sync"
|
||||
action=(action "refresh")
|
||||
class="refresh"}}
|
||||
class="refresh"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -31,7 +32,10 @@
|
|||
{{#each logs as |log|}}
|
||||
<tr>
|
||||
{{#each-in log as |field value|}}
|
||||
<td class="small">{{wizard-table-field field=field value=value}}</td>
|
||||
<td class="small">{{wizard-table-field
|
||||
field=field
|
||||
value=value
|
||||
}}</td>
|
||||
{{/each-in}}
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
value=wizardId
|
||||
content=wizardList
|
||||
onChange=(route-action "changeWizard")
|
||||
options=(hash
|
||||
none="admin.wizard.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.select")
|
||||
}}
|
||||
</div>
|
||||
|
||||
{{wizard-message
|
||||
key=messageKey
|
||||
opts=messageOpts
|
||||
url=documentationUrl
|
||||
component="logs"}}
|
||||
component="logs"
|
||||
}}
|
||||
|
||||
<div class="admin-wizard-container">
|
||||
{{outlet}}
|
||||
|
|
|
@ -20,22 +20,26 @@
|
|||
{{d-button
|
||||
id="upload-button"
|
||||
label="admin.wizard.manager.upload"
|
||||
action=(action "upload")}}
|
||||
action=(action "upload")
|
||||
}}
|
||||
{{d-button
|
||||
id="import-button"
|
||||
label="admin.wizard.manager.import"
|
||||
action=(action "import")
|
||||
disabled=importDisabled}}
|
||||
disabled=importDisabled
|
||||
}}
|
||||
{{d-button
|
||||
id="export-button"
|
||||
label="admin.wizard.manager.export"
|
||||
action=(action "export")
|
||||
disabled=exportDisabled}}
|
||||
disabled=exportDisabled
|
||||
}}
|
||||
{{d-button
|
||||
id="destroy-button"
|
||||
label="admin.wizard.manager.destroy"
|
||||
action=(action "destroy")
|
||||
disabled=destoryDisabled}}
|
||||
disabled=destoryDisabled
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -46,7 +50,8 @@
|
|||
opts=messageOpts
|
||||
items=messageItems
|
||||
loading=loading
|
||||
component="manager"}}
|
||||
component="manager"
|
||||
}}
|
||||
|
||||
<div class="admin-wizard-container">
|
||||
<table class="table grid">
|
||||
|
|
|
@ -3,16 +3,16 @@
|
|||
value=wizardId
|
||||
content=wizardList
|
||||
onChange=(route-action "changeWizard")
|
||||
options=(hash
|
||||
none="admin.wizard.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.select")
|
||||
}}
|
||||
</div>
|
||||
|
||||
{{wizard-message
|
||||
key=messageKey
|
||||
opts=messageOpts
|
||||
url=documentationUrl
|
||||
component="submissions"}}
|
||||
component="submissions"
|
||||
}}
|
||||
|
||||
<div class="admin-wizard-container">
|
||||
{{outlet}}
|
||||
|
|
|
@ -9,11 +9,23 @@
|
|||
<div class="wizard-url">
|
||||
{{#if wizard.name}}
|
||||
{{#if copiedUrl}}
|
||||
{{d-button class="btn-hover pull-right" icon="copy" label="ip_lookup.copied"}}
|
||||
{{d-button
|
||||
class="btn-hover pull-right"
|
||||
icon="copy"
|
||||
label="ip_lookup.copied"
|
||||
}}
|
||||
{{else}}
|
||||
{{d-button action=(action "copyUrl") class="pull-right no-text" icon="copy"}}
|
||||
{{d-button
|
||||
action=(action "copyUrl")
|
||||
class="pull-right no-text"
|
||||
icon="copy"
|
||||
}}
|
||||
{{/if}}
|
||||
<a href={{wizardUrl}} target="_blank" rel="noopener noreferrer">{{wizardUrl}}</a>
|
||||
<a
|
||||
href={{wizardUrl}}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>{{wizardUrl}}</a>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -43,9 +55,8 @@
|
|||
valueProperty="id"
|
||||
value=wizard.theme_id
|
||||
onChange=(action (mut wizard.theme_id))
|
||||
options=(hash
|
||||
none="admin.wizard.no_theme"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.no_theme")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -60,10 +71,7 @@
|
|||
<label>{{i18n "admin.wizard.save_submissions"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.wizard.save_submissions}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.wizard.save_submissions}} />
|
||||
<span>{{i18n "admin.wizard.save_submissions_label"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -73,10 +81,7 @@
|
|||
<label>{{i18n "admin.wizard.multiple_submissions"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.wizard.multiple_submissions}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.wizard.multiple_submissions}} />
|
||||
<span>{{i18n "admin.wizard.multiple_submissions_label"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -86,10 +91,7 @@
|
|||
<label>{{i18n "admin.wizard.after_signup"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.wizard.after_signup}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.wizard.after_signup}} />
|
||||
<span>{{i18n "admin.wizard.after_signup_label"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -99,10 +101,7 @@
|
|||
<label>{{i18n "admin.wizard.prompt_completion"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.wizard.prompt_completion}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.wizard.prompt_completion}} />
|
||||
<span>{{i18n "admin.wizard.prompt_completion_label"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -112,16 +111,14 @@
|
|||
<label>{{i18n "admin.wizard.after_time"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.wizard.after_time}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.wizard.after_time}} />
|
||||
<span>{{i18n "admin.wizard.after_time_label"}}</span>
|
||||
{{d-button
|
||||
action=(action "setNextSessionScheduled")
|
||||
translatedLabel=nextSessionScheduledLabel
|
||||
class="btn-after-time"
|
||||
icon="far-calendar"}}
|
||||
icon="far-calendar"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -131,10 +128,7 @@
|
|||
<label>{{i18n "admin.wizard.required"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.wizard.required}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.wizard.required}} />
|
||||
<span>{{i18n "admin.wizard.required_label"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -144,10 +138,7 @@
|
|||
<label>{{i18n "admin.wizard.restart_on_revisit"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.wizard.restart_on_revisit}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.wizard.restart_on_revisit}} />
|
||||
<span>{{i18n "admin.wizard.restart_on_revisit_label"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -167,16 +158,14 @@
|
|||
userFieldSelection="key"
|
||||
textSelection="value"
|
||||
inputConnector="and"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/wizard-subscription-container}}
|
||||
</div>
|
||||
|
||||
{{wizard-links
|
||||
itemType="step"
|
||||
current=currentStep
|
||||
items=wizard.steps}}
|
||||
{{wizard-links itemType="step" current=currentStep items=wizard.steps}}
|
||||
|
||||
{{#if currentStep}}
|
||||
{{wizard-custom-step
|
||||
|
@ -185,14 +174,16 @@
|
|||
currentField=currentField
|
||||
wizardFields=wizardFields
|
||||
fieldTypes=filteredFieldTypes
|
||||
subscribed=subscribed}}
|
||||
subscribed=subscribed
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{wizard-links
|
||||
itemType="action"
|
||||
current=currentAction
|
||||
items=wizard.actions
|
||||
generateLabels=true}}
|
||||
generateLabels=true
|
||||
}}
|
||||
|
||||
{{#each wizard.actions as |wizardAction|}}
|
||||
{{wizard-custom-action
|
||||
|
@ -202,11 +193,17 @@
|
|||
apis=apis
|
||||
removeAction="removeAction"
|
||||
wizardFields=wizardFields
|
||||
fieldTypes=filteredFieldTypes}}
|
||||
fieldTypes=filteredFieldTypes
|
||||
}}
|
||||
{{/each}}
|
||||
|
||||
<div class="admin-wizard-buttons">
|
||||
<button {{action "save"}} disabled={{disableSave}} class="btn btn-primary" type="button">
|
||||
<button
|
||||
{{action "save"}}
|
||||
disabled={{disableSave}}
|
||||
class="btn btn-primary"
|
||||
type="button"
|
||||
>
|
||||
{{i18n "admin.wizard.save"}}
|
||||
</button>
|
||||
|
||||
|
|
|
@ -3,20 +3,17 @@
|
|||
value=wizardListVal
|
||||
content=wizardList
|
||||
onChange=(route-action "changeWizard")
|
||||
options=(hash
|
||||
none="admin.wizard.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.select")
|
||||
}}
|
||||
|
||||
{{d-button
|
||||
action=(route-action "createWizard")
|
||||
label="admin.wizard.create"
|
||||
icon="plus"}}
|
||||
icon="plus"
|
||||
}}
|
||||
</div>
|
||||
|
||||
{{wizard-message
|
||||
key=messageKey
|
||||
url=messageUrl
|
||||
component="wizard"}}
|
||||
{{wizard-message key=messageKey url=messageUrl component="wizard"}}
|
||||
|
||||
<div class="admin-wizard-container settings">
|
||||
{{outlet}}
|
||||
|
|
|
@ -1,12 +1,21 @@
|
|||
{{#admin-nav}}
|
||||
{{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}}
|
||||
{{nav-item route="adminWizardsCustomFields" label="admin.wizard.custom_field.nav_label"}}
|
||||
{{nav-item route="adminWizardsSubmissions" label="admin.wizard.submissions.nav_label"}}
|
||||
{{nav-item
|
||||
route="adminWizardsCustomFields"
|
||||
label="admin.wizard.custom_field.nav_label"
|
||||
}}
|
||||
{{nav-item
|
||||
route="adminWizardsSubmissions"
|
||||
label="admin.wizard.submissions.nav_label"
|
||||
}}
|
||||
{{#if showApi}}
|
||||
{{nav-item route="adminWizardsApi" label="admin.wizard.api.nav_label"}}
|
||||
{{/if}}
|
||||
{{nav-item route="adminWizardsLogs" label="admin.wizard.log.nav_label"}}
|
||||
{{nav-item route="adminWizardsManager" label="admin.wizard.manager.nav_label"}}
|
||||
{{nav-item
|
||||
route="adminWizardsManager"
|
||||
label="admin.wizard.manager.nav_label"
|
||||
}}
|
||||
|
||||
<div class="admin-actions">
|
||||
{{wizard-subscription-badge}}
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
feature="custom_field"
|
||||
attribute="klass"
|
||||
onChange=(action (mut field.klass))
|
||||
options=(hash
|
||||
none="admin.wizard.custom_field.klass.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.custom_field.klass.select")
|
||||
}}
|
||||
</td>
|
||||
<td>
|
||||
{{wizard-subscription-selector
|
||||
|
@ -15,9 +14,8 @@
|
|||
feature="custom_field"
|
||||
attribute="type"
|
||||
onChange=(action (mut field.type))
|
||||
options=(hash
|
||||
none="admin.wizard.custom_field.type.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.custom_field.type.select")
|
||||
}}
|
||||
</td>
|
||||
<td class="input">
|
||||
<Input
|
||||
|
@ -30,9 +28,8 @@
|
|||
value=field.serializers
|
||||
content=serializerContent
|
||||
onChange=(action (mut field.serializers))
|
||||
options=(hash
|
||||
none="admin.wizard.custom_field.serializers.select"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.custom_field.serializers.select")
|
||||
}}
|
||||
</td>
|
||||
<td class="actions">
|
||||
{{#if loading}}
|
||||
|
@ -46,16 +43,15 @@
|
|||
action=(action "destroy")
|
||||
icon="trash-alt"
|
||||
class="destroy"
|
||||
disabled=destroyDisabled}}
|
||||
disabled=destroyDisabled
|
||||
}}
|
||||
{{d-button
|
||||
icon="save"
|
||||
action=(action "save")
|
||||
disabled=saveDisabled
|
||||
class="save"}}
|
||||
{{d-button
|
||||
action=(action "close")
|
||||
icon="times"
|
||||
disabled=closeDisabled}}
|
||||
class="save"
|
||||
}}
|
||||
{{d-button action=(action "close") icon="times" disabled=closeDisabled}}
|
||||
</td>
|
||||
{{else}}
|
||||
<td><label>{{field.klass}}</label></td>
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
wizardComposer=true
|
||||
fieldId=field.id
|
||||
disabled=disableTextarea
|
||||
outletArgs=(hash composer=composer editorType="composer")}}
|
||||
outletArgs=(hash composer=composer editorType="composer")
|
||||
}}
|
||||
|
||||
<input
|
||||
type="file"
|
||||
|
@ -22,4 +23,4 @@
|
|||
class="wizard-composer-upload"
|
||||
accept={{allowedFileTypes}}
|
||||
multiple
|
||||
>
|
||||
/>
|
|
@ -26,9 +26,5 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if clearable}}
|
||||
{{d-button
|
||||
class="clear-date-time"
|
||||
icon="times"
|
||||
action=(action "onClear")
|
||||
}}
|
||||
{{d-button class="clear-date-time" icon="times" action=(action "onClear")}}
|
||||
{{/if}}
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<div class="d-editor-container">
|
||||
{{#if showPreview}}
|
||||
<div class="d-editor-preview-wrapper {{if forcePreview "force-preview"}}">
|
||||
<div class="d-editor-preview-wrapper {{if forcePreview 'force-preview'}}">
|
||||
<div class="d-editor-preview">
|
||||
{{html-safe preview}}
|
||||
</div>
|
||||
|
@ -18,13 +18,16 @@
|
|||
onExpand=(action b.action b)
|
||||
class=b.className
|
||||
content=popupMenuOptions
|
||||
options=(hash
|
||||
popupTitle=b.title
|
||||
icon=b.icon
|
||||
)}}
|
||||
options=(hash popupTitle=b.title icon=b.icon)
|
||||
}}
|
||||
{{else}}
|
||||
<div>{{d.icon}}</div>
|
||||
<button class="wizard-btn {{b.className}}" {{action b.action b}} title={{b.title}} type="button">
|
||||
<button
|
||||
class="wizard-btn {{b.className}}"
|
||||
{{action b.action b}}
|
||||
title={{b.title}}
|
||||
type="button"
|
||||
>
|
||||
{{d-icon b.icon}}
|
||||
{{#if b.label}}
|
||||
<span class="d-button-label">{{i18n b.label}}</span>
|
||||
|
|
|
@ -4,6 +4,5 @@
|
|||
whitelist=field.content
|
||||
onChange=(action (mut categories))
|
||||
tabindex=field.tabindex
|
||||
options=(hash
|
||||
maximum=field.limit
|
||||
)}}
|
||||
options=(hash maximum=field.limit)
|
||||
}}
|
|
@ -7,10 +7,15 @@
|
|||
cannotSeeMention=(action "cannotSeeMention")
|
||||
importQuote=(action "importQuote")
|
||||
togglePreview=(action "togglePreview")
|
||||
afterRefresh=(action "afterRefresh")}}
|
||||
afterRefresh=(action "afterRefresh")
|
||||
}}
|
||||
|
||||
<div class="bottom-bar">
|
||||
<button class="wizard-btn toggle-preview" {{action "togglePreview"}} type="button">
|
||||
<button
|
||||
class="wizard-btn toggle-preview"
|
||||
{{action "togglePreview"}}
|
||||
type="button"
|
||||
>
|
||||
<span class="d-button-label">{{i18n togglePreviewLabel}}</span>
|
||||
</button>
|
||||
|
||||
|
|
|
@ -4,6 +4,5 @@
|
|||
content=field.content
|
||||
tabindex=field.tabindex
|
||||
onChange=(action "onChangeValue")
|
||||
options=(hash
|
||||
none="select_kit.default_header_text"
|
||||
)}}
|
||||
options=(hash none="select_kit.default_header_text")
|
||||
}}
|
|
@ -6,6 +6,5 @@
|
|||
value=field.value
|
||||
tabindex=field.tabindex
|
||||
onChange=(action (mut field.value))
|
||||
options=(hash
|
||||
none="select_kit.default_header_text"
|
||||
)}}
|
||||
options=(hash none="select_kit.default_header_text")
|
||||
}}
|
|
@ -6,4 +6,3 @@
|
|||
tabindex={{this.field.tabindex}}
|
||||
class={{this.fieldClass}}
|
||||
/>
|
||||
|
||||
|
|
|
@ -4,7 +4,5 @@
|
|||
tabindex=field.tabindex
|
||||
tagGroups=field.tag_groups
|
||||
everyTag=true
|
||||
options=(hash
|
||||
maximum=field.limit
|
||||
allowAny=field.can_create_tag
|
||||
)}}
|
||||
options=(hash maximum=field.limit allowAny=field.can_create_tag)
|
||||
}}
|
|
@ -1,4 +1,7 @@
|
|||
<label class="wizard-btn wizard-btn-upload-file {{if uploading "disabled"}}" tabindex={{field.tabindex}}>
|
||||
<label
|
||||
class="wizard-btn wizard-btn-upload-file {{if uploading 'disabled'}}"
|
||||
tabindex={{field.tabindex}}
|
||||
>
|
||||
{{#if uploading}}
|
||||
{{i18n "wizard.uploading"}}
|
||||
{{else}}
|
||||
|
@ -6,12 +9,18 @@
|
|||
{{d-icon "upload"}}
|
||||
{{/if}}
|
||||
|
||||
<input disabled={{uploading}} class="hidden-upload-field" type="file" accept={{field.file_types}} style="visibility: hidden; position: absolute;" >
|
||||
<input
|
||||
disabled={{uploading}}
|
||||
class="hidden-upload-field"
|
||||
type="file"
|
||||
accept={{field.file_types}}
|
||||
style="visibility: hidden; position: absolute;"
|
||||
/>
|
||||
</label>
|
||||
|
||||
{{#if field.value}}
|
||||
{{#if isImage}}
|
||||
<img src={{field.value.url}} class="wizard-image-preview">
|
||||
<img src={{field.value.url}} class="wizard-image-preview" />
|
||||
{{else}}
|
||||
{{field.value.original_filename}}
|
||||
{{/if}}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
{{custom-user-selector
|
||||
usernames=field.value
|
||||
placeholderKey=field.placeholder
|
||||
tabindex=field.tabindex}}
|
||||
tabindex=field.tabindex
|
||||
}}
|
|
@ -3,7 +3,7 @@
|
|||
</label>
|
||||
|
||||
{{#if field.image}}
|
||||
<div class="field-image"><img src={{field.image}}></div>
|
||||
<div class="field-image"><img src={{field.image}} /></div>
|
||||
{{/if}}
|
||||
|
||||
{{#if field.description}}
|
||||
|
@ -13,7 +13,14 @@
|
|||
{{#field-validators field=field as |validators|}}
|
||||
{{#if inputComponentName}}
|
||||
<div class="input-area">
|
||||
{{component inputComponentName field=field step=step fieldClass=fieldClass wizard=wizard autocomplete=validators.autocomplete}}
|
||||
{{component
|
||||
inputComponentName
|
||||
field=field
|
||||
step=step
|
||||
fieldClass=fieldClass
|
||||
wizard=wizard
|
||||
autocomplete=validators.autocomplete
|
||||
}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/field-validators}}
|
||||
|
@ -25,5 +32,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if field.errorDescription}}
|
||||
<div class="field-error-description">{{html-safe field.errorDescription}}</div>
|
||||
<div class="field-error-description">{{html-safe
|
||||
field.errorDescription
|
||||
}}</div>
|
||||
{{/if}}
|
|
@ -1,6 +1,10 @@
|
|||
<div>{{text}}</div>
|
||||
<div class="no-access-gutter">
|
||||
<button class="wizard-btn primary return-to-site" {{action "skip"}} type="button">
|
||||
<button
|
||||
class="wizard-btn primary return-to-site"
|
||||
{{action "skip"}}
|
||||
type="button"
|
||||
>
|
||||
{{i18n "wizard.return_to_site" siteName=siteName}}
|
||||
{{d-icon "sign-out-alt"}}
|
||||
</button>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
<a href={{topic.url}} target="_blank" rel="noopener noreferrer">
|
||||
<span class="title">{{html-safe topic.fancy_title}}</span>
|
||||
<div class="blurb">{{date-node topic.created_at}} - {{html-safe topic.blurb}}</div>
|
||||
<div class="blurb">{{date-node topic.created_at}}
|
||||
-
|
||||
{{html-safe topic.blurb}}</div>
|
||||
</a>
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
{{#if bannerImage}}
|
||||
<div class="wizard-step-banner">
|
||||
<img src={{bannerImage}}>
|
||||
<img src={{bannerImage}} />
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
@ -26,7 +26,11 @@
|
|||
<div class="white"></div>
|
||||
<div class="black" style={{barStyle}}></div>
|
||||
<div class="screen"></div>
|
||||
<span>{{i18n "wizard.step" current=step.displayIndex total=wizard.totalSteps}}</span>
|
||||
<span>{{i18n
|
||||
"wizard.step"
|
||||
current=step.displayIndex
|
||||
total=wizard.totalSteps
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div class="wizard-buttons">
|
||||
|
@ -34,22 +38,44 @@
|
|||
{{loading-spinner size="small"}}
|
||||
{{else}}
|
||||
{{#if showQuitButton}}
|
||||
<a href {{action "quit"}} class="action-link quit" tabindex={{secondaryButtonIndex}}>{{i18n "wizard.quit"}}</a>
|
||||
<a
|
||||
href
|
||||
{{action "quit"}}
|
||||
class="action-link quit"
|
||||
tabindex={{secondaryButtonIndex}}
|
||||
>{{i18n "wizard.quit"}}</a>
|
||||
{{/if}}
|
||||
{{#if showBackButton}}
|
||||
<a href {{action "backStep"}} class="action-link back" tabindex={{secondaryButtonIndex}}>{{i18n "wizard.back"}}</a>
|
||||
<a
|
||||
href
|
||||
{{action "backStep"}}
|
||||
class="action-link back"
|
||||
tabindex={{secondaryButtonIndex}}
|
||||
>{{i18n "wizard.back"}}</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if showNextButton}}
|
||||
<button type="button" class="wizard-btn next primary" {{action "nextStep"}} disabled={{saving}} tabindex={{primaryButtonIndex}}>
|
||||
<button
|
||||
type="button"
|
||||
class="wizard-btn next primary"
|
||||
{{action "nextStep"}}
|
||||
disabled={{saving}}
|
||||
tabindex={{primaryButtonIndex}}
|
||||
>
|
||||
{{i18n "wizard.next"}}
|
||||
{{d-icon "chevron-right"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
||||
{{#if showDoneButton}}
|
||||
<button type="button" class="wizard-btn done" {{action "done"}} disabled={{saving}} tabindex={{primaryButtonIndex}}>
|
||||
<button
|
||||
type="button"
|
||||
class="wizard-btn done"
|
||||
{{action "done"}}
|
||||
disabled={{saving}}
|
||||
tabindex={{primaryButtonIndex}}
|
||||
>
|
||||
{{i18n "wizard.done_custom"}}
|
||||
</button>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,12 +1,22 @@
|
|||
{{#if field.validations}}
|
||||
{{#each-in field.validations.above as |type validation|}}
|
||||
{{component validation.component field=field type=type validation=validation}}
|
||||
{{component
|
||||
validation.component
|
||||
field=field
|
||||
type=type
|
||||
validation=validation
|
||||
}}
|
||||
{{/each-in}}
|
||||
|
||||
{{yield (hash perform=(action "perform") autocomplete="off")}}
|
||||
|
||||
{{#each-in field.validations.below as |type validation|}}
|
||||
{{component validation.component field=field type=type validation=validation}}
|
||||
{{component
|
||||
validation.component
|
||||
field=field
|
||||
type=type
|
||||
validation=validation
|
||||
}}
|
||||
{{/each-in}}
|
||||
{{else}}
|
||||
{{yield}}
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
action=(action "undoChanges")
|
||||
icon=undoIcon
|
||||
label=undoKey
|
||||
class="undo-changes"}}
|
||||
class="undo-changes"
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
<div class="setting">
|
||||
|
@ -13,14 +14,12 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-subscription-selector
|
||||
value=action.type
|
||||
value=this.action.type
|
||||
feature="action"
|
||||
attribute="type"
|
||||
onChange=(action "changeType")
|
||||
wizard=wizard
|
||||
options=(hash
|
||||
none="admin.wizard.select_type"
|
||||
)
|
||||
options=(hash none="admin.wizard.select_type")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
@ -32,16 +31,14 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{combo-box
|
||||
value=action.run_after
|
||||
value=this.action.run_after
|
||||
content=runAfterContent
|
||||
onChange=(action (mut action.run_after))}}
|
||||
onChange=(action (mut this.action.run_after))
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{wizard-message
|
||||
key=messageKey
|
||||
url=messageUrl
|
||||
component="action"}}
|
||||
{{wizard-message key=messageKey url=messageUrl component="action"}}
|
||||
|
||||
{{#if basicTopicFields}}
|
||||
<div class="setting full field-mapper-setting">
|
||||
|
@ -51,14 +48,15 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.title
|
||||
inputs=this.action.title
|
||||
property="title"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -69,26 +67,24 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{combo-box
|
||||
value=action.post
|
||||
value=this.action.post
|
||||
content=wizardFields
|
||||
nameProperty="label"
|
||||
onChange=(action (mut action.post))
|
||||
onChange=(action (mut this.action.post))
|
||||
options=(hash
|
||||
none="admin.wizard.selector.placeholder.wizard_field"
|
||||
isDisabled=showPostBuilder
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
|
||||
<div class="setting-gutter">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.action.post_builder}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.action.post_builder}} />
|
||||
<span>{{i18n "admin.wizard.action.post_builder.checkbox"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if action.post_builder}}
|
||||
{{#if this.action.post_builder}}
|
||||
<div class="setting full">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.post_builder.label"}}</label>
|
||||
|
@ -96,8 +92,9 @@
|
|||
|
||||
<div class="setting-value editor">
|
||||
{{wizard-text-editor
|
||||
value=action.post_template
|
||||
wizardFields=wizardFields}}
|
||||
value=this.action.post_template
|
||||
wizardFields=wizardFields
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -111,7 +108,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.category
|
||||
inputs=this.action.category
|
||||
property="category"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -122,7 +119,8 @@
|
|||
wizardActionSelection="output"
|
||||
outputDefaultSelection="category"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -133,7 +131,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.tags
|
||||
inputs=this.action.tags
|
||||
property="tags"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -143,7 +141,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -154,14 +153,13 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.visible
|
||||
inputs=this.action.visible
|
||||
property="visible"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
wizardFieldSelection=true userFieldSelection=true context="action"
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -173,13 +171,11 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.add_event
|
||||
inputs=this.action.add_event
|
||||
property="add_event"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
wizardFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
options=(hash wizardFieldSelection=true context="action")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -192,13 +188,11 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.add_location
|
||||
inputs=this.action.add_location
|
||||
property="add_location"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
wizardFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
options=(hash wizardFieldSelection=true context="action")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -212,7 +206,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.recipient
|
||||
inputs=this.action.recipient
|
||||
property="recipient"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -223,7 +217,8 @@
|
|||
userSelection="output"
|
||||
outputDefaultSelection="user"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -235,7 +230,7 @@
|
|||
</div>
|
||||
|
||||
{{wizard-mapper
|
||||
inputs=action.profile_updates
|
||||
inputs=this.action.profile_updates
|
||||
property="profile_updates"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -246,7 +241,8 @@
|
|||
wizardActionSelection="value"
|
||||
keyDefaultSelection="userField"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
|
@ -258,13 +254,14 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{combo-box
|
||||
value=action.api
|
||||
value=this.action.api
|
||||
content=availableApis
|
||||
onChange=(action (mut action.api))
|
||||
onChange=(action (mut this.action.api))
|
||||
options=(hash
|
||||
isDisabled=action.custom_title_enabled
|
||||
isDisabled=this.action.custom_title_enabled
|
||||
none="admin.wizard.action.send_to_api.select_an_api"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -275,13 +272,14 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{combo-box
|
||||
value=action.api_endpoint
|
||||
value=this.action.api_endpoint
|
||||
content=availableEndpoints
|
||||
onChange=(action (mut action.api_endpoint))
|
||||
onChange=(action (mut this.action.api_endpoint))
|
||||
options=(hash
|
||||
isDisabled=apiEmpty
|
||||
none="admin.wizard.action.send_to_api.select_an_endpoint"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -292,11 +290,12 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-text-editor
|
||||
value=action.api_body
|
||||
value=this.action.api_body
|
||||
previewEnabled=false
|
||||
barEnabled=false
|
||||
wizardFields=wizardFields
|
||||
placeholder="admin.wizard.action.send_to_api.body_placeholder"}}
|
||||
placeholder="admin.wizard.action.send_to_api.body_placeholder"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -309,7 +308,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.group
|
||||
inputs=this.action.group
|
||||
property="group"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -320,7 +319,8 @@
|
|||
groupSelection="value,output"
|
||||
outputDefaultSelection="group"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -333,7 +333,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.url
|
||||
inputs=this.action.url
|
||||
property="url"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -343,7 +343,8 @@
|
|||
groupSelection="key,value"
|
||||
categorySelection="key,value"
|
||||
userSelection="key,value"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -356,7 +357,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.categories
|
||||
inputs=this.action.categories
|
||||
property="categories"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -366,42 +367,49 @@
|
|||
userFieldSelection="key,value"
|
||||
categorySelection="output"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.watch_categories.mute_remainder"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.watch_categories.mute_remainder"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.mute_remainder
|
||||
inputs=this.action.mute_remainder
|
||||
property="mute_remainder"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
context="action"
|
||||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.watch_x.notification_level.label"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.watch_x.notification_level.label"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{combo-box
|
||||
value=action.notification_level
|
||||
value=this.action.notification_level
|
||||
content=availableNotificationLevels
|
||||
onChange=(action (mut action.notification_level))
|
||||
onChange=(action (mut this.action.notification_level))
|
||||
options=(hash
|
||||
isDisabled=action.custom_title_enabled
|
||||
isDisabled=this.action.custom_title_enabled
|
||||
none="admin.wizard.action.watch_x.select_a_notification_level"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -411,10 +419,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.action.wizard_user}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.action.wizard_user}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -425,7 +430,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.usernames
|
||||
inputs=this.action.usernames
|
||||
property="usernames"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -433,7 +438,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
userSelection="output"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -446,7 +452,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.tags
|
||||
inputs=this.action.tags
|
||||
property="tags"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -456,24 +462,28 @@
|
|||
wizardActionSelection=true
|
||||
userFieldSelection="key,value"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.watch_x.notification_level.label"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.watch_x.notification_level.label"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{combo-box
|
||||
value=action.notification_level
|
||||
value=this.action.notification_level
|
||||
content=availableNotificationLevels
|
||||
onChange=(action (mut action.notification_level))
|
||||
onChange=(action (mut this.action.notification_level))
|
||||
options=(hash
|
||||
isDisabled=action.custom_title_enabled
|
||||
isDisabled=this.action.custom_title_enabled
|
||||
none="admin.wizard.action.watch_x.select_a_notification_level"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -483,10 +493,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.action.wizard_user}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.action.wizard_user}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -497,7 +504,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.usernames
|
||||
inputs=this.action.usernames
|
||||
property="usernames"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -505,7 +512,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
userSelection="output"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -518,7 +526,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.name
|
||||
inputs=this.action.name
|
||||
property="name"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -526,7 +534,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
|
@ -536,7 +545,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.full_name
|
||||
inputs=this.action.full_name
|
||||
property="full_name"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -544,7 +553,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
|
@ -554,7 +564,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.title
|
||||
inputs=this.action.title
|
||||
property="title"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -562,7 +572,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
|
@ -572,7 +583,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.bio_raw
|
||||
inputs=this.action.bio_raw
|
||||
property="bio_raw"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -580,7 +591,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
|
@ -590,7 +602,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.owner_usernames
|
||||
inputs=this.action.owner_usernames
|
||||
property="owner_usernames"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -599,7 +611,8 @@
|
|||
userFieldSelection=true
|
||||
userSelection="output"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
|
@ -609,7 +622,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.usernames
|
||||
inputs=this.action.usernames
|
||||
property="usernames"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -618,17 +631,20 @@
|
|||
userFieldSelection=true
|
||||
userSelection="output"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.grant_trust_level"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.create_group.grant_trust_level"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.grant_trust_level
|
||||
inputs=this.action.grant_trust_level
|
||||
property="grant_trust_level"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -636,17 +652,20 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.mentionable_level"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.create_group.mentionable_level"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.mentionable_level
|
||||
inputs=this.action.mentionable_level
|
||||
property="mentionable_level"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -654,17 +673,20 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.messageable_level"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.create_group.messageable_level"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.messageable_level
|
||||
inputs=this.action.messageable_level
|
||||
property="messageable_level"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -672,17 +694,20 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.visibility_level"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.create_group.visibility_level"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.visibility_level
|
||||
inputs=this.action.visibility_level
|
||||
property="visibility_level"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -690,17 +715,20 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_group.members_visibility_level"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.create_group.members_visibility_level"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.members_visibility_level
|
||||
inputs=this.action.members_visibility_level
|
||||
property="members_visibility_level"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -708,7 +736,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -721,7 +750,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.name
|
||||
inputs=this.action.name
|
||||
property="name"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -729,7 +758,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -740,7 +770,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.slug
|
||||
inputs=this.action.slug
|
||||
property="slug"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -748,7 +778,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -759,7 +790,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.color
|
||||
inputs=this.action.color
|
||||
property="color"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -767,7 +798,8 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -778,7 +810,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.text_color
|
||||
inputs=this.action.text_color
|
||||
property="text_color"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -786,18 +818,21 @@
|
|||
wizardFieldSelection=true
|
||||
userFieldSelection="key,value"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="setting full field-mapper-setting">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.action.create_category.parent_category"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.action.create_category.parent_category"
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.parent_category_id
|
||||
inputs=this.action.parent_category_id
|
||||
property="parent_category_id"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -806,7 +841,8 @@
|
|||
userFieldSelection="key,value"
|
||||
categorySelection="output"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -817,7 +853,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.permissions
|
||||
inputs=this.action.permissions
|
||||
property="permissions"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -828,7 +864,8 @@
|
|||
userFieldSelection=true
|
||||
groupSelection="key"
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -841,7 +878,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.custom_fields
|
||||
inputs=this.action.custom_fields
|
||||
property="custom_fields"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -852,7 +889,8 @@
|
|||
userFieldSelection="value"
|
||||
keyPlaceholder="admin.wizard.action.custom_fields.key"
|
||||
context=customFieldsContext
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -865,7 +903,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=action.required
|
||||
inputs=this.action.required
|
||||
property="required"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=(hash
|
||||
|
@ -874,7 +912,8 @@
|
|||
userFieldSelection=true
|
||||
groupSelection=true
|
||||
context="action"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -886,10 +925,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.action.skip_redirect}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.action.skip_redirect}} />
|
||||
|
||||
<span>
|
||||
{{i18n "admin.wizard.action.skip_redirect.description" type="topic"}}
|
||||
|
@ -903,13 +939,13 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.action.suppress_notifications}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.action.suppress_notifications}} />
|
||||
|
||||
<span>
|
||||
{{i18n "admin.wizard.action.suppress_notifications.description" type="topic"}}
|
||||
{{i18n
|
||||
"admin.wizard.action.suppress_notifications.description"
|
||||
type="topic"
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
action=(action "undoChanges")
|
||||
icon=undoIcon
|
||||
label=undoKey
|
||||
class="undo-changes"}}
|
||||
class="undo-changes"
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
<div class="setting">
|
||||
|
@ -11,10 +12,7 @@
|
|||
<label>{{i18n "admin.wizard.field.label"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
name="label"
|
||||
@value={{this.field.label}}
|
||||
/>
|
||||
<Input name="label" @value={{this.field.label}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -25,10 +23,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
<span>{{i18n "admin.wizard.field.required_label"}}</span>
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.field.required}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.field.required}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -37,10 +32,7 @@
|
|||
<label>{{i18n "admin.wizard.field.description"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Textarea
|
||||
name="description"
|
||||
@value={{this.field.description}}
|
||||
/>
|
||||
<Textarea name="description" @value={{this.field.description}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -55,7 +47,8 @@
|
|||
onUploadDeleted=(action "imageUploadDeleted")
|
||||
type="wizard-field-image"
|
||||
class="no-repeat contain-image"
|
||||
id=(concat "wizard-field-" field.id "-image-upload")}}
|
||||
id=(concat "wizard-field-" field.id "-image-upload")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -71,17 +64,12 @@
|
|||
attribute="type"
|
||||
onChange=(action "changeType")
|
||||
wizard=wizard
|
||||
options=(hash
|
||||
none="admin.wizard.select_type"
|
||||
)
|
||||
options=(hash none="admin.wizard.select_type")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{wizard-message
|
||||
key=messageKey
|
||||
url=messageUrl
|
||||
component="field"}}
|
||||
{{wizard-message key=messageKey url=messageUrl component="field"}}
|
||||
|
||||
{{#if isTextType}}
|
||||
<div class="setting">
|
||||
|
@ -121,10 +109,7 @@
|
|||
|
||||
<div class="setting-value">
|
||||
<span>{{i18n "admin.wizard.field.char_counter_placeholder"}}</span>
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.field.char_counter}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.field.char_counter}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -166,10 +151,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@value={{this.field.file_types}}
|
||||
class="medium"
|
||||
/>
|
||||
<Input @value={{this.field.file_types}} class="medium" />
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -181,11 +163,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="number"
|
||||
@value={{this.field.limit}}
|
||||
class="small"
|
||||
/>
|
||||
<Input @type="number" @value={{this.field.limit}} class="small" />
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -193,15 +171,16 @@
|
|||
{{#if isDateTime}}
|
||||
<div class="setting">
|
||||
<div class="setting-label">
|
||||
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.label")}}</label>
|
||||
<label>{{html-safe
|
||||
(i18n "admin.wizard.field.date_time_format.label")
|
||||
}}</label>
|
||||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@value={{this.field.format}}
|
||||
class="medium"
|
||||
/>
|
||||
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.instructions")}}</label>
|
||||
<Input @value={{this.field.format}} class="medium" />
|
||||
<label>{{html-safe
|
||||
(i18n "admin.wizard.field.date_time_format.instructions")
|
||||
}}</label>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -217,7 +196,8 @@
|
|||
inputs=field.prefill
|
||||
property="prefill"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=prefillOptions}}
|
||||
options=prefillOptions
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -233,7 +213,8 @@
|
|||
inputs=field.content
|
||||
property="content"
|
||||
onUpdate=(action "mappedFieldUpdated")
|
||||
options=contentOptions}}
|
||||
options=contentOptions
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -259,10 +240,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.field.can_create_tag}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.field.can_create_tag}} />
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -274,9 +252,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=field.condition
|
||||
options=fieldConditionOptions}}
|
||||
{{wizard-mapper inputs=field.condition options=fieldConditionOptions}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -286,9 +262,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=field.index
|
||||
options=fieldIndexOptions}}
|
||||
{{wizard-mapper inputs=field.index options=fieldIndexOptions}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -303,9 +277,8 @@
|
|||
value=field.property
|
||||
content=categoryPropertyTypes
|
||||
onChange=(action (mut field.property))
|
||||
options=(hash
|
||||
none="admin.wizard.selector.placeholder.property"
|
||||
)}}
|
||||
options=(hash none="admin.wizard.selector.placeholder.property")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
|
|
@ -3,10 +3,7 @@
|
|||
<label>{{i18n "admin.wizard.step.title"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
name="title"
|
||||
@value={{this.step.title}}
|
||||
/>
|
||||
<Input name="title" @value={{this.step.title}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -21,7 +18,8 @@
|
|||
onUploadDeleted=(action "bannerUploadDeleted")
|
||||
type="wizard-step-banner"
|
||||
class="no-repeat contain-image"
|
||||
id=(concat "wizard-step-" step.id "-banner-upload")}}
|
||||
id=(concat "wizard-step-" step.id "-banner-upload")
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -30,8 +28,7 @@
|
|||
<label>{{i18n "admin.wizard.step.description"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
{{wizard-text-editor
|
||||
value=step.raw_description}}
|
||||
{{wizard-text-editor value=step.raw_description}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -42,9 +39,7 @@
|
|||
</div>
|
||||
|
||||
<div class="setting-value">
|
||||
{{wizard-mapper
|
||||
inputs=step.condition
|
||||
options=stepConditionOptions}}
|
||||
{{wizard-mapper inputs=step.condition options=stepConditionOptions}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -52,10 +47,7 @@
|
|||
<div class="setting-label"></div>
|
||||
<div class="setting-value force-final">
|
||||
<h4>{{i18n "admin.wizard.step.force_final.label"}}</h4>
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.step.force_final}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.step.force_final}} />
|
||||
<span>{{i18n "admin.wizard.step.force_final.description"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -75,15 +67,14 @@
|
|||
userFieldSelection="value"
|
||||
keyPlaceholder="admin.wizard.submission_key"
|
||||
context="step"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
{{#if step.required_data}}
|
||||
<div class="required-data-message">
|
||||
<div class="label">
|
||||
{{i18n "admin.wizard.step.required_data.not_permitted_message"}}
|
||||
</div>
|
||||
<Input
|
||||
@value={{this.step.required_data_message}}
|
||||
/>
|
||||
<Input @value={{this.step.required_data_message}} />
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -102,7 +93,8 @@
|
|||
keyPlaceholder="admin.wizard.param_key"
|
||||
valuePlaceholder="admin.wizard.submission_key"
|
||||
context="step"
|
||||
)}}
|
||||
)
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
{{/wizard-subscription-container}}
|
||||
|
@ -111,7 +103,8 @@
|
|||
itemType="field"
|
||||
current=currentField
|
||||
items=step.fields
|
||||
parentId=step.id}}
|
||||
parentId=step.id
|
||||
}}
|
||||
|
||||
{{#each step.fields as |field|}}
|
||||
{{wizard-custom-field
|
||||
|
@ -122,5 +115,6 @@
|
|||
fieldTypes=fieldTypes
|
||||
removeField="removeField"
|
||||
wizardFields=wizardFields
|
||||
subscribed=subscribed}}
|
||||
subscribed=subscribed
|
||||
}}
|
||||
{{/each}}
|
|
@ -4,14 +4,34 @@
|
|||
{{#if anyLinks}}
|
||||
{{#each links as |link|}}
|
||||
<div data-id={{link.id}}>
|
||||
{{d-button action=(action "change") actionParam=link.id translatedLabel=link.label class=link.classes}}
|
||||
{{d-button
|
||||
action=(action "change")
|
||||
actionParam=link.id
|
||||
translatedLabel=link.label
|
||||
class=link.classes
|
||||
}}
|
||||
{{#unless link.first}}
|
||||
{{d-button action=(action "back") actionParam=link icon="arrow-left" class="back"}}
|
||||
{{d-button
|
||||
action=(action "back")
|
||||
actionParam=link
|
||||
icon="arrow-left"
|
||||
class="back"
|
||||
}}
|
||||
{{/unless}}
|
||||
{{#unless link.last}}
|
||||
{{d-button action=(action "forward") actionParam=link icon="arrow-right" class="forward"}}
|
||||
{{d-button
|
||||
action=(action "forward")
|
||||
actionParam=link
|
||||
icon="arrow-right"
|
||||
class="forward"
|
||||
}}
|
||||
{{/unless}}
|
||||
{{d-button action=(action "remove") actionParam=link.id icon="times" class="remove"}}
|
||||
{{d-button
|
||||
action=(action "remove")
|
||||
actionParam=link.id
|
||||
icon="times"
|
||||
class="remove"
|
||||
}}
|
||||
</div>
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
{{combo-box
|
||||
value=connector
|
||||
content=connectors
|
||||
onChange=(action "changeConnector")}}
|
||||
onChange=(action "changeConnector")
|
||||
}}
|
||||
{{else}}
|
||||
{{#if connector}}
|
||||
<span class="connector-single">
|
||||
|
|
|
@ -1,22 +1,24 @@
|
|||
{{wizard-mapper-connector
|
||||
connector=input.type
|
||||
connectors=inputTypes
|
||||
connector=this.input.type
|
||||
connectors=this.inputTypes
|
||||
inputTypes=true
|
||||
inputType=inputType
|
||||
inputType=this.inputType
|
||||
connectorType="type"
|
||||
options=options
|
||||
onUpdate=onUpdate}}
|
||||
options=this.options
|
||||
onUpdate=this.onUpdate
|
||||
}}
|
||||
|
||||
{{#if hasPairs}}
|
||||
<div class="mapper-pairs mapper-block">
|
||||
{{#each input.pairs as |pair|}}
|
||||
{{#each this.input.pairs as |pair|}}
|
||||
{{wizard-mapper-pair
|
||||
pair=pair
|
||||
last=pair.last
|
||||
inputType=inputType
|
||||
options=options
|
||||
inputType=this.inputType
|
||||
options=this.options
|
||||
removePair=(action "removePair")
|
||||
onUpdate=onUpdate}}
|
||||
onUpdate=this.onUpdate
|
||||
}}
|
||||
{{/each}}
|
||||
|
||||
{{#if canAddPair}}
|
||||
|
@ -30,25 +32,27 @@
|
|||
{{#if hasOutput}}
|
||||
{{#if hasPairs}}
|
||||
{{wizard-mapper-connector
|
||||
connector=input.output_connector
|
||||
connectors=connectors
|
||||
connector=this.input.output_connector
|
||||
connectors=this.connectors
|
||||
connectorType="output"
|
||||
inputType=inputType
|
||||
options=options
|
||||
onUpdate=onUpdate}}
|
||||
inputType=this.inputType
|
||||
options=this.options
|
||||
onUpdate=this.onUpdate
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
<div class="output mapper-block">
|
||||
{{wizard-mapper-selector
|
||||
selectorType="output"
|
||||
inputType=input.type
|
||||
value=input.output
|
||||
activeType=input.output_type
|
||||
options=options
|
||||
onUpdate=onUpdate}}
|
||||
inputType=this.input.type
|
||||
value=this.input.output
|
||||
activeType=this.input.output_type
|
||||
options=this.options
|
||||
onUpdate=this.onUpdate
|
||||
}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<a role="button" class="remove-input" {{action remove input}}>
|
||||
<a role="button" class="remove-input" {{action remove this.input}}>
|
||||
{{d-icon "times"}}
|
||||
</a>
|
|
@ -5,7 +5,8 @@
|
|||
value=pair.key
|
||||
activeType=pair.key_type
|
||||
options=options
|
||||
onUpdate=onUpdate}}
|
||||
onUpdate=onUpdate
|
||||
}}
|
||||
</div>
|
||||
|
||||
{{wizard-mapper-connector
|
||||
|
@ -14,7 +15,8 @@
|
|||
connectorType="pair"
|
||||
inputType=inputType
|
||||
options=options
|
||||
onUpdate=onUpdate}}
|
||||
onUpdate=onUpdate
|
||||
}}
|
||||
|
||||
<div class="value mapper-block">
|
||||
{{wizard-mapper-selector
|
||||
|
@ -24,7 +26,8 @@
|
|||
activeType=pair.value_type
|
||||
options=options
|
||||
onUpdate=onUpdate
|
||||
connector=pair.connector}}
|
||||
connector=pair.connector
|
||||
}}
|
||||
</div>
|
||||
|
||||
{{#if showJoin}}
|
||||
|
@ -32,5 +35,7 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if showRemove}}
|
||||
<a role="button" {{action removePair pair}} class="remove-pair">{{d-icon "times"}}</a>
|
||||
<a role="button" {{action removePair pair}} class="remove-pair">{{d-icon
|
||||
"times"
|
||||
}}</a>
|
||||
{{/if}}
|
|
@ -10,7 +10,8 @@
|
|||
{{wizard-mapper-selector-type
|
||||
activeType=activeType
|
||||
item=item
|
||||
toggle=(action "toggleType")}}
|
||||
toggle=(action "toggleType")
|
||||
}}
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
@ -34,10 +35,8 @@
|
|||
value=value
|
||||
content=comboBoxContent
|
||||
onChange=(action "changeValue")
|
||||
options=(hash
|
||||
none=placeholderKey
|
||||
allowAny=comboBoxAllowAny
|
||||
)}}
|
||||
options=(hash none=placeholderKey allowAny=comboBoxAllowAny)
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{#if showMultiSelect}}
|
||||
|
@ -45,14 +44,16 @@
|
|||
content=multiSelectContent
|
||||
value=value
|
||||
onChange=(action "changeValue")
|
||||
options=multiSelectOptions}}
|
||||
options=multiSelectOptions
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{#if showList}}
|
||||
{{wizard-value-list
|
||||
values=value
|
||||
addKey=placeholderKey
|
||||
onChange=(action "changeValue")}}
|
||||
onChange=(action "changeValue")
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{#if showTag}}
|
||||
|
@ -60,10 +61,8 @@
|
|||
tags=value
|
||||
onChange=(action "changeValue")
|
||||
everyTag=true
|
||||
options=(hash
|
||||
none=placeholderKey
|
||||
filterable=true
|
||||
)}}
|
||||
options=(hash none=placeholderKey filterable=true)
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{#if showUser}}
|
||||
|
@ -72,8 +71,7 @@
|
|||
value=value
|
||||
autocomplete="discourse"
|
||||
onChange=(action "changeUserValue")
|
||||
options=(hash
|
||||
includeMessageableGroups="true"
|
||||
)}}
|
||||
options=(hash includeMessageableGroups="true")
|
||||
}}
|
||||
{{/if}}
|
||||
</div>
|
|
@ -3,14 +3,16 @@
|
|||
{{wizard-mapper-connector
|
||||
connector=input.connector
|
||||
connectorType="input"
|
||||
onUpdate=(action "inputUpdated")}}
|
||||
onUpdate=(action "inputUpdated")
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{wizard-mapper-input
|
||||
input=input
|
||||
options=inputOptions
|
||||
remove=(action "remove")
|
||||
onUpdate=(action "inputUpdated")}}
|
||||
onUpdate=(action "inputUpdated")
|
||||
}}
|
||||
{{/each}}
|
||||
|
||||
{{#if canAdd}}
|
||||
|
|
|
@ -7,27 +7,31 @@
|
|||
<li>
|
||||
<span class="setting-title">
|
||||
<h4>{{i18n (concat "admin.wizard.field.validations." type)}}</h4>
|
||||
<Input
|
||||
@type="checkbox"
|
||||
@checked={{this.props.status}}
|
||||
/>
|
||||
<Input @type="checkbox" @checked={{this.props.status}} />
|
||||
{{i18n "admin.wizard.field.validations.enabled"}}
|
||||
</span>
|
||||
<div class="validation-container">
|
||||
<div class="validation-section">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.field.validations.categories"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.field.validations.categories"
|
||||
}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
{{category-selector
|
||||
categories=(get this (concat "validationBuffer." type ".categories"))
|
||||
categories=(get
|
||||
this (concat "validationBuffer." type ".categories")
|
||||
)
|
||||
onChange=(action "updateValidationCategories" type props)
|
||||
class="wizard"}}
|
||||
class="wizard"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="validation-section">
|
||||
<div class="setting-label">
|
||||
<label>{{i18n "admin.wizard.field.validations.max_topic_age"}}</label>
|
||||
<label>{{i18n
|
||||
"admin.wizard.field.validations.max_topic_age"
|
||||
}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
<Input
|
||||
|
@ -39,7 +43,8 @@
|
|||
value=(readonly props.time_unit)
|
||||
content=timeUnits
|
||||
class="time-unit-selector"
|
||||
onChange=(action (mut props.time_unit))}}
|
||||
onChange=(action (mut props.time_unit))
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="validation-section">
|
||||
|
@ -47,9 +52,17 @@
|
|||
<label>{{i18n "admin.wizard.field.validations.position"}}</label>
|
||||
</div>
|
||||
<div class="setting-value">
|
||||
{{radio-button name=(concat type field.id) value="above" selection=props.position}}
|
||||
{{radio-button
|
||||
name=(concat type field.id)
|
||||
value="above"
|
||||
selection=props.position
|
||||
}}
|
||||
<span>{{i18n "admin.wizard.field.validations.above"}}</span>
|
||||
{{radio-button name=(concat type field.id) value="below" selection=props.position}}
|
||||
{{radio-button
|
||||
name=(concat type field.id)
|
||||
value="below"
|
||||
selection=props.position
|
||||
}}
|
||||
<span>{{i18n "admin.wizard.field.validations.below"}}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,24 @@
|
|||
<svg width="300px" height="300px" viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<g id="pavilion-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<path id="Combined-Shape" stroke="currentColor" stroke-width="35" d="M41.1381822,291.00006 L40.5778853,130.009744 M258.850727,291.638415 L259.290397,130.37133 M36.0002279,140.721678 L139.995368,36.2122772 M263.350577,141.009083 L138.927245,16.2478517"></path>
|
||||
<svg
|
||||
width="300px"
|
||||
height="300px"
|
||||
viewBox="0 0 300 300"
|
||||
version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
>
|
||||
<g
|
||||
id="pavilion-logo"
|
||||
stroke="none"
|
||||
stroke-width="1"
|
||||
fill="none"
|
||||
fill-rule="evenodd"
|
||||
>
|
||||
<path
|
||||
id="Combined-Shape"
|
||||
stroke="currentColor"
|
||||
stroke-width="35"
|
||||
d="M41.1381822,291.00006 L40.5778853,130.009744 M258.850727,291.638415 L259.290397,130.37133 M36.0002279,140.721678 L139.995368,36.2122772 M263.350577,141.009083 L138.927245,16.2478517"
|
||||
></path>
|
||||
</g>
|
||||
</svg>
|
||||
<span>{{label}}</span>
|
Vorher Breite: | Höhe: | Größe: 538 B Nachher Breite: | Höhe: | Größe: 602 B |
|
@ -1,6 +1,7 @@
|
|||
<div class="select-kit-header-wrapper">
|
||||
|
||||
{{component selectKit.options.selectedNameComponent
|
||||
{{component
|
||||
selectKit.options.selectedNameComponent
|
||||
tabindex=tabindex
|
||||
item=selectedContent
|
||||
selectKit=selectKit
|
||||
|
|
|
@ -16,7 +16,10 @@
|
|||
|
||||
{{#if isComposer}}
|
||||
<div class="wizard-table-long-text">
|
||||
<p class="wizard-table-composer-text wizard-table-long-text-content {{textState}}">
|
||||
<p
|
||||
class="wizard-table-composer-text wizard-table-long-text-content
|
||||
{{textState}}"
|
||||
>
|
||||
{{value.value}}
|
||||
</p>
|
||||
<a href {{action "expandText"}}>
|
||||
|
@ -28,7 +31,8 @@
|
|||
{{#if isComposerPreview}}
|
||||
{{d-icon "comment-alt"}}
|
||||
<span class="wizard-table-composer-text">
|
||||
{{i18n "admin.wizard.submissions.composer_preview"}}: {{value.value}}
|
||||
{{i18n "admin.wizard.submissions.composer_preview"}}:
|
||||
{{value.value}}
|
||||
</span>
|
||||
{{/if}}
|
||||
|
||||
|
@ -146,7 +150,12 @@
|
|||
{{/if}}
|
||||
|
||||
{{#if showUsername}}
|
||||
<a target="_blank" rel="noopener noreferrer" href={{userProfileUrl}} title={{username}}>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href={{userProfileUrl}}
|
||||
title={{username}}
|
||||
>
|
||||
{{username}}
|
||||
</a>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,19 +1,12 @@
|
|||
{{d-editor
|
||||
value=value
|
||||
forcePreview=forcePreview
|
||||
placeholder=placeholder}}
|
||||
{{d-editor value=value forcePreview=forcePreview placeholder=placeholder}}
|
||||
|
||||
<div class="wizard-editor-gutter">
|
||||
{{#if previewEnabled}}
|
||||
{{d-button
|
||||
action=(action "togglePreview")
|
||||
translatedLabel=previewLabel}}
|
||||
{{d-button action=(action "togglePreview") translatedLabel=previewLabel}}
|
||||
{{/if}}
|
||||
|
||||
{{#if fieldsEnabled}}
|
||||
{{d-button
|
||||
action=(action "togglePopover")
|
||||
translatedLabel=popoverLabel}}
|
||||
{{d-button action=(action "togglePopover") translatedLabel=popoverLabel}}
|
||||
|
||||
{{#if showPopover}}
|
||||
<div class="wizard-editor-gutter-popover">
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
{{#if noAccess}}
|
||||
{{custom-wizard-no-access text=(i18n noAccessI18nKey) wizardId=wizardId reason=noAccessReason}}
|
||||
{{custom-wizard-no-access
|
||||
text=(i18n noAccessI18nKey)
|
||||
wizardId=wizardId
|
||||
reason=noAccessReason
|
||||
}}
|
||||
{{/if}}
|
|
@ -16,5 +16,6 @@
|
|||
wizard=wizard
|
||||
goNext=(action "goNext")
|
||||
goBack=(action "goBack")
|
||||
showMessage=(action "showMessage")}}
|
||||
showMessage=(action "showMessage")
|
||||
}}
|
||||
{{/if}}
|
|
@ -4,7 +4,10 @@
|
|||
</div>
|
||||
<div class="wizard-footer">
|
||||
{{#if customWizard}}
|
||||
<img src={{logoUrl}} style="background-image: initial; width: 33px; height: 33px;" >
|
||||
<img
|
||||
src={{logoUrl}}
|
||||
style="background-image: initial; width: 33px; height: 33px;"
|
||||
/>
|
||||
{{else}}
|
||||
<div class="discourse-logo"></div>
|
||||
{{/if}}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
{{#d-modal-body title="admin.wizard.edit_columns"}}
|
||||
{{#if loading}}
|
||||
{{loading-spinner size="large"}}
|
||||
{{else}}
|
||||
<div class="edit-directory-columns-container">
|
||||
{{#each model.columns as |column|}}
|
||||
<div class="edit-directory-column">
|
||||
<div class="left-content">
|
||||
<label class="column-name">
|
||||
{{input type="checkbox" checked=column.enabled}}
|
||||
{{directory-table-header-title field=column.label translated=true}}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/d-modal-body}}
|
||||
|
||||
<div class="modal-footer">
|
||||
{{d-button
|
||||
class="btn-primary"
|
||||
label="directory.edit_columns.save"
|
||||
action=(action "save")
|
||||
}}
|
||||
|
||||
{{d-button
|
||||
class="btn-secondary reset-to-default"
|
||||
label="directory.edit_columns.reset_to_default"
|
||||
action=(action "resetToDefault")
|
||||
}}
|
||||
</div>
|
|
@ -1,16 +0,0 @@
|
|||
{{#d-modal-body class="next-session-time-modal" title=title}}
|
||||
{{date-time-input
|
||||
date=bufferedDateTime
|
||||
onChange=(action "dateTimeChanged")
|
||||
showTime=true
|
||||
clearable=true
|
||||
}}
|
||||
{{/d-modal-body}}
|
||||
|
||||
<div class="modal-footer">
|
||||
{{d-button
|
||||
action=(action "submit")
|
||||
class="btn-primary"
|
||||
label="admin.wizard.after_time_modal.done"
|
||||
disabled=submitDisabled}}
|
||||
</div>
|
|
@ -55,6 +55,8 @@ en:
|
|||
liquid_syntax_error: "Liquid syntax error in %{attribute}: %{message}"
|
||||
subscription: "%{type} %{property} usage is not supported on your subscription"
|
||||
not_permitted_for_guests: "%{object_id} is not permitted when guests can access the wizard"
|
||||
error_messages:
|
||||
wizard_replacing_composer: "Category not allowed for topic creation."
|
||||
|
||||
site_settings:
|
||||
custom_wizard_enabled: "Enable custom wizards."
|
||||
|
|
|
@ -140,7 +140,7 @@ class ::CustomWizard::CustomField
|
|||
end
|
||||
|
||||
def self.cached_list
|
||||
::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
|
||||
@custom_wizard_cached_fields ||= ::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
|
||||
PluginStoreRow.where(plugin_name: NAMESPACE).map do |record|
|
||||
create_from_store(record).as_json.with_indifferent_access
|
||||
end
|
||||
|
@ -216,6 +216,7 @@ class ::CustomWizard::CustomField
|
|||
end
|
||||
|
||||
def self.invalidate_cache
|
||||
@custom_wizard_cached_fields = nil
|
||||
CustomWizard::Cache.new(LIST_CACHE_KEY).delete
|
||||
Discourse.clear_readonly!
|
||||
Discourse.request_refresh!
|
||||
|
|
|
@ -10,19 +10,19 @@ class CustomWizard::Subscription
|
|||
{
|
||||
wizard: {
|
||||
required: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
permitted: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*', "!#{CustomWizard::Wizard::GUEST_GROUP_ID}"]
|
||||
},
|
||||
restart_on_revisit: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -30,19 +30,19 @@ class CustomWizard::Subscription
|
|||
},
|
||||
step: {
|
||||
condition: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
required_data: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
permitted_params: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -50,19 +50,19 @@ class CustomWizard::Subscription
|
|||
},
|
||||
field: {
|
||||
condition: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
type: {
|
||||
none: ['text', 'textarea', 'text_only', 'date', 'time', 'date_time', 'number', 'checkbox', 'dropdown', 'upload'],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
realtime_validations: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: ['*'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -70,7 +70,7 @@ class CustomWizard::Subscription
|
|||
},
|
||||
action: {
|
||||
type: {
|
||||
none: ['create_topic', 'update_profile', 'open_composer', 'route_to'],
|
||||
none: ['*'],
|
||||
standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -78,13 +78,13 @@ class CustomWizard::Subscription
|
|||
},
|
||||
custom_field: {
|
||||
klass: {
|
||||
none: ['topic', 'post'],
|
||||
none: ['*'],
|
||||
standard: ['topic', 'post'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
},
|
||||
type: {
|
||||
none: ['string', 'boolean', 'integer'],
|
||||
none: ['*'],
|
||||
standard: ['string', 'boolean', 'integer'],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -92,7 +92,7 @@ class CustomWizard::Subscription
|
|||
},
|
||||
api: {
|
||||
all: {
|
||||
none: [],
|
||||
none: ['*'],
|
||||
standard: [],
|
||||
business: ['*'],
|
||||
community: ['*']
|
||||
|
@ -106,7 +106,7 @@ class CustomWizard::Subscription
|
|||
|
||||
def initialize
|
||||
if CustomWizard::Subscription.client_installed?
|
||||
result = SubscriptionClient.find_subscriptions("discourse-custom-wizard")
|
||||
result = DiscourseSubscriptionClient.find_subscriptions("discourse-custom-wizard")
|
||||
|
||||
if result&.any?
|
||||
ids_and_slugs = result.subscriptions.map do |subscription|
|
||||
|
@ -117,13 +117,15 @@ class CustomWizard::Subscription
|
|||
end
|
||||
|
||||
id_and_slug = ids_and_slugs.sort do |a, b|
|
||||
PRODUCT_HIERARCHY[a[:slug]] - PRODUCT_HIERARCHY[b[:slug]]
|
||||
PRODUCT_HIERARCHY.index(b[:slug]) - PRODUCT_HIERARCHY.index(a[:slug])
|
||||
end.first
|
||||
|
||||
@product_id = id_and_slug[:id]
|
||||
@product_slug = id_and_slug[:slug]
|
||||
end
|
||||
end
|
||||
|
||||
@product_slug ||= ENV["CUSTOM_WIZARD_PRODUCT_SLUG"]
|
||||
end
|
||||
|
||||
def includes?(feature, attribute, value = nil)
|
||||
|
@ -152,14 +154,11 @@ class CustomWizard::Subscription
|
|||
end
|
||||
|
||||
def type
|
||||
return :none unless subscribed?
|
||||
return :standard if standard?
|
||||
return :business if business?
|
||||
return :community if community?
|
||||
return :business
|
||||
end
|
||||
|
||||
def subscribed?
|
||||
standard? || business? || community?
|
||||
true
|
||||
end
|
||||
|
||||
def standard?
|
||||
|
@ -167,7 +166,7 @@ class CustomWizard::Subscription
|
|||
end
|
||||
|
||||
def business?
|
||||
product_slug === "business"
|
||||
true
|
||||
end
|
||||
|
||||
def community?
|
||||
|
@ -175,7 +174,7 @@ class CustomWizard::Subscription
|
|||
end
|
||||
|
||||
def self.client_installed?
|
||||
defined?(SubscriptionClient) == 'constant' && SubscriptionClient.class == Module
|
||||
defined?(DiscourseSubscriptionClient) == 'constant' && DiscourseSubscriptionClient.class == Module
|
||||
end
|
||||
|
||||
def self.subscribed?
|
||||
|
|
|
@ -64,6 +64,8 @@ class CustomWizard::Template
|
|||
ensure_wizard_upload_references!(wizard_id)
|
||||
PluginStore.remove(CustomWizard::PLUGIN_NAME, wizard.id)
|
||||
clear_user_wizard_redirect(wizard_id, after_time: !!wizard.after_time)
|
||||
related_custom_fields = CategoryCustomField.where(name: 'create_topic_wizard', value: wizard.name.parameterize(separator: "_"))
|
||||
related_custom_fields.destroy_all
|
||||
end
|
||||
|
||||
clear_cache_keys
|
||||
|
|
|
@ -145,7 +145,7 @@ class CustomWizard::Wizard
|
|||
step.last_step = true
|
||||
end
|
||||
|
||||
if step.previous && step.previous.id === last_completed_step_id
|
||||
if !@restart_on_revisit && step.previous && step.previous.id === last_completed_step_id
|
||||
@start = step.id
|
||||
end
|
||||
end
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"author": "Pavilion",
|
||||
"license": "GPL V2",
|
||||
"devDependencies": {
|
||||
"eslint-config-discourse": "^1.1.8",
|
||||
"eslint-config-discourse": "^3.4.0",
|
||||
"semver": "^7.3.5"
|
||||
}
|
||||
}
|
||||
|
|
13
plugin.rb
13
plugin.rb
|
@ -1,8 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
# name: discourse-custom-wizard
|
||||
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
|
||||
# version: 2.4.0
|
||||
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
|
||||
# version: 2.4.23
|
||||
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
|
||||
# url: https://github.com/paviliondev/discourse-custom-wizard
|
||||
# contact_emails: development@pavilion.tech
|
||||
# subscription_url: https://coop.pavilion.tech
|
||||
|
@ -236,4 +236,13 @@ after_initialize do
|
|||
end
|
||||
|
||||
DiscourseEvent.trigger(:custom_wizard_ready)
|
||||
|
||||
on(:before_create_topic) do |topic_params, user|
|
||||
category = topic_params.category
|
||||
if category&.custom_fields&.[]('create_topic_wizard').present?
|
||||
raise Discourse::InvalidParameters.new(
|
||||
I18n.t('wizard.error_messages.wizard_replacing_composer')
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
describe CustomWizard::Log do
|
||||
before do
|
||||
CustomWizard::Log.create('first-test-wizard', 'perform_first_action', 'first_test_user', 'First log message')
|
||||
CustomWizard::Log.create('second-test-wizard', 'perform_second_action', 'second_test_user', 'Second log message')
|
||||
CustomWizard::Log.create('third-test-wizard', 'perform_third_action', 'third_test_user', 'Third log message')
|
||||
CustomWizard::Log.create('first-test-wizard', 'perform_first_action', 'first_test_user', 'First log message', 5.minutes.ago)
|
||||
CustomWizard::Log.create('second-test-wizard', 'perform_second_action', 'second_test_user', 'Second log message', 3.minutes.ago)
|
||||
CustomWizard::Log.create('third-test-wizard', 'perform_third_action', 'third_test_user', 'Third log message', 1.minutes.ago)
|
||||
end
|
||||
|
||||
it "creates logs" do
|
||||
|
|
|
@ -281,13 +281,13 @@ describe CustomWizard::Mapper do
|
|||
|
||||
it "avatar with valid size" do
|
||||
avatar_inputs = inputs['interpolate_avatar'].dup
|
||||
avatar_inputs[0]["output"] = "Avatar: ![avatar](u{avatar.120})"
|
||||
avatar_inputs[0]["output"] = "Avatar: ![avatar](u{avatar.144})"
|
||||
|
||||
expect(CustomWizard::Mapper.new(
|
||||
inputs: avatar_inputs,
|
||||
data: data,
|
||||
user: user1
|
||||
).perform).to eq("Avatar: ![avatar](#{user1.avatar_template_url.gsub("{size}", "120")})")
|
||||
).perform).to eq("Avatar: ![avatar](#{user1.avatar_template_url.gsub("{size}", "144")})")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -13,15 +13,6 @@ describe CustomWizard::Subscription do
|
|||
}
|
||||
}
|
||||
|
||||
def undefine_client_classes
|
||||
Object.send(:remove_const, :SubscriptionClient) if Object.constants.include?(:SubscriptionClient)
|
||||
Object.send(:remove_const, :SubscriptionClientSubscription) if Object.constants.include?(:SubscriptionClientSubscription)
|
||||
end
|
||||
|
||||
def define_client_classes
|
||||
load File.expand_path("#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/subscription_client.rb", __FILE__)
|
||||
end
|
||||
|
||||
after do
|
||||
undefine_client_classes
|
||||
end
|
||||
|
@ -33,7 +24,7 @@ describe CustomWizard::Subscription do
|
|||
|
||||
context "without a subscription client" do
|
||||
it "is not subscribed" do
|
||||
expect(described_class.subscribed?).to eq(false)
|
||||
expect(described_class.subscribed?).to eq(true)
|
||||
end
|
||||
|
||||
it "has none type" do
|
||||
|
@ -61,7 +52,7 @@ describe CustomWizard::Subscription do
|
|||
|
||||
context "without a subscription" do
|
||||
before do
|
||||
SubscriptionClient.stubs(:find_subscriptions).returns(nil)
|
||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(nil)
|
||||
end
|
||||
|
||||
it "has none type" do
|
||||
|
@ -78,29 +69,30 @@ describe CustomWizard::Subscription do
|
|||
end
|
||||
|
||||
context "with subscriptions" do
|
||||
def get_subscription_result(product_id)
|
||||
result = SubscriptionClient::Subscriptions::Result.new
|
||||
def get_subscription_result(product_ids)
|
||||
result = DiscourseSubscriptionClient::Subscriptions::Result.new
|
||||
result.supplier = SubscriptionClientSupplier.new(product_slugs)
|
||||
result.resource = SubscriptionClientResource.new
|
||||
result.subscriptions = [SubscriptionClientSubscription.new(product_id)]
|
||||
result.subscriptions = product_ids.map { |product_id| SubscriptionClientSubscription.new(product_id) }
|
||||
result.products = product_slugs
|
||||
result
|
||||
end
|
||||
let!(:business_subscription_result) { get_subscription_result(business_product_id) }
|
||||
let!(:standard_subscription_result) { get_subscription_result(standard_product_id) }
|
||||
let!(:community_subscription_result) { get_subscription_result(community_product_id) }
|
||||
let!(:business_subscription_result) { get_subscription_result([business_product_id]) }
|
||||
let!(:standard_subscription_result) { get_subscription_result([standard_product_id]) }
|
||||
let!(:community_subscription_result) { get_subscription_result([community_product_id]) }
|
||||
let!(:multiple_subscription_result) { get_subscription_result([community_product_id, business_product_id]) }
|
||||
|
||||
it "handles mapped values" do
|
||||
SubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
|
||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
|
||||
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(true)
|
||||
|
||||
SubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
|
||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
|
||||
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(false)
|
||||
end
|
||||
|
||||
context "with a standard subscription" do
|
||||
before do
|
||||
SubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
|
||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
|
||||
end
|
||||
|
||||
it "detects standard type" do
|
||||
|
@ -118,7 +110,7 @@ describe CustomWizard::Subscription do
|
|||
|
||||
context "with a business subscription" do
|
||||
before do
|
||||
SubscriptionClient.stubs(:find_subscriptions).returns(business_subscription_result)
|
||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(business_subscription_result)
|
||||
end
|
||||
|
||||
it "detects business type" do
|
||||
|
@ -132,7 +124,7 @@ describe CustomWizard::Subscription do
|
|||
|
||||
context "with a community subscription" do
|
||||
before do
|
||||
SubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
|
||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
|
||||
end
|
||||
|
||||
it "detects community type" do
|
||||
|
@ -143,6 +135,40 @@ describe CustomWizard::Subscription do
|
|||
expect(described_class.includes?(:action, :type, 'create_category')).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context "with multiple subscriptions" do
|
||||
before do
|
||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(multiple_subscription_result)
|
||||
end
|
||||
|
||||
it "detects correct type in hierarchy" do
|
||||
expect(described_class.type).to eq(:business)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "with environment variable" do
|
||||
before do
|
||||
ENV["CUSTOM_WIZARD_PRODUCT_SLUG"] = "standard"
|
||||
end
|
||||
|
||||
after do
|
||||
ENV["CUSTOM_WIZARD_PRODUCT_SLUG"] = nil
|
||||
end
|
||||
|
||||
it "enables the relevant subscription" do
|
||||
expect(described_class.type).to eq(:standard)
|
||||
end
|
||||
|
||||
context "with a subscription" do
|
||||
before do
|
||||
enable_subscription("business")
|
||||
end
|
||||
|
||||
it "respects the subscription" do
|
||||
expect(described_class.type).to eq(:business)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -226,6 +226,21 @@ describe CustomWizard::Wizard do
|
|||
end
|
||||
end
|
||||
|
||||
context "with subscription and restart upon revisit" do
|
||||
before do
|
||||
enable_subscription("standard")
|
||||
@wizard.restart_on_revisit = true
|
||||
CustomWizard::Template.save(@wizard.as_json)
|
||||
end
|
||||
|
||||
it "returns to step 1 if option to clear submissions on each visit is set" do
|
||||
append_steps
|
||||
expect(@wizard.unfinished?).to eq(true)
|
||||
progress_step('step_1')
|
||||
expect(@wizard.start).to eq('step_1')
|
||||
end
|
||||
end
|
||||
|
||||
context "with subscription and guest wizard" do
|
||||
before do
|
||||
enable_subscription("standard")
|
||||
|
|
45
spec/extensions/topic_extension_spec.rb
Normale Datei
45
spec/extensions/topic_extension_spec.rb
Normale Datei
|
@ -0,0 +1,45 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
describe Topic, type: :model do
|
||||
fab!(:category_with_wizard) do
|
||||
Fabricate(:category, custom_fields: { create_topic_wizard: 'true' })
|
||||
end
|
||||
fab!(:category_without_wizard) { Fabricate(:category) }
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
let(:valid_attrs) { Fabricate.attributes_for(:topic) }
|
||||
|
||||
context 'with a create_topic_wizard custom field in the category' do
|
||||
it 'will not allow creating a topic directly' do
|
||||
expect do
|
||||
TopicCreator.create(
|
||||
user,
|
||||
Guardian.new(user),
|
||||
valid_attrs.merge(
|
||||
title: 'A valid and sufficiently long title for testing',
|
||||
category: category_with_wizard.id,
|
||||
raw: 'hello this is a test topic with category with custom fields'
|
||||
)
|
||||
)
|
||||
end.to raise_error(
|
||||
Discourse::InvalidParameters,
|
||||
'Category not allowed for topic creation.'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
context 'without a create_topic_wizard custom field in the category' do
|
||||
it 'will allow creating a topic directly' do
|
||||
expect do
|
||||
TopicCreator.create(
|
||||
user,
|
||||
Guardian.new(user),
|
||||
valid_attrs.merge(
|
||||
category: category_without_wizard.id,
|
||||
title: 'Another valid and sufficiently long title for testing',
|
||||
raw: 'This is the body of a valid topic'
|
||||
)
|
||||
)
|
||||
end.not_to raise_error
|
||||
end
|
||||
end
|
||||
end
|
4
spec/fixtures/subscription_client.rb
gevendort
4
spec/fixtures/subscription_client.rb
gevendort
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module SubscriptionClient
|
||||
module DiscourseSubscriptionClient
|
||||
def self.find_subscriptions(resource_name)
|
||||
end
|
||||
end
|
||||
|
@ -24,7 +24,7 @@ class SubscriptionClientSubscription
|
|||
end
|
||||
end
|
||||
|
||||
module SubscriptionClient
|
||||
module DiscourseSubscriptionClient
|
||||
class Subscriptions
|
||||
class Result
|
||||
attr_accessor :supplier,
|
||||
|
|
|
@ -12,3 +12,23 @@ def enable_subscription(type)
|
|||
CustomWizard::Subscription.stubs("#{type}?".to_sym).returns(true)
|
||||
CustomWizard::Subscription.any_instance.stubs("#{type}?".to_sym).returns(true)
|
||||
end
|
||||
|
||||
def disable_subscriptions
|
||||
%w[
|
||||
standard
|
||||
business
|
||||
community
|
||||
].each do |type|
|
||||
CustomWizard::Subscription.stubs("#{type}?".to_sym).returns(false)
|
||||
CustomWizard::Subscription.any_instance.stubs("#{type}?".to_sym).returns(false)
|
||||
end
|
||||
end
|
||||
|
||||
def undefine_client_classes
|
||||
Object.send(:remove_const, :DiscourseSubscriptionClient) if Object.constants.include?(:DiscourseSubscriptionClient)
|
||||
Object.send(:remove_const, :SubscriptionClientSubscription) if Object.constants.include?(:SubscriptionClientSubscription)
|
||||
end
|
||||
|
||||
def define_client_classes
|
||||
load File.expand_path("#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/subscription_client.rb", __FILE__)
|
||||
end
|
||||
|
|
|
@ -14,18 +14,23 @@ describe CustomWizard::AdminController do
|
|||
end
|
||||
|
||||
context "without a subscription" do
|
||||
before do
|
||||
disable_subscriptions
|
||||
define_client_classes
|
||||
end
|
||||
|
||||
it "returns the right subscription details" do
|
||||
get "/admin/wizards.json"
|
||||
expect(response.parsed_body["subscribed"]).to eq(false)
|
||||
expect(response.parsed_body["subscription_attributes"]).to eq(CustomWizard::Subscription.attributes.as_json)
|
||||
expect(response.parsed_body["subscription_client_installed"]).to eq(false)
|
||||
expect(response.parsed_body["subscription_client_installed"]).to eq(true)
|
||||
end
|
||||
end
|
||||
|
||||
context "with a subscription" do
|
||||
before do
|
||||
enable_subscription("standard")
|
||||
load File.expand_path("#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/subscription_client.rb", __FILE__)
|
||||
define_client_classes
|
||||
end
|
||||
|
||||
it "returns the right subscription details" do
|
||||
|
|
|
@ -13,8 +13,8 @@ describe CustomWizard::AdminManagerController do
|
|||
template_3["id"] = 'super_mega_fun_wizard_3'
|
||||
@template_array = [template, template_2, template_3]
|
||||
|
||||
FileUtils.mkdir_p(file_from_fixtures_tmp_folder) unless Dir.exist?(file_from_fixtures_tmp_folder)
|
||||
@tmp_file_path = File.join(file_from_fixtures_tmp_folder, SecureRandom.hex << 'wizards.json')
|
||||
FileUtils.mkdir_p(concurrency_safe_tmp_dir) unless Dir.exist?(concurrency_safe_tmp_dir)
|
||||
@tmp_file_path = File.join(concurrency_safe_tmp_dir, SecureRandom.hex << 'wizards.json')
|
||||
File.write(@tmp_file_path, @template_array.to_json)
|
||||
end
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ describe CustomWizard::AdminWizardController do
|
|||
fab!(:user1) { Fabricate(:user) }
|
||||
fab!(:user2) { Fabricate(:user) }
|
||||
let(:template) { get_wizard_fixture("wizard") }
|
||||
let(:category) { Fabricate(:category, custom_fields: { create_topic_wizard: template['name'].parameterize(separator: "_") }) }
|
||||
|
||||
before do
|
||||
CustomWizard::Template.save(template, skip_jobs: true)
|
||||
|
@ -39,10 +40,12 @@ describe CustomWizard::AdminWizardController do
|
|||
expect(response.parsed_body['steps'].length).to eq(3)
|
||||
end
|
||||
|
||||
it "removes wizard templates" do
|
||||
it "removes wizard templates whilst making sure create_topic_wizard settings for that wizard are removed from Categories" do
|
||||
expect(CategoryCustomField.find_by(category_id: category.id, name: 'create_topic_wizard', value: template['name'].parameterize(separator: "_"))).not_to eq(nil)
|
||||
delete "/admin/wizards/wizard/#{template['id']}.json"
|
||||
expect(response.status).to eq(200)
|
||||
expect(CustomWizard::Template.exists?(template['id'])).to eq(false)
|
||||
expect(CategoryCustomField.find_by(name: 'create_topic_wizard', value: template['name'].parameterize(separator: "_"))).to eq(nil)
|
||||
end
|
||||
|
||||
it "saves wizard templates" do
|
||||
|
|
|
@ -24,7 +24,7 @@ describe CustomWizard::SubmissionSerializer do
|
|||
|
||||
it 'should return submission attributes' do
|
||||
wizard = CustomWizard::Wizard.create(template_json["id"])
|
||||
list = CustomWizard::Submission.list(wizard, page: 0)
|
||||
list = CustomWizard::Submission.list(wizard, page: 0, order_by: 'id')
|
||||
|
||||
json_array = ActiveModel::ArraySerializer.new(
|
||||
list.submissions,
|
||||
|
|
358
test/javascripts/acceptance/admin-custom-fields-unsubscribed-test.js
Normale Datei
358
test/javascripts/acceptance/admin-custom-fields-unsubscribed-test.js
Normale Datei
|
@ -0,0 +1,358 @@
|
|||
import {
|
||||
acceptance,
|
||||
query,
|
||||
visible,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, fillIn, findAll, visit, waitUntil } from "@ember/test-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import {
|
||||
getCustomFields,
|
||||
getUnsubscribedAdminWizards,
|
||||
getWizard,
|
||||
} from "../helpers/admin-wizard";
|
||||
import { Promise } from "rsvp";
|
||||
|
||||
acceptance("Admin | Custom Fields Unsubscribed", function (needs) {
|
||||
needs.user();
|
||||
needs.settings({
|
||||
custom_wizard_enabled: true,
|
||||
available_locales: JSON.stringify([{ name: "English", value: "en" }]),
|
||||
});
|
||||
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/admin/wizards/wizard", () => {
|
||||
return helper.response(getWizard);
|
||||
});
|
||||
server.get("/admin/wizards", () => {
|
||||
return helper.response(getUnsubscribedAdminWizards);
|
||||
});
|
||||
server.get("/admin/wizards/custom-fields", () => {
|
||||
return helper.response(getCustomFields);
|
||||
});
|
||||
server.put("/admin/wizards/custom-fields", () => {
|
||||
return helper.response({ success: "OK" });
|
||||
});
|
||||
server.delete("/admin/wizards/custom-fields/topic_custom_field", () => {
|
||||
return helper.response({ success: "OK" });
|
||||
});
|
||||
});
|
||||
|
||||
async function selectTypeAndSerializerAndFillInName(
|
||||
type,
|
||||
serializer,
|
||||
name,
|
||||
summaryName
|
||||
) {
|
||||
const typeDropdown = selectKit(
|
||||
`.admin-wizard-container details:has(summary[name="${summaryName}"])`
|
||||
);
|
||||
await typeDropdown.expand();
|
||||
await click(
|
||||
`.select-kit-collection li[data-value="${type.toLowerCase()}"]`
|
||||
);
|
||||
|
||||
const serializerDropdown = selectKit(
|
||||
".admin-wizard-container details.multi-select"
|
||||
);
|
||||
await serializerDropdown.expand();
|
||||
await click(
|
||||
`.select-kit-collection li[data-value="${serializer
|
||||
.toLowerCase()
|
||||
.replace(/ /g, "_")}"]`
|
||||
);
|
||||
|
||||
await fillIn(
|
||||
".admin-wizard-container input",
|
||||
name.toLowerCase().replace(/ /g, "_")
|
||||
);
|
||||
}
|
||||
|
||||
async function waitForSaveMessage() {
|
||||
// Wait for the "Saved custom field" message to appear
|
||||
await waitUntil(
|
||||
() =>
|
||||
document.querySelector(".message-content")?.innerText ===
|
||||
"Saved custom field",
|
||||
{ timeout: 5000 }
|
||||
);
|
||||
|
||||
// Wait for the message to change back to the original text
|
||||
await waitUntil(
|
||||
() =>
|
||||
document.querySelector(".message-content")?.innerText ===
|
||||
"View, create, edit and destroy custom fields",
|
||||
{ timeout: 15000 }
|
||||
);
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
}
|
||||
|
||||
test("Navigate to custom fields tab", async (assert) => {
|
||||
await visit("/admin/wizards/custom-fields");
|
||||
assert.ok(find("table"));
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length === 4,
|
||||
"Display loaded custom fields"
|
||||
);
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes(
|
||||
"View, create, edit and destroy custom fields"
|
||||
),
|
||||
"it displays wizard message"
|
||||
);
|
||||
});
|
||||
test("view available custom fields for unsubscribed plan", async (assert) => {
|
||||
await visit("/admin/wizards/custom-fields");
|
||||
await click(".admin-wizard-controls .btn-icon-text");
|
||||
assert.ok(
|
||||
visible(".wizard-subscription-selector"),
|
||||
"custom field class is present"
|
||||
);
|
||||
assert.ok(
|
||||
visible(".wizard-subscription-selector-header"),
|
||||
"custom field type is present"
|
||||
);
|
||||
assert.ok(visible(".input"), "custom field name is present");
|
||||
assert.ok(visible(".multi-select"), "custom field serializer is present");
|
||||
assert.ok(visible(".actions"), "custom field action buttons are present");
|
||||
|
||||
const dropdown1 = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"])'
|
||||
);
|
||||
await dropdown1.expand();
|
||||
let enabledOptions1 = findAll(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"]) ul li:not(.disabled)'
|
||||
);
|
||||
let disabledOptions1 = findAll(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"]) ul li.disabled'
|
||||
);
|
||||
assert.equal(
|
||||
enabledOptions1.length,
|
||||
2,
|
||||
"There are two enabled options for class fields"
|
||||
);
|
||||
assert.equal(
|
||||
disabledOptions1.length,
|
||||
2,
|
||||
"There are two disabled options for class fields"
|
||||
);
|
||||
const dropdown2 = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a type"])'
|
||||
);
|
||||
await dropdown2.expand();
|
||||
let enabledOptions2 = findAll(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a type"]) ul li:not(.disabled)'
|
||||
);
|
||||
let disabledOptions2 = findAll(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a type"]) ul li.disabled'
|
||||
);
|
||||
assert.equal(
|
||||
enabledOptions2.length,
|
||||
3,
|
||||
"There are three enabled options for type"
|
||||
);
|
||||
assert.equal(
|
||||
disabledOptions2.length,
|
||||
1,
|
||||
"There is one disabled option for type"
|
||||
);
|
||||
});
|
||||
test("change custom fields for unsubscribed plan", async (assert) => {
|
||||
await visit("/admin/wizards/custom-fields");
|
||||
await click(".admin-wizard-controls .btn-icon-text");
|
||||
|
||||
const dropdown1 = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"])'
|
||||
);
|
||||
await dropdown1.expand();
|
||||
await click('.select-kit-collection li[data-value="topic"]');
|
||||
const serializerDropdown = selectKit(
|
||||
".admin-wizard-container details.multi-select"
|
||||
);
|
||||
await serializerDropdown.expand();
|
||||
let enabledOptions1 = findAll(
|
||||
".admin-wizard-container details.multi-select ul li"
|
||||
);
|
||||
assert.equal(
|
||||
enabledOptions1.length,
|
||||
2,
|
||||
"There are two enabled options in the serializer dropdown for Topic"
|
||||
);
|
||||
await serializerDropdown.collapse();
|
||||
const dropdown2 = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Topic"])'
|
||||
);
|
||||
await dropdown2.expand();
|
||||
await click('.select-kit-collection li[data-value="post"]');
|
||||
await serializerDropdown.expand();
|
||||
let enabledOptions2 = findAll(
|
||||
".admin-wizard-container details.multi-select ul li"
|
||||
);
|
||||
assert.equal(
|
||||
enabledOptions2.length,
|
||||
1,
|
||||
"There is one enabled option in the serializer dropdown for Post"
|
||||
);
|
||||
});
|
||||
|
||||
test("Create Topic and Post custom fields", async (assert) => {
|
||||
await visit("/admin/wizards/custom-fields");
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length === 4,
|
||||
"Display loaded custom fields"
|
||||
);
|
||||
await click(".admin-wizard-controls .btn-icon-text");
|
||||
|
||||
const dropdownTopic = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"])'
|
||||
);
|
||||
await dropdownTopic.expand();
|
||||
await click('.select-kit-collection li[data-value="topic"]');
|
||||
|
||||
await selectTypeAndSerializerAndFillInName(
|
||||
"String",
|
||||
"Topic View",
|
||||
"Topic Custom Field",
|
||||
"Filter by: Select a type"
|
||||
);
|
||||
|
||||
await click(".actions .save");
|
||||
// Wait for the "Saved custom field" message to appear
|
||||
await waitForSaveMessage();
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(1) label"
|
||||
).innerText.includes("topic"),
|
||||
"Topic custom field is displayed"
|
||||
);
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(3) label"
|
||||
).innerText.includes("topic_custom_field"),
|
||||
"Topic custom field name is displayed"
|
||||
);
|
||||
|
||||
await click(".admin-wizard-controls .btn-icon-text");
|
||||
|
||||
const dropdownPost = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"])'
|
||||
);
|
||||
await dropdownPost.expand();
|
||||
await click('.select-kit-collection li[data-value="post"]');
|
||||
|
||||
await selectTypeAndSerializerAndFillInName(
|
||||
"Boolean",
|
||||
"Post",
|
||||
"Post Custom Field",
|
||||
"Filter by: Select a type"
|
||||
);
|
||||
|
||||
await click(".actions .save");
|
||||
// Wait for the "Saved custom field" message to appear
|
||||
await waitForSaveMessage();
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(1) label"
|
||||
).innerText.includes("post"),
|
||||
"Post custom field is displayed"
|
||||
);
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(3) label"
|
||||
).innerText.includes("post_custom_field"),
|
||||
"Post custom field name is displayed"
|
||||
);
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length === 6,
|
||||
"Display added custom fields"
|
||||
);
|
||||
});
|
||||
test("Update Topic custom field", async (assert) => {
|
||||
await visit("/admin/wizards/custom-fields");
|
||||
await click(".admin-wizard-controls .btn-icon-text");
|
||||
const dropdownTopic = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"])'
|
||||
);
|
||||
await dropdownTopic.expand();
|
||||
await click('.select-kit-collection li[data-value="topic"]');
|
||||
await selectTypeAndSerializerAndFillInName(
|
||||
"String",
|
||||
"Topic View",
|
||||
"Topic Custom Field",
|
||||
"Filter by: Select a type"
|
||||
);
|
||||
await click(".actions .save");
|
||||
await waitForSaveMessage();
|
||||
await click(".admin-wizard-container tbody tr:first-child button");
|
||||
await selectTypeAndSerializerAndFillInName(
|
||||
"Boolean",
|
||||
"Topic List Item",
|
||||
"Updated Topic Custom Field",
|
||||
"Filter by: String"
|
||||
);
|
||||
await click(".admin-wizard-container tbody tr:first-child .save");
|
||||
await waitForSaveMessage();
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(1) label"
|
||||
).innerText.includes("topic"),
|
||||
"Topic custom field is displayed"
|
||||
);
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(2) label"
|
||||
).innerText.includes("boolean"),
|
||||
"Updated Type is displayed"
|
||||
);
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(3) label"
|
||||
).innerText.includes("updated_topic_custom_field"),
|
||||
"Updated Topic custom field name is displayed"
|
||||
);
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(4)"
|
||||
).innerText.includes("topic_view"),
|
||||
"Original Serializer is displayed"
|
||||
);
|
||||
assert.ok(
|
||||
query(
|
||||
".admin-wizard-container tbody tr:first-child td:nth-child(4)"
|
||||
).innerText.includes("topic_list_item"),
|
||||
"Updated Serializer is displayed"
|
||||
);
|
||||
});
|
||||
test("Delete Topic custom field", async (assert) => {
|
||||
await visit("/admin/wizards/custom-fields");
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length === 4,
|
||||
"Display loaded custom fields"
|
||||
);
|
||||
await click(".admin-wizard-controls .btn-icon-text");
|
||||
|
||||
const dropdownTopic = selectKit(
|
||||
'.admin-wizard-container details:has(summary[name="Filter by: Select a class"])'
|
||||
);
|
||||
await dropdownTopic.expand();
|
||||
await click('.select-kit-collection li[data-value="topic"]');
|
||||
await selectTypeAndSerializerAndFillInName(
|
||||
"String",
|
||||
"Topic View",
|
||||
"Topic Custom Field",
|
||||
"Filter by: Select a type"
|
||||
);
|
||||
await click(".actions .save");
|
||||
await waitForSaveMessage();
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length === 5,
|
||||
"Display added custom fields"
|
||||
);
|
||||
await click(".admin-wizard-container tbody tr:first-child button");
|
||||
await click(".actions .destroy");
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length === 4,
|
||||
"Display custom fields without deleted fields"
|
||||
);
|
||||
});
|
||||
});
|
69
test/javascripts/acceptance/admin-logs-test.js
Normale Datei
69
test/javascripts/acceptance/admin-logs-test.js
Normale Datei
|
@ -0,0 +1,69 @@
|
|||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, findAll, visit } from "@ember/test-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import {
|
||||
getUnsubscribedAdminWizards,
|
||||
getWizard,
|
||||
getWizardTestingLog,
|
||||
} from "../helpers/admin-wizard";
|
||||
|
||||
acceptance("Admin | Logs", function (needs) {
|
||||
needs.user();
|
||||
needs.settings({
|
||||
custom_wizard_enabled: true,
|
||||
available_locales: JSON.stringify([{ name: "English", value: "en" }]),
|
||||
});
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/admin/wizards/logs", () => {
|
||||
return helper.response([
|
||||
{ id: "this_is_testing_wizard", name: "This is testing wizard" },
|
||||
]);
|
||||
});
|
||||
server.get("/admin/wizards/logs/this_is_testing_wizard", () => {
|
||||
return helper.response(getWizardTestingLog);
|
||||
});
|
||||
server.get("/admin/wizards", () => {
|
||||
return helper.response(getUnsubscribedAdminWizards);
|
||||
});
|
||||
server.get("/admin/wizards/wizard", () => {
|
||||
return helper.response(getWizard);
|
||||
});
|
||||
});
|
||||
test("viewing logs fields tab", async (assert) => {
|
||||
await visit("/admin/wizards/logs");
|
||||
const wizards = selectKit(".select-kit");
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes(
|
||||
"Select a wizard to see its logs"
|
||||
),
|
||||
"it displays logs message"
|
||||
);
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes("Select a wizard"),
|
||||
"it displays list of logs"
|
||||
);
|
||||
await wizards.expand();
|
||||
await wizards.selectRowByValue("this_is_testing_wizard");
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes(
|
||||
"View recent logs for wizards on the forum"
|
||||
),
|
||||
"it displays logs for a selected wizard"
|
||||
);
|
||||
assert.ok(find("table"));
|
||||
assert.ok(findAll("table tbody tr").length === 2, "Displays logs list");
|
||||
|
||||
await click(".refresh.btn");
|
||||
assert.ok(find("table"));
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length === 2,
|
||||
"Refresh button works correctly"
|
||||
);
|
||||
|
||||
await wizards.expand();
|
||||
await click('[data-name="Select a wizard"]');
|
||||
const wizardContainerDiv = find(".admin-wizard-container");
|
||||
assert.ok(wizardContainerDiv.children().length === 0, "the div is empty");
|
||||
});
|
||||
});
|
112
test/javascripts/acceptance/admin-manager-test.js
Normale Datei
112
test/javascripts/acceptance/admin-manager-test.js
Normale Datei
|
@ -0,0 +1,112 @@
|
|||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, find, findAll, visit, waitUntil } from "@ember/test-helpers";
|
||||
import {
|
||||
getUnsubscribedAdminWizards,
|
||||
getWizard,
|
||||
getWizardTestingLog,
|
||||
} from "../helpers/admin-wizard";
|
||||
import { Promise } from "rsvp";
|
||||
|
||||
acceptance("Admin | Manager", function (needs) {
|
||||
needs.user();
|
||||
needs.settings({
|
||||
custom_wizard_enabled: true,
|
||||
available_locales: JSON.stringify([{ name: "English", value: "en" }]),
|
||||
});
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/admin/wizards/manager/this_is_testing_wizard", () => {
|
||||
return helper.response(getWizardTestingLog);
|
||||
});
|
||||
server.get("/admin/wizards", () => {
|
||||
return helper.response(getUnsubscribedAdminWizards);
|
||||
});
|
||||
server.get("/admin/wizards/wizard", () => {
|
||||
return helper.response(getWizard);
|
||||
});
|
||||
server.delete("/admin/wizards/manager/destroy", () => {
|
||||
return helper.response({
|
||||
success: "OK",
|
||||
destroyed: [
|
||||
{ id: "this_is_testing_wizard", name: "This is testing wizard" },
|
||||
],
|
||||
failures: [],
|
||||
});
|
||||
});
|
||||
});
|
||||
async function waitForDestructionAndResetMessage() {
|
||||
await waitUntil(
|
||||
() =>
|
||||
document.querySelector(".message-content")?.innerText ===
|
||||
"Destruction complete",
|
||||
{ timeout: 5000 }
|
||||
);
|
||||
|
||||
await waitUntil(
|
||||
() =>
|
||||
document.querySelector(".message-content")?.innerText ===
|
||||
"Export, import or destroy wizards" &&
|
||||
!document.querySelector(".message-block.primary ul") &&
|
||||
!find(".message-block.primary svg").classList.contains(
|
||||
"d-icon-check-circle"
|
||||
),
|
||||
{ timeout: 15000 }
|
||||
);
|
||||
// Wait an additional second after the conditions are met
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
}
|
||||
|
||||
test("viewing manager fields content", async (assert) => {
|
||||
await visit("/admin/wizards/manager");
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes(
|
||||
"Export, import or destroy wizards"
|
||||
),
|
||||
"it displays manager message"
|
||||
);
|
||||
assert.ok(
|
||||
find('table tr[data-wizard-id="this-is-testing-wizard"]'),
|
||||
"table shows the wizard content list"
|
||||
);
|
||||
|
||||
const checkbox = findAll(
|
||||
'table tr[data-wizard-id="this-is-testing-wizard"] input[type="checkbox"]'
|
||||
);
|
||||
const exportCheck = checkbox[0];
|
||||
const destroyCheck = checkbox[1];
|
||||
|
||||
const exportButton = find("#export-button");
|
||||
assert.ok(
|
||||
exportButton.hasAttribute("disabled"),
|
||||
"the export button is disabled when export checkbox is unchecked"
|
||||
);
|
||||
|
||||
await click(exportCheck);
|
||||
assert.ok(
|
||||
!exportButton.hasAttribute("disabled"),
|
||||
"the export button is enabled when export checkbox is clicked"
|
||||
);
|
||||
await click(exportCheck);
|
||||
assert.ok(
|
||||
exportButton.hasAttribute("disabled"),
|
||||
"the export button is disabled when export checkbox is unchecked"
|
||||
);
|
||||
const destroyButton = find("#destroy-button");
|
||||
assert.ok(
|
||||
destroyButton.hasAttribute("disabled"),
|
||||
"the destroy button is disabled when destroy checkbox is unchecked"
|
||||
);
|
||||
await click(destroyCheck);
|
||||
assert.ok(
|
||||
!destroyButton.hasAttribute("disabled"),
|
||||
"the destroy button is enabled when destroy checkbox is clicked"
|
||||
);
|
||||
await click("#destroy-button");
|
||||
|
||||
assert.notOk(
|
||||
find('table tr[data-wizard-id="this-is-testing-wizard"]'),
|
||||
"the wizard row is removed after destroy button is clicked"
|
||||
);
|
||||
await waitForDestructionAndResetMessage();
|
||||
});
|
||||
});
|
229
test/javascripts/acceptance/admin-submissions-test.js
Normale Datei
229
test/javascripts/acceptance/admin-submissions-test.js
Normale Datei
|
@ -0,0 +1,229 @@
|
|||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, findAll, visit } from "@ember/test-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import {
|
||||
getAnotherWizardSubmission,
|
||||
getUnsubscribedAdminWizards,
|
||||
getWizard,
|
||||
getWizardSubmissions,
|
||||
} from "../helpers/admin-wizard";
|
||||
|
||||
acceptance("Admin | Submissions", function (needs) {
|
||||
needs.user();
|
||||
needs.settings({
|
||||
custom_wizard_enabled: true,
|
||||
available_locales: JSON.stringify([{ name: "English", value: "en" }]),
|
||||
});
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/admin/wizards/submissions", () => {
|
||||
return helper.response([
|
||||
{ id: "this_is_testing_wizard", name: "This is testing wizard" },
|
||||
{ id: "another_wizard", name: "another wizard" },
|
||||
]);
|
||||
});
|
||||
server.get("/admin/wizards/submissions/this_is_testing_wizard", () => {
|
||||
return helper.response(getWizardSubmissions);
|
||||
});
|
||||
server.get("/admin/wizards/submissions/another_wizard", () => {
|
||||
return helper.response(getAnotherWizardSubmission);
|
||||
});
|
||||
server.get("/admin/wizards", () => {
|
||||
return helper.response(getUnsubscribedAdminWizards);
|
||||
});
|
||||
server.get("/admin/wizards/wizard", () => {
|
||||
return helper.response(getWizard);
|
||||
});
|
||||
});
|
||||
test("View submissions fields tab and content", async (assert) => {
|
||||
await visit("/admin/wizards/submissions");
|
||||
const wizards = selectKit(".select-kit");
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes(
|
||||
"Select a wizard to see its submissions"
|
||||
),
|
||||
"it displays submissions message"
|
||||
);
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes("Select a wizard"),
|
||||
"it displays list of wizards"
|
||||
);
|
||||
await wizards.expand();
|
||||
await wizards.selectRowByValue("this_is_testing_wizard");
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes(
|
||||
"You're viewing the submissions of the This is testing wizard"
|
||||
),
|
||||
"it displays submissions for a selected wizard"
|
||||
);
|
||||
const submissions = getWizardSubmissions.submissions; // Get submissions data from your JSON file
|
||||
const rows = findAll("table tbody tr");
|
||||
|
||||
for (let i = 0; i < submissions.length; i++) {
|
||||
const dateCell = rows[i].querySelector("td:nth-child(1)");
|
||||
const userCell = rows[i].querySelector("td:nth-child(2)");
|
||||
const stepCell = rows[i].querySelector("td:nth-child(3)");
|
||||
const expectedDate = moment(submissions[i].submitted_at).format(
|
||||
"MMM D, YYYY h:mm a"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
dateCell.innerText,
|
||||
expectedDate,
|
||||
`Date is displayed correctly for submission ${i + 1}`
|
||||
);
|
||||
assert.equal(
|
||||
userCell.innerText.trim(),
|
||||
submissions[i].user.username,
|
||||
`User is displayed correctly for submission ${i + 1}`
|
||||
);
|
||||
assert.equal(
|
||||
stepCell.innerText.trim().split("\n")[0],
|
||||
submissions[i].fields.step_1_field_1.value,
|
||||
`Step is displayed correctly for submission ${i + 1}`
|
||||
);
|
||||
}
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length >= 1,
|
||||
"Displays submissions list"
|
||||
);
|
||||
|
||||
await wizards.expand();
|
||||
await click('[data-name="Select a wizard"]');
|
||||
const wizardContainerDiv = find(".admin-wizard-container");
|
||||
assert.ok(wizardContainerDiv.children().length === 0, "the div is empty");
|
||||
});
|
||||
test("View submissions tab for another wizard with more steps", async (assert) => {
|
||||
await visit("/admin/wizards/submissions");
|
||||
const wizards = selectKit(".select-kit");
|
||||
|
||||
await wizards.expand();
|
||||
await wizards.selectRowByValue("another_wizard");
|
||||
|
||||
assert.ok(
|
||||
query(".message-content").innerText.includes(
|
||||
"You're viewing the submissions of the another wizard"
|
||||
),
|
||||
"it displays submissions for another wizard"
|
||||
);
|
||||
|
||||
const submissions = getAnotherWizardSubmission.submissions; // Get submissions data from your JSON file
|
||||
const rows = findAll("table tbody tr");
|
||||
|
||||
for (let i = 0; i < submissions.length; i++) {
|
||||
const dateCell = rows[i].querySelector("td:nth-child(1)");
|
||||
const userCell = rows[i].querySelector("td:nth-child(2)");
|
||||
const step1Cell = rows[i].querySelector("td:nth-child(3)");
|
||||
const step2Cell = rows[i].querySelector("td:nth-child(4)");
|
||||
const submission = submissions[i];
|
||||
const expectedDate = moment(submission.submitted_at).format(
|
||||
"MMM D, YYYY h:mm a"
|
||||
);
|
||||
|
||||
assert.equal(
|
||||
dateCell.innerText,
|
||||
expectedDate,
|
||||
`Date is displayed correctly for submission ${i + 1}`
|
||||
);
|
||||
assert.equal(
|
||||
userCell.innerText.trim(),
|
||||
submissions[i].user.username,
|
||||
`User is displayed correctly for submission ${i + 1}`
|
||||
);
|
||||
assert.equal(
|
||||
step1Cell.innerText.trim().split("\n")[0],
|
||||
submissions[i].fields.step_1_field_1.value,
|
||||
`Step 1 is displayed correctly for submission ${i + 1}`
|
||||
);
|
||||
assert.equal(
|
||||
step2Cell.innerText.trim().split("\n")[0],
|
||||
submissions[i].fields.step_2_field_1.value,
|
||||
`Step 2 is displayed correctly for submission ${i + 1}`
|
||||
);
|
||||
}
|
||||
|
||||
assert.ok(
|
||||
findAll("table tbody tr").length >= 1,
|
||||
"Displays submissions list for another wizard"
|
||||
);
|
||||
});
|
||||
test("Modal actions for submissions", async (assert) => {
|
||||
await visit("/admin/wizards/submissions");
|
||||
const wizards = await selectKit(".select-kit");
|
||||
await wizards.expand();
|
||||
await wizards.selectRowByValue("this_is_testing_wizard");
|
||||
|
||||
await click(".open-edit-columns-btn");
|
||||
assert.dom(".modal-inner-container").exists("Modal is displayed");
|
||||
|
||||
const userCheckbox = find(
|
||||
".edit-directory-columns-container .edit-directory-column:nth-child(2) .left-content .column-name input"
|
||||
);
|
||||
assert.ok(userCheckbox, "User checkbox is present");
|
||||
assert.ok(userCheckbox[0].checked, "User checkbox is checked by default");
|
||||
await click(userCheckbox[0]);
|
||||
assert.notOk(
|
||||
userCheckbox[0].checked,
|
||||
"User checkbox is unchecked after clicking"
|
||||
);
|
||||
|
||||
await click(".modal-footer .btn-primary");
|
||||
assert
|
||||
.dom("table thead th")
|
||||
.doesNotIncludeText("User", "User column is not displayed");
|
||||
|
||||
await click(".open-edit-columns-btn");
|
||||
const submittedAtCheckbox = find(
|
||||
".edit-directory-columns-container .edit-directory-column:nth-child(1) .left-content .column-name input"
|
||||
);
|
||||
assert.ok(submittedAtCheckbox, "Submitted At checkbox is present");
|
||||
assert.ok(
|
||||
submittedAtCheckbox[0].checked,
|
||||
"Submitted At checkbox is checked by default"
|
||||
);
|
||||
await click(submittedAtCheckbox[0]);
|
||||
|
||||
await click(".modal-footer .btn-primary");
|
||||
assert.notOk(
|
||||
submittedAtCheckbox[0].checked,
|
||||
"Submitted At checkbox is unchecked after clicking"
|
||||
);
|
||||
assert
|
||||
.dom("table thead th")
|
||||
.doesNotIncludeText(
|
||||
"Submitted At",
|
||||
"Submitted At column is not displayed"
|
||||
);
|
||||
|
||||
await click(".open-edit-columns-btn");
|
||||
await click(".modal-footer .btn-secondary");
|
||||
|
||||
assert
|
||||
.dom("table thead th:nth-child(1)")
|
||||
.hasText("Submitted At", "Submitted At column is displayed after reset");
|
||||
assert
|
||||
.dom("table thead th:nth-child(2)")
|
||||
.hasText("User", "User column is displayed after reset");
|
||||
});
|
||||
test("Download submissions", async (assert) => {
|
||||
await visit("/admin/wizards/submissions");
|
||||
const wizards = await selectKit(".select-kit");
|
||||
await wizards.expand();
|
||||
await wizards.selectRowByValue("this_is_testing_wizard");
|
||||
|
||||
const downloadLinks = findAll(".download-link");
|
||||
assert.ok(downloadLinks.length > 1, "Download links are present");
|
||||
|
||||
const downloadLink = downloadLinks[1];
|
||||
await click(downloadLink);
|
||||
|
||||
const expectedURL =
|
||||
"/admin/wizards/submissions/this_is_testing_wizard/download";
|
||||
const actualURL = new URL(downloadLink.href);
|
||||
assert.equal(
|
||||
actualURL.pathname,
|
||||
expectedURL,
|
||||
"Download link has correct URL"
|
||||
);
|
||||
});
|
||||
});
|
123
test/javascripts/acceptance/admin-wizards-api-test.js
Normale Datei
123
test/javascripts/acceptance/admin-wizards-api-test.js
Normale Datei
|
@ -0,0 +1,123 @@
|
|||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { test } from "qunit";
|
||||
import { click, currentURL, fillIn, visit } from "@ember/test-helpers";
|
||||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import {
|
||||
getBusinessAdminWizard,
|
||||
getCustomFields,
|
||||
getNewApi,
|
||||
getWizard,
|
||||
putNewApi,
|
||||
} from "../helpers/admin-wizard";
|
||||
|
||||
acceptance("Admin | API tab", function (needs) {
|
||||
needs.user();
|
||||
needs.settings({
|
||||
custom_wizard_enabled: true,
|
||||
available_locales: JSON.stringify([{ name: "English", value: "en" }]),
|
||||
});
|
||||
|
||||
needs.pretender((server, helper) => {
|
||||
server.get("/admin/wizards/wizard", () => {
|
||||
return helper.response(getWizard);
|
||||
});
|
||||
server.get("/admin/wizards", () => {
|
||||
return helper.response(getBusinessAdminWizard);
|
||||
});
|
||||
server.get("/admin/wizards/custom-fields", () => {
|
||||
return helper.response(getCustomFields);
|
||||
});
|
||||
server.get("/admin/wizards/api", () => {
|
||||
return helper.response([
|
||||
{
|
||||
name: "new_api",
|
||||
title: "new API",
|
||||
endpoints: [{ id: "59e3b6", name: "ag" }],
|
||||
},
|
||||
]);
|
||||
});
|
||||
server.get("/admin/customize/user_fields", () => {
|
||||
return helper.response({ user_fields: [] });
|
||||
});
|
||||
server.put("/admin/wizards/api/new_api", () => {
|
||||
return helper.response(putNewApi);
|
||||
});
|
||||
server.get("/admin/wizards/api/new_api", () => {
|
||||
return helper.response(getNewApi);
|
||||
});
|
||||
});
|
||||
|
||||
test("Visit API tab and fill data", async function (assert) {
|
||||
await visit("/admin/wizards/api");
|
||||
const list = find(".admin-controls li");
|
||||
const count = list.length;
|
||||
assert.equal(count, 6, "There should be 6 admin tabs");
|
||||
|
||||
// create new api
|
||||
await click(".admin-wizard-controls button");
|
||||
assert.ok(
|
||||
query(".wizard-header.large").innerText.includes("New API"),
|
||||
"it displays API creation message"
|
||||
);
|
||||
assert.equal(
|
||||
currentURL(),
|
||||
"/admin/wizards/api/create",
|
||||
"clicking the button navigates to the correct URL"
|
||||
);
|
||||
// fill data
|
||||
await fillIn('.metadata input[placeholder="Display name"]', "new API");
|
||||
await fillIn('.metadata input[placeholder="Underscored"]', "new_api");
|
||||
const fieldTypeDropdown = selectKit(
|
||||
".wizard-api-authentication .settings .control-group.auth-type .select-kit"
|
||||
);
|
||||
await fieldTypeDropdown.expand();
|
||||
await fieldTypeDropdown.selectRowByValue("basic");
|
||||
await fillIn(
|
||||
".wizard-api-authentication .settings .control-group:nth-child(3) .controls input",
|
||||
"some_username"
|
||||
);
|
||||
await fillIn(
|
||||
".wizard-api-authentication .settings .control-group:nth-child(4) .controls input",
|
||||
"some_password"
|
||||
);
|
||||
await click(".wizard-api-endpoints button");
|
||||
await fillIn(
|
||||
'.wizard-api-endpoints .endpoint .top input[placeholder="Endpoint name"]',
|
||||
"endpoint_name"
|
||||
);
|
||||
await fillIn(
|
||||
'.wizard-api-endpoints .endpoint .top input[placeholder="Enter a url"]',
|
||||
"https://test.api.com"
|
||||
);
|
||||
const endpointMethodDropdown = await selectKit(
|
||||
'.wizard-api-endpoints .endpoint .bottom details:has(summary[name="Filter by: Select a method"])'
|
||||
);
|
||||
await endpointMethodDropdown.expand();
|
||||
await endpointMethodDropdown.selectRowByValue("POST");
|
||||
|
||||
const contentTypeDropdown = await selectKit(
|
||||
'.wizard-api-endpoints .endpoint .bottom details:has(summary[name="Filter by: Select a content type"])'
|
||||
);
|
||||
await contentTypeDropdown.expand();
|
||||
await contentTypeDropdown.selectRowByValue("application/json");
|
||||
|
||||
const successCodesDropdown = await selectKit(
|
||||
".wizard-api-endpoints .endpoint .bottom details.multi-select"
|
||||
);
|
||||
await successCodesDropdown.expand();
|
||||
await successCodesDropdown.selectRowByValue(200);
|
||||
await successCodesDropdown.selectRowByValue(100);
|
||||
|
||||
assert.strictEqual(
|
||||
successCodesDropdown.header().value(),
|
||||
"200,100",
|
||||
"group should be set"
|
||||
);
|
||||
await click(".wizard-api-header.page button.btn-primary");
|
||||
assert.equal(
|
||||
currentURL(),
|
||||
"/admin/wizards/api/new_api",
|
||||
"clicking the button navigates to the correct URL"
|
||||
);
|
||||
});
|
||||
});
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden …
In neuem Issue referenzieren