Commits vergleichen
Keine gemeinsamen Commits. „main“ und „group_user_population_fix“ haben vollständig unterschiedliche Historien.
main
...
group_user
139 geänderte Dateien mit 1925 neuen und 6785 gelöschten Zeilen
|
@ -1,3 +1,2 @@
|
||||||
3.1.999: 1f35b80f85e5fd1efb7f4851f0845700432febdc
|
|
||||||
2.7.99: e07a57e398b6b1676ab42a7e34467556fca5416b
|
2.7.99: e07a57e398b6b1676ab42a7e34467556fca5416b
|
||||||
2.5.1: bb85b3a0d2c0ab6b59bcb405731c39089ec6731c
|
2.5.1: bb85b3a0d2c0ab6b59bcb405731c39089ec6731c
|
||||||
|
|
2
.github/workflows/discourse-plugin.yml
gevendort
2
.github/workflows/discourse-plugin.yml
gevendort
|
@ -5,8 +5,6 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
schedule:
|
|
||||||
- cron: "0 0 * * *"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ci:
|
ci:
|
||||||
|
|
20
README.md
20
README.md
|
@ -4,24 +4,22 @@ The Custom Wizard Plugin lets you make forms for your Discourse forum. Better us
|
||||||
|
|
||||||
<img src="https://camo.githubusercontent.com/593432f1fc9658ffca104065668cc88fa21dffcd3002cb78ffd50c71f33a2523/68747470733a2f2f706176696c696f6e2d6173736574732e6e7963332e63646e2e6469676974616c6f6365616e7370616365732e636f6d2f706c7567696e732f77697a6172642d7265706f7369746f72792d62616e6e65722e706e67" alt="" data-canonical-src="https://pavilion-assets.nyc3.cdn.digitaloceanspaces.com/plugins/wizard-repository-banner.png" style="max-width: 100%;" width="400">
|
<img src="https://camo.githubusercontent.com/593432f1fc9658ffca104065668cc88fa21dffcd3002cb78ffd50c71f33a2523/68747470733a2f2f706176696c696f6e2d6173736574732e6e7963332e63646e2e6469676974616c6f6365616e7370616365732e636f6d2f706c7567696e732f77697a6172642d7265706f7369746f72792d62616e6e65722e706e67" alt="" data-canonical-src="https://pavilion-assets.nyc3.cdn.digitaloceanspaces.com/plugins/wizard-repository-banner.png" style="max-width: 100%;" width="400">
|
||||||
|
|
||||||
👋 Looking to report an issue? We're managing issues for this plugin using our [bug report wizard](https://coop.pavilion.tech/w/bug-report).
|
|
||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
If you're not sure how to install a plugin in Discourse, please follow the [plugin installation guide](https://meta.discourse.org/t/install-a-plugin/19157) or contact your Discourse hosting provider.
|
If you're not sure how to install a plugin in Discourse, please follow the [plugin installation guide](https://meta.discourse.org/t/install-a-plugin/19157) or contact your Discourse hosting provider.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
[Read the full documentation here](https://coop.pavilion.tech/c/82), or go directly to the relevant section
|
[Read the full documentation here](https://discourse.pluginmanager.org/c/discourse-custom-wizard/documentation), or go directly to the relevant section
|
||||||
|
|
||||||
- [Wizard Administration](https://coop.pavilion.tech/t/1602)
|
- [Wizard Administration](https://discourse.pluginmanager.org/t/wizard-administration)
|
||||||
- [Wizard Settings](https://coop.pavilion.tech/t/1614)
|
- [Wizard Settings](https://discourse.pluginmanager.org/t/wizard-settings)
|
||||||
- [Step Settings](https://coop.pavilion.tech/t/1735)
|
- [Step Settings](https://discourse.pluginmanager.org/t/step-settings)
|
||||||
- [Field Settings](https://coop.pavilion.tech/t/1580)
|
- [Field Settings](https://discourse.pluginmanager.org/t/field-settings)
|
||||||
- [Conditional Settings](https://coop.pavilion.tech/t/1673)
|
- [Conditional Settings](https://discourse.pluginmanager.org/t/conditional-settings)
|
||||||
- [Field Interpolation](https://coop.pavilion.tech/t/1557)
|
- [Field Interpolation](https://discourse.pluginmanager.org/t/field-interpolation)
|
||||||
- [Handling Dates and Times](https://coop.pavilion.tech/t/1708)
|
- [Wizard Examples and Templates](https://discourse.pluginmanager.org/t/wizard-examples-and-templates)
|
||||||
|
|
||||||
## Support
|
## Support
|
||||||
|
|
||||||
- [Report an issue](https://coop.pavilion.tech/w/bug-report)
|
- [Report a bug](https://discourse.pluginmanager.org/w/bug-report)
|
||||||
|
|
|
@ -8,7 +8,7 @@ class CustomWizard::AdminController < ::Admin::AdminController
|
||||||
subscribed: subcription.subscribed?,
|
subscribed: subcription.subscribed?,
|
||||||
subscription_type: subcription.type,
|
subscription_type: subcription.type,
|
||||||
subscription_attributes: CustomWizard::Subscription.attributes,
|
subscription_attributes: CustomWizard::Subscription.attributes,
|
||||||
subscription_client_installed: CustomWizard::Subscription.client_installed?
|
subscription_client_installed: subcription.client_installed?
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -22,12 +22,7 @@ class CustomWizard::AdminSubmissionsController < CustomWizard::AdminController
|
||||||
end
|
end
|
||||||
|
|
||||||
def download
|
def download
|
||||||
content = ActiveModel::ArraySerializer.new(
|
send_data submission_list.submissions.to_json,
|
||||||
CustomWizard::Submission.list(@wizard).submissions,
|
|
||||||
each_serializer: CustomWizard::SubmissionSerializer
|
|
||||||
)
|
|
||||||
|
|
||||||
send_data content.to_json,
|
|
||||||
filename: "#{Discourse.current_hostname}-wizard-submissions-#{@wizard.name}.json",
|
filename: "#{Discourse.current_hostname}-wizard-submissions-#{@wizard.name}.json",
|
||||||
content_type: "application/json",
|
content_type: "application/json",
|
||||||
disposition: "attachment"
|
disposition: "attachment"
|
||||||
|
|
|
@ -7,7 +7,7 @@ import userSearch from "discourse/lib/user-search";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import Handlebars from "handlebars";
|
import Handlebars from "handlebars";
|
||||||
import { isEmpty } from "@ember/utils";
|
import { isEmpty } from "@ember/utils";
|
||||||
import TextField from "discourse/components/text-field";
|
import TextField from "@ember/component/text-field";
|
||||||
|
|
||||||
const template = function (params) {
|
const template = function (params) {
|
||||||
const options = params.options;
|
const options = params.options;
|
||||||
|
|
|
@ -12,15 +12,11 @@ import { alias } from "@ember/object/computed";
|
||||||
import Site from "discourse/models/site";
|
import Site from "discourse/models/site";
|
||||||
import { uploadIcon } from "discourse/lib/uploads";
|
import { uploadIcon } from "discourse/lib/uploads";
|
||||||
import { dasherize } from "@ember/string";
|
import { dasherize } from "@ember/string";
|
||||||
import InsertHyperlink from "discourse/components/modal/insert-hyperlink";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
const IMAGE_MARKDOWN_REGEX =
|
const IMAGE_MARKDOWN_REGEX = /!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
|
||||||
/!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
|
|
||||||
|
|
||||||
export default ComposerEditor.extend({
|
export default ComposerEditor.extend({
|
||||||
modal: service(),
|
|
||||||
|
|
||||||
classNameBindings: ["fieldClass"],
|
classNameBindings: ["fieldClass"],
|
||||||
allowUpload: true,
|
allowUpload: true,
|
||||||
showLink: false,
|
showLink: false,
|
||||||
|
@ -120,8 +116,9 @@ export default ComposerEditor.extend({
|
||||||
event.target.closest(".button-wrapper").dataset.imageIndex,
|
event.target.closest(".button-wrapper").dataset.imageIndex,
|
||||||
10
|
10
|
||||||
);
|
);
|
||||||
const matchingPlaceholder =
|
const matchingPlaceholder = this.get("composer.reply").match(
|
||||||
this.get("composer.reply").match(IMAGE_MARKDOWN_REGEX);
|
IMAGE_MARKDOWN_REGEX
|
||||||
|
);
|
||||||
|
|
||||||
this.session.set("wizardEventFieldId", this.field.id);
|
this.session.set("wizardEventFieldId", this.field.id);
|
||||||
this.appEvents.trigger(
|
this.appEvents.trigger(
|
||||||
|
@ -200,8 +197,10 @@ export default ComposerEditor.extend({
|
||||||
if (this._lastSel) {
|
if (this._lastSel) {
|
||||||
linkText = this._lastSel.value;
|
linkText = this._lastSel.value;
|
||||||
}
|
}
|
||||||
this.modal.show(InsertHyperlink, {
|
|
||||||
model: { linkText, toolbarEvent },
|
showModal("insert-hyperlink").setProperties({
|
||||||
|
linkText,
|
||||||
|
toolbarEvent,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import computed from "discourse-common/utils/decorators";
|
import computed from "discourse-common/utils/decorators";
|
||||||
import { isLTR, isRTL, siteDir } from "discourse/lib/text-direction";
|
import { isLTR, isRTL, siteDir } from "discourse/lib/text-direction";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import TextField from "discourse/components/text-field";
|
import TextField from "@ember/component/text-field";
|
||||||
|
|
||||||
export default TextField.extend({
|
export default TextField.extend({
|
||||||
attributeBindings: [
|
attributeBindings: [
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
<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>
|
|
|
@ -1,15 +0,0 @@
|
||||||
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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,20 +0,0 @@
|
||||||
<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>
|
|
|
@ -1,30 +0,0 @@
|
||||||
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,7 +9,8 @@
|
||||||
value=wizardListVal
|
value=wizardListVal
|
||||||
content=wizardList
|
content=wizardList
|
||||||
onChange=(action "changeWizard")
|
onChange=(action "changeWizard")
|
||||||
options=(hash none="admin.wizard.select")
|
options=(hash
|
||||||
}}
|
none="admin.wizard.select"
|
||||||
|
)}}
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
|
@ -1,10 +1,7 @@
|
||||||
{{#each site.complete_custom_wizard as |wizard|}}
|
{{#each site.complete_custom_wizard as |wizard|}}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="alert alert-info alert-wizard">
|
<div class="alert alert-info alert-wizard">
|
||||||
<a href={{wizard.url}}>{{i18n
|
<a href={{wizard.url}}>{{i18n "wizard.complete_custom" name=wizard.name}}</a>
|
||||||
"wizard.complete_custom"
|
|
||||||
name=wizard.name
|
|
||||||
}}</a>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
|
@ -4,14 +4,10 @@ import CustomWizardApi from "../models/custom-wizard-api";
|
||||||
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
import { default as discourseComputed } from "discourse-common/utils/decorators";
|
||||||
import { and, equal, not } from "@ember/object/computed";
|
import { and, equal, not } from "@ember/object/computed";
|
||||||
import { selectKitContent } from "../lib/wizard";
|
import { selectKitContent } from "../lib/wizard";
|
||||||
import { underscore } from "@ember/string";
|
|
||||||
import Controller from "@ember/controller";
|
import Controller from "@ember/controller";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
queryParams: ["refresh_list"],
|
queryParams: ["refresh_list"],
|
||||||
loadingSubscriptions: false,
|
loadingSubscriptions: false,
|
||||||
notAuthorized: not("api.authorized"),
|
notAuthorized: not("api.authorized"),
|
||||||
|
@ -24,8 +20,29 @@ export default Controller.extend({
|
||||||
"application/x-www-form-urlencoded",
|
"application/x-www-form-urlencoded",
|
||||||
]),
|
]),
|
||||||
successCodes: selectKitContent([
|
successCodes: selectKitContent([
|
||||||
100, 101, 102, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301,
|
100,
|
||||||
302, 303, 303, 304, 305, 306, 307, 308,
|
101,
|
||||||
|
102,
|
||||||
|
200,
|
||||||
|
201,
|
||||||
|
202,
|
||||||
|
203,
|
||||||
|
204,
|
||||||
|
205,
|
||||||
|
206,
|
||||||
|
207,
|
||||||
|
208,
|
||||||
|
226,
|
||||||
|
300,
|
||||||
|
301,
|
||||||
|
302,
|
||||||
|
303,
|
||||||
|
303,
|
||||||
|
304,
|
||||||
|
305,
|
||||||
|
306,
|
||||||
|
307,
|
||||||
|
308,
|
||||||
]),
|
]),
|
||||||
|
|
||||||
@discourseComputed(
|
@discourseComputed(
|
||||||
|
@ -101,7 +118,7 @@ export default Controller.extend({
|
||||||
|
|
||||||
if (authType === "oauth_2") {
|
if (authType === "oauth_2") {
|
||||||
this.set("authorizing", true);
|
this.set("authorizing", true);
|
||||||
ajax(`/admin/wizards/apis/${underscore(name)}/authorize`)
|
ajax(`/admin/wizards/apis/${name.underscore()}/authorize`)
|
||||||
.catch(popupAjaxError)
|
.catch(popupAjaxError)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
|
@ -170,11 +187,11 @@ export default Controller.extend({
|
||||||
if (!api[rp]) {
|
if (!api[rp]) {
|
||||||
let key = rp.replace("auth", "");
|
let key = rp.replace("auth", "");
|
||||||
error = `${I18n.t(
|
error = `${I18n.t(
|
||||||
`admin.wizard.api.auth.${underscore(key)}`
|
`admin.wizard.api.auth.${key.underscore()}`
|
||||||
)} is required for ${authType}`;
|
)} is required for ${authType}`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
data[underscore(rp)] = api[rp];
|
data[rp.underscore()] = api[rp];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +221,7 @@ export default Controller.extend({
|
||||||
|
|
||||||
this.set("updating", true);
|
this.set("updating", true);
|
||||||
|
|
||||||
ajax(`/admin/wizards/api/${underscore(name)}`, {
|
ajax(`/admin/wizards/api/${name.underscore()}`, {
|
||||||
type: "PUT",
|
type: "PUT",
|
||||||
data,
|
data,
|
||||||
})
|
})
|
||||||
|
@ -227,7 +244,7 @@ export default Controller.extend({
|
||||||
|
|
||||||
this.set("updating", true);
|
this.set("updating", true);
|
||||||
|
|
||||||
ajax(`/admin/wizards/api/${underscore(name)}`, {
|
ajax(`/admin/wizards/api/${name.underscore()}`, {
|
||||||
type: "DELETE",
|
type: "DELETE",
|
||||||
})
|
})
|
||||||
.catch(popupAjaxError)
|
.catch(popupAjaxError)
|
||||||
|
@ -245,13 +262,13 @@ export default Controller.extend({
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ajax(`/admin/wizards/api/${underscore(name)}/logs`, {
|
ajax(`/admin/wizards/api/${name.underscore()}/logs`, {
|
||||||
type: "DELETE",
|
type: "DELETE",
|
||||||
})
|
})
|
||||||
.catch(popupAjaxError)
|
.catch(popupAjaxError)
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
this.router.transitionTo("adminWizardsApis").then(() => {
|
this.transitionToRoute("adminWizardsApis").then(() => {
|
||||||
this.send("refreshModel");
|
this.send("refreshModel");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
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,13 +2,11 @@ import Controller from "@ember/controller";
|
||||||
import { empty } from "@ember/object/computed";
|
import { empty } from "@ember/object/computed";
|
||||||
import discourseComputed from "discourse-common/utils/decorators";
|
import discourseComputed from "discourse-common/utils/decorators";
|
||||||
import { fmt } from "discourse/lib/computed";
|
import { fmt } from "discourse/lib/computed";
|
||||||
import { inject as service } from "@ember/service";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import AdminWizardsColumnsModal from "../components/modal/admin-wizards-columns";
|
|
||||||
import CustomWizardAdmin from "../models/custom-wizard-admin";
|
import CustomWizardAdmin from "../models/custom-wizard-admin";
|
||||||
import { formatModel } from "../lib/wizard-submission";
|
import { formatModel } from "../lib/wizard-submission";
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
modal: service(),
|
|
||||||
downloadUrl: fmt("wizard.id", "/admin/wizards/submissions/%@/download"),
|
downloadUrl: fmt("wizard.id", "/admin/wizards/submissions/%@/download"),
|
||||||
noResults: empty("submissions"),
|
noResults: empty("submissions"),
|
||||||
page: 0,
|
page: 0,
|
||||||
|
@ -59,7 +57,7 @@ export default Controller.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
showEditColumnsModal() {
|
showEditColumnsModal() {
|
||||||
return this.modal.show(AdminWizardsColumnsModal, {
|
return showModal("admin-wizards-columns", {
|
||||||
model: {
|
model: {
|
||||||
columns: this.get("fields"),
|
columns: this.get("fields"),
|
||||||
reset: () => {
|
reset: () => {
|
||||||
|
|
|
@ -3,8 +3,7 @@ import {
|
||||||
observes,
|
observes,
|
||||||
} from "discourse-common/utils/decorators";
|
} from "discourse-common/utils/decorators";
|
||||||
import { notEmpty } from "@ember/object/computed";
|
import { notEmpty } from "@ember/object/computed";
|
||||||
import { inject as service } from "@ember/service";
|
import showModal from "discourse/lib/show-modal";
|
||||||
import NextSessionScheduledModal from "../components/modal/next-session-scheduled";
|
|
||||||
import { generateId, wizardFieldList } from "../lib/wizard";
|
import { generateId, wizardFieldList } from "../lib/wizard";
|
||||||
import { dasherize } from "@ember/string";
|
import { dasherize } from "@ember/string";
|
||||||
import { later, scheduleOnce } from "@ember/runloop";
|
import { later, scheduleOnce } from "@ember/runloop";
|
||||||
|
@ -14,7 +13,6 @@ import I18n from "I18n";
|
||||||
import { filterValues } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard-schema";
|
import { filterValues } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard-schema";
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
modal: service(),
|
|
||||||
hasName: notEmpty("wizard.name"),
|
hasName: notEmpty("wizard.name"),
|
||||||
|
|
||||||
@observes("currentStep")
|
@observes("currentStep")
|
||||||
|
@ -128,13 +126,15 @@ export default Controller.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
setNextSessionScheduled() {
|
setNextSessionScheduled() {
|
||||||
this.modal.show(NextSessionScheduledModal, {
|
let controller = showModal("next-session-scheduled", {
|
||||||
model: {
|
model: {
|
||||||
dateTime: this.wizard.after_time_scheduled,
|
dateTime: this.wizard.after_time_scheduled,
|
||||||
update: (dateTime) =>
|
update: (dateTime) =>
|
||||||
this.set("wizard.after_time_scheduled", dateTime),
|
this.set("wizard.after_time_scheduled", dateTime),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
controller.setup();
|
||||||
},
|
},
|
||||||
|
|
||||||
copyUrl() {
|
copyUrl() {
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
import Controller from "@ember/controller";
|
import Controller from "@ember/controller";
|
||||||
import getUrl from "discourse-common/lib/get-url";
|
import getUrl from "discourse-common/lib/get-url";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default Controller.extend({
|
export default Controller.extend({
|
||||||
router: service(),
|
|
||||||
wizard: null,
|
wizard: null,
|
||||||
step: null,
|
step: null,
|
||||||
|
|
||||||
|
@ -17,12 +15,12 @@ export default Controller.extend({
|
||||||
const wizardId = this.get("wizard.id");
|
const wizardId = this.get("wizard.id");
|
||||||
window.location.href = getUrl(`/w/${wizardId}/steps/${nextStepId}`);
|
window.location.href = getUrl(`/w/${wizardId}/steps/${nextStepId}`);
|
||||||
} else {
|
} else {
|
||||||
this.router.transitionTo("customWizardStep", nextStepId);
|
this.transitionToRoute("customWizardStep", nextStepId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
goBack() {
|
goBack() {
|
||||||
this.router.transitionTo("customWizardStep", this.get("step.previous"));
|
this.transitionToRoute("customWizardStep", this.get("step.previous"));
|
||||||
},
|
},
|
||||||
|
|
||||||
showMessage(message) {
|
showMessage(message) {
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
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,10 +69,7 @@ export default {
|
||||||
},
|
},
|
||||||
|
|
||||||
_wizardInsertText(text, options) {
|
_wizardInsertText(text, options) {
|
||||||
if (
|
if (this.session.wizardEventFieldId === this.fieldId) {
|
||||||
this.session.wizardEventFieldId === this.fieldId &&
|
|
||||||
this.element
|
|
||||||
) {
|
|
||||||
this.insertText(text, options);
|
this.insertText(text, options);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -83,16 +80,6 @@ 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,16 +1,14 @@
|
||||||
import DiscourseURL from "discourse/lib/url";
|
import ApplicationRoute from "discourse/routes/application";
|
||||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
||||||
import { dasherize } from "@ember/string";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "custom-wizard-redirect",
|
name: "custom-wizard-redirect",
|
||||||
after: "message-bus",
|
after: "message-bus",
|
||||||
|
|
||||||
initialize(container) {
|
initialize: function (container) {
|
||||||
const messageBus = container.lookup("service:message-bus");
|
const messageBus = container.lookup("service:message-bus");
|
||||||
const siteSettings = container.lookup("service:site-settings");
|
const siteSettings = container.lookup("service:site-settings");
|
||||||
|
|
||||||
if (!siteSettings.custom_wizard_enabled) {
|
if (!siteSettings.custom_wizard_enabled || !messageBus) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,27 +17,28 @@ export default {
|
||||||
window.location.href = wizardUrl;
|
window.location.href = wizardUrl;
|
||||||
});
|
});
|
||||||
|
|
||||||
withPluginApi("0.8.36", (api) => {
|
ApplicationRoute.reopen({
|
||||||
api.onAppEvent("page:changed", (data) => {
|
actions: {
|
||||||
const currentUser = api.getCurrentUser();
|
willTransition(transition) {
|
||||||
|
const redirectToWizard = this.get("currentUser.redirect_to_wizard");
|
||||||
if (currentUser) {
|
const excludedPaths = this.siteSettings.wizard_redirect_exclude_paths
|
||||||
const redirectToWizard = currentUser.redirect_to_wizard;
|
|
||||||
const excludedPaths = siteSettings.wizard_redirect_exclude_paths
|
|
||||||
.split("|")
|
.split("|")
|
||||||
.concat(["loading"]);
|
.concat(["loading"]);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
redirectToWizard &&
|
redirectToWizard &&
|
||||||
!data.url.includes("ignore_redirect") &&
|
(!transition.intent.name ||
|
||||||
data.currentRouteName !== "customWizardStep" &&
|
|
||||||
!excludedPaths.find((p) => {
|
!excludedPaths.find((p) => {
|
||||||
return data.currentRouteName.indexOf(p) > -1;
|
return transition.intent.name.indexOf(p) > -1;
|
||||||
})
|
}))
|
||||||
) {
|
) {
|
||||||
DiscourseURL.routeTo(`/w/${dasherize(redirectToWizard)}`);
|
transition.abort();
|
||||||
|
window.location = "/w/" + redirectToWizard.dasherize();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
return this._super(transition);
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,7 +35,6 @@ function inputTypesContent(options = {}) {
|
||||||
const connectors = {
|
const connectors = {
|
||||||
pair: [
|
pair: [
|
||||||
"equal",
|
"equal",
|
||||||
"not_equal",
|
|
||||||
"greater",
|
"greater",
|
||||||
"less",
|
"less",
|
||||||
"greater_or_equal",
|
"greater_or_equal",
|
||||||
|
|
|
@ -244,7 +244,6 @@ const custom_field = {
|
||||||
|
|
||||||
export function buildFieldTypes(types) {
|
export function buildFieldTypes(types) {
|
||||||
wizardSchema.field.types = types;
|
wizardSchema.field.types = types;
|
||||||
wizardSchema.field.type = Object.keys(types);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
field.type = Object.keys(field.types);
|
field.type = Object.keys(field.types);
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
import CustomWizardApi from "../models/custom-wizard-api";
|
import CustomWizardApi from "../models/custom-wizard-api";
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model(params) {
|
model(params) {
|
||||||
if (params.name === "create") {
|
if (params.name === "create") {
|
||||||
return CustomWizardApi.create({ isNew: true });
|
return CustomWizardApi.create({ isNew: true });
|
||||||
|
@ -13,12 +10,6 @@ export default DiscourseRoute.extend({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
afterModel(model) {
|
|
||||||
if (model === null) {
|
|
||||||
return this.router.transitionTo("adminWizardsApi");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setupController(controller, model) {
|
setupController(controller, model) {
|
||||||
controller.set("api", model);
|
controller.set("api", model);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import CustomWizardApi from "../models/custom-wizard-api";
|
import CustomWizardApi from "../models/custom-wizard-api";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return CustomWizardApi.list();
|
return CustomWizardApi.list();
|
||||||
},
|
},
|
||||||
|
@ -28,11 +25,11 @@ export default DiscourseRoute.extend({
|
||||||
actions: {
|
actions: {
|
||||||
changeApi(apiName) {
|
changeApi(apiName) {
|
||||||
this.controllerFor("adminWizardsApi").set("apiName", apiName);
|
this.controllerFor("adminWizardsApi").set("apiName", apiName);
|
||||||
this.router.transitionTo("adminWizardsApiShow", apiName);
|
this.transitionTo("adminWizardsApiShow", apiName);
|
||||||
},
|
},
|
||||||
|
|
||||||
afterDestroy() {
|
afterDestroy() {
|
||||||
this.router.transitionTo("adminWizardsApi").then(() => this.refresh());
|
this.transitionTo("adminWizardsApi").then(() => this.refresh());
|
||||||
},
|
},
|
||||||
|
|
||||||
afterSave(apiName) {
|
afterSave(apiName) {
|
||||||
|
@ -41,7 +38,7 @@ export default DiscourseRoute.extend({
|
||||||
|
|
||||||
createApi() {
|
createApi() {
|
||||||
this.controllerFor("adminWizardsApi").set("apiName", "create");
|
this.controllerFor("adminWizardsApi").set("apiName", "create");
|
||||||
this.router.transitionTo("adminWizardsApiShow", "create");
|
this.transitionTo("adminWizardsApiShow", "create");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,21 +1,12 @@
|
||||||
import CustomWizardLogs from "../models/custom-wizard-logs";
|
import CustomWizardLogs from "../models/custom-wizard-logs";
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import { A } from "@ember/array";
|
import { A } from "@ember/array";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model(params) {
|
model(params) {
|
||||||
return CustomWizardLogs.list(params.wizardId);
|
return CustomWizardLogs.list(params.wizardId);
|
||||||
},
|
},
|
||||||
|
|
||||||
afterModel(model) {
|
|
||||||
if (model === null) {
|
|
||||||
return this.router.transitionTo("adminWizardsLogs");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setupController(controller, model) {
|
setupController(controller, model) {
|
||||||
controller.setProperties({
|
controller.setProperties({
|
||||||
wizard: model.wizard,
|
wizard: model.wizard,
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return ajax(`/admin/wizards/wizard`);
|
return ajax(`/admin/wizards/wizard`);
|
||||||
},
|
},
|
||||||
|
@ -21,7 +18,7 @@ export default DiscourseRoute.extend({
|
||||||
actions: {
|
actions: {
|
||||||
changeWizard(wizardId) {
|
changeWizard(wizardId) {
|
||||||
this.controllerFor("adminWizardsLogs").set("wizardId", wizardId);
|
this.controllerFor("adminWizardsLogs").set("wizardId", wizardId);
|
||||||
this.router.transitionTo("adminWizardsLogsShow", wizardId);
|
this.transitionTo("adminWizardsLogsShow", wizardId);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,21 +2,12 @@ import { A } from "@ember/array";
|
||||||
import CustomWizardAdmin from "../models/custom-wizard-admin";
|
import CustomWizardAdmin from "../models/custom-wizard-admin";
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import { formatModel } from "../lib/wizard-submission";
|
import { formatModel } from "../lib/wizard-submission";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model(params) {
|
model(params) {
|
||||||
return CustomWizardAdmin.submissions(params.wizardId);
|
return CustomWizardAdmin.submissions(params.wizardId);
|
||||||
},
|
},
|
||||||
|
|
||||||
afterModel(model) {
|
|
||||||
if (model === null) {
|
|
||||||
return this.router.transitionTo("adminWizardsSubmissions");
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
setupController(controller, model) {
|
setupController(controller, model) {
|
||||||
const { fields, submissions } = formatModel(model);
|
const { fields, submissions } = formatModel(model);
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return ajax(`/admin/wizards/wizard`);
|
return ajax(`/admin/wizards/wizard`);
|
||||||
},
|
},
|
||||||
|
@ -21,7 +18,7 @@ export default DiscourseRoute.extend({
|
||||||
actions: {
|
actions: {
|
||||||
changeWizard(wizardId) {
|
changeWizard(wizardId) {
|
||||||
this.controllerFor("adminWizardsSubmissions").set("wizardId", wizardId);
|
this.controllerFor("adminWizardsSubmissions").set("wizardId", wizardId);
|
||||||
this.router.transitionTo("adminWizardsSubmissionsShow", wizardId);
|
this.transitionTo("adminWizardsSubmissionsShow", wizardId);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -2,11 +2,8 @@ import CustomWizardAdmin from "../models/custom-wizard-admin";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model(params) {
|
model(params) {
|
||||||
if (params.wizardId === "create") {
|
if (params.wizardId === "create") {
|
||||||
return { create: true };
|
return { create: true };
|
||||||
|
@ -17,7 +14,7 @@ export default DiscourseRoute.extend({
|
||||||
|
|
||||||
afterModel(model) {
|
afterModel(model) {
|
||||||
if (model.none) {
|
if (model.none) {
|
||||||
return this.router.transitionTo("adminWizardsWizard");
|
return this.transitionTo("adminWizardsWizard");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,8 @@ import EmberObject, { set } from "@ember/object";
|
||||||
import { A } from "@ember/array";
|
import { A } from "@ember/array";
|
||||||
import { all } from "rsvp";
|
import { all } from "rsvp";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return ajax("/admin/wizards/wizard");
|
return ajax("/admin/wizards/wizard");
|
||||||
},
|
},
|
||||||
|
@ -83,14 +80,14 @@ export default DiscourseRoute.extend({
|
||||||
this.controllerFor("adminWizardsWizard").set("wizardId", wizardId);
|
this.controllerFor("adminWizardsWizard").set("wizardId", wizardId);
|
||||||
|
|
||||||
if (wizardId) {
|
if (wizardId) {
|
||||||
this.router.transitionTo("adminWizardsWizardShow", wizardId);
|
this.transitionTo("adminWizardsWizardShow", wizardId);
|
||||||
} else {
|
} else {
|
||||||
this.router.transitionTo("adminWizardsWizard");
|
this.transitionTo("adminWizardsWizard");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
afterDestroy() {
|
afterDestroy() {
|
||||||
this.router.transitionTo("adminWizardsWizard").then(() => this.refresh());
|
this.transitionTo("adminWizardsWizard").then(() => this.refresh());
|
||||||
},
|
},
|
||||||
|
|
||||||
afterSave(wizardId) {
|
afterSave(wizardId) {
|
||||||
|
@ -99,7 +96,7 @@ export default DiscourseRoute.extend({
|
||||||
|
|
||||||
createWizard() {
|
createWizard() {
|
||||||
this.controllerFor("adminWizardsWizard").set("wizardId", "create");
|
this.controllerFor("adminWizardsWizard").set("wizardId", "create");
|
||||||
this.router.transitionTo("adminWizardsWizardShow", "create");
|
this.transitionTo("adminWizardsWizardShow", "create");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import { ajax } from "discourse/lib/ajax";
|
import { ajax } from "discourse/lib/ajax";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
model() {
|
model() {
|
||||||
return ajax("/admin/wizards");
|
return ajax("/admin/wizards");
|
||||||
},
|
},
|
||||||
|
@ -20,7 +17,7 @@ export default DiscourseRoute.extend({
|
||||||
|
|
||||||
afterModel(model, transition) {
|
afterModel(model, transition) {
|
||||||
if (transition.targetName === "adminWizards.index") {
|
if (transition.targetName === "adminWizards.index") {
|
||||||
this.router.transitionTo("adminWizardsWizard");
|
this.transitionTo("adminWizardsWizard");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,14 +1,11 @@
|
||||||
import { getCachedWizard } from "../models/custom-wizard";
|
import { getCachedWizard } from "../models/custom-wizard";
|
||||||
import Route from "@ember/routing/route";
|
import Route from "@ember/routing/route";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
const wizard = getCachedWizard();
|
const wizard = getCachedWizard();
|
||||||
if (wizard && wizard.permitted && !wizard.completed && wizard.start) {
|
if (wizard && wizard.permitted && !wizard.completed && wizard.start) {
|
||||||
this.router.replaceWith("customWizardStep", wizard.start);
|
this.replaceWith("customWizardStep", wizard.start);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,14 @@ import { getCachedWizard } from "../models/custom-wizard";
|
||||||
import Route from "@ember/routing/route";
|
import Route from "@ember/routing/route";
|
||||||
import { scrollTop } from "discourse/mixins/scroll-top";
|
import { scrollTop } from "discourse/mixins/scroll-top";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
import { inject as service } from "@ember/service";
|
|
||||||
|
|
||||||
export default Route.extend({
|
export default Route.extend({
|
||||||
router: service(),
|
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
const wizard = getCachedWizard();
|
const wizard = getCachedWizard();
|
||||||
this.set("wizard", wizard);
|
this.set("wizard", wizard);
|
||||||
|
|
||||||
if (!wizard || !wizard.permitted || wizard.completed) {
|
if (!wizard || !wizard.permitted || wizard.completed) {
|
||||||
this.router.replaceWith("customWizard");
|
this.replaceWith("customWizard");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -30,7 +27,7 @@ export default Route.extend({
|
||||||
|
|
||||||
afterModel(model) {
|
afterModel(model) {
|
||||||
if (model.completed) {
|
if (model.completed) {
|
||||||
return this.router.transitionTo("wizard.index");
|
return this.transitionTo("wizard.index");
|
||||||
}
|
}
|
||||||
return model.set("wizardId", this.wizard.id);
|
return model.set("wizardId", this.wizard.id);
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import { findCustomWizard, updateCachedWizard } from "../models/custom-wizard";
|
import { findCustomWizard, updateCachedWizard } from "../models/custom-wizard";
|
||||||
import I18n from "I18n";
|
import I18n from "I18n";
|
||||||
import DiscourseRoute from "discourse/routes/discourse";
|
import DiscourseRoute from "discourse/routes/discourse";
|
||||||
import bootbox from "bootbox";
|
|
||||||
|
|
||||||
export default DiscourseRoute.extend({
|
export default DiscourseRoute.extend({
|
||||||
titleToken() {
|
titleToken() {
|
||||||
|
|
|
@ -8,12 +8,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{d-button
|
{{d-button label="admin.wizard.api.save" action=(action "save") class="btn-primary" disabled=saveDisabled}}
|
||||||
label="admin.wizard.api.save"
|
|
||||||
action=(action "save")
|
|
||||||
class="btn-primary"
|
|
||||||
disabled=saveDisabled
|
|
||||||
}}
|
|
||||||
|
|
||||||
{{#if showRemove}}
|
{{#if showRemove}}
|
||||||
{{d-button action=(action "remove") label="admin.wizard.api.remove"}}
|
{{d-button action=(action "remove") label="admin.wizard.api.remove"}}
|
||||||
|
@ -67,12 +62,10 @@
|
||||||
<span>{{authErrorMessage}}</span>
|
<span>{{authErrorMessage}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{d-button
|
{{d-button label="admin.wizard.api.auth.btn"
|
||||||
label="admin.wizard.api.auth.btn"
|
|
||||||
action=(action "authorize")
|
action=(action "authorize")
|
||||||
disabled=authDisabled
|
disabled=authDisabled
|
||||||
class="btn-primary"
|
class="btn-primary"}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -106,8 +99,9 @@
|
||||||
value=api.authType
|
value=api.authType
|
||||||
content=authorizationTypes
|
content=authorizationTypes
|
||||||
onChange=(action (mut api.authType))
|
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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -116,7 +110,9 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label>{{i18n "admin.wizard.api.auth.url"}}</label>
|
<label>{{i18n "admin.wizard.api.auth.url"}}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<Input @value={{this.api.authUrl}} />
|
<Input
|
||||||
|
@value={{this.api.authUrl}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -124,21 +120,27 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label>{{i18n "admin.wizard.api.auth.token_url"}}</label>
|
<label>{{i18n "admin.wizard.api.auth.token_url"}}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<Input @value={{this.api.tokenUrl}} />
|
<Input
|
||||||
|
@value={{this.api.tokenUrl}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label>{{i18n "admin.wizard.api.auth.client_id"}}</label>
|
<label>{{i18n "admin.wizard.api.auth.client_id"}}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<Input @value={{this.api.clientId}} />
|
<Input
|
||||||
|
@value={{this.api.clientId}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label>{{i18n "admin.wizard.api.auth.client_secret"}}</label>
|
<label>{{i18n "admin.wizard.api.auth.client_secret"}}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<Input @value={{this.api.clientSecret}} />
|
<Input
|
||||||
|
@value={{this.api.clientSecret}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -155,18 +157,10 @@
|
||||||
@value={{this.param.value}}
|
@value={{this.param.value}}
|
||||||
placeholder={{i18n "admin.wizard.value"}}
|
placeholder={{i18n "admin.wizard.value"}}
|
||||||
/>
|
/>
|
||||||
{{d-button
|
{{d-button action=(action "removeParam") actionParam=param icon="times"}}
|
||||||
action=(action "removeParam")
|
|
||||||
actionParam=param
|
|
||||||
icon="times"
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{d-button
|
{{d-button label="admin.wizard.api.auth.params.new" icon="plus" action=(action "addParam")}}
|
||||||
label="admin.wizard.api.auth.params.new"
|
|
||||||
icon="plus"
|
|
||||||
action=(action "addParam")
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -175,14 +169,18 @@
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label>{{i18n "admin.wizard.api.auth.username"}}</label>
|
<label>{{i18n "admin.wizard.api.auth.username"}}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<Input @value={{this.api.username}} />
|
<Input
|
||||||
|
@value={{this.api.username}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label>{{i18n "admin.wizard.api.auth.password"}}</label>
|
<label>{{i18n "admin.wizard.api.auth.password"}}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<Input @value={{this.api.password}} />
|
<Input
|
||||||
|
@value={{this.api.password}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -251,11 +249,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="wizard-api-endpoints">
|
<div class="wizard-api-endpoints">
|
||||||
{{d-button
|
{{d-button action=(action "addEndpoint") label="admin.wizard.api.endpoint.add" icon="plus"}}
|
||||||
action=(action "addEndpoint")
|
|
||||||
label="admin.wizard.api.endpoint.add"
|
|
||||||
icon="plus"
|
|
||||||
}}
|
|
||||||
|
|
||||||
{{#if api.endpoints}}
|
{{#if api.endpoints}}
|
||||||
<div class="endpoint-list">
|
<div class="endpoint-list">
|
||||||
|
@ -266,42 +260,41 @@
|
||||||
<div class="endpoint-">
|
<div class="endpoint-">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<Input
|
<Input
|
||||||
@value={{endpoint.name}}
|
@value={{this.endpoint.name}}
|
||||||
placeholder={{i18n "admin.wizard.api.endpoint.name"}}
|
placeholder={{i18n "admin.wizard.api.endpoint.name"}}
|
||||||
/>
|
/>
|
||||||
<Input
|
<Input
|
||||||
@value={{endpoint.url}}
|
@value={{this.endpoint.url}}
|
||||||
placeholder={{i18n "admin.wizard.api.endpoint.url"}}
|
placeholder={{i18n "admin.wizard.api.endpoint.url"}}
|
||||||
class="endpoint-url"
|
class="endpoint-url"
|
||||||
/>
|
/>
|
||||||
{{d-button
|
{{d-button action=(action "removeEndpoint")
|
||||||
action=(action "removeEndpoint")
|
|
||||||
actionParam=endpoint
|
actionParam=endpoint
|
||||||
icon="times"
|
icon="times"
|
||||||
class="remove-endpoint"
|
class="remove-endpoint"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
{{combo-box
|
{{combo-box
|
||||||
content=endpointMethods
|
content=endpointMethods
|
||||||
value=endpoint.method
|
value=endpoint.method
|
||||||
onChange=(action (mut 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
|
{{combo-box
|
||||||
content=contentTypes
|
content=contentTypes
|
||||||
value=endpoint.content_type
|
value=endpoint.content_type
|
||||||
onChange=(action (mut 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
|
{{multi-select
|
||||||
value=endpoint.success_codes
|
value=endpoint.success_codes
|
||||||
content=successCodes
|
content=successCodes
|
||||||
onChange=(action (mut endpoint.success_codes))
|
onChange=(action (mut endpoint.success_codes))
|
||||||
options=(hash
|
options=(hash
|
||||||
none="admin.wizard.api.endpoint.success_codes"
|
none="admin.wizard.api.endpoint.success_codes"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -319,8 +312,7 @@
|
||||||
{{d-button
|
{{d-button
|
||||||
action=(action "clearLogs")
|
action=(action "clearLogs")
|
||||||
class="clear-logs"
|
class="clear-logs"
|
||||||
label="admin.wizard.api.log.clear"
|
label="admin.wizard.api.log.clear"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -340,10 +332,7 @@
|
||||||
<td>{{logentry.time}}</td>
|
<td>{{logentry.time}}</td>
|
||||||
<td class="user-image">
|
<td class="user-image">
|
||||||
<div class="user-image-inner">
|
<div class="user-image-inner">
|
||||||
<a
|
<a href={{logentry.userpath}} data-user-card={{logentry.username}}>{{avatar logentry imageSize="medium"}}</a>
|
||||||
href={{logentry.userpath}}
|
|
||||||
data-user-card={{logentry.username}}
|
|
||||||
>{{avatar logentry imageSize="medium"}}</a>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>{{logentry.status}}</td>
|
<td>{{logentry.status}}</td>
|
||||||
|
|
|
@ -3,14 +3,14 @@
|
||||||
value=apiName
|
value=apiName
|
||||||
content=apiList
|
content=apiList
|
||||||
onChange=(route-action "changeApi")
|
onChange=(route-action "changeApi")
|
||||||
options=(hash none="admin.wizard.api.select")
|
options=(hash
|
||||||
}}
|
none="admin.wizard.api.select"
|
||||||
|
)}}
|
||||||
|
|
||||||
{{d-button
|
{{d-button
|
||||||
action=(route-action "createApi")
|
action=(route-action "createApi")
|
||||||
label="admin.wizard.api.create"
|
label="admin.wizard.api.create"
|
||||||
icon="plus"
|
icon="plus"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="admin-wizard-container">
|
<div class="admin-wizard-container">
|
||||||
|
|
|
@ -5,8 +5,7 @@
|
||||||
{{d-button
|
{{d-button
|
||||||
label="admin.wizard.custom_field.add"
|
label="admin.wizard.custom_field.add"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
action=(action "addField")
|
action=(action "addField")}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -15,8 +14,7 @@
|
||||||
opts=messageOpts
|
opts=messageOpts
|
||||||
type=messageType
|
type=messageType
|
||||||
url=documentationUrl
|
url=documentationUrl
|
||||||
component="custom_fields"
|
component="custom_fields"}}
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="admin-wizard-container">
|
<div class="admin-wizard-container">
|
||||||
{{#if customFields}}
|
{{#if customFields}}
|
||||||
|
@ -34,8 +32,7 @@
|
||||||
{{custom-field-input
|
{{custom-field-input
|
||||||
field=field
|
field=field
|
||||||
removeField=(action "removeField")
|
removeField=(action "removeField")
|
||||||
saveField=(action "saveField")
|
saveField=(action "saveField")}}
|
||||||
}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -9,8 +9,7 @@
|
||||||
label="refresh"
|
label="refresh"
|
||||||
icon="sync"
|
icon="sync"
|
||||||
action=(action "refresh")
|
action=(action "refresh")
|
||||||
class="refresh"
|
class="refresh"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -32,10 +31,7 @@
|
||||||
{{#each logs as |log|}}
|
{{#each logs as |log|}}
|
||||||
<tr>
|
<tr>
|
||||||
{{#each-in log as |field value|}}
|
{{#each-in log as |field value|}}
|
||||||
<td class="small">{{wizard-table-field
|
<td class="small">{{wizard-table-field field=field value=value}}</td>
|
||||||
field=field
|
|
||||||
value=value
|
|
||||||
}}</td>
|
|
||||||
{{/each-in}}
|
{{/each-in}}
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
value=wizardId
|
value=wizardId
|
||||||
content=wizardList
|
content=wizardList
|
||||||
onChange=(route-action "changeWizard")
|
onChange=(route-action "changeWizard")
|
||||||
options=(hash none="admin.wizard.select")
|
options=(hash
|
||||||
}}
|
none="admin.wizard.select"
|
||||||
|
)}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-message
|
{{wizard-message
|
||||||
key=messageKey
|
key=messageKey
|
||||||
opts=messageOpts
|
opts=messageOpts
|
||||||
url=documentationUrl
|
url=documentationUrl
|
||||||
component="logs"
|
component="logs"}}
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="admin-wizard-container">
|
<div class="admin-wizard-container">
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
|
|
|
@ -20,26 +20,22 @@
|
||||||
{{d-button
|
{{d-button
|
||||||
id="upload-button"
|
id="upload-button"
|
||||||
label="admin.wizard.manager.upload"
|
label="admin.wizard.manager.upload"
|
||||||
action=(action "upload")
|
action=(action "upload")}}
|
||||||
}}
|
|
||||||
{{d-button
|
{{d-button
|
||||||
id="import-button"
|
id="import-button"
|
||||||
label="admin.wizard.manager.import"
|
label="admin.wizard.manager.import"
|
||||||
action=(action "import")
|
action=(action "import")
|
||||||
disabled=importDisabled
|
disabled=importDisabled}}
|
||||||
}}
|
|
||||||
{{d-button
|
{{d-button
|
||||||
id="export-button"
|
id="export-button"
|
||||||
label="admin.wizard.manager.export"
|
label="admin.wizard.manager.export"
|
||||||
action=(action "export")
|
action=(action "export")
|
||||||
disabled=exportDisabled
|
disabled=exportDisabled}}
|
||||||
}}
|
|
||||||
{{d-button
|
{{d-button
|
||||||
id="destroy-button"
|
id="destroy-button"
|
||||||
label="admin.wizard.manager.destroy"
|
label="admin.wizard.manager.destroy"
|
||||||
action=(action "destroy")
|
action=(action "destroy")
|
||||||
disabled=destoryDisabled
|
disabled=destoryDisabled}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -50,8 +46,7 @@
|
||||||
opts=messageOpts
|
opts=messageOpts
|
||||||
items=messageItems
|
items=messageItems
|
||||||
loading=loading
|
loading=loading
|
||||||
component="manager"
|
component="manager"}}
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="admin-wizard-container">
|
<div class="admin-wizard-container">
|
||||||
<table class="table grid">
|
<table class="table grid">
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
value=wizardId
|
value=wizardId
|
||||||
content=wizardList
|
content=wizardList
|
||||||
onChange=(route-action "changeWizard")
|
onChange=(route-action "changeWizard")
|
||||||
options=(hash none="admin.wizard.select")
|
options=(hash
|
||||||
}}
|
none="admin.wizard.select"
|
||||||
|
)}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-message
|
{{wizard-message
|
||||||
key=messageKey
|
key=messageKey
|
||||||
opts=messageOpts
|
opts=messageOpts
|
||||||
url=documentationUrl
|
url=documentationUrl
|
||||||
component="submissions"
|
component="submissions"}}
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="admin-wizard-container">
|
<div class="admin-wizard-container">
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
|
|
|
@ -9,23 +9,11 @@
|
||||||
<div class="wizard-url">
|
<div class="wizard-url">
|
||||||
{{#if wizard.name}}
|
{{#if wizard.name}}
|
||||||
{{#if copiedUrl}}
|
{{#if copiedUrl}}
|
||||||
{{d-button
|
{{d-button class="btn-hover pull-right" icon="copy" label="ip_lookup.copied"}}
|
||||||
class="btn-hover pull-right"
|
|
||||||
icon="copy"
|
|
||||||
label="ip_lookup.copied"
|
|
||||||
}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{d-button
|
{{d-button action=(action "copyUrl") class="pull-right no-text" icon="copy"}}
|
||||||
action=(action "copyUrl")
|
|
||||||
class="pull-right no-text"
|
|
||||||
icon="copy"
|
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<a
|
<a href={{wizardUrl}} target="_blank" rel="noopener noreferrer">{{wizardUrl}}</a>
|
||||||
href={{wizardUrl}}
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
>{{wizardUrl}}</a>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,8 +43,9 @@
|
||||||
valueProperty="id"
|
valueProperty="id"
|
||||||
value=wizard.theme_id
|
value=wizard.theme_id
|
||||||
onChange=(action (mut 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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -71,7 +60,10 @@
|
||||||
<label>{{i18n "admin.wizard.save_submissions"}}</label>
|
<label>{{i18n "admin.wizard.save_submissions"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<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>
|
<span>{{i18n "admin.wizard.save_submissions_label"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -81,7 +73,10 @@
|
||||||
<label>{{i18n "admin.wizard.multiple_submissions"}}</label>
|
<label>{{i18n "admin.wizard.multiple_submissions"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<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>
|
<span>{{i18n "admin.wizard.multiple_submissions_label"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -91,7 +86,10 @@
|
||||||
<label>{{i18n "admin.wizard.after_signup"}}</label>
|
<label>{{i18n "admin.wizard.after_signup"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<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>
|
<span>{{i18n "admin.wizard.after_signup_label"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -101,7 +99,10 @@
|
||||||
<label>{{i18n "admin.wizard.prompt_completion"}}</label>
|
<label>{{i18n "admin.wizard.prompt_completion"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<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>
|
<span>{{i18n "admin.wizard.prompt_completion_label"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -111,14 +112,16 @@
|
||||||
<label>{{i18n "admin.wizard.after_time"}}</label>
|
<label>{{i18n "admin.wizard.after_time"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<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>
|
<span>{{i18n "admin.wizard.after_time_label"}}</span>
|
||||||
{{d-button
|
{{d-button
|
||||||
action=(action "setNextSessionScheduled")
|
action=(action "setNextSessionScheduled")
|
||||||
translatedLabel=nextSessionScheduledLabel
|
translatedLabel=nextSessionScheduledLabel
|
||||||
class="btn-after-time"
|
class="btn-after-time"
|
||||||
icon="far-calendar"
|
icon="far-calendar"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -128,7 +131,10 @@
|
||||||
<label>{{i18n "admin.wizard.required"}}</label>
|
<label>{{i18n "admin.wizard.required"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<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>
|
<span>{{i18n "admin.wizard.required_label"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -138,7 +144,10 @@
|
||||||
<label>{{i18n "admin.wizard.restart_on_revisit"}}</label>
|
<label>{{i18n "admin.wizard.restart_on_revisit"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<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>
|
<span>{{i18n "admin.wizard.restart_on_revisit_label"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -158,14 +167,16 @@
|
||||||
userFieldSelection="key"
|
userFieldSelection="key"
|
||||||
textSelection="value"
|
textSelection="value"
|
||||||
inputConnector="and"
|
inputConnector="and"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/wizard-subscription-container}}
|
{{/wizard-subscription-container}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-links itemType="step" current=currentStep items=wizard.steps}}
|
{{wizard-links
|
||||||
|
itemType="step"
|
||||||
|
current=currentStep
|
||||||
|
items=wizard.steps}}
|
||||||
|
|
||||||
{{#if currentStep}}
|
{{#if currentStep}}
|
||||||
{{wizard-custom-step
|
{{wizard-custom-step
|
||||||
|
@ -174,16 +185,14 @@
|
||||||
currentField=currentField
|
currentField=currentField
|
||||||
wizardFields=wizardFields
|
wizardFields=wizardFields
|
||||||
fieldTypes=filteredFieldTypes
|
fieldTypes=filteredFieldTypes
|
||||||
subscribed=subscribed
|
subscribed=subscribed}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{wizard-links
|
{{wizard-links
|
||||||
itemType="action"
|
itemType="action"
|
||||||
current=currentAction
|
current=currentAction
|
||||||
items=wizard.actions
|
items=wizard.actions
|
||||||
generateLabels=true
|
generateLabels=true}}
|
||||||
}}
|
|
||||||
|
|
||||||
{{#each wizard.actions as |wizardAction|}}
|
{{#each wizard.actions as |wizardAction|}}
|
||||||
{{wizard-custom-action
|
{{wizard-custom-action
|
||||||
|
@ -193,17 +202,11 @@
|
||||||
apis=apis
|
apis=apis
|
||||||
removeAction="removeAction"
|
removeAction="removeAction"
|
||||||
wizardFields=wizardFields
|
wizardFields=wizardFields
|
||||||
fieldTypes=filteredFieldTypes
|
fieldTypes=filteredFieldTypes}}
|
||||||
}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
<div class="admin-wizard-buttons">
|
<div class="admin-wizard-buttons">
|
||||||
<button
|
<button {{action "save"}} disabled={{disableSave}} class="btn btn-primary" type="button">
|
||||||
{{action "save"}}
|
|
||||||
disabled={{disableSave}}
|
|
||||||
class="btn btn-primary"
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{i18n "admin.wizard.save"}}
|
{{i18n "admin.wizard.save"}}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
@ -3,17 +3,20 @@
|
||||||
value=wizardListVal
|
value=wizardListVal
|
||||||
content=wizardList
|
content=wizardList
|
||||||
onChange=(route-action "changeWizard")
|
onChange=(route-action "changeWizard")
|
||||||
options=(hash none="admin.wizard.select")
|
options=(hash
|
||||||
}}
|
none="admin.wizard.select"
|
||||||
|
)}}
|
||||||
|
|
||||||
{{d-button
|
{{d-button
|
||||||
action=(route-action "createWizard")
|
action=(route-action "createWizard")
|
||||||
label="admin.wizard.create"
|
label="admin.wizard.create"
|
||||||
icon="plus"
|
icon="plus"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-message key=messageKey url=messageUrl component="wizard"}}
|
{{wizard-message
|
||||||
|
key=messageKey
|
||||||
|
url=messageUrl
|
||||||
|
component="wizard"}}
|
||||||
|
|
||||||
<div class="admin-wizard-container settings">
|
<div class="admin-wizard-container settings">
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
|
|
|
@ -1,21 +1,12 @@
|
||||||
{{#admin-nav}}
|
{{#admin-nav}}
|
||||||
{{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}}
|
{{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}}
|
||||||
{{nav-item
|
{{nav-item route="adminWizardsCustomFields" label="admin.wizard.custom_field.nav_label"}}
|
||||||
route="adminWizardsCustomFields"
|
{{nav-item route="adminWizardsSubmissions" label="admin.wizard.submissions.nav_label"}}
|
||||||
label="admin.wizard.custom_field.nav_label"
|
|
||||||
}}
|
|
||||||
{{nav-item
|
|
||||||
route="adminWizardsSubmissions"
|
|
||||||
label="admin.wizard.submissions.nav_label"
|
|
||||||
}}
|
|
||||||
{{#if showApi}}
|
{{#if showApi}}
|
||||||
{{nav-item route="adminWizardsApi" label="admin.wizard.api.nav_label"}}
|
{{nav-item route="adminWizardsApi" label="admin.wizard.api.nav_label"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{nav-item route="adminWizardsLogs" label="admin.wizard.log.nav_label"}}
|
{{nav-item route="adminWizardsLogs" label="admin.wizard.log.nav_label"}}
|
||||||
{{nav-item
|
{{nav-item route="adminWizardsManager" label="admin.wizard.manager.nav_label"}}
|
||||||
route="adminWizardsManager"
|
|
||||||
label="admin.wizard.manager.nav_label"
|
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="admin-actions">
|
<div class="admin-actions">
|
||||||
{{wizard-subscription-badge}}
|
{{wizard-subscription-badge}}
|
||||||
|
|
|
@ -5,8 +5,9 @@
|
||||||
feature="custom_field"
|
feature="custom_field"
|
||||||
attribute="klass"
|
attribute="klass"
|
||||||
onChange=(action (mut field.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>
|
||||||
<td>
|
<td>
|
||||||
{{wizard-subscription-selector
|
{{wizard-subscription-selector
|
||||||
|
@ -14,8 +15,9 @@
|
||||||
feature="custom_field"
|
feature="custom_field"
|
||||||
attribute="type"
|
attribute="type"
|
||||||
onChange=(action (mut field.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>
|
||||||
<td class="input">
|
<td class="input">
|
||||||
<Input
|
<Input
|
||||||
|
@ -28,8 +30,9 @@
|
||||||
value=field.serializers
|
value=field.serializers
|
||||||
content=serializerContent
|
content=serializerContent
|
||||||
onChange=(action (mut field.serializers))
|
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>
|
||||||
<td class="actions">
|
<td class="actions">
|
||||||
{{#if loading}}
|
{{#if loading}}
|
||||||
|
@ -43,15 +46,16 @@
|
||||||
action=(action "destroy")
|
action=(action "destroy")
|
||||||
icon="trash-alt"
|
icon="trash-alt"
|
||||||
class="destroy"
|
class="destroy"
|
||||||
disabled=destroyDisabled
|
disabled=destroyDisabled}}
|
||||||
}}
|
|
||||||
{{d-button
|
{{d-button
|
||||||
icon="save"
|
icon="save"
|
||||||
action=(action "save")
|
action=(action "save")
|
||||||
disabled=saveDisabled
|
disabled=saveDisabled
|
||||||
class="save"
|
class="save"}}
|
||||||
}}
|
{{d-button
|
||||||
{{d-button action=(action "close") icon="times" disabled=closeDisabled}}
|
action=(action "close")
|
||||||
|
icon="times"
|
||||||
|
disabled=closeDisabled}}
|
||||||
</td>
|
</td>
|
||||||
{{else}}
|
{{else}}
|
||||||
<td><label>{{field.klass}}</label></td>
|
<td><label>{{field.klass}}</label></td>
|
||||||
|
|
|
@ -14,8 +14,7 @@
|
||||||
wizardComposer=true
|
wizardComposer=true
|
||||||
fieldId=field.id
|
fieldId=field.id
|
||||||
disabled=disableTextarea
|
disabled=disableTextarea
|
||||||
outletArgs=(hash composer=composer editorType="composer")
|
outletArgs=(hash composer=composer editorType="composer")}}
|
||||||
}}
|
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
|
@ -23,4 +22,4 @@
|
||||||
class="wizard-composer-upload"
|
class="wizard-composer-upload"
|
||||||
accept={{allowedFileTypes}}
|
accept={{allowedFileTypes}}
|
||||||
multiple
|
multiple
|
||||||
/>
|
>
|
||||||
|
|
|
@ -26,5 +26,9 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if clearable}}
|
{{#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}}
|
{{/if}}
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<div class="d-editor-container">
|
<div class="d-editor-container">
|
||||||
{{#if showPreview}}
|
{{#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">
|
<div class="d-editor-preview">
|
||||||
{{html-safe preview}}
|
{{html-safe preview}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -18,16 +18,13 @@
|
||||||
onExpand=(action b.action b)
|
onExpand=(action b.action b)
|
||||||
class=b.className
|
class=b.className
|
||||||
content=popupMenuOptions
|
content=popupMenuOptions
|
||||||
options=(hash popupTitle=b.title icon=b.icon)
|
options=(hash
|
||||||
}}
|
popupTitle=b.title
|
||||||
|
icon=b.icon
|
||||||
|
)}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<div>{{d.icon}}</div>
|
<div>{{d.icon}}</div>
|
||||||
<button
|
<button class="wizard-btn {{b.className}}" {{action b.action b}} title={{b.title}} type="button">
|
||||||
class="wizard-btn {{b.className}}"
|
|
||||||
{{action b.action b}}
|
|
||||||
title={{b.title}}
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{d-icon b.icon}}
|
{{d-icon b.icon}}
|
||||||
{{#if b.label}}
|
{{#if b.label}}
|
||||||
<span class="d-button-label">{{i18n b.label}}</span>
|
<span class="d-button-label">{{i18n b.label}}</span>
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
whitelist=field.content
|
whitelist=field.content
|
||||||
onChange=(action (mut categories))
|
onChange=(action (mut categories))
|
||||||
tabindex=field.tabindex
|
tabindex=field.tabindex
|
||||||
options=(hash maximum=field.limit)
|
options=(hash
|
||||||
}}
|
maximum=field.limit
|
||||||
|
)}}
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
cannotSeeMention=(action "cannotSeeMention")
|
cannotSeeMention=(action "cannotSeeMention")
|
||||||
importQuote=(action "importQuote")
|
importQuote=(action "importQuote")
|
||||||
togglePreview=(action "togglePreview")
|
togglePreview=(action "togglePreview")
|
||||||
afterRefresh=(action "afterRefresh")
|
afterRefresh=(action "afterRefresh")}}
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="bottom-bar">
|
<div class="bottom-bar">
|
||||||
<button
|
<button class="wizard-btn toggle-preview" {{action "togglePreview"}} type="button">
|
||||||
class="wizard-btn toggle-preview"
|
|
||||||
{{action "togglePreview"}}
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
<span class="d-button-label">{{i18n togglePreviewLabel}}</span>
|
<span class="d-button-label">{{i18n togglePreviewLabel}}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,6 @@
|
||||||
content=field.content
|
content=field.content
|
||||||
tabindex=field.tabindex
|
tabindex=field.tabindex
|
||||||
onChange=(action "onChangeValue")
|
onChange=(action "onChangeValue")
|
||||||
options=(hash none="select_kit.default_header_text")
|
options=(hash
|
||||||
}}
|
none="select_kit.default_header_text"
|
||||||
|
)}}
|
||||||
|
|
|
@ -6,5 +6,6 @@
|
||||||
value=field.value
|
value=field.value
|
||||||
tabindex=field.tabindex
|
tabindex=field.tabindex
|
||||||
onChange=(action (mut field.value))
|
onChange=(action (mut field.value))
|
||||||
options=(hash none="select_kit.default_header_text")
|
options=(hash
|
||||||
}}
|
none="select_kit.default_header_text"
|
||||||
|
)}}
|
||||||
|
|
|
@ -6,3 +6,4 @@
|
||||||
tabindex={{this.field.tabindex}}
|
tabindex={{this.field.tabindex}}
|
||||||
class={{this.fieldClass}}
|
class={{this.fieldClass}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,7 @@
|
||||||
tabindex=field.tabindex
|
tabindex=field.tabindex
|
||||||
tagGroups=field.tag_groups
|
tagGroups=field.tag_groups
|
||||||
everyTag=true
|
everyTag=true
|
||||||
options=(hash maximum=field.limit allowAny=field.can_create_tag)
|
options=(hash
|
||||||
}}
|
maximum=field.limit
|
||||||
|
allowAny=field.can_create_tag
|
||||||
|
)}}
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
<label
|
<label class="wizard-btn wizard-btn-upload-file {{if uploading "disabled"}}" tabindex={{field.tabindex}}>
|
||||||
class="wizard-btn wizard-btn-upload-file {{if uploading 'disabled'}}"
|
|
||||||
tabindex={{field.tabindex}}
|
|
||||||
>
|
|
||||||
{{#if uploading}}
|
{{#if uploading}}
|
||||||
{{i18n "wizard.uploading"}}
|
{{i18n "wizard.uploading"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
@ -9,18 +6,12 @@
|
||||||
{{d-icon "upload"}}
|
{{d-icon "upload"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<input
|
<input disabled={{uploading}} class="hidden-upload-field" type="file" accept={{field.file_types}} style="visibility: hidden; position: absolute;" >
|
||||||
disabled={{uploading}}
|
|
||||||
class="hidden-upload-field"
|
|
||||||
type="file"
|
|
||||||
accept={{field.file_types}}
|
|
||||||
style="visibility: hidden; position: absolute;"
|
|
||||||
/>
|
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
{{#if field.value}}
|
{{#if field.value}}
|
||||||
{{#if isImage}}
|
{{#if isImage}}
|
||||||
<img src={{field.value.url}} class="wizard-image-preview" />
|
<img src={{field.value.url}} class="wizard-image-preview">
|
||||||
{{else}}
|
{{else}}
|
||||||
{{field.value.original_filename}}
|
{{field.value.original_filename}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{{custom-user-selector
|
{{custom-user-selector
|
||||||
usernames=field.value
|
usernames=field.value
|
||||||
placeholderKey=field.placeholder
|
placeholderKey=field.placeholder
|
||||||
tabindex=field.tabindex
|
tabindex=field.tabindex}}
|
||||||
}}
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
{{#if field.image}}
|
{{#if field.image}}
|
||||||
<div class="field-image"><img src={{field.image}} /></div>
|
<div class="field-image"><img src={{field.image}}></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if field.description}}
|
{{#if field.description}}
|
||||||
|
@ -13,14 +13,7 @@
|
||||||
{{#field-validators field=field as |validators|}}
|
{{#field-validators field=field as |validators|}}
|
||||||
{{#if inputComponentName}}
|
{{#if inputComponentName}}
|
||||||
<div class="input-area">
|
<div class="input-area">
|
||||||
{{component
|
{{component inputComponentName field=field step=step fieldClass=fieldClass wizard=wizard autocomplete=validators.autocomplete}}
|
||||||
inputComponentName
|
|
||||||
field=field
|
|
||||||
step=step
|
|
||||||
fieldClass=fieldClass
|
|
||||||
wizard=wizard
|
|
||||||
autocomplete=validators.autocomplete
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/field-validators}}
|
{{/field-validators}}
|
||||||
|
@ -32,7 +25,5 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if field.errorDescription}}
|
{{#if field.errorDescription}}
|
||||||
<div class="field-error-description">{{html-safe
|
<div class="field-error-description">{{html-safe field.errorDescription}}</div>
|
||||||
field.errorDescription
|
|
||||||
}}</div>
|
|
||||||
{{/if}}
|
{{/if}}
|
|
@ -1,10 +1,6 @@
|
||||||
<div>{{text}}</div>
|
<div>{{text}}</div>
|
||||||
<div class="no-access-gutter">
|
<div class="no-access-gutter">
|
||||||
<button
|
<button class="wizard-btn primary return-to-site" {{action "skip"}} type="button">
|
||||||
class="wizard-btn primary return-to-site"
|
|
||||||
{{action "skip"}}
|
|
||||||
type="button"
|
|
||||||
>
|
|
||||||
{{i18n "wizard.return_to_site" siteName=siteName}}
|
{{i18n "wizard.return_to_site" siteName=siteName}}
|
||||||
{{d-icon "sign-out-alt"}}
|
{{d-icon "sign-out-alt"}}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
<a href={{topic.url}} target="_blank" rel="noopener noreferrer">
|
<a href={{topic.url}} target="_blank" rel="noopener noreferrer">
|
||||||
<span class="title">{{html-safe topic.fancy_title}}</span>
|
<span class="title">{{html-safe topic.fancy_title}}</span>
|
||||||
<div class="blurb">{{date-node topic.created_at}}
|
<div class="blurb">{{date-node topic.created_at}} - {{html-safe topic.blurb}}</div>
|
||||||
-
|
|
||||||
{{html-safe topic.blurb}}</div>
|
|
||||||
</a>
|
</a>
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
{{#if bannerImage}}
|
{{#if bannerImage}}
|
||||||
<div class="wizard-step-banner">
|
<div class="wizard-step-banner">
|
||||||
<img src={{bannerImage}} />
|
<img src={{bannerImage}}>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -26,11 +26,7 @@
|
||||||
<div class="white"></div>
|
<div class="white"></div>
|
||||||
<div class="black" style={{barStyle}}></div>
|
<div class="black" style={{barStyle}}></div>
|
||||||
<div class="screen"></div>
|
<div class="screen"></div>
|
||||||
<span>{{i18n
|
<span>{{i18n "wizard.step" current=step.displayIndex total=wizard.totalSteps}}</span>
|
||||||
"wizard.step"
|
|
||||||
current=step.displayIndex
|
|
||||||
total=wizard.totalSteps
|
|
||||||
}}</span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="wizard-buttons">
|
<div class="wizard-buttons">
|
||||||
|
@ -38,44 +34,22 @@
|
||||||
{{loading-spinner size="small"}}
|
{{loading-spinner size="small"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if showQuitButton}}
|
{{#if showQuitButton}}
|
||||||
<a
|
<a href {{action "quit"}} class="action-link quit" tabindex={{secondaryButtonIndex}}>{{i18n "wizard.quit"}}</a>
|
||||||
href
|
|
||||||
{{action "quit"}}
|
|
||||||
class="action-link quit"
|
|
||||||
tabindex={{secondaryButtonIndex}}
|
|
||||||
>{{i18n "wizard.quit"}}</a>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{#if showBackButton}}
|
{{#if showBackButton}}
|
||||||
<a
|
<a href {{action "backStep"}} class="action-link back" tabindex={{secondaryButtonIndex}}>{{i18n "wizard.back"}}</a>
|
||||||
href
|
|
||||||
{{action "backStep"}}
|
|
||||||
class="action-link back"
|
|
||||||
tabindex={{secondaryButtonIndex}}
|
|
||||||
>{{i18n "wizard.back"}}</a>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showNextButton}}
|
{{#if showNextButton}}
|
||||||
<button
|
<button type="button" class="wizard-btn next primary" {{action "nextStep"}} disabled={{saving}} tabindex={{primaryButtonIndex}}>
|
||||||
type="button"
|
|
||||||
class="wizard-btn next primary"
|
|
||||||
{{action "nextStep"}}
|
|
||||||
disabled={{saving}}
|
|
||||||
tabindex={{primaryButtonIndex}}
|
|
||||||
>
|
|
||||||
{{i18n "wizard.next"}}
|
{{i18n "wizard.next"}}
|
||||||
{{d-icon "chevron-right"}}
|
{{d-icon "chevron-right"}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showDoneButton}}
|
{{#if showDoneButton}}
|
||||||
<button
|
<button type="button" class="wizard-btn done" {{action "done"}} disabled={{saving}} tabindex={{primaryButtonIndex}}>
|
||||||
type="button"
|
|
||||||
class="wizard-btn done"
|
|
||||||
{{action "done"}}
|
|
||||||
disabled={{saving}}
|
|
||||||
tabindex={{primaryButtonIndex}}
|
|
||||||
>
|
|
||||||
{{i18n "wizard.done_custom"}}
|
{{i18n "wizard.done_custom"}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,22 +1,12 @@
|
||||||
{{#if field.validations}}
|
{{#if field.validations}}
|
||||||
{{#each-in field.validations.above as |type validation|}}
|
{{#each-in field.validations.above as |type validation|}}
|
||||||
{{component
|
{{component validation.component field=field type=type validation=validation}}
|
||||||
validation.component
|
|
||||||
field=field
|
|
||||||
type=type
|
|
||||||
validation=validation
|
|
||||||
}}
|
|
||||||
{{/each-in}}
|
{{/each-in}}
|
||||||
|
|
||||||
{{yield (hash perform=(action "perform") autocomplete="off")}}
|
{{yield (hash perform=(action "perform") autocomplete="off")}}
|
||||||
|
|
||||||
{{#each-in field.validations.below as |type validation|}}
|
{{#each-in field.validations.below as |type validation|}}
|
||||||
{{component
|
{{component validation.component field=field type=type validation=validation}}
|
||||||
validation.component
|
|
||||||
field=field
|
|
||||||
type=type
|
|
||||||
validation=validation
|
|
||||||
}}
|
|
||||||
{{/each-in}}
|
{{/each-in}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{yield}}
|
{{yield}}
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
action=(action "undoChanges")
|
action=(action "undoChanges")
|
||||||
icon=undoIcon
|
icon=undoIcon
|
||||||
label=undoKey
|
label=undoKey
|
||||||
class="undo-changes"
|
class="undo-changes"}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
|
@ -14,12 +13,14 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-subscription-selector
|
{{wizard-subscription-selector
|
||||||
value=this.action.type
|
value=action.type
|
||||||
feature="action"
|
feature="action"
|
||||||
attribute="type"
|
attribute="type"
|
||||||
onChange=(action "changeType")
|
onChange=(action "changeType")
|
||||||
wizard=wizard
|
wizard=wizard
|
||||||
options=(hash none="admin.wizard.select_type")
|
options=(hash
|
||||||
|
none="admin.wizard.select_type"
|
||||||
|
)
|
||||||
}}
|
}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -31,14 +32,16 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{combo-box
|
{{combo-box
|
||||||
value=this.action.run_after
|
value=action.run_after
|
||||||
content=runAfterContent
|
content=runAfterContent
|
||||||
onChange=(action (mut this.action.run_after))
|
onChange=(action (mut action.run_after))}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-message key=messageKey url=messageUrl component="action"}}
|
{{wizard-message
|
||||||
|
key=messageKey
|
||||||
|
url=messageUrl
|
||||||
|
component="action"}}
|
||||||
|
|
||||||
{{#if basicTopicFields}}
|
{{#if basicTopicFields}}
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
|
@ -48,15 +51,14 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.title
|
inputs=action.title
|
||||||
property="title"
|
property="title"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -67,24 +69,26 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{combo-box
|
{{combo-box
|
||||||
value=this.action.post
|
value=action.post
|
||||||
content=wizardFields
|
content=wizardFields
|
||||||
nameProperty="label"
|
nameProperty="label"
|
||||||
onChange=(action (mut this.action.post))
|
onChange=(action (mut action.post))
|
||||||
options=(hash
|
options=(hash
|
||||||
none="admin.wizard.selector.placeholder.wizard_field"
|
none="admin.wizard.selector.placeholder.wizard_field"
|
||||||
isDisabled=showPostBuilder
|
isDisabled=showPostBuilder
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="setting-gutter">
|
<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>
|
<span>{{i18n "admin.wizard.action.post_builder.checkbox"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if this.action.post_builder}}
|
{{#if action.post_builder}}
|
||||||
<div class="setting full">
|
<div class="setting full">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n "admin.wizard.action.post_builder.label"}}</label>
|
<label>{{i18n "admin.wizard.action.post_builder.label"}}</label>
|
||||||
|
@ -92,9 +96,8 @@
|
||||||
|
|
||||||
<div class="setting-value editor">
|
<div class="setting-value editor">
|
||||||
{{wizard-text-editor
|
{{wizard-text-editor
|
||||||
value=this.action.post_template
|
value=action.post_template
|
||||||
wizardFields=wizardFields
|
wizardFields=wizardFields}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -108,7 +111,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.category
|
inputs=action.category
|
||||||
property="category"
|
property="category"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -119,8 +122,7 @@
|
||||||
wizardActionSelection="output"
|
wizardActionSelection="output"
|
||||||
outputDefaultSelection="category"
|
outputDefaultSelection="category"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -131,7 +133,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.tags
|
inputs=action.tags
|
||||||
property="tags"
|
property="tags"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -141,8 +143,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -153,13 +154,14 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.visible
|
inputs=action.visible
|
||||||
property="visible"
|
property="visible"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
wizardFieldSelection=true userFieldSelection=true context="action"
|
wizardFieldSelection=true
|
||||||
)
|
userFieldSelection=true
|
||||||
}}
|
context="action"
|
||||||
|
)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -171,11 +173,13 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.add_event
|
inputs=action.add_event
|
||||||
property="add_event"
|
property="add_event"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash wizardFieldSelection=true context="action")
|
options=(hash
|
||||||
}}
|
wizardFieldSelection=true
|
||||||
|
context="action"
|
||||||
|
)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -188,11 +192,13 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.add_location
|
inputs=action.add_location
|
||||||
property="add_location"
|
property="add_location"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash wizardFieldSelection=true context="action")
|
options=(hash
|
||||||
}}
|
wizardFieldSelection=true
|
||||||
|
context="action"
|
||||||
|
)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -206,7 +212,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.recipient
|
inputs=action.recipient
|
||||||
property="recipient"
|
property="recipient"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -217,8 +223,7 @@
|
||||||
userSelection="output"
|
userSelection="output"
|
||||||
outputDefaultSelection="user"
|
outputDefaultSelection="user"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -230,7 +235,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.profile_updates
|
inputs=action.profile_updates
|
||||||
property="profile_updates"
|
property="profile_updates"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -241,8 +246,7 @@
|
||||||
wizardActionSelection="value"
|
wizardActionSelection="value"
|
||||||
keyDefaultSelection="userField"
|
keyDefaultSelection="userField"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -254,14 +258,13 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{combo-box
|
{{combo-box
|
||||||
value=this.action.api
|
value=action.api
|
||||||
content=availableApis
|
content=availableApis
|
||||||
onChange=(action (mut this.action.api))
|
onChange=(action (mut action.api))
|
||||||
options=(hash
|
options=(hash
|
||||||
isDisabled=this.action.custom_title_enabled
|
isDisabled=action.custom_title_enabled
|
||||||
none="admin.wizard.action.send_to_api.select_an_api"
|
none="admin.wizard.action.send_to_api.select_an_api"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -272,14 +275,13 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{combo-box
|
{{combo-box
|
||||||
value=this.action.api_endpoint
|
value=action.api_endpoint
|
||||||
content=availableEndpoints
|
content=availableEndpoints
|
||||||
onChange=(action (mut this.action.api_endpoint))
|
onChange=(action (mut action.api_endpoint))
|
||||||
options=(hash
|
options=(hash
|
||||||
isDisabled=apiEmpty
|
isDisabled=apiEmpty
|
||||||
none="admin.wizard.action.send_to_api.select_an_endpoint"
|
none="admin.wizard.action.send_to_api.select_an_endpoint"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -290,12 +292,11 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-text-editor
|
{{wizard-text-editor
|
||||||
value=this.action.api_body
|
value=action.api_body
|
||||||
previewEnabled=false
|
previewEnabled=false
|
||||||
barEnabled=false
|
barEnabled=false
|
||||||
wizardFields=wizardFields
|
wizardFields=wizardFields
|
||||||
placeholder="admin.wizard.action.send_to_api.body_placeholder"
|
placeholder="admin.wizard.action.send_to_api.body_placeholder"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -308,7 +309,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.group
|
inputs=action.group
|
||||||
property="group"
|
property="group"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -319,8 +320,7 @@
|
||||||
groupSelection="value,output"
|
groupSelection="value,output"
|
||||||
outputDefaultSelection="group"
|
outputDefaultSelection="group"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -333,7 +333,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.url
|
inputs=action.url
|
||||||
property="url"
|
property="url"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -343,8 +343,7 @@
|
||||||
groupSelection="key,value"
|
groupSelection="key,value"
|
||||||
categorySelection="key,value"
|
categorySelection="key,value"
|
||||||
userSelection="key,value"
|
userSelection="key,value"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -357,7 +356,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.categories
|
inputs=action.categories
|
||||||
property="categories"
|
property="categories"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -367,49 +366,42 @@
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
categorySelection="output"
|
categorySelection="output"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.watch_categories.mute_remainder"}}</label>
|
||||||
"admin.wizard.action.watch_categories.mute_remainder"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.mute_remainder
|
inputs=action.mute_remainder
|
||||||
property="mute_remainder"
|
property="mute_remainder"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
context="action"
|
context="action"
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.watch_x.notification_level.label"}}</label>
|
||||||
"admin.wizard.action.watch_x.notification_level.label"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{combo-box
|
{{combo-box
|
||||||
value=this.action.notification_level
|
value=action.notification_level
|
||||||
content=availableNotificationLevels
|
content=availableNotificationLevels
|
||||||
onChange=(action (mut this.action.notification_level))
|
onChange=(action (mut action.notification_level))
|
||||||
options=(hash
|
options=(hash
|
||||||
isDisabled=this.action.custom_title_enabled
|
isDisabled=action.custom_title_enabled
|
||||||
none="admin.wizard.action.watch_x.select_a_notification_level"
|
none="admin.wizard.action.watch_x.select_a_notification_level"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -419,7 +411,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @type="checkbox" @checked={{this.action.wizard_user}} />
|
<Input
|
||||||
|
@type="checkbox"
|
||||||
|
@checked={{this.action.wizard_user}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -430,7 +425,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.usernames
|
inputs=action.usernames
|
||||||
property="usernames"
|
property="usernames"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -438,8 +433,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
userSelection="output"
|
userSelection="output"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -452,7 +446,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.tags
|
inputs=action.tags
|
||||||
property="tags"
|
property="tags"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -462,28 +456,24 @@
|
||||||
wizardActionSelection=true
|
wizardActionSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.watch_x.notification_level.label"}}</label>
|
||||||
"admin.wizard.action.watch_x.notification_level.label"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{combo-box
|
{{combo-box
|
||||||
value=this.action.notification_level
|
value=action.notification_level
|
||||||
content=availableNotificationLevels
|
content=availableNotificationLevels
|
||||||
onChange=(action (mut this.action.notification_level))
|
onChange=(action (mut action.notification_level))
|
||||||
options=(hash
|
options=(hash
|
||||||
isDisabled=this.action.custom_title_enabled
|
isDisabled=action.custom_title_enabled
|
||||||
none="admin.wizard.action.watch_x.select_a_notification_level"
|
none="admin.wizard.action.watch_x.select_a_notification_level"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -493,7 +483,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @type="checkbox" @checked={{this.action.wizard_user}} />
|
<Input
|
||||||
|
@type="checkbox"
|
||||||
|
@checked={{this.action.wizard_user}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -504,7 +497,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.usernames
|
inputs=action.usernames
|
||||||
property="usernames"
|
property="usernames"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -512,8 +505,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
userSelection="output"
|
userSelection="output"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -526,7 +518,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.name
|
inputs=action.name
|
||||||
property="name"
|
property="name"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -534,8 +526,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
|
@ -545,7 +536,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.full_name
|
inputs=action.full_name
|
||||||
property="full_name"
|
property="full_name"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -553,8 +544,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
|
@ -564,7 +554,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.title
|
inputs=action.title
|
||||||
property="title"
|
property="title"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -572,8 +562,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
|
@ -583,7 +572,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.bio_raw
|
inputs=action.bio_raw
|
||||||
property="bio_raw"
|
property="bio_raw"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -591,8 +580,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
|
@ -602,7 +590,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.owner_usernames
|
inputs=action.owner_usernames
|
||||||
property="owner_usernames"
|
property="owner_usernames"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -611,8 +599,7 @@
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
userSelection="output"
|
userSelection="output"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
|
@ -622,7 +609,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.usernames
|
inputs=action.usernames
|
||||||
property="usernames"
|
property="usernames"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -631,20 +618,17 @@
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
userSelection="output"
|
userSelection="output"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.create_group.grant_trust_level"}}</label>
|
||||||
"admin.wizard.action.create_group.grant_trust_level"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.grant_trust_level
|
inputs=action.grant_trust_level
|
||||||
property="grant_trust_level"
|
property="grant_trust_level"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -652,20 +636,17 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.create_group.mentionable_level"}}</label>
|
||||||
"admin.wizard.action.create_group.mentionable_level"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.mentionable_level
|
inputs=action.mentionable_level
|
||||||
property="mentionable_level"
|
property="mentionable_level"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -673,20 +654,17 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.create_group.messageable_level"}}</label>
|
||||||
"admin.wizard.action.create_group.messageable_level"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.messageable_level
|
inputs=action.messageable_level
|
||||||
property="messageable_level"
|
property="messageable_level"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -694,20 +672,17 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.create_group.visibility_level"}}</label>
|
||||||
"admin.wizard.action.create_group.visibility_level"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.visibility_level
|
inputs=action.visibility_level
|
||||||
property="visibility_level"
|
property="visibility_level"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -715,20 +690,17 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.create_group.members_visibility_level"}}</label>
|
||||||
"admin.wizard.action.create_group.members_visibility_level"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.members_visibility_level
|
inputs=action.members_visibility_level
|
||||||
property="members_visibility_level"
|
property="members_visibility_level"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -736,8 +708,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -750,7 +721,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.name
|
inputs=action.name
|
||||||
property="name"
|
property="name"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -758,8 +729,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -770,7 +740,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.slug
|
inputs=action.slug
|
||||||
property="slug"
|
property="slug"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -778,8 +748,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -790,7 +759,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.color
|
inputs=action.color
|
||||||
property="color"
|
property="color"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -798,8 +767,7 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -810,7 +778,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.text_color
|
inputs=action.text_color
|
||||||
property="text_color"
|
property="text_color"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -818,21 +786,18 @@
|
||||||
wizardFieldSelection=true
|
wizardFieldSelection=true
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting full field-mapper-setting">
|
<div class="setting full field-mapper-setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.action.create_category.parent_category"}}</label>
|
||||||
"admin.wizard.action.create_category.parent_category"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.parent_category_id
|
inputs=action.parent_category_id
|
||||||
property="parent_category_id"
|
property="parent_category_id"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -841,8 +806,7 @@
|
||||||
userFieldSelection="key,value"
|
userFieldSelection="key,value"
|
||||||
categorySelection="output"
|
categorySelection="output"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -853,7 +817,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.permissions
|
inputs=action.permissions
|
||||||
property="permissions"
|
property="permissions"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -864,8 +828,7 @@
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
groupSelection="key"
|
groupSelection="key"
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -878,7 +841,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.custom_fields
|
inputs=action.custom_fields
|
||||||
property="custom_fields"
|
property="custom_fields"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -889,8 +852,7 @@
|
||||||
userFieldSelection="value"
|
userFieldSelection="value"
|
||||||
keyPlaceholder="admin.wizard.action.custom_fields.key"
|
keyPlaceholder="admin.wizard.action.custom_fields.key"
|
||||||
context=customFieldsContext
|
context=customFieldsContext
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -903,7 +865,7 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper
|
{{wizard-mapper
|
||||||
inputs=this.action.required
|
inputs=action.required
|
||||||
property="required"
|
property="required"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=(hash
|
options=(hash
|
||||||
|
@ -912,8 +874,7 @@
|
||||||
userFieldSelection=true
|
userFieldSelection=true
|
||||||
groupSelection=true
|
groupSelection=true
|
||||||
context="action"
|
context="action"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -925,7 +886,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @type="checkbox" @checked={{this.action.skip_redirect}} />
|
<Input
|
||||||
|
@type="checkbox"
|
||||||
|
@checked={{this.action.skip_redirect}}
|
||||||
|
/>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
{{i18n "admin.wizard.action.skip_redirect.description" type="topic"}}
|
{{i18n "admin.wizard.action.skip_redirect.description" type="topic"}}
|
||||||
|
@ -939,13 +903,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @type="checkbox" @checked={{this.action.suppress_notifications}} />
|
<Input
|
||||||
|
@type="checkbox"
|
||||||
|
@checked={{this.action.suppress_notifications}}
|
||||||
|
/>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
{{i18n
|
{{i18n "admin.wizard.action.suppress_notifications.description" type="topic"}}
|
||||||
"admin.wizard.action.suppress_notifications.description"
|
|
||||||
type="topic"
|
|
||||||
}}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,8 +3,7 @@
|
||||||
action=(action "undoChanges")
|
action=(action "undoChanges")
|
||||||
icon=undoIcon
|
icon=undoIcon
|
||||||
label=undoKey
|
label=undoKey
|
||||||
class="undo-changes"
|
class="undo-changes"}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
|
@ -12,7 +11,10 @@
|
||||||
<label>{{i18n "admin.wizard.field.label"}}</label>
|
<label>{{i18n "admin.wizard.field.label"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input name="label" @value={{this.field.label}} />
|
<Input
|
||||||
|
name="label"
|
||||||
|
@value={{this.field.label}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -23,7 +25,10 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<span>{{i18n "admin.wizard.field.required_label"}}</span>
|
<span>{{i18n "admin.wizard.field.required_label"}}</span>
|
||||||
<Input @type="checkbox" @checked={{this.field.required}} />
|
<Input
|
||||||
|
@type="checkbox"
|
||||||
|
@checked={{this.field.required}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -32,7 +37,10 @@
|
||||||
<label>{{i18n "admin.wizard.field.description"}}</label>
|
<label>{{i18n "admin.wizard.field.description"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Textarea name="description" @value={{this.field.description}} />
|
<Textarea
|
||||||
|
name="description"
|
||||||
|
@value={{this.field.description}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -47,8 +55,7 @@
|
||||||
onUploadDeleted=(action "imageUploadDeleted")
|
onUploadDeleted=(action "imageUploadDeleted")
|
||||||
type="wizard-field-image"
|
type="wizard-field-image"
|
||||||
class="no-repeat contain-image"
|
class="no-repeat contain-image"
|
||||||
id=(concat "wizard-field-" field.id "-image-upload")
|
id=(concat "wizard-field-" field.id "-image-upload")}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -58,18 +65,20 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-subscription-selector
|
{{combo-box
|
||||||
value=field.type
|
value=field.type
|
||||||
feature="field"
|
content=fieldTypes
|
||||||
attribute="type"
|
|
||||||
onChange=(action "changeType")
|
onChange=(action "changeType")
|
||||||
wizard=wizard
|
options=(hash
|
||||||
options=(hash none="admin.wizard.select_type")
|
none="admin.wizard.select_type"
|
||||||
}}
|
)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-message key=messageKey url=messageUrl component="field"}}
|
{{wizard-message
|
||||||
|
key=messageKey
|
||||||
|
url=messageUrl
|
||||||
|
component="field"}}
|
||||||
|
|
||||||
{{#if isTextType}}
|
{{#if isTextType}}
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
|
@ -109,7 +118,10 @@
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<span>{{i18n "admin.wizard.field.char_counter_placeholder"}}</span>
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -151,7 +163,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @value={{this.field.file_types}} class="medium" />
|
<Input
|
||||||
|
@value={{this.field.file_types}}
|
||||||
|
class="medium"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -163,7 +178,11 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @type="number" @value={{this.field.limit}} class="small" />
|
<Input
|
||||||
|
@type="number"
|
||||||
|
@value={{this.field.limit}}
|
||||||
|
class="small"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -171,16 +190,15 @@
|
||||||
{{#if isDateTime}}
|
{{#if isDateTime}}
|
||||||
<div class="setting">
|
<div class="setting">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{html-safe
|
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.label")}}</label>
|
||||||
(i18n "admin.wizard.field.date_time_format.label")
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @value={{this.field.format}} class="medium" />
|
<Input
|
||||||
<label>{{html-safe
|
@value={{this.field.format}}
|
||||||
(i18n "admin.wizard.field.date_time_format.instructions")
|
class="medium"
|
||||||
}}</label>
|
/>
|
||||||
|
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.instructions")}}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -196,8 +214,7 @@
|
||||||
inputs=field.prefill
|
inputs=field.prefill
|
||||||
property="prefill"
|
property="prefill"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=prefillOptions
|
options=prefillOptions}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -213,8 +230,7 @@
|
||||||
inputs=field.content
|
inputs=field.content
|
||||||
property="content"
|
property="content"
|
||||||
onUpdate=(action "mappedFieldUpdated")
|
onUpdate=(action "mappedFieldUpdated")
|
||||||
options=contentOptions
|
options=contentOptions}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -240,7 +256,10 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input @type="checkbox" @checked={{this.field.can_create_tag}} />
|
<Input
|
||||||
|
@type="checkbox"
|
||||||
|
@checked={{this.field.can_create_tag}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -252,7 +271,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper inputs=field.condition options=fieldConditionOptions}}
|
{{wizard-mapper
|
||||||
|
inputs=field.condition
|
||||||
|
options=fieldConditionOptions}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -262,7 +283,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper inputs=field.index options=fieldIndexOptions}}
|
{{wizard-mapper
|
||||||
|
inputs=field.index
|
||||||
|
options=fieldIndexOptions}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -277,8 +300,9 @@
|
||||||
value=field.property
|
value=field.property
|
||||||
content=categoryPropertyTypes
|
content=categoryPropertyTypes
|
||||||
onChange=(action (mut field.property))
|
onChange=(action (mut field.property))
|
||||||
options=(hash none="admin.wizard.selector.placeholder.property")
|
options=(hash
|
||||||
}}
|
none="admin.wizard.selector.placeholder.property"
|
||||||
|
)}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
<label>{{i18n "admin.wizard.step.title"}}</label>
|
<label>{{i18n "admin.wizard.step.title"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input name="title" @value={{this.step.title}} />
|
<Input
|
||||||
|
name="title"
|
||||||
|
@value={{this.step.title}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -18,8 +21,7 @@
|
||||||
onUploadDeleted=(action "bannerUploadDeleted")
|
onUploadDeleted=(action "bannerUploadDeleted")
|
||||||
type="wizard-step-banner"
|
type="wizard-step-banner"
|
||||||
class="no-repeat contain-image"
|
class="no-repeat contain-image"
|
||||||
id=(concat "wizard-step-" step.id "-banner-upload")
|
id=(concat "wizard-step-" step.id "-banner-upload")}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -28,7 +30,8 @@
|
||||||
<label>{{i18n "admin.wizard.step.description"}}</label>
|
<label>{{i18n "admin.wizard.step.description"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-text-editor value=step.raw_description}}
|
{{wizard-text-editor
|
||||||
|
value=step.raw_description}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,7 +42,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{wizard-mapper inputs=step.condition options=stepConditionOptions}}
|
{{wizard-mapper
|
||||||
|
inputs=step.condition
|
||||||
|
options=stepConditionOptions}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -47,7 +52,10 @@
|
||||||
<div class="setting-label"></div>
|
<div class="setting-label"></div>
|
||||||
<div class="setting-value force-final">
|
<div class="setting-value force-final">
|
||||||
<h4>{{i18n "admin.wizard.step.force_final.label"}}</h4>
|
<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>
|
<span>{{i18n "admin.wizard.step.force_final.description"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -67,14 +75,15 @@
|
||||||
userFieldSelection="value"
|
userFieldSelection="value"
|
||||||
keyPlaceholder="admin.wizard.submission_key"
|
keyPlaceholder="admin.wizard.submission_key"
|
||||||
context="step"
|
context="step"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
{{#if step.required_data}}
|
{{#if step.required_data}}
|
||||||
<div class="required-data-message">
|
<div class="required-data-message">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
{{i18n "admin.wizard.step.required_data.not_permitted_message"}}
|
{{i18n "admin.wizard.step.required_data.not_permitted_message"}}
|
||||||
</div>
|
</div>
|
||||||
<Input @value={{this.step.required_data_message}} />
|
<Input
|
||||||
|
@value={{this.step.required_data_message}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -93,8 +102,7 @@
|
||||||
keyPlaceholder="admin.wizard.param_key"
|
keyPlaceholder="admin.wizard.param_key"
|
||||||
valuePlaceholder="admin.wizard.submission_key"
|
valuePlaceholder="admin.wizard.submission_key"
|
||||||
context="step"
|
context="step"
|
||||||
)
|
)}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/wizard-subscription-container}}
|
{{/wizard-subscription-container}}
|
||||||
|
@ -103,18 +111,15 @@
|
||||||
itemType="field"
|
itemType="field"
|
||||||
current=currentField
|
current=currentField
|
||||||
items=step.fields
|
items=step.fields
|
||||||
parentId=step.id
|
parentId=step.id}}
|
||||||
}}
|
|
||||||
|
|
||||||
{{#each step.fields as |field|}}
|
{{#each step.fields as |field|}}
|
||||||
{{wizard-custom-field
|
{{wizard-custom-field
|
||||||
field=field
|
field=field
|
||||||
step=step
|
step=step
|
||||||
wizard=wizard
|
|
||||||
currentFieldId=currentField.id
|
currentFieldId=currentField.id
|
||||||
fieldTypes=fieldTypes
|
fieldTypes=fieldTypes
|
||||||
removeField="removeField"
|
removeField="removeField"
|
||||||
wizardFields=wizardFields
|
wizardFields=wizardFields
|
||||||
subscribed=subscribed
|
subscribed=subscribed}}
|
||||||
}}
|
|
||||||
{{/each}}
|
{{/each}}
|
|
@ -4,34 +4,14 @@
|
||||||
{{#if anyLinks}}
|
{{#if anyLinks}}
|
||||||
{{#each links as |link|}}
|
{{#each links as |link|}}
|
||||||
<div data-id={{link.id}}>
|
<div data-id={{link.id}}>
|
||||||
{{d-button
|
{{d-button action=(action "change") actionParam=link.id translatedLabel=link.label class=link.classes}}
|
||||||
action=(action "change")
|
|
||||||
actionParam=link.id
|
|
||||||
translatedLabel=link.label
|
|
||||||
class=link.classes
|
|
||||||
}}
|
|
||||||
{{#unless link.first}}
|
{{#unless link.first}}
|
||||||
{{d-button
|
{{d-button action=(action "back") actionParam=link icon="arrow-left" class="back"}}
|
||||||
action=(action "back")
|
|
||||||
actionParam=link
|
|
||||||
icon="arrow-left"
|
|
||||||
class="back"
|
|
||||||
}}
|
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{#unless link.last}}
|
{{#unless link.last}}
|
||||||
{{d-button
|
{{d-button action=(action "forward") actionParam=link icon="arrow-right" class="forward"}}
|
||||||
action=(action "forward")
|
|
||||||
actionParam=link
|
|
||||||
icon="arrow-right"
|
|
||||||
class="forward"
|
|
||||||
}}
|
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{d-button
|
{{d-button action=(action "remove") actionParam=link.id icon="times" class="remove"}}
|
||||||
action=(action "remove")
|
|
||||||
actionParam=link.id
|
|
||||||
icon="times"
|
|
||||||
class="remove"
|
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -2,8 +2,7 @@
|
||||||
{{combo-box
|
{{combo-box
|
||||||
value=connector
|
value=connector
|
||||||
content=connectors
|
content=connectors
|
||||||
onChange=(action "changeConnector")
|
onChange=(action "changeConnector")}}
|
||||||
}}
|
|
||||||
{{else}}
|
{{else}}
|
||||||
{{#if connector}}
|
{{#if connector}}
|
||||||
<span class="connector-single">
|
<span class="connector-single">
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
{{wizard-mapper-connector
|
{{wizard-mapper-connector
|
||||||
connector=this.input.type
|
connector=input.type
|
||||||
connectors=this.inputTypes
|
connectors=inputTypes
|
||||||
inputTypes=true
|
inputTypes=true
|
||||||
inputType=this.inputType
|
inputType=inputType
|
||||||
connectorType="type"
|
connectorType="type"
|
||||||
options=this.options
|
options=options
|
||||||
onUpdate=this.onUpdate
|
onUpdate=onUpdate}}
|
||||||
}}
|
|
||||||
|
|
||||||
{{#if hasPairs}}
|
{{#if hasPairs}}
|
||||||
<div class="mapper-pairs mapper-block">
|
<div class="mapper-pairs mapper-block">
|
||||||
{{#each this.input.pairs as |pair|}}
|
{{#each input.pairs as |pair|}}
|
||||||
{{wizard-mapper-pair
|
{{wizard-mapper-pair
|
||||||
pair=pair
|
pair=pair
|
||||||
last=pair.last
|
last=pair.last
|
||||||
inputType=this.inputType
|
inputType=inputType
|
||||||
options=this.options
|
options=options
|
||||||
removePair=(action "removePair")
|
removePair=(action "removePair")
|
||||||
onUpdate=this.onUpdate
|
onUpdate=onUpdate}}
|
||||||
}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#if canAddPair}}
|
{{#if canAddPair}}
|
||||||
|
@ -32,27 +30,25 @@
|
||||||
{{#if hasOutput}}
|
{{#if hasOutput}}
|
||||||
{{#if hasPairs}}
|
{{#if hasPairs}}
|
||||||
{{wizard-mapper-connector
|
{{wizard-mapper-connector
|
||||||
connector=this.input.output_connector
|
connector=input.output_connector
|
||||||
connectors=this.connectors
|
connectors=connectors
|
||||||
connectorType="output"
|
connectorType="output"
|
||||||
inputType=this.inputType
|
inputType=inputType
|
||||||
options=this.options
|
options=options
|
||||||
onUpdate=this.onUpdate
|
onUpdate=onUpdate}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<div class="output mapper-block">
|
<div class="output mapper-block">
|
||||||
{{wizard-mapper-selector
|
{{wizard-mapper-selector
|
||||||
selectorType="output"
|
selectorType="output"
|
||||||
inputType=this.input.type
|
inputType=input.type
|
||||||
value=this.input.output
|
value=input.output
|
||||||
activeType=this.input.output_type
|
activeType=input.output_type
|
||||||
options=this.options
|
options=options
|
||||||
onUpdate=this.onUpdate
|
onUpdate=onUpdate}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<a role="button" class="remove-input" {{action remove this.input}}>
|
<a role="button" class="remove-input" {{action remove input}}>
|
||||||
{{d-icon "times"}}
|
{{d-icon "times"}}
|
||||||
</a>
|
</a>
|
|
@ -5,8 +5,7 @@
|
||||||
value=pair.key
|
value=pair.key
|
||||||
activeType=pair.key_type
|
activeType=pair.key_type
|
||||||
options=options
|
options=options
|
||||||
onUpdate=onUpdate
|
onUpdate=onUpdate}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{wizard-mapper-connector
|
{{wizard-mapper-connector
|
||||||
|
@ -15,8 +14,7 @@
|
||||||
connectorType="pair"
|
connectorType="pair"
|
||||||
inputType=inputType
|
inputType=inputType
|
||||||
options=options
|
options=options
|
||||||
onUpdate=onUpdate
|
onUpdate=onUpdate}}
|
||||||
}}
|
|
||||||
|
|
||||||
<div class="value mapper-block">
|
<div class="value mapper-block">
|
||||||
{{wizard-mapper-selector
|
{{wizard-mapper-selector
|
||||||
|
@ -26,8 +24,7 @@
|
||||||
activeType=pair.value_type
|
activeType=pair.value_type
|
||||||
options=options
|
options=options
|
||||||
onUpdate=onUpdate
|
onUpdate=onUpdate
|
||||||
connector=pair.connector
|
connector=pair.connector}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if showJoin}}
|
{{#if showJoin}}
|
||||||
|
@ -35,7 +32,5 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showRemove}}
|
{{#if showRemove}}
|
||||||
<a role="button" {{action removePair pair}} class="remove-pair">{{d-icon
|
<a role="button" {{action removePair pair}} class="remove-pair">{{d-icon "times"}}</a>
|
||||||
"times"
|
|
||||||
}}</a>
|
|
||||||
{{/if}}
|
{{/if}}
|
|
@ -10,8 +10,7 @@
|
||||||
{{wizard-mapper-selector-type
|
{{wizard-mapper-selector-type
|
||||||
activeType=activeType
|
activeType=activeType
|
||||||
item=item
|
item=item
|
||||||
toggle=(action "toggleType")
|
toggle=(action "toggleType")}}
|
||||||
}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -35,8 +34,10 @@
|
||||||
value=value
|
value=value
|
||||||
content=comboBoxContent
|
content=comboBoxContent
|
||||||
onChange=(action "changeValue")
|
onChange=(action "changeValue")
|
||||||
options=(hash none=placeholderKey allowAny=comboBoxAllowAny)
|
options=(hash
|
||||||
}}
|
none=placeholderKey
|
||||||
|
allowAny=comboBoxAllowAny
|
||||||
|
)}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showMultiSelect}}
|
{{#if showMultiSelect}}
|
||||||
|
@ -44,16 +45,14 @@
|
||||||
content=multiSelectContent
|
content=multiSelectContent
|
||||||
value=value
|
value=value
|
||||||
onChange=(action "changeValue")
|
onChange=(action "changeValue")
|
||||||
options=multiSelectOptions
|
options=multiSelectOptions}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showList}}
|
{{#if showList}}
|
||||||
{{wizard-value-list
|
{{wizard-value-list
|
||||||
values=value
|
values=value
|
||||||
addKey=placeholderKey
|
addKey=placeholderKey
|
||||||
onChange=(action "changeValue")
|
onChange=(action "changeValue")}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showTag}}
|
{{#if showTag}}
|
||||||
|
@ -61,8 +60,10 @@
|
||||||
tags=value
|
tags=value
|
||||||
onChange=(action "changeValue")
|
onChange=(action "changeValue")
|
||||||
everyTag=true
|
everyTag=true
|
||||||
options=(hash none=placeholderKey filterable=true)
|
options=(hash
|
||||||
}}
|
none=placeholderKey
|
||||||
|
filterable=true
|
||||||
|
)}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showUser}}
|
{{#if showUser}}
|
||||||
|
@ -71,7 +72,8 @@
|
||||||
value=value
|
value=value
|
||||||
autocomplete="discourse"
|
autocomplete="discourse"
|
||||||
onChange=(action "changeUserValue")
|
onChange=(action "changeUserValue")
|
||||||
options=(hash includeMessageableGroups="true")
|
options=(hash
|
||||||
}}
|
includeMessageableGroups="true"
|
||||||
|
)}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
|
@ -3,16 +3,14 @@
|
||||||
{{wizard-mapper-connector
|
{{wizard-mapper-connector
|
||||||
connector=input.connector
|
connector=input.connector
|
||||||
connectorType="input"
|
connectorType="input"
|
||||||
onUpdate=(action "inputUpdated")
|
onUpdate=(action "inputUpdated")}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{wizard-mapper-input
|
{{wizard-mapper-input
|
||||||
input=input
|
input=input
|
||||||
options=inputOptions
|
options=inputOptions
|
||||||
remove=(action "remove")
|
remove=(action "remove")
|
||||||
onUpdate=(action "inputUpdated")
|
onUpdate=(action "inputUpdated")}}
|
||||||
}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
||||||
{{#if canAdd}}
|
{{#if canAdd}}
|
||||||
|
|
|
@ -7,31 +7,27 @@
|
||||||
<li>
|
<li>
|
||||||
<span class="setting-title">
|
<span class="setting-title">
|
||||||
<h4>{{i18n (concat "admin.wizard.field.validations." type)}}</h4>
|
<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"}}
|
{{i18n "admin.wizard.field.validations.enabled"}}
|
||||||
</span>
|
</span>
|
||||||
<div class="validation-container">
|
<div class="validation-container">
|
||||||
<div class="validation-section">
|
<div class="validation-section">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.field.validations.categories"}}</label>
|
||||||
"admin.wizard.field.validations.categories"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{category-selector
|
{{category-selector
|
||||||
categories=(get
|
categories=(get this (concat "validationBuffer." type ".categories"))
|
||||||
this (concat "validationBuffer." type ".categories")
|
|
||||||
)
|
|
||||||
onChange=(action "updateValidationCategories" type props)
|
onChange=(action "updateValidationCategories" type props)
|
||||||
class="wizard"
|
class="wizard"}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="validation-section">
|
<div class="validation-section">
|
||||||
<div class="setting-label">
|
<div class="setting-label">
|
||||||
<label>{{i18n
|
<label>{{i18n "admin.wizard.field.validations.max_topic_age"}}</label>
|
||||||
"admin.wizard.field.validations.max_topic_age"
|
|
||||||
}}</label>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
<Input
|
<Input
|
||||||
|
@ -43,8 +39,7 @@
|
||||||
value=(readonly props.time_unit)
|
value=(readonly props.time_unit)
|
||||||
content=timeUnits
|
content=timeUnits
|
||||||
class="time-unit-selector"
|
class="time-unit-selector"
|
||||||
onChange=(action (mut props.time_unit))
|
onChange=(action (mut props.time_unit))}}
|
||||||
}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="validation-section">
|
<div class="validation-section">
|
||||||
|
@ -52,17 +47,9 @@
|
||||||
<label>{{i18n "admin.wizard.field.validations.position"}}</label>
|
<label>{{i18n "admin.wizard.field.validations.position"}}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="setting-value">
|
<div class="setting-value">
|
||||||
{{radio-button
|
{{radio-button name=(concat type field.id) value="above" selection=props.position}}
|
||||||
name=(concat type field.id)
|
|
||||||
value="above"
|
|
||||||
selection=props.position
|
|
||||||
}}
|
|
||||||
<span>{{i18n "admin.wizard.field.validations.above"}}</span>
|
<span>{{i18n "admin.wizard.field.validations.above"}}</span>
|
||||||
{{radio-button
|
{{radio-button name=(concat type field.id) value="below" selection=props.position}}
|
||||||
name=(concat type field.id)
|
|
||||||
value="below"
|
|
||||||
selection=props.position
|
|
||||||
}}
|
|
||||||
<span>{{i18n "admin.wizard.field.validations.below"}}</span>
|
<span>{{i18n "admin.wizard.field.validations.below"}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,24 +1,6 @@
|
||||||
<svg
|
<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">
|
||||||
width="300px"
|
<g id="pavilion-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||||
height="300px"
|
<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>
|
||||||
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>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
<span>{{label}}</span>
|
<span>{{label}}</span>
|
Vorher Breite: | Höhe: | Größe: 602 B Nachher Breite: | Höhe: | Größe: 538 B |
|
@ -1,7 +1,6 @@
|
||||||
<div class="select-kit-header-wrapper">
|
<div class="select-kit-header-wrapper">
|
||||||
|
|
||||||
{{component
|
{{component selectKit.options.selectedNameComponent
|
||||||
selectKit.options.selectedNameComponent
|
|
||||||
tabindex=tabindex
|
tabindex=tabindex
|
||||||
item=selectedContent
|
item=selectedContent
|
||||||
selectKit=selectKit
|
selectKit=selectKit
|
||||||
|
|
|
@ -16,10 +16,7 @@
|
||||||
|
|
||||||
{{#if isComposer}}
|
{{#if isComposer}}
|
||||||
<div class="wizard-table-long-text">
|
<div class="wizard-table-long-text">
|
||||||
<p
|
<p class="wizard-table-composer-text wizard-table-long-text-content {{textState}}">
|
||||||
class="wizard-table-composer-text wizard-table-long-text-content
|
|
||||||
{{textState}}"
|
|
||||||
>
|
|
||||||
{{value.value}}
|
{{value.value}}
|
||||||
</p>
|
</p>
|
||||||
<a href {{action "expandText"}}>
|
<a href {{action "expandText"}}>
|
||||||
|
@ -31,8 +28,7 @@
|
||||||
{{#if isComposerPreview}}
|
{{#if isComposerPreview}}
|
||||||
{{d-icon "comment-alt"}}
|
{{d-icon "comment-alt"}}
|
||||||
<span class="wizard-table-composer-text">
|
<span class="wizard-table-composer-text">
|
||||||
{{i18n "admin.wizard.submissions.composer_preview"}}:
|
{{i18n "admin.wizard.submissions.composer_preview"}}: {{value.value}}
|
||||||
{{value.value}}
|
|
||||||
</span>
|
</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -150,12 +146,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if showUsername}}
|
{{#if showUsername}}
|
||||||
<a
|
<a target="_blank" rel="noopener noreferrer" href={{userProfileUrl}} title={{username}}>
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
href={{userProfileUrl}}
|
|
||||||
title={{username}}
|
|
||||||
>
|
|
||||||
{{username}}
|
{{username}}
|
||||||
</a>
|
</a>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -1,12 +1,19 @@
|
||||||
{{d-editor value=value forcePreview=forcePreview placeholder=placeholder}}
|
{{d-editor
|
||||||
|
value=value
|
||||||
|
forcePreview=forcePreview
|
||||||
|
placeholder=placeholder}}
|
||||||
|
|
||||||
<div class="wizard-editor-gutter">
|
<div class="wizard-editor-gutter">
|
||||||
{{#if previewEnabled}}
|
{{#if previewEnabled}}
|
||||||
{{d-button action=(action "togglePreview") translatedLabel=previewLabel}}
|
{{d-button
|
||||||
|
action=(action "togglePreview")
|
||||||
|
translatedLabel=previewLabel}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if fieldsEnabled}}
|
{{#if fieldsEnabled}}
|
||||||
{{d-button action=(action "togglePopover") translatedLabel=popoverLabel}}
|
{{d-button
|
||||||
|
action=(action "togglePopover")
|
||||||
|
translatedLabel=popoverLabel}}
|
||||||
|
|
||||||
{{#if showPopover}}
|
{{#if showPopover}}
|
||||||
<div class="wizard-editor-gutter-popover">
|
<div class="wizard-editor-gutter-popover">
|
||||||
|
|
|
@ -1,7 +1,3 @@
|
||||||
{{#if noAccess}}
|
{{#if noAccess}}
|
||||||
{{custom-wizard-no-access
|
{{custom-wizard-no-access text=(i18n noAccessI18nKey) wizardId=wizardId reason=noAccessReason}}
|
||||||
text=(i18n noAccessI18nKey)
|
|
||||||
wizardId=wizardId
|
|
||||||
reason=noAccessReason
|
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
|
@ -16,6 +16,5 @@
|
||||||
wizard=wizard
|
wizard=wizard
|
||||||
goNext=(action "goNext")
|
goNext=(action "goNext")
|
||||||
goBack=(action "goBack")
|
goBack=(action "goBack")
|
||||||
showMessage=(action "showMessage")
|
showMessage=(action "showMessage")}}
|
||||||
}}
|
|
||||||
{{/if}}
|
{{/if}}
|
|
@ -4,10 +4,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="wizard-footer">
|
<div class="wizard-footer">
|
||||||
{{#if customWizard}}
|
{{#if customWizard}}
|
||||||
<img
|
<img src={{logoUrl}} style="background-image: initial; width: 33px; height: 33px;" >
|
||||||
src={{logoUrl}}
|
|
||||||
style="background-image: initial; width: 33px; height: 33px;"
|
|
||||||
/>
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="discourse-logo"></div>
|
<div class="discourse-logo"></div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
{{#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>
|
|
@ -0,0 +1,16 @@
|
||||||
|
{{#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>
|
|
@ -324,7 +324,6 @@ en:
|
||||||
then: "then"
|
then: "then"
|
||||||
set: "set"
|
set: "set"
|
||||||
equal: '='
|
equal: '='
|
||||||
not_equal: '!='
|
|
||||||
greater: '>'
|
greater: '>'
|
||||||
less: '<'
|
less: '<'
|
||||||
greater_or_equal: '>='
|
greater_or_equal: '>='
|
||||||
|
|
|
@ -55,8 +55,6 @@ en:
|
||||||
liquid_syntax_error: "Liquid syntax error in %{attribute}: %{message}"
|
liquid_syntax_error: "Liquid syntax error in %{attribute}: %{message}"
|
||||||
subscription: "%{type} %{property} usage is not supported on your subscription"
|
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"
|
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:
|
site_settings:
|
||||||
custom_wizard_enabled: "Enable custom wizards."
|
custom_wizard_enabled: "Enable custom wizards."
|
||||||
|
|
|
@ -65,18 +65,18 @@ class CustomWizard::Api::LogEntry
|
||||||
data = ::JSON.parse(record['value'])
|
data = ::JSON.parse(record['value'])
|
||||||
data[:log_id] = record['key'].split('_').last
|
data[:log_id] = record['key'].split('_').last
|
||||||
this_user = User.find_by(id: data['user_id'])
|
this_user = User.find_by(id: data['user_id'])
|
||||||
if this_user.nil?
|
unless this_user.nil?
|
||||||
data[:user_id] = nil
|
|
||||||
data[:username] = ""
|
|
||||||
data[:userpath] = ""
|
|
||||||
data[:name] = ""
|
|
||||||
data[:avatar_template] = ""
|
|
||||||
else
|
|
||||||
data[:user_id] = this_user.id || nil
|
data[:user_id] = this_user.id || nil
|
||||||
data[:username] = this_user.username || ""
|
data[:username] = this_user.username || ""
|
||||||
data[:userpath] = "/u/#{this_user.username_lower}/activity"
|
data[:userpath] = "/u/#{this_user.username_lower}/activity"
|
||||||
data[:name] = this_user.name || ""
|
data[:name] = this_user.name || ""
|
||||||
data[:avatar_template] = "/user_avatar/default/#{this_user.username_lower}/97/#{this_user.uploaded_avatar_id}.png"
|
data[:avatar_template] = "/user_avatar/default/#{this_user.username_lower}/97/#{this_user.uploaded_avatar_id}.png"
|
||||||
|
else
|
||||||
|
data[:user_id] = nil
|
||||||
|
data[:username] = ""
|
||||||
|
data[:userpath] = ""
|
||||||
|
data[:name] = ""
|
||||||
|
data[:avatar_template] = ""
|
||||||
end
|
end
|
||||||
self.new(api_name, data)
|
self.new(api_name, data)
|
||||||
end
|
end
|
||||||
|
|
|
@ -140,7 +140,7 @@ class ::CustomWizard::CustomField
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.cached_list
|
def self.cached_list
|
||||||
@custom_wizard_cached_fields ||= ::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
|
::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
|
||||||
PluginStoreRow.where(plugin_name: NAMESPACE).map do |record|
|
PluginStoreRow.where(plugin_name: NAMESPACE).map do |record|
|
||||||
create_from_store(record).as_json.with_indifferent_access
|
create_from_store(record).as_json.with_indifferent_access
|
||||||
end
|
end
|
||||||
|
@ -216,7 +216,6 @@ class ::CustomWizard::CustomField
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.invalidate_cache
|
def self.invalidate_cache
|
||||||
@custom_wizard_cached_fields = nil
|
|
||||||
CustomWizard::Cache.new(LIST_CACHE_KEY).delete
|
CustomWizard::Cache.new(LIST_CACHE_KEY).delete
|
||||||
Discourse.clear_readonly!
|
Discourse.clear_readonly!
|
||||||
Discourse.request_refresh!
|
Discourse.request_refresh!
|
||||||
|
|
|
@ -15,13 +15,13 @@ class CustomWizard::Log
|
||||||
@username = attrs['username']
|
@username = attrs['username']
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.create(wizard_id, action, username, message, date = Time.now)
|
def self.create(wizard_id, action, username, message)
|
||||||
log_id = SecureRandom.hex(12)
|
log_id = SecureRandom.hex(12)
|
||||||
|
|
||||||
PluginStore.set('custom_wizard_log',
|
PluginStore.set('custom_wizard_log',
|
||||||
log_id.to_s,
|
log_id.to_s,
|
||||||
{
|
{
|
||||||
date: date,
|
date: Time.now,
|
||||||
wizard_id: wizard_id,
|
wizard_id: wizard_id,
|
||||||
action: action,
|
action: action,
|
||||||
username: username,
|
username: username,
|
||||||
|
|
|
@ -30,7 +30,6 @@ class CustomWizard::Mapper
|
||||||
|
|
||||||
OPERATORS = {
|
OPERATORS = {
|
||||||
equal: '==',
|
equal: '==',
|
||||||
not_equal: "!=",
|
|
||||||
greater: '>',
|
greater: '>',
|
||||||
less: '<',
|
less: '<',
|
||||||
greater_or_equal: '>=',
|
greater_or_equal: '>=',
|
||||||
|
|
|
@ -1,28 +1,26 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
class CustomWizard::Subscription
|
class CustomWizard::Subscription
|
||||||
PRODUCT_HIERARCHY = %w[
|
STANDARD_PRODUCT_ID = 'prod_MH11woVoZU5AWb'
|
||||||
community
|
BUSINESS_PRODUCT_ID = 'prod_MH0wT627okh3Ef'
|
||||||
standard
|
COMMUNITY_PRODUCT_ID = 'prod_MU7l9EjxhaukZ7'
|
||||||
business
|
|
||||||
]
|
|
||||||
|
|
||||||
def self.attributes
|
def self.attributes
|
||||||
{
|
{
|
||||||
wizard: {
|
wizard: {
|
||||||
required: {
|
required: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
permitted: {
|
permitted: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*', "!#{CustomWizard::Wizard::GUEST_GROUP_ID}"]
|
community: ['*', "!#{CustomWizard::Wizard::GUEST_GROUP_ID}"]
|
||||||
},
|
},
|
||||||
restart_on_revisit: {
|
restart_on_revisit: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -30,19 +28,19 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
step: {
|
step: {
|
||||||
condition: {
|
condition: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
required_data: {
|
required_data: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
permitted_params: {
|
permitted_params: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -50,19 +48,19 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
field: {
|
field: {
|
||||||
condition: {
|
condition: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ['text', 'textarea', 'text_only', 'date', 'time', 'date_time', 'number', 'checkbox', 'dropdown', 'upload'],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
realtime_validations: {
|
realtime_validations: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: ['*'],
|
standard: ['*'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -70,7 +68,7 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
action: {
|
action: {
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ['create_topic', 'update_profile', 'open_composer', 'route_to'],
|
||||||
standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'],
|
standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -78,13 +76,13 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
custom_field: {
|
custom_field: {
|
||||||
klass: {
|
klass: {
|
||||||
none: ['*'],
|
none: ['topic', 'post'],
|
||||||
standard: ['topic', 'post'],
|
standard: ['topic', 'post'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
},
|
},
|
||||||
type: {
|
type: {
|
||||||
none: ['*'],
|
none: ['string', 'boolean', 'integer'],
|
||||||
standard: ['string', 'boolean', 'integer'],
|
standard: ['string', 'boolean', 'integer'],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -92,7 +90,7 @@ class CustomWizard::Subscription
|
||||||
},
|
},
|
||||||
api: {
|
api: {
|
||||||
all: {
|
all: {
|
||||||
none: ['*'],
|
none: [],
|
||||||
standard: [],
|
standard: [],
|
||||||
business: ['*'],
|
business: ['*'],
|
||||||
community: ['*']
|
community: ['*']
|
||||||
|
@ -101,31 +99,8 @@ class CustomWizard::Subscription
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
attr_accessor :product_id,
|
|
||||||
:product_slug
|
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
if CustomWizard::Subscription.client_installed?
|
@subscription = find_subscription
|
||||||
result = DiscourseSubscriptionClient.find_subscriptions("discourse-custom-wizard")
|
|
||||||
|
|
||||||
if result&.any?
|
|
||||||
ids_and_slugs = result.subscriptions.map do |subscription|
|
|
||||||
{
|
|
||||||
id: subscription.product_id,
|
|
||||||
slug: result.products[subscription.product_id]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
id_and_slug = ids_and_slugs.sort do |a, b|
|
|
||||||
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
|
end
|
||||||
|
|
||||||
def includes?(feature, attribute, value = nil)
|
def includes?(feature, attribute, value = nil)
|
||||||
|
@ -154,27 +129,47 @@ class CustomWizard::Subscription
|
||||||
end
|
end
|
||||||
|
|
||||||
def type
|
def type
|
||||||
return :business
|
return :none unless subscribed?
|
||||||
|
return :standard if standard?
|
||||||
|
return :business if business?
|
||||||
|
return :community if community?
|
||||||
end
|
end
|
||||||
|
|
||||||
def subscribed?
|
def subscribed?
|
||||||
true
|
standard? || business? || community?
|
||||||
end
|
end
|
||||||
|
|
||||||
def standard?
|
def standard?
|
||||||
product_slug === "standard"
|
@subscription.product_id === STANDARD_PRODUCT_ID
|
||||||
end
|
end
|
||||||
|
|
||||||
def business?
|
def business?
|
||||||
true
|
@subscription.product_id === BUSINESS_PRODUCT_ID
|
||||||
end
|
end
|
||||||
|
|
||||||
def community?
|
def community?
|
||||||
product_slug === "community"
|
@subscription.product_id === COMMUNITY_PRODUCT_ID
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.client_installed?
|
def client_installed?
|
||||||
defined?(DiscourseSubscriptionClient) == 'constant' && DiscourseSubscriptionClient.class == Module
|
defined?(SubscriptionClient) == 'constant' && SubscriptionClient.class == Module
|
||||||
|
end
|
||||||
|
|
||||||
|
def find_subscription
|
||||||
|
subscription = nil
|
||||||
|
|
||||||
|
if client_installed?
|
||||||
|
subscription = SubscriptionClientSubscription.active
|
||||||
|
.where(product_id: [STANDARD_PRODUCT_ID, BUSINESS_PRODUCT_ID, COMMUNITY_PRODUCT_ID])
|
||||||
|
.order("product_id = '#{BUSINESS_PRODUCT_ID}' DESC")
|
||||||
|
.first
|
||||||
|
end
|
||||||
|
|
||||||
|
unless subscription
|
||||||
|
subscription = OpenStruct.new(product_id: nil)
|
||||||
|
end
|
||||||
|
|
||||||
|
subscription
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.subscribed?
|
def self.subscribed?
|
||||||
|
@ -197,6 +192,10 @@ class CustomWizard::Subscription
|
||||||
new.type
|
new.type
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.client_installed?
|
||||||
|
new.client_installed?
|
||||||
|
end
|
||||||
|
|
||||||
def self.includes?(feature, attribute, value)
|
def self.includes?(feature, attribute, value)
|
||||||
new.includes?(feature, attribute, value)
|
new.includes?(feature, attribute, value)
|
||||||
end
|
end
|
||||||
|
|
|
@ -64,8 +64,6 @@ class CustomWizard::Template
|
||||||
ensure_wizard_upload_references!(wizard_id)
|
ensure_wizard_upload_references!(wizard_id)
|
||||||
PluginStore.remove(CustomWizard::PLUGIN_NAME, wizard.id)
|
PluginStore.remove(CustomWizard::PLUGIN_NAME, wizard.id)
|
||||||
clear_user_wizard_redirect(wizard_id, after_time: !!wizard.after_time)
|
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
|
end
|
||||||
|
|
||||||
clear_cache_keys
|
clear_cache_keys
|
||||||
|
|
|
@ -145,7 +145,7 @@ class CustomWizard::Wizard
|
||||||
step.last_step = true
|
step.last_step = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if !@restart_on_revisit && step.previous && step.previous.id === last_completed_step_id
|
if step.previous && step.previous.id === last_completed_step_id
|
||||||
@start = step.id
|
@start = step.id
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"author": "Pavilion",
|
"author": "Pavilion",
|
||||||
"license": "GPL V2",
|
"license": "GPL V2",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint-config-discourse": "^3.4.0",
|
"eslint-config-discourse": "^1.1.8",
|
||||||
"semver": "^7.3.5"
|
"semver": "^7.3.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
13
plugin.rb
13
plugin.rb
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
# name: discourse-custom-wizard
|
# name: discourse-custom-wizard
|
||||||
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
|
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
|
||||||
# version: 2.4.23
|
# version: 2.3.1
|
||||||
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
|
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
|
||||||
# url: https://github.com/paviliondev/discourse-custom-wizard
|
# url: https://github.com/paviliondev/discourse-custom-wizard
|
||||||
# contact_emails: development@pavilion.tech
|
# contact_emails: development@pavilion.tech
|
||||||
# subscription_url: https://coop.pavilion.tech
|
# subscription_url: https://coop.pavilion.tech
|
||||||
|
@ -236,13 +236,4 @@ after_initialize do
|
||||||
end
|
end
|
||||||
|
|
||||||
DiscourseEvent.trigger(:custom_wizard_ready)
|
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
|
end
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
describe CustomWizard::Log do
|
describe CustomWizard::Log do
|
||||||
before do
|
before do
|
||||||
CustomWizard::Log.create('first-test-wizard', 'perform_first_action', 'first_test_user', 'First log message', 5.minutes.ago)
|
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', 3.minutes.ago)
|
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', 1.minutes.ago)
|
CustomWizard::Log.create('third-test-wizard', 'perform_third_action', 'third_test_user', 'Third log message')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "creates logs" do
|
it "creates logs" do
|
||||||
|
|
|
@ -281,29 +281,16 @@ describe CustomWizard::Mapper do
|
||||||
|
|
||||||
it "avatar with valid size" do
|
it "avatar with valid size" do
|
||||||
avatar_inputs = inputs['interpolate_avatar'].dup
|
avatar_inputs = inputs['interpolate_avatar'].dup
|
||||||
avatar_inputs[0]["output"] = "Avatar: ![avatar](u{avatar.144})"
|
avatar_inputs[0]["output"] = "Avatar: ![avatar](u{avatar.120})"
|
||||||
|
|
||||||
expect(CustomWizard::Mapper.new(
|
expect(CustomWizard::Mapper.new(
|
||||||
inputs: avatar_inputs,
|
inputs: avatar_inputs,
|
||||||
data: data,
|
data: data,
|
||||||
user: user1
|
user: user1
|
||||||
).perform).to eq("Avatar: ![avatar](#{user1.avatar_template_url.gsub("{size}", "144")})")
|
).perform).to eq("Avatar: ![avatar](#{user1.avatar_template_url.gsub("{size}", "120")})")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "handles not equal pairs" do
|
|
||||||
expect(CustomWizard::Mapper.new(
|
|
||||||
inputs: inputs['not_equals_pair'],
|
|
||||||
data: data,
|
|
||||||
user: user1
|
|
||||||
).perform).to eq(true)
|
|
||||||
expect(CustomWizard::Mapper.new(
|
|
||||||
inputs: inputs['not_equals_pair'],
|
|
||||||
data: data,
|
|
||||||
user: user2
|
|
||||||
).perform).to eq(false)
|
|
||||||
end
|
|
||||||
|
|
||||||
it "handles greater than pairs" do
|
it "handles greater than pairs" do
|
||||||
expect(CustomWizard::Mapper.new(
|
expect(CustomWizard::Mapper.new(
|
||||||
inputs: inputs['greater_than_pair'],
|
inputs: inputs['greater_than_pair'],
|
||||||
|
|
|
@ -2,29 +2,35 @@
|
||||||
|
|
||||||
describe CustomWizard::Subscription do
|
describe CustomWizard::Subscription do
|
||||||
let(:guests_permitted) { get_wizard_fixture("wizard/guests_permitted") }
|
let(:guests_permitted) { get_wizard_fixture("wizard/guests_permitted") }
|
||||||
let!(:business_product_id) { SecureRandom.hex(8) }
|
|
||||||
let!(:standard_product_id) { SecureRandom.hex(8) }
|
def undefine_client_classes
|
||||||
let!(:community_product_id) { SecureRandom.hex(8) }
|
Object.send(:remove_const, :SubscriptionClient) if Object.constants.include?(:SubscriptionClient)
|
||||||
let!(:product_slugs) {
|
Object.send(:remove_const, :SubscriptionClientSubscription) if Object.constants.include?(:SubscriptionClientSubscription)
|
||||||
{
|
end
|
||||||
"#{business_product_id}" => "business",
|
|
||||||
"#{standard_product_id}" => "standard",
|
def define_client_classes
|
||||||
"#{community_product_id}" => "community"
|
load File.expand_path("#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/subscription_client.rb", __FILE__)
|
||||||
}
|
end
|
||||||
}
|
|
||||||
|
def stub_client_methods
|
||||||
|
[:active, :where, :order, :first].each do |method|
|
||||||
|
SubscriptionClientSubscription.stubs(method)
|
||||||
|
.returns(SubscriptionClientSubscription)
|
||||||
|
end
|
||||||
|
SubscriptionClientSubscription.stubs(:product_id).returns(SecureRandom.hex(8))
|
||||||
|
end
|
||||||
|
|
||||||
after do
|
after do
|
||||||
undefine_client_classes
|
undefine_client_classes
|
||||||
end
|
end
|
||||||
|
|
||||||
it "detects the subscription client" do
|
it "detects the subscription client" do
|
||||||
undefine_client_classes
|
|
||||||
expect(described_class.client_installed?).to eq(false)
|
expect(described_class.client_installed?).to eq(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
context "without a subscription client" do
|
context "without a subscription client" do
|
||||||
it "is not subscribed" do
|
it "is not subscribed" do
|
||||||
expect(described_class.subscribed?).to eq(true)
|
expect(described_class.subscribed?).to eq(false)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "has none type" do
|
it "has none type" do
|
||||||
|
@ -44,6 +50,7 @@ describe CustomWizard::Subscription do
|
||||||
context "with subscription client" do
|
context "with subscription client" do
|
||||||
before do
|
before do
|
||||||
define_client_classes
|
define_client_classes
|
||||||
|
stub_client_methods
|
||||||
end
|
end
|
||||||
|
|
||||||
it "detects the subscription client" do
|
it "detects the subscription client" do
|
||||||
|
@ -51,10 +58,6 @@ describe CustomWizard::Subscription do
|
||||||
end
|
end
|
||||||
|
|
||||||
context "without a subscription" do
|
context "without a subscription" do
|
||||||
before do
|
|
||||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(nil)
|
|
||||||
end
|
|
||||||
|
|
||||||
it "has none type" do
|
it "has none type" do
|
||||||
expect(described_class.type).to eq(:none)
|
expect(described_class.type).to eq(:none)
|
||||||
end
|
end
|
||||||
|
@ -68,31 +71,19 @@ describe CustomWizard::Subscription do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with subscriptions" do
|
context "with a subscription" do
|
||||||
def get_subscription_result(product_ids)
|
|
||||||
result = DiscourseSubscriptionClient::Subscriptions::Result.new
|
|
||||||
result.supplier = SubscriptionClientSupplier.new(product_slugs)
|
|
||||||
result.resource = SubscriptionClientResource.new
|
|
||||||
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!(:multiple_subscription_result) { get_subscription_result([community_product_id, business_product_id]) }
|
|
||||||
|
|
||||||
it "handles mapped values" do
|
it "handles mapped values" do
|
||||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
|
SubscriptionClientSubscription.stubs(:product_id).returns(CustomWizard::Subscription::STANDARD_PRODUCT_ID)
|
||||||
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(true)
|
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(true)
|
||||||
|
|
||||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
|
SubscriptionClientSubscription.stubs(:product_id).returns(CustomWizard::Subscription::COMMUNITY_PRODUCT_ID)
|
||||||
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(false)
|
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(false)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context "with a standard subscription" do
|
context "with standard subscription" do
|
||||||
before do
|
before do
|
||||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
|
SubscriptionClientSubscription.stubs(:product_id).returns(CustomWizard::Subscription::STANDARD_PRODUCT_ID)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "detects standard type" do
|
it "detects standard type" do
|
||||||
|
@ -108,9 +99,9 @@ describe CustomWizard::Subscription do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a business subscription" do
|
context "with business subscription" do
|
||||||
before do
|
before do
|
||||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(business_subscription_result)
|
SubscriptionClientSubscription.stubs(:product_id).returns(CustomWizard::Subscription::BUSINESS_PRODUCT_ID)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "detects business type" do
|
it "detects business type" do
|
||||||
|
@ -122,9 +113,9 @@ describe CustomWizard::Subscription do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context "with a community subscription" do
|
context "with community subscription" do
|
||||||
before do
|
before do
|
||||||
DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
|
SubscriptionClientSubscription.stubs(:product_id).returns(CustomWizard::Subscription::COMMUNITY_PRODUCT_ID)
|
||||||
end
|
end
|
||||||
|
|
||||||
it "detects community type" do
|
it "detects community type" do
|
||||||
|
@ -135,40 +126,5 @@ describe CustomWizard::Subscription do
|
||||||
expect(described_class.includes?(:action, :type, 'create_category')).to eq(true)
|
expect(described_class.includes?(:action, :type, 'create_category')).to eq(true)
|
||||||
end
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -226,21 +226,6 @@ describe CustomWizard::Wizard do
|
||||||
end
|
end
|
||||||
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
|
context "with subscription and guest wizard" do
|
||||||
before do
|
before do
|
||||||
enable_subscription("standard")
|
enable_subscription("standard")
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
# 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
|
|
15
spec/fixtures/mapper/inputs.json
gevendort
15
spec/fixtures/mapper/inputs.json
gevendort
|
@ -195,21 +195,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"not_equals_pair": [
|
|
||||||
{
|
|
||||||
"type": "validation",
|
|
||||||
"pairs": [
|
|
||||||
{
|
|
||||||
"index": 0,
|
|
||||||
"key": "trust_level",
|
|
||||||
"key_type": "user_field",
|
|
||||||
"value": "1",
|
|
||||||
"value_type": "text",
|
|
||||||
"connector": "not_equal"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"greater_than_pair": [
|
"greater_than_pair": [
|
||||||
{
|
{
|
||||||
"type": "validation",
|
"type": "validation",
|
||||||
|
|
40
spec/fixtures/subscription_client.rb
gevendort
40
spec/fixtures/subscription_client.rb
gevendort
|
@ -1,40 +1,4 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
module DiscourseSubscriptionClient
|
module SubscriptionClient; end
|
||||||
def self.find_subscriptions(resource_name)
|
class SubscriptionClientSubscription; end
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class SubscriptionClientSupplier
|
|
||||||
attr_reader :product_slugs
|
|
||||||
|
|
||||||
def initialize(product_slugs)
|
|
||||||
@product_slugs = product_slugs
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
class SubscriptionClientResource
|
|
||||||
end
|
|
||||||
|
|
||||||
class SubscriptionClientSubscription
|
|
||||||
attr_reader :product_id
|
|
||||||
|
|
||||||
def initialize(product_id)
|
|
||||||
@product_id = product_id
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
module DiscourseSubscriptionClient
|
|
||||||
class Subscriptions
|
|
||||||
class Result
|
|
||||||
attr_accessor :supplier,
|
|
||||||
:resource,
|
|
||||||
:subscriptions,
|
|
||||||
:products
|
|
||||||
|
|
||||||
def any?
|
|
||||||
supplier.present? && resource.present? && subscriptions.present? && products.present?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden Mehr anzeigen
Laden …
In neuem Issue referenzieren