1
0
Fork 0

Commits vergleichen

..

135 Commits

Autor SHA1 Nachricht Datum
5fe63ec70e
test 2023-10-03 20:36:04 +02:00
6bc33ebd64
test 2023-10-03 20:25:00 +02:00
df456abda0
test3 2023-10-03 20:09:53 +02:00
df30ce32ee
test2 2023-10-03 19:54:15 +02:00
4750829e1a
testing 2023-10-03 19:35:16 +02:00
49535d88bb
set default type to business 2023-10-03 18:44:50 +02:00
Angus McLeod
d5aa616ff8 DEV: Add explicit ordering to more specs 2023-09-30 09:46:25 +08:00
Angus McLeod
578c92e90e
Merge pull request #269 from paviliondev/composer-control-feature
Composer control feature
2023-09-21 10:43:24 +10:00
jumagura
3d104406fd REFACTOR: Improve test for category chooser when there is a create_topic_wizard customfield 2023-09-20 03:55:32 -04:00
jumagura
0eb6fb1ae0 REFACTOR: Move before_create_topic event handler to plugin.rb 2023-09-19 20:46:42 -04:00
jumagura
0992e9601c DEV: Make hide category default when custom wizard is selected 2023-09-19 14:17:06 -04:00
jumagura
10609f33e2 FIX: linting error 2023-09-19 14:00:04 -04:00
jumagura
bb81c5700a DEV: Use Discourse Events instead of topic model 2023-09-19 13:57:11 -04:00
jumagura
03ef41f7f0 FIX: Linting error 2023-09-18 18:11:20 -04:00
jumagura
bdd290f4e6 FIX: Linting error 2023-09-18 18:07:27 -04:00
jumagura
2ab15aaf86 FIX: linting error 2023-09-18 18:06:52 -04:00
jumagura
de9dccf233 bump version 2023-09-18 17:46:41 -04:00
jumagura
bb3f0c6252 DEV: Add acceptance tests for category filtering 2023-09-18 17:41:24 -04:00
jumagura
61309fd320 DEV: Add initializer logic to filter categories 2023-09-18 17:40:44 -04:00
jumagura
b365b5dd4f DEV: Add custom_field 2023-09-18 17:40:07 -04:00
jumagura
de03cbd15a DEV: Implement control to hide category from composer dropdown in specified categories 2023-09-18 17:39:50 -04:00
jumagura
29d7818a4a DEV: Add spec for validation 2023-09-18 17:36:21 -04:00
jumagura
f2d1437cff DEV: Implement wizard replacement validation in Topic Creation 2023-09-18 17:35:38 -04:00
Angus McLeod
9ab4ca21c8
Merge pull request #268 from paviliondev/fix_export_size
FIX: avoid page limit on downloads
2023-09-16 16:03:15 +10:00
merefield
16109b01e7 bump patch 2023-09-15 16:19:09 +01:00
merefield
43cd090b17 FIX: avoid page limit on downloads 2023-09-15 16:15:31 +01:00
Angus McLeod
5f99dc226a
Merge pull request #267 from paviliondev/resolve_deprecations
COMPATIBILITY:  resolve deprecations expected in Ember upgrade for Discourse 3.2
2023-09-15 16:55:45 +10:00
merefield
2460685e65 remove unintentional comment 2023-09-15 07:04:17 +01:00
merefield
c6fded7113 fix disabled behaviour of start time button 2023-09-14 21:08:20 +01:00
merefield
713c1bcaa5 fix test 2023-09-14 20:47:05 +01:00
merefield
ffa37e895c fix test and test spelling 2023-09-14 20:35:30 +01:00
merefield
22fac139b6 linting 2023-09-14 20:08:10 +01:00
merefield
61ea75dcad remove debugger statement 2023-09-14 20:03:02 +01:00
merefield
766d3b5fc9 fix erroneous route transitions 2023-09-14 20:02:02 +01:00
merefield
a786b5956b linting 2023-09-14 19:21:10 +01:00
merefield
794b7c9d5c add missing I18n imports 2023-09-14 19:19:20 +01:00
merefield
76c359be3b linting 2023-09-14 19:16:59 +01:00
merefield
6572b32706 move modals to glimmer components 2023-09-14 19:14:44 +01:00
merefield
d71d9976b8 bump patch 2023-09-14 15:05:54 +01:00
merefield
27596a1624 linting 2023-09-14 15:03:15 +01:00
merefield
3c17ef574e linting 2023-09-14 14:59:22 +01:00
merefield
742239b023 add router service to controllers to avoid deprecation 2023-09-14 14:58:34 +01:00
merefield
33a320021f linting 2023-09-14 14:47:52 +01:00
merefield
e6f44b7dfc resolve a batch of router deprecations 2023-09-14 14:42:12 +01:00
merefield
31f917ec80 fix replaceWith calling style deprecation 2023-09-14 14:34:18 +01:00
merefield
6c0d7a671e more this additions 2023-09-14 14:18:47 +01:00
merefield
31b2625a65 add this to avoid deprecation 2023-09-14 14:05:55 +01:00
Robert
bce0acbfd2
Merge pull request #263 from paviliondev/update-compatibility-main
DEV: Pin plugin for Discourse 3.1 stable
2023-09-08 16:31:17 +01:00
Robert
b81bc762c7
Merge branch 'main' into update-compatibility-main 2023-09-08 16:21:00 +01:00
jumagura
785bce228e bump version 2023-09-08 10:02:12 -04:00
Angus McLeod
52efc15576
Merge pull request #265 from paviliondev/temp_ignore_redirect
FEATURE: implement a way to temporarily ignore redirect
2023-09-08 09:53:12 +02:00
merefield
ebc0f706e3 remove redundant assignment 2023-09-08 07:18:31 +01:00
merefield
050a38a9d3 make code testable, add test 2023-09-08 07:13:52 +01:00
merefield
8649ab2286 bump patch 2023-09-06 16:27:40 +01:00
merefield
037132fb1a prettier 2023-09-06 16:26:30 +01:00
merefield
8332818616 FEATURE: implement way to temporarily ignore redirect 2023-09-06 13:29:21 +01:00
jumagura
36d6f9bc6f bump version 2023-09-05 12:52:11 -04:00
jumagura
121d60330a DEV: Pin plugin for Discourse 3.1 stable 2023-09-05 12:49:58 -04:00
jumagura
13a1538eb9 DEV: Update compatibility for main branch 2023-09-05 12:38:25 -04:00
Angus McLeod
fee56c2d43
Merge pull request #261 from paviliondev/fix_submissions_data_export_content
SECURITY: remove sensitive user content from submissions export
2023-08-23 17:50:10 +02:00
merefield
da4fe79aea bump patch 2023-08-23 14:35:58 +01:00
merefield
0a450d58f4 SECURITY: remove sensitive user content from submissions export 2023-08-23 14:33:56 +01:00
Robert
b45e01803d
Merge pull request #260 from paviliondev/fix-hyperlink-modal-deprecation
COMPATIBILITY: Update insert-hyperlink invocation following core change
2023-08-15 07:52:08 +01:00
jumagura
b8cfaa7f23 bump version 2023-08-14 18:19:14 -04:00
jumagura
690f12ee3e COMPATIBILITY: Update insert-hyperlink invocation following core change 2023-08-14 18:17:57 -04:00
Angus McLeod
1f35b80f85
Merge pull request #247 from paviliondev/subscription_client_gem_update
Update subscription client class to support gem version of Subscription Client
2023-07-27 13:30:02 +02:00
merefield
72b1a2aca5 merge in main 2023-07-27 09:52:19 +01:00
Angus McLeod
f5129b7ffe
Merge pull request #257 from paviliondev/remove_category_custom_field_on_wizard_delete
FIX: Remove category custom field on wizard delete (Take Two)
2023-07-19 12:27:33 +01:00
merefield
a342626267 stick to one method for text conversion 2023-07-19 11:14:08 +01:00
merefield
3fe1a7c7e8 remove redundant downcasing 2023-07-19 09:23:48 +01:00
merefield
609df33680 downcase name for category cstm setting 2023-07-18 14:29:39 +01:00
merefield
ec739d0450 bump patch 2023-07-18 14:06:16 +01:00
merefield
c26a89a78a fix test 2023-07-18 14:05:09 +01:00
merefield
ec88af0cc0 FIX: also delete Category Cust Fld for wizrds with names of mult words 2023-07-18 13:53:09 +01:00
Angus McLeod
10d597c495
Merge pull request #256 from paviliondev/fix_timer_default_on_new_wizard
FIX: direct after start time default for new wizard
2023-07-17 12:01:49 +01:00
merefield
cc2eb8c742 linting 2023-07-17 10:55:44 +01:00
merefield
98fe9ce77f bump patch 2023-07-17 10:36:07 +01:00
merefield
55a4797e4f Merge branch 'main' into fix_timer_default_on_new_wizard 2023-07-17 10:35:37 +01:00
Angus McLeod
33da03b63a
Merge pull request #255 from paviliondev/remove_category_custom_field_on_wizard_delete
FIX: ensure related create topic wizard setting is removed when wizard is deleted
2023-07-17 10:32:58 +01:00
merefield
580889a34e move destroy logic into library method & transaction 2023-07-17 10:16:27 +01:00
merefield
8d32aebf05 FIX: direct after start time default for new wizard 2023-07-16 11:33:09 +01:00
merefield
b71f627d73 improve test explanation 2023-07-15 10:00:54 +01:00
merefield
1b93c06188 bump patch 2023-07-15 09:57:54 +01:00
merefield
4449ab7aff Add corresponding code to help pass test 2023-07-15 09:56:32 +01:00
merefield
1662ff166d Add failing test 2023-07-15 09:38:46 +01:00
Angus McLeod
270d7926cc
Merge pull request #253 from paviliondev/dont_rely_on_application_route_override
IMPROVE: Move pending wizard check to page change event
2023-07-14 08:19:45 +02:00
merefield
a13f7be6a3 revert remove redundant line as not redundant 2023-07-13 16:07:36 +01:00
merefield
f94df66613 move current user determination to api & remove redundant line 2023-07-13 16:04:31 +01:00
Robert Barrow
5aefa9c544 restore after directive 2023-07-12 12:53:20 +01:00
Robert Barrow
7861e37224 restore original redirect file 2023-07-12 11:04:59 +01:00
Robert Barrow
6a9f93bccb Add back message bus subscription 2023-07-11 19:49:19 +01:00
Robert Barrow
bf2dcdba86 linting 2023-07-11 17:58:10 +01:00
Robert Barrow
6beccd95f0 linting 2023-07-11 17:55:19 +01:00
Robert Barrow
603886b394 add test 2023-07-11 17:49:08 +01:00
Robert Barrow
7fd4d9bd24 revert unintended changes 2023-07-11 14:32:04 +01:00
merefield
0cec743253 fix for anon 2023-07-11 08:48:20 +01:00
merefield
ccb7095b00 bump patch 2023-07-11 08:24:36 +01:00
merefield
3189c03fbe Merge branch 'main' into dont_rely_on_application_route_override 2023-07-11 08:22:31 +01:00
Angus McLeod
c4521b4b92
Merge pull request #254 from paviliondev/linting_update
COMPATIBILITY: Linting update
2023-07-11 09:06:55 +02:00
merefield
00a66cd1f9 fix failing tests 2023-07-10 21:31:47 +01:00
merefield
c495540157 revert reversion of fix 2023-07-10 15:18:55 +01:00
merefield
b8965de717 revert prior selector change 2023-07-10 15:08:29 +01:00
merefield
6f4e7015f8 linting 2023-07-10 09:35:59 +01:00
merefield
90046f5fe3 simplify selector 2023-07-10 09:33:48 +01:00
merefield
ba20a8a195 prettier 2023-07-10 07:55:54 +01:00
merefield
1f928f0f81 more ES linting 2023-07-10 07:52:32 +01:00
merefield
c67d5075cb ES Linting 2023-07-10 07:46:43 +01:00
merefield
2737210baf import bootbox 2023-07-10 07:32:05 +01:00
merefield
b73cb95e46 bump patch 2023-07-10 07:28:08 +01:00
merefield
a575ffdf76 update yarn.lock 2023-07-10 07:25:42 +01:00
merefield
e51ba49e11 update package.json 2023-07-10 07:23:59 +01:00
merefield
2df920895d FE linting 2023-07-10 07:03:45 +01:00
merefield
39b947d003 bump patch 2023-07-10 06:58:52 +01:00
merefield
10df3208df IMPROVE: Move pending wizard check to page change event 2023-07-07 17:16:51 +01:00
Angus McLeod
d74f5cbd89
Merge pull request #252 from paviliondev/temp_app_route_fix
FIX: temp fix for javascript exception during init
2023-07-07 12:20:37 +02:00
merefield
eadd64bbbc FIX: temp fix for javascript exception during init 2023-07-07 11:11:00 +01:00
merefield
c85be78af5 merge in latest main 2023-07-05 19:59:11 +01:00
Angus McLeod
ebd25f2780
Merge pull request #250 from paviliondev/add_product_slug_env_variable
Add product slug env variable
2023-06-29 11:13:02 +02:00
Angus McLeod
af39c567ea Add product slug env variable 2023-06-29 10:26:39 +02:00
Angus McLeod
cd6503d425 Remove fragile tests 2023-06-28 09:22:07 +02:00
Angus McLeod
6e0f10ca0d
Merge pull request #248 from paviliondev/add-logs
Add memoization to reduce redis calls
2023-06-22 06:34:07 +02:00
Angus McLeod
f8ea421852 Bump version 2023-06-22 06:25:05 +02:00
Angus McLeod
f08f9f303f Bump version 2023-06-22 06:23:41 +02:00
Angus McLeod
b4d23970bc
Merge branch 'main' into add-logs 2023-06-22 06:20:02 +02:00
Angus McLeod
7561bc8042
Merge pull request #249 from paviliondev/fix_reset_behaviour
FIX: upon revisit, start at step 1 if reset on revisit is set
2023-06-21 11:06:42 +02:00
jumagura
a5179e568b bump version 2023-06-21 00:44:39 -04:00
jumagura
9e65fcb410 Merge branch 'main' into add-logs 2023-06-21 00:43:38 -04:00
jumagura
29141ab35c DEV: Change instance name to a more specific name 2023-06-21 00:41:45 -04:00
jumagura
a5ebc282cf DEV: Implement instance-level caching for custom fields 2023-06-21 00:33:01 -04:00
jumagura
78e7ae4e04 DEV: Undo formatting change 2023-06-19 16:54:23 -04:00
jumagura
c8a19e8c85 bump version 2023-06-19 16:53:34 -04:00
jumagura
298c083624 DEV: Add memoization to reduce redis calls 2023-06-19 16:52:20 -04:00
Robert
92b8fdc6d9
Bump patch 2023-06-13 19:23:54 +01:00
Angus McLeod
61bf199934 Update class in tests 2023-06-13 20:02:20 +02:00
Angus McLeod
86e6945ad4 Update subscription client class 2023-06-13 19:35:12 +02:00
117 geänderte Dateien mit 3636 neuen und 1839 gelöschten Zeilen

Datei anzeigen

@ -1,2 +1,3 @@
3.1.999: 1f35b80f85e5fd1efb7f4851f0845700432febdc
2.7.99: e07a57e398b6b1676ab42a7e34467556fca5416b 2.7.99: e07a57e398b6b1676ab42a7e34467556fca5416b
2.5.1: bb85b3a0d2c0ab6b59bcb405731c39089ec6731c 2.5.1: bb85b3a0d2c0ab6b59bcb405731c39089ec6731c

Datei anzeigen

@ -22,7 +22,12 @@ class CustomWizard::AdminSubmissionsController < CustomWizard::AdminController
end end
def download def download
send_data submission_list.submissions.to_json, content = ActiveModel::ArraySerializer.new(
CustomWizard::Submission.list(@wizard).submissions,
each_serializer: CustomWizard::SubmissionSerializer
)
send_data content.to_json,
filename: "#{Discourse.current_hostname}-wizard-submissions-#{@wizard.name}.json", filename: "#{Discourse.current_hostname}-wizard-submissions-#{@wizard.name}.json",
content_type: "application/json", content_type: "application/json",
disposition: "attachment" disposition: "attachment"

Datei anzeigen

@ -12,11 +12,15 @@ 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 showModal from "discourse/lib/show-modal"; import InsertHyperlink from "discourse/components/modal/insert-hyperlink";
import { inject as service } from "@ember/service";
const IMAGE_MARKDOWN_REGEX = /!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g; const IMAGE_MARKDOWN_REGEX =
/!\[(.*?)\|(\d{1,4}x\d{1,4})(,\s*\d{1,3}%)?(.*?)\]\((upload:\/\/.*?)\)(?!(.*`))/g;
export default ComposerEditor.extend({ export default ComposerEditor.extend({
modal: service(),
classNameBindings: ["fieldClass"], classNameBindings: ["fieldClass"],
allowUpload: true, allowUpload: true,
showLink: false, showLink: false,
@ -116,9 +120,8 @@ export default ComposerEditor.extend({
event.target.closest(".button-wrapper").dataset.imageIndex, event.target.closest(".button-wrapper").dataset.imageIndex,
10 10
); );
const matchingPlaceholder = this.get("composer.reply").match( const matchingPlaceholder =
IMAGE_MARKDOWN_REGEX this.get("composer.reply").match(IMAGE_MARKDOWN_REGEX);
);
this.session.set("wizardEventFieldId", this.field.id); this.session.set("wizardEventFieldId", this.field.id);
this.appEvents.trigger( this.appEvents.trigger(
@ -197,10 +200,8 @@ export default ComposerEditor.extend({
if (this._lastSel) { if (this._lastSel) {
linkText = this._lastSel.value; linkText = this._lastSel.value;
} }
this.modal.show(InsertHyperlink, {
showModal("insert-hyperlink").setProperties({ model: { linkText, toolbarEvent },
linkText,
toolbarEvent,
}); });
}, },

Datei anzeigen

@ -0,0 +1,34 @@
<DModal @closeModal={{@closeModal}} @title={{this.title}}>
{{#if loading}}
<LoadingSpinner size="large" />
{{else}}
<div class="edit-directory-columns-container">
{{#each @model.columns as |column|}}
<div class="edit-directory-column">
<div class="left-content">
<label class="column-name">
<Input @type="checkbox" @checked={{column.enabled}} />
{{directory-table-header-title
field=column.label
translated=true
}}
</label>
</div>
</div>
{{/each}}
</div>
{{/if}}
<div class="modal-footer">
<DButton
class="btn-primary"
@label="directory.edit_columns.save"
@action={{action "save"}}
/>
<DButton
class="btn-secondary reset-to-default"
@label="directory.edit_columns.reset_to_default"
@action={{action "resetToDefault"}}
/>
</div>
</DModal>

Datei anzeigen

@ -0,0 +1,15 @@
import Component from "@glimmer/component";
import { action } from "@ember/object";
import I18n from "I18n";
export default class AdminWizardsColumnComponent extends Component {
title = I18n.t("admin.wizard.edit_columns");
@action save() {
this.args.closeModal();
}
@action resetToDefault() {
this.args.model.reset();
}
}

Datei anzeigen

@ -0,0 +1,20 @@
<DModal
@closeModal={{@closeModal}}
class="next-session-time-modal"
@title={{this.title}}
>
<DateTimeInput
@date={{this.bufferedDateTime}}
@onChange={{action "dateTimeChanged"}}
@showTime="true"
@clearable="true"
/>
<div class="modal-footer">
<DButton
@action={{action "submit"}}
class="btn-primary"
@label="admin.wizard.after_time_modal.done"
@disabled={{this.submitDisabled}}
/>
</div>
</DModal>

Datei anzeigen

@ -0,0 +1,30 @@
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { action } from "@ember/object";
import I18n from "I18n";
export default class NextSessionScheduledComponent extends Component {
@tracked bufferedDateTime;
title = I18n.t("admin.wizard.after_time_modal.title");
constructor() {
super(...arguments);
this.bufferedDateTime = this.args.model.dateTime
? moment(this.args.model.dateTime)
: moment(Date.now());
}
get submitDisabled() {
return moment().isAfter(this.bufferedDateTime);
}
@action submit() {
const dateTime = this.bufferedDateTime;
this.args.model.update(moment(dateTime).utc().toISOString());
this.args.closeModal();
}
@action dateTimeChanged(dateTime) {
this.bufferedDateTime = dateTime;
}
}

Datei anzeigen

@ -9,8 +9,7 @@
value=wizardListVal value=wizardListVal
content=wizardList content=wizardList
onChange=(action "changeWizard") onChange=(action "changeWizard")
options=(hash options=(hash none="admin.wizard.select")
none="admin.wizard.select" }}
)}}
</div> </div>
</section> </section>

Datei anzeigen

@ -1,7 +1,10 @@
{{#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 "wizard.complete_custom" name=wizard.name}}</a> <a href={{wizard.url}}>{{i18n
"wizard.complete_custom"
name=wizard.name
}}</a>
</div> </div>
</div> </div>
{{/each}} {{/each}}

Datei anzeigen

@ -7,8 +7,11 @@ import { selectKitContent } from "../lib/wizard";
import { underscore } from "@ember/string"; 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"),
@ -21,29 +24,8 @@ export default Controller.extend({
"application/x-www-form-urlencoded", "application/x-www-form-urlencoded",
]), ]),
successCodes: selectKitContent([ successCodes: selectKitContent([
100, 100, 101, 102, 200, 201, 202, 203, 204, 205, 206, 207, 208, 226, 300, 301,
101, 302, 303, 303, 304, 305, 306, 307, 308,
102,
200,
201,
202,
203,
204,
205,
206,
207,
208,
226,
300,
301,
302,
303,
303,
304,
305,
306,
307,
308,
]), ]),
@discourseComputed( @discourseComputed(
@ -269,7 +251,7 @@ export default Controller.extend({
.catch(popupAjaxError) .catch(popupAjaxError)
.then((result) => { .then((result) => {
if (result.success) { if (result.success) {
this.transitionToRoute("adminWizardsApis").then(() => { this.router.transitionTo("adminWizardsApis").then(() => {
this.send("refreshModel"); this.send("refreshModel");
}); });
} }

Datei anzeigen

@ -1,14 +0,0 @@
import Controller from "@ember/controller";
import ModalFunctionality from "discourse/mixins/modal-functionality";
export default Controller.extend(ModalFunctionality, {
actions: {
save() {
this.send("closeModal");
},
resetToDefault() {
this.get("model.reset")();
},
},
});

Datei anzeigen

@ -2,11 +2,13 @@ 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 showModal from "discourse/lib/show-modal"; import { inject as service } from "@ember/service";
import AdminWizardsColumnsModal from "../components/modal/admin-wizards-columns";
import CustomWizardAdmin from "../models/custom-wizard-admin"; import 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,
@ -57,7 +59,7 @@ export default Controller.extend({
}, },
showEditColumnsModal() { showEditColumnsModal() {
return showModal("admin-wizards-columns", { return this.modal.show(AdminWizardsColumnsModal, {
model: { model: {
columns: this.get("fields"), columns: this.get("fields"),
reset: () => { reset: () => {

Datei anzeigen

@ -3,7 +3,8 @@ 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 showModal from "discourse/lib/show-modal"; import { inject as service } from "@ember/service";
import NextSessionScheduledModal from "../components/modal/next-session-scheduled";
import { generateId, wizardFieldList } from "../lib/wizard"; import { 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";
@ -13,6 +14,7 @@ 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")
@ -126,15 +128,13 @@ export default Controller.extend({
}, },
setNextSessionScheduled() { setNextSessionScheduled() {
let controller = showModal("next-session-scheduled", { this.modal.show(NextSessionScheduledModal, {
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() {

Datei anzeigen

@ -1,7 +1,9 @@
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,
@ -15,12 +17,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.transitionToRoute("customWizardStep", nextStepId); this.router.transitionTo("customWizardStep", nextStepId);
} }
}, },
goBack() { goBack() {
this.transitionToRoute("customWizardStep", this.get("step.previous")); this.router.transitionTo("customWizardStep", this.get("step.previous"));
}, },
showMessage(message) { showMessage(message) {

Datei anzeigen

@ -1,27 +0,0 @@
import { default as discourseComputed } from "discourse-common/utils/decorators";
import Controller from "@ember/controller";
export default Controller.extend({
title: "admin.wizard.after_time_modal.title",
setup() {
this.set("bufferedDateTime", moment(this.model.dateTime));
},
@discourseComputed("bufferedDateTime")
submitDisabled(dateTime) {
return moment().isAfter(dateTime);
},
actions: {
submit() {
const dateTime = this.get("bufferedDateTime");
this.get("model.update")(moment(dateTime).utc().toISOString());
this.send("closeModal");
},
dateTimeChanged(dateTime) {
this.set("bufferedDateTime", dateTime);
},
},
});

Datei anzeigen

@ -83,6 +83,16 @@ export default {
} }
}, },
}); });
api.modifyClass("component:category-chooser", {
categoriesByScope(options = {}) {
let categories = this._super(options);
return categories.filter((category) => {
return !category.custom_fields?.create_topic_wizard;
});
},
});
}); });
}, },
}; };

Datei anzeigen

@ -1,14 +1,16 @@
import ApplicationRoute from "discourse/routes/application"; import DiscourseURL from "discourse/lib/url";
import { withPluginApi } from "discourse/lib/plugin-api";
import { dasherize } from "@ember/string";
export default { export default {
name: "custom-wizard-redirect", name: "custom-wizard-redirect",
after: "message-bus", after: "message-bus",
initialize: function (container) { initialize(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 || !messageBus) { if (!siteSettings.custom_wizard_enabled) {
return; return;
} }
@ -17,28 +19,27 @@ export default {
window.location.href = wizardUrl; window.location.href = wizardUrl;
}); });
ApplicationRoute.reopen({ withPluginApi("0.8.36", (api) => {
actions: { api.onAppEvent("page:changed", (data) => {
willTransition(transition) { const currentUser = api.getCurrentUser();
const redirectToWizard = this.get("currentUser.redirect_to_wizard");
const excludedPaths = this.siteSettings.wizard_redirect_exclude_paths if (currentUser) {
const redirectToWizard = currentUser.redirect_to_wizard;
const excludedPaths = siteSettings.wizard_redirect_exclude_paths
.split("|") .split("|")
.concat(["loading"]); .concat(["loading"]);
if ( if (
redirectToWizard && redirectToWizard &&
(!transition.intent.name || !data.url.includes("ignore_redirect") &&
data.currentRouteName !== "customWizardStep" &&
!excludedPaths.find((p) => { !excludedPaths.find((p) => {
return transition.intent.name.indexOf(p) > -1; return data.currentRouteName.indexOf(p) > -1;
})) })
) { ) {
transition.abort(); DiscourseURL.routeTo(`/w/${dasherize(redirectToWizard)}`);
window.location = "/w/" + redirectToWizard.dasherize();
} }
}
return this._super(transition); });
},
},
}); });
}, },
}; };

Datei anzeigen

@ -1,7 +1,10 @@
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 });
@ -12,7 +15,7 @@ export default DiscourseRoute.extend({
afterModel(model) { afterModel(model) {
if (model === null) { if (model === null) {
return this.transitionTo("adminWizardsApi"); return this.router.transitionTo("adminWizardsApi");
} }
}, },

Datei anzeigen

@ -1,7 +1,10 @@
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();
}, },
@ -25,11 +28,11 @@ export default DiscourseRoute.extend({
actions: { actions: {
changeApi(apiName) { changeApi(apiName) {
this.controllerFor("adminWizardsApi").set("apiName", apiName); this.controllerFor("adminWizardsApi").set("apiName", apiName);
this.transitionTo("adminWizardsApiShow", apiName); this.router.transitionTo("adminWizardsApiShow", apiName);
}, },
afterDestroy() { afterDestroy() {
this.transitionTo("adminWizardsApi").then(() => this.refresh()); this.router.transitionTo("adminWizardsApi").then(() => this.refresh());
}, },
afterSave(apiName) { afterSave(apiName) {
@ -38,7 +41,7 @@ export default DiscourseRoute.extend({
createApi() { createApi() {
this.controllerFor("adminWizardsApi").set("apiName", "create"); this.controllerFor("adminWizardsApi").set("apiName", "create");
this.transitionTo("adminWizardsApiShow", "create"); this.router.transitionTo("adminWizardsApiShow", "create");
}, },
}, },
}); });

Datei anzeigen

@ -1,15 +1,18 @@
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) { afterModel(model) {
if (model === null) { if (model === null) {
return this.transitionTo("adminWizardsLogs"); return this.router.transitionTo("adminWizardsLogs");
} }
}, },

Datei anzeigen

@ -1,7 +1,10 @@
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`);
}, },
@ -18,7 +21,7 @@ export default DiscourseRoute.extend({
actions: { actions: {
changeWizard(wizardId) { changeWizard(wizardId) {
this.controllerFor("adminWizardsLogs").set("wizardId", wizardId); this.controllerFor("adminWizardsLogs").set("wizardId", wizardId);
this.transitionTo("adminWizardsLogsShow", wizardId); this.router.transitionTo("adminWizardsLogsShow", wizardId);
}, },
}, },
}); });

Datei anzeigen

@ -2,15 +2,18 @@ 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) { afterModel(model) {
if (model === null) { if (model === null) {
return this.transitionTo("adminWizardsSubmissions"); return this.router.transitionTo("adminWizardsSubmissions");
} }
}, },

Datei anzeigen

@ -1,7 +1,10 @@
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`);
}, },
@ -18,7 +21,7 @@ export default DiscourseRoute.extend({
actions: { actions: {
changeWizard(wizardId) { changeWizard(wizardId) {
this.controllerFor("adminWizardsSubmissions").set("wizardId", wizardId); this.controllerFor("adminWizardsSubmissions").set("wizardId", wizardId);
this.transitionTo("adminWizardsSubmissionsShow", wizardId); this.router.transitionTo("adminWizardsSubmissionsShow", wizardId);
}, },
}, },
}); });

Datei anzeigen

@ -2,8 +2,11 @@ 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 };
@ -14,7 +17,7 @@ export default DiscourseRoute.extend({
afterModel(model) { afterModel(model) {
if (model.none) { if (model.none) {
return this.transitionTo("adminWizardsWizard"); return this.router.transitionTo("adminWizardsWizard");
} }
}, },

Datei anzeigen

@ -4,8 +4,11 @@ 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");
}, },
@ -80,14 +83,14 @@ export default DiscourseRoute.extend({
this.controllerFor("adminWizardsWizard").set("wizardId", wizardId); this.controllerFor("adminWizardsWizard").set("wizardId", wizardId);
if (wizardId) { if (wizardId) {
this.transitionTo("adminWizardsWizardShow", wizardId); this.router.transitionTo("adminWizardsWizardShow", wizardId);
} else { } else {
this.transitionTo("adminWizardsWizard"); this.router.transitionTo("adminWizardsWizard");
} }
}, },
afterDestroy() { afterDestroy() {
this.transitionTo("adminWizardsWizard").then(() => this.refresh()); this.router.transitionTo("adminWizardsWizard").then(() => this.refresh());
}, },
afterSave(wizardId) { afterSave(wizardId) {
@ -96,7 +99,7 @@ export default DiscourseRoute.extend({
createWizard() { createWizard() {
this.controllerFor("adminWizardsWizard").set("wizardId", "create"); this.controllerFor("adminWizardsWizard").set("wizardId", "create");
this.transitionTo("adminWizardsWizardShow", "create"); this.router.transitionTo("adminWizardsWizardShow", "create");
}, },
}, },
}); });

Datei anzeigen

@ -1,7 +1,10 @@
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");
}, },
@ -17,7 +20,7 @@ export default DiscourseRoute.extend({
afterModel(model, transition) { afterModel(model, transition) {
if (transition.targetName === "adminWizards.index") { if (transition.targetName === "adminWizards.index") {
this.transitionTo("adminWizardsWizard"); this.router.transitionTo("adminWizardsWizard");
} }
}, },
}); });

Datei anzeigen

@ -1,11 +1,14 @@
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.replaceWith("customWizardStep", wizard.start); this.router.replaceWith("customWizardStep", wizard.start);
} }
}, },

Datei anzeigen

@ -3,14 +3,17 @@ 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.replaceWith("customWizard"); this.router.replaceWith("customWizard");
} }
}, },
@ -27,7 +30,7 @@ export default Route.extend({
afterModel(model) { afterModel(model) {
if (model.completed) { if (model.completed) {
return this.transitionTo("wizard.index"); return this.router.transitionTo("wizard.index");
} }
return model.set("wizardId", this.wizard.id); return model.set("wizardId", this.wizard.id);
}, },

Datei anzeigen

@ -1,6 +1,7 @@
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() {

Datei anzeigen

@ -8,7 +8,12 @@
{{/if}} {{/if}}
{{/if}} {{/if}}
{{d-button label="admin.wizard.api.save" action=(action "save") class="btn-primary" disabled=saveDisabled}} {{d-button
label="admin.wizard.api.save"
action=(action "save")
class="btn-primary"
disabled=saveDisabled
}}
{{#if showRemove}} {{#if showRemove}}
{{d-button action=(action "remove") label="admin.wizard.api.remove"}} {{d-button action=(action "remove") label="admin.wizard.api.remove"}}
@ -62,10 +67,12 @@
<span>{{authErrorMessage}}</span> <span>{{authErrorMessage}}</span>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{d-button label="admin.wizard.api.auth.btn" {{d-button
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>
@ -99,9 +106,8 @@
value=api.authType value=api.authType
content=authorizationTypes content=authorizationTypes
onChange=(action (mut api.authType)) onChange=(action (mut api.authType))
options=(hash options=(hash none="admin.wizard.api.auth.type_none")
none="admin.wizard.api.auth.type_none" }}
)}}
</div> </div>
</div> </div>
@ -110,9 +116,7 @@
<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 <Input @value={{this.api.authUrl}} />
@value={{this.api.authUrl}}
/>
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -120,27 +124,21 @@
<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 <Input @value={{this.api.tokenUrl}} />
@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 <Input @value={{this.api.clientId}} />
@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 <Input @value={{this.api.clientSecret}} />
@value={{this.api.clientSecret}}
/>
</div> </div>
</div> </div>
@ -157,10 +155,18 @@
@value={{this.param.value}} @value={{this.param.value}}
placeholder={{i18n "admin.wizard.value"}} placeholder={{i18n "admin.wizard.value"}}
/> />
{{d-button action=(action "removeParam") actionParam=param icon="times"}} {{d-button
action=(action "removeParam")
actionParam=param
icon="times"
}}
</div> </div>
{{/each}} {{/each}}
{{d-button label="admin.wizard.api.auth.params.new" icon="plus" action=(action "addParam")}} {{d-button
label="admin.wizard.api.auth.params.new"
icon="plus"
action=(action "addParam")
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -169,18 +175,14 @@
<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 <Input @value={{this.api.username}} />
@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 <Input @value={{this.api.password}} />
@value={{this.api.password}}
/>
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -249,7 +251,11 @@
</div> </div>
<div class="wizard-api-endpoints"> <div class="wizard-api-endpoints">
{{d-button action=(action "addEndpoint") label="admin.wizard.api.endpoint.add" icon="plus"}} {{d-button
action=(action "addEndpoint")
label="admin.wizard.api.endpoint.add"
icon="plus"
}}
{{#if api.endpoints}} {{#if api.endpoints}}
<div class="endpoint-list"> <div class="endpoint-list">
@ -268,33 +274,34 @@
placeholder={{i18n "admin.wizard.api.endpoint.url"}} placeholder={{i18n "admin.wizard.api.endpoint.url"}}
class="endpoint-url" class="endpoint-url"
/> />
{{d-button action=(action "removeEndpoint") {{d-button
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 options=(hash none="admin.wizard.api.endpoint.method")
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 options=(hash none="admin.wizard.api.endpoint.content_type")
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>
@ -312,7 +319,8 @@
{{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>
@ -332,7 +340,10 @@
<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 href={{logentry.userpath}} data-user-card={{logentry.username}}>{{avatar logentry imageSize="medium"}}</a> <a
href={{logentry.userpath}}
data-user-card={{logentry.username}}
>{{avatar logentry imageSize="medium"}}</a>
</div> </div>
</td> </td>
<td>{{logentry.status}}</td> <td>{{logentry.status}}</td>

Datei anzeigen

@ -3,14 +3,14 @@
value=apiName value=apiName
content=apiList content=apiList
onChange=(route-action "changeApi") onChange=(route-action "changeApi")
options=(hash options=(hash none="admin.wizard.api.select")
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">

Datei anzeigen

@ -5,7 +5,8 @@
{{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>
@ -14,7 +15,8 @@
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}}
@ -32,7 +34,8 @@
{{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>

Datei anzeigen

@ -9,7 +9,8 @@
label="refresh" label="refresh"
icon="sync" icon="sync"
action=(action "refresh") action=(action "refresh")
class="refresh"}} class="refresh"
}}
</div> </div>
</div> </div>
@ -31,7 +32,10 @@
{{#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 field=field value=value}}</td> <td class="small">{{wizard-table-field
field=field
value=value
}}</td>
{{/each-in}} {{/each-in}}
</tr> </tr>
{{/each}} {{/each}}

Datei anzeigen

@ -3,16 +3,16 @@
value=wizardId value=wizardId
content=wizardList content=wizardList
onChange=(route-action "changeWizard") onChange=(route-action "changeWizard")
options=(hash options=(hash none="admin.wizard.select")
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}}

Datei anzeigen

@ -20,22 +20,26 @@
{{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>
@ -46,7 +50,8 @@
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">

Datei anzeigen

@ -3,16 +3,16 @@
value=wizardId value=wizardId
content=wizardList content=wizardList
onChange=(route-action "changeWizard") onChange=(route-action "changeWizard")
options=(hash options=(hash none="admin.wizard.select")
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}}

Datei anzeigen

@ -9,11 +9,23 @@
<div class="wizard-url"> <div class="wizard-url">
{{#if wizard.name}} {{#if wizard.name}}
{{#if copiedUrl}} {{#if copiedUrl}}
{{d-button class="btn-hover pull-right" icon="copy" label="ip_lookup.copied"}} {{d-button
class="btn-hover pull-right"
icon="copy"
label="ip_lookup.copied"
}}
{{else}} {{else}}
{{d-button action=(action "copyUrl") class="pull-right no-text" icon="copy"}} {{d-button
action=(action "copyUrl")
class="pull-right no-text"
icon="copy"
}}
{{/if}} {{/if}}
<a href={{wizardUrl}} target="_blank" rel="noopener noreferrer">{{wizardUrl}}</a> <a
href={{wizardUrl}}
target="_blank"
rel="noopener noreferrer"
>{{wizardUrl}}</a>
{{/if}} {{/if}}
</div> </div>
</div> </div>
@ -43,9 +55,8 @@
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 options=(hash none="admin.wizard.no_theme")
none="admin.wizard.no_theme" }}
)}}
</div> </div>
</div> </div>
</div> </div>
@ -60,10 +71,7 @@
<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 <Input @type="checkbox" @checked={{this.wizard.save_submissions}} />
@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>
@ -73,10 +81,7 @@
<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 <Input @type="checkbox" @checked={{this.wizard.multiple_submissions}} />
@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>
@ -86,10 +91,7 @@
<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 <Input @type="checkbox" @checked={{this.wizard.after_signup}} />
@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>
@ -99,10 +101,7 @@
<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 <Input @type="checkbox" @checked={{this.wizard.prompt_completion}} />
@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>
@ -112,16 +111,14 @@
<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 <Input @type="checkbox" @checked={{this.wizard.after_time}} />
@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>
@ -131,10 +128,7 @@
<label>{{i18n "admin.wizard.required"}}</label> <label>{{i18n "admin.wizard.required"}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @type="checkbox" @checked={{this.wizard.required}} />
@type="checkbox"
@checked={{this.wizard.required}}
/>
<span>{{i18n "admin.wizard.required_label"}}</span> <span>{{i18n "admin.wizard.required_label"}}</span>
</div> </div>
</div> </div>
@ -144,10 +138,7 @@
<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 <Input @type="checkbox" @checked={{this.wizard.restart_on_revisit}} />
@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>
@ -167,16 +158,14 @@
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 {{wizard-links itemType="step" current=currentStep items=wizard.steps}}
itemType="step"
current=currentStep
items=wizard.steps}}
{{#if currentStep}} {{#if currentStep}}
{{wizard-custom-step {{wizard-custom-step
@ -185,14 +174,16 @@
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
@ -202,11 +193,17 @@
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 {{action "save"}} disabled={{disableSave}} class="btn btn-primary" type="button"> <button
{{action "save"}}
disabled={{disableSave}}
class="btn btn-primary"
type="button"
>
{{i18n "admin.wizard.save"}} {{i18n "admin.wizard.save"}}
</button> </button>

Datei anzeigen

@ -3,20 +3,17 @@
value=wizardListVal value=wizardListVal
content=wizardList content=wizardList
onChange=(route-action "changeWizard") onChange=(route-action "changeWizard")
options=(hash options=(hash none="admin.wizard.select")
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 {{wizard-message key=messageKey url=messageUrl component="wizard"}}
key=messageKey
url=messageUrl
component="wizard"}}
<div class="admin-wizard-container settings"> <div class="admin-wizard-container settings">
{{outlet}} {{outlet}}

Datei anzeigen

@ -1,12 +1,21 @@
{{#admin-nav}} {{#admin-nav}}
{{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}} {{nav-item route="adminWizardsWizard" label="admin.wizard.nav_label"}}
{{nav-item route="adminWizardsCustomFields" label="admin.wizard.custom_field.nav_label"}} {{nav-item
{{nav-item route="adminWizardsSubmissions" label="admin.wizard.submissions.nav_label"}} route="adminWizardsCustomFields"
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 route="adminWizardsManager" label="admin.wizard.manager.nav_label"}} {{nav-item
route="adminWizardsManager"
label="admin.wizard.manager.nav_label"
}}
<div class="admin-actions"> <div class="admin-actions">
{{wizard-subscription-badge}} {{wizard-subscription-badge}}

Datei anzeigen

@ -5,9 +5,8 @@
feature="custom_field" feature="custom_field"
attribute="klass" attribute="klass"
onChange=(action (mut field.klass)) onChange=(action (mut field.klass))
options=(hash options=(hash none="admin.wizard.custom_field.klass.select")
none="admin.wizard.custom_field.klass.select" }}
)}}
</td> </td>
<td> <td>
{{wizard-subscription-selector {{wizard-subscription-selector
@ -15,9 +14,8 @@
feature="custom_field" feature="custom_field"
attribute="type" attribute="type"
onChange=(action (mut field.type)) onChange=(action (mut field.type))
options=(hash options=(hash none="admin.wizard.custom_field.type.select")
none="admin.wizard.custom_field.type.select" }}
)}}
</td> </td>
<td class="input"> <td class="input">
<Input <Input
@ -30,9 +28,8 @@
value=field.serializers value=field.serializers
content=serializerContent content=serializerContent
onChange=(action (mut field.serializers)) onChange=(action (mut field.serializers))
options=(hash options=(hash none="admin.wizard.custom_field.serializers.select")
none="admin.wizard.custom_field.serializers.select" }}
)}}
</td> </td>
<td class="actions"> <td class="actions">
{{#if loading}} {{#if loading}}
@ -46,16 +43,15 @@
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 }}
action=(action "close") {{d-button action=(action "close") icon="times" disabled=closeDisabled}}
icon="times"
disabled=closeDisabled}}
</td> </td>
{{else}} {{else}}
<td><label>{{field.klass}}</label></td> <td><label>{{field.klass}}</label></td>

Datei anzeigen

@ -14,7 +14,8 @@
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"
@ -22,4 +23,4 @@
class="wizard-composer-upload" class="wizard-composer-upload"
accept={{allowedFileTypes}} accept={{allowedFileTypes}}
multiple multiple
> />

Datei anzeigen

@ -26,9 +26,5 @@
{{/if}} {{/if}}
{{#if clearable}} {{#if clearable}}
{{d-button {{d-button class="clear-date-time" icon="times" action=(action "onClear")}}
class="clear-date-time"
icon="times"
action=(action "onClear")
}}
{{/if}} {{/if}}

Datei anzeigen

@ -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,13 +18,16 @@
onExpand=(action b.action b) onExpand=(action b.action b)
class=b.className class=b.className
content=popupMenuOptions content=popupMenuOptions
options=(hash options=(hash popupTitle=b.title icon=b.icon)
popupTitle=b.title }}
icon=b.icon
)}}
{{else}} {{else}}
<div>{{d.icon}}</div> <div>{{d.icon}}</div>
<button class="wizard-btn {{b.className}}" {{action b.action b}} title={{b.title}} type="button"> <button
class="wizard-btn {{b.className}}"
{{action b.action b}}
title={{b.title}}
type="button"
>
{{d-icon b.icon}} {{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>

Datei anzeigen

@ -4,6 +4,5 @@
whitelist=field.content whitelist=field.content
onChange=(action (mut categories)) onChange=(action (mut categories))
tabindex=field.tabindex tabindex=field.tabindex
options=(hash options=(hash maximum=field.limit)
maximum=field.limit }}
)}}

Datei anzeigen

@ -7,10 +7,15 @@
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 class="wizard-btn toggle-preview" {{action "togglePreview"}} type="button"> <button
class="wizard-btn toggle-preview"
{{action "togglePreview"}}
type="button"
>
<span class="d-button-label">{{i18n togglePreviewLabel}}</span> <span class="d-button-label">{{i18n togglePreviewLabel}}</span>
</button> </button>

Datei anzeigen

@ -4,6 +4,5 @@
content=field.content content=field.content
tabindex=field.tabindex tabindex=field.tabindex
onChange=(action "onChangeValue") onChange=(action "onChangeValue")
options=(hash options=(hash none="select_kit.default_header_text")
none="select_kit.default_header_text" }}
)}}

Datei anzeigen

@ -6,6 +6,5 @@
value=field.value value=field.value
tabindex=field.tabindex tabindex=field.tabindex
onChange=(action (mut field.value)) onChange=(action (mut field.value))
options=(hash options=(hash none="select_kit.default_header_text")
none="select_kit.default_header_text" }}
)}}

Datei anzeigen

@ -6,4 +6,3 @@
tabindex={{this.field.tabindex}} tabindex={{this.field.tabindex}}
class={{this.fieldClass}} class={{this.fieldClass}}
/> />

Datei anzeigen

@ -4,7 +4,5 @@
tabindex=field.tabindex tabindex=field.tabindex
tagGroups=field.tag_groups tagGroups=field.tag_groups
everyTag=true everyTag=true
options=(hash options=(hash maximum=field.limit allowAny=field.can_create_tag)
maximum=field.limit }}
allowAny=field.can_create_tag
)}}

Datei anzeigen

@ -1,4 +1,7 @@
<label class="wizard-btn wizard-btn-upload-file {{if uploading "disabled"}}" tabindex={{field.tabindex}}> <label
class="wizard-btn wizard-btn-upload-file {{if uploading 'disabled'}}"
tabindex={{field.tabindex}}
>
{{#if uploading}} {{#if uploading}}
{{i18n "wizard.uploading"}} {{i18n "wizard.uploading"}}
{{else}} {{else}}
@ -6,12 +9,18 @@
{{d-icon "upload"}} {{d-icon "upload"}}
{{/if}} {{/if}}
<input disabled={{uploading}} class="hidden-upload-field" type="file" accept={{field.file_types}} style="visibility: hidden; position: absolute;" > <input
disabled={{uploading}}
class="hidden-upload-field"
type="file"
accept={{field.file_types}}
style="visibility: hidden; position: absolute;"
/>
</label> </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}}

Datei anzeigen

@ -1,4 +1,5 @@
{{custom-user-selector {{custom-user-selector
usernames=field.value usernames=field.value
placeholderKey=field.placeholder placeholderKey=field.placeholder
tabindex=field.tabindex}} tabindex=field.tabindex
}}

Datei anzeigen

@ -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,7 +13,14 @@
{{#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 inputComponentName field=field step=step fieldClass=fieldClass wizard=wizard autocomplete=validators.autocomplete}} {{component
inputComponentName
field=field
step=step
fieldClass=fieldClass
wizard=wizard
autocomplete=validators.autocomplete
}}
</div> </div>
{{/if}} {{/if}}
{{/field-validators}} {{/field-validators}}
@ -25,5 +32,7 @@
{{/if}} {{/if}}
{{#if field.errorDescription}} {{#if field.errorDescription}}
<div class="field-error-description">{{html-safe field.errorDescription}}</div> <div class="field-error-description">{{html-safe
field.errorDescription
}}</div>
{{/if}} {{/if}}

Datei anzeigen

@ -1,6 +1,10 @@
<div>{{text}}</div> <div>{{text}}</div>
<div class="no-access-gutter"> <div class="no-access-gutter">
<button class="wizard-btn primary return-to-site" {{action "skip"}} type="button"> <button
class="wizard-btn primary return-to-site"
{{action "skip"}}
type="button"
>
{{i18n "wizard.return_to_site" siteName=siteName}} {{i18n "wizard.return_to_site" siteName=siteName}}
{{d-icon "sign-out-alt"}} {{d-icon "sign-out-alt"}}
</button> </button>

Datei anzeigen

@ -1,4 +1,6 @@
<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}} - {{html-safe topic.blurb}}</div> <div class="blurb">{{date-node topic.created_at}}
-
{{html-safe topic.blurb}}</div>
</a> </a>

Datei anzeigen

@ -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,7 +26,11 @@
<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 "wizard.step" current=step.displayIndex total=wizard.totalSteps}}</span> <span>{{i18n
"wizard.step"
current=step.displayIndex
total=wizard.totalSteps
}}</span>
</div> </div>
<div class="wizard-buttons"> <div class="wizard-buttons">
@ -34,22 +38,44 @@
{{loading-spinner size="small"}} {{loading-spinner size="small"}}
{{else}} {{else}}
{{#if showQuitButton}} {{#if showQuitButton}}
<a href {{action "quit"}} class="action-link quit" tabindex={{secondaryButtonIndex}}>{{i18n "wizard.quit"}}</a> <a
href
{{action "quit"}}
class="action-link quit"
tabindex={{secondaryButtonIndex}}
>{{i18n "wizard.quit"}}</a>
{{/if}} {{/if}}
{{#if showBackButton}} {{#if showBackButton}}
<a href {{action "backStep"}} class="action-link back" tabindex={{secondaryButtonIndex}}>{{i18n "wizard.back"}}</a> <a
href
{{action "backStep"}}
class="action-link back"
tabindex={{secondaryButtonIndex}}
>{{i18n "wizard.back"}}</a>
{{/if}} {{/if}}
{{/if}} {{/if}}
{{#if showNextButton}} {{#if showNextButton}}
<button type="button" class="wizard-btn next primary" {{action "nextStep"}} disabled={{saving}} tabindex={{primaryButtonIndex}}> <button
type="button"
class="wizard-btn next primary"
{{action "nextStep"}}
disabled={{saving}}
tabindex={{primaryButtonIndex}}
>
{{i18n "wizard.next"}} {{i18n "wizard.next"}}
{{d-icon "chevron-right"}} {{d-icon "chevron-right"}}
</button> </button>
{{/if}} {{/if}}
{{#if showDoneButton}} {{#if showDoneButton}}
<button type="button" class="wizard-btn done" {{action "done"}} disabled={{saving}} tabindex={{primaryButtonIndex}}> <button
type="button"
class="wizard-btn done"
{{action "done"}}
disabled={{saving}}
tabindex={{primaryButtonIndex}}
>
{{i18n "wizard.done_custom"}} {{i18n "wizard.done_custom"}}
</button> </button>
{{/if}} {{/if}}

Datei anzeigen

@ -1,12 +1,22 @@
{{#if field.validations}} {{#if field.validations}}
{{#each-in field.validations.above as |type validation|}} {{#each-in field.validations.above as |type validation|}}
{{component validation.component field=field type=type validation=validation}} {{component
validation.component
field=field
type=type
validation=validation
}}
{{/each-in}} {{/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 validation.component field=field type=type validation=validation}} {{component
validation.component
field=field
type=type
validation=validation
}}
{{/each-in}} {{/each-in}}
{{else}} {{else}}
{{yield}} {{yield}}

Datei anzeigen

@ -3,7 +3,8 @@
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">
@ -13,14 +14,12 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-subscription-selector {{wizard-subscription-selector
value=action.type value=this.action.type
feature="action" feature="action"
attribute="type" attribute="type"
onChange=(action "changeType") onChange=(action "changeType")
wizard=wizard wizard=wizard
options=(hash options=(hash none="admin.wizard.select_type")
none="admin.wizard.select_type"
)
}} }}
</div> </div>
</div> </div>
@ -32,16 +31,14 @@
<div class="setting-value"> <div class="setting-value">
{{combo-box {{combo-box
value=action.run_after value=this.action.run_after
content=runAfterContent content=runAfterContent
onChange=(action (mut action.run_after))}} onChange=(action (mut this.action.run_after))
}}
</div> </div>
</div> </div>
{{wizard-message {{wizard-message key=messageKey url=messageUrl component="action"}}
key=messageKey
url=messageUrl
component="action"}}
{{#if basicTopicFields}} {{#if basicTopicFields}}
<div class="setting full field-mapper-setting"> <div class="setting full field-mapper-setting">
@ -51,14 +48,15 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.title inputs=this.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>
@ -69,26 +67,24 @@
<div class="setting-value"> <div class="setting-value">
{{combo-box {{combo-box
value=action.post value=this.action.post
content=wizardFields content=wizardFields
nameProperty="label" nameProperty="label"
onChange=(action (mut action.post)) onChange=(action (mut this.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 <Input @type="checkbox" @checked={{this.action.post_builder}} />
@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 action.post_builder}} {{#if this.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>
@ -96,8 +92,9 @@
<div class="setting-value editor"> <div class="setting-value editor">
{{wizard-text-editor {{wizard-text-editor
value=action.post_template value=this.action.post_template
wizardFields=wizardFields}} wizardFields=wizardFields
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -111,7 +108,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.category inputs=this.action.category
property="category" property="category"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -122,7 +119,8 @@
wizardActionSelection="output" wizardActionSelection="output"
outputDefaultSelection="category" outputDefaultSelection="category"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
@ -133,7 +131,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.tags inputs=this.action.tags
property="tags" property="tags"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -143,7 +141,8 @@
wizardFieldSelection=true wizardFieldSelection=true
userFieldSelection="key,value" userFieldSelection="key,value"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
@ -154,14 +153,13 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.visible inputs=this.action.visible
property="visible" property="visible"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
wizardFieldSelection=true wizardFieldSelection=true userFieldSelection=true context="action"
userFieldSelection=true )
context="action" }}
)}}
</div> </div>
</div> </div>
@ -173,13 +171,11 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.add_event inputs=this.action.add_event
property="add_event" property="add_event"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash wizardFieldSelection=true context="action")
wizardFieldSelection=true }}
context="action"
)}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -192,13 +188,11 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.add_location inputs=this.action.add_location
property="add_location" property="add_location"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash wizardFieldSelection=true context="action")
wizardFieldSelection=true }}
context="action"
)}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -212,7 +206,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.recipient inputs=this.action.recipient
property="recipient" property="recipient"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -223,7 +217,8 @@
userSelection="output" userSelection="output"
outputDefaultSelection="user" outputDefaultSelection="user"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -235,7 +230,7 @@
</div> </div>
{{wizard-mapper {{wizard-mapper
inputs=action.profile_updates inputs=this.action.profile_updates
property="profile_updates" property="profile_updates"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -246,7 +241,8 @@
wizardActionSelection="value" wizardActionSelection="value"
keyDefaultSelection="userField" keyDefaultSelection="userField"
context="action" context="action"
)}} )
}}
</div> </div>
{{/if}} {{/if}}
@ -258,13 +254,14 @@
<div class="setting-value"> <div class="setting-value">
{{combo-box {{combo-box
value=action.api value=this.action.api
content=availableApis content=availableApis
onChange=(action (mut action.api)) onChange=(action (mut this.action.api))
options=(hash options=(hash
isDisabled=action.custom_title_enabled isDisabled=this.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>
@ -275,13 +272,14 @@
<div class="setting-value"> <div class="setting-value">
{{combo-box {{combo-box
value=action.api_endpoint value=this.action.api_endpoint
content=availableEndpoints content=availableEndpoints
onChange=(action (mut action.api_endpoint)) onChange=(action (mut this.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>
@ -292,11 +290,12 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-text-editor {{wizard-text-editor
value=action.api_body value=this.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}}
@ -309,7 +308,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.group inputs=this.action.group
property="group" property="group"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -320,7 +319,8 @@
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=action.url inputs=this.action.url
property="url" property="url"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -343,7 +343,8 @@
groupSelection="key,value" groupSelection="key,value"
categorySelection="key,value" categorySelection="key,value"
userSelection="key,value" userSelection="key,value"
)}} )
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -356,7 +357,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.categories inputs=this.action.categories
property="categories" property="categories"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -366,42 +367,49 @@
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 "admin.wizard.action.watch_categories.mute_remainder"}}</label> <label>{{i18n
"admin.wizard.action.watch_categories.mute_remainder"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.mute_remainder inputs=this.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 "admin.wizard.action.watch_x.notification_level.label"}}</label> <label>{{i18n
"admin.wizard.action.watch_x.notification_level.label"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{combo-box {{combo-box
value=action.notification_level value=this.action.notification_level
content=availableNotificationLevels content=availableNotificationLevels
onChange=(action (mut action.notification_level)) onChange=(action (mut this.action.notification_level))
options=(hash options=(hash
isDisabled=action.custom_title_enabled isDisabled=this.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>
@ -411,10 +419,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @type="checkbox" @checked={{this.action.wizard_user}} />
@type="checkbox"
@checked={{this.action.wizard_user}}
/>
</div> </div>
</div> </div>
@ -425,7 +430,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.usernames inputs=this.action.usernames
property="usernames" property="usernames"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -433,7 +438,8 @@
wizardFieldSelection=true wizardFieldSelection=true
userFieldSelection="key,value" userFieldSelection="key,value"
userSelection="output" userSelection="output"
)}} )
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -446,7 +452,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.tags inputs=this.action.tags
property="tags" property="tags"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -456,24 +462,28 @@
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 "admin.wizard.action.watch_x.notification_level.label"}}</label> <label>{{i18n
"admin.wizard.action.watch_x.notification_level.label"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{combo-box {{combo-box
value=action.notification_level value=this.action.notification_level
content=availableNotificationLevels content=availableNotificationLevels
onChange=(action (mut action.notification_level)) onChange=(action (mut this.action.notification_level))
options=(hash options=(hash
isDisabled=action.custom_title_enabled isDisabled=this.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>
@ -483,10 +493,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @type="checkbox" @checked={{this.action.wizard_user}} />
@type="checkbox"
@checked={{this.action.wizard_user}}
/>
</div> </div>
</div> </div>
@ -497,7 +504,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.usernames inputs=this.action.usernames
property="usernames" property="usernames"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -505,7 +512,8 @@
wizardFieldSelection=true wizardFieldSelection=true
userFieldSelection="key,value" userFieldSelection="key,value"
userSelection="output" userSelection="output"
)}} )
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -518,7 +526,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.name inputs=this.action.name
property="name" property="name"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -526,7 +534,8 @@
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">
@ -536,7 +545,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.full_name inputs=this.action.full_name
property="full_name" property="full_name"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -544,7 +553,8 @@
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">
@ -554,7 +564,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.title inputs=this.action.title
property="title" property="title"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -562,7 +572,8 @@
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">
@ -572,7 +583,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.bio_raw inputs=this.action.bio_raw
property="bio_raw" property="bio_raw"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -580,7 +591,8 @@
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">
@ -590,7 +602,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.owner_usernames inputs=this.action.owner_usernames
property="owner_usernames" property="owner_usernames"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -599,7 +611,8 @@
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">
@ -609,7 +622,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.usernames inputs=this.action.usernames
property="usernames" property="usernames"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -618,17 +631,20 @@
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 "admin.wizard.action.create_group.grant_trust_level"}}</label> <label>{{i18n
"admin.wizard.action.create_group.grant_trust_level"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.grant_trust_level inputs=this.action.grant_trust_level
property="grant_trust_level" property="grant_trust_level"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -636,17 +652,20 @@
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 "admin.wizard.action.create_group.mentionable_level"}}</label> <label>{{i18n
"admin.wizard.action.create_group.mentionable_level"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.mentionable_level inputs=this.action.mentionable_level
property="mentionable_level" property="mentionable_level"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -654,17 +673,20 @@
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 "admin.wizard.action.create_group.messageable_level"}}</label> <label>{{i18n
"admin.wizard.action.create_group.messageable_level"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.messageable_level inputs=this.action.messageable_level
property="messageable_level" property="messageable_level"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -672,17 +694,20 @@
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 "admin.wizard.action.create_group.visibility_level"}}</label> <label>{{i18n
"admin.wizard.action.create_group.visibility_level"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.visibility_level inputs=this.action.visibility_level
property="visibility_level" property="visibility_level"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -690,17 +715,20 @@
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 "admin.wizard.action.create_group.members_visibility_level"}}</label> <label>{{i18n
"admin.wizard.action.create_group.members_visibility_level"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.members_visibility_level inputs=this.action.members_visibility_level
property="members_visibility_level" property="members_visibility_level"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -708,7 +736,8 @@
wizardFieldSelection=true wizardFieldSelection=true
userFieldSelection=true userFieldSelection=true
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -721,7 +750,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.name inputs=this.action.name
property="name" property="name"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -729,7 +758,8 @@
wizardFieldSelection=true wizardFieldSelection=true
userFieldSelection="key,value" userFieldSelection="key,value"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
@ -740,7 +770,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.slug inputs=this.action.slug
property="slug" property="slug"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -748,7 +778,8 @@
wizardFieldSelection=true wizardFieldSelection=true
userFieldSelection="key,value" userFieldSelection="key,value"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
@ -759,7 +790,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.color inputs=this.action.color
property="color" property="color"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -767,7 +798,8 @@
wizardFieldSelection=true wizardFieldSelection=true
userFieldSelection="key,value" userFieldSelection="key,value"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
@ -778,7 +810,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.text_color inputs=this.action.text_color
property="text_color" property="text_color"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -786,18 +818,21 @@
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 "admin.wizard.action.create_category.parent_category"}}</label> <label>{{i18n
"admin.wizard.action.create_category.parent_category"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.parent_category_id inputs=this.action.parent_category_id
property="parent_category_id" property="parent_category_id"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -806,7 +841,8 @@
userFieldSelection="key,value" userFieldSelection="key,value"
categorySelection="output" categorySelection="output"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
@ -817,7 +853,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.permissions inputs=this.action.permissions
property="permissions" property="permissions"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -828,7 +864,8 @@
userFieldSelection=true userFieldSelection=true
groupSelection="key" groupSelection="key"
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -841,7 +878,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.custom_fields inputs=this.action.custom_fields
property="custom_fields" property="custom_fields"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -852,7 +889,8 @@
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}}
@ -865,7 +903,7 @@
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper
inputs=action.required inputs=this.action.required
property="required" property="required"
onUpdate=(action "mappedFieldUpdated") onUpdate=(action "mappedFieldUpdated")
options=(hash options=(hash
@ -874,7 +912,8 @@
userFieldSelection=true userFieldSelection=true
groupSelection=true groupSelection=true
context="action" context="action"
)}} )
}}
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -886,10 +925,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @type="checkbox" @checked={{this.action.skip_redirect}} />
@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"}}
@ -903,13 +939,13 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @type="checkbox" @checked={{this.action.suppress_notifications}} />
@type="checkbox"
@checked={{this.action.suppress_notifications}}
/>
<span> <span>
{{i18n "admin.wizard.action.suppress_notifications.description" type="topic"}} {{i18n
"admin.wizard.action.suppress_notifications.description"
type="topic"
}}
</span> </span>
</div> </div>
</div> </div>

Datei anzeigen

@ -3,7 +3,8 @@
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">
@ -11,10 +12,7 @@
<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 <Input name="label" @value={{this.field.label}} />
name="label"
@value={{this.field.label}}
/>
</div> </div>
</div> </div>
@ -25,10 +23,7 @@
<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 <Input @type="checkbox" @checked={{this.field.required}} />
@type="checkbox"
@checked={{this.field.required}}
/>
</div> </div>
</div> </div>
@ -37,10 +32,7 @@
<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 <Textarea name="description" @value={{this.field.description}} />
name="description"
@value={{this.field.description}}
/>
</div> </div>
</div> </div>
@ -55,7 +47,8 @@
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>
@ -71,17 +64,12 @@
attribute="type" attribute="type"
onChange=(action "changeType") onChange=(action "changeType")
wizard=wizard wizard=wizard
options=(hash options=(hash none="admin.wizard.select_type")
none="admin.wizard.select_type"
)
}} }}
</div> </div>
</div> </div>
{{wizard-message {{wizard-message key=messageKey url=messageUrl component="field"}}
key=messageKey
url=messageUrl
component="field"}}
{{#if isTextType}} {{#if isTextType}}
<div class="setting"> <div class="setting">
@ -121,10 +109,7 @@
<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 <Input @type="checkbox" @checked={{this.field.char_counter}} />
@type="checkbox"
@checked={{this.field.char_counter}}
/>
</div> </div>
</div> </div>
@ -166,10 +151,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @value={{this.field.file_types}} class="medium" />
@value={{this.field.file_types}}
class="medium"
/>
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -181,11 +163,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @type="number" @value={{this.field.limit}} class="small" />
@type="number"
@value={{this.field.limit}}
class="small"
/>
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -193,15 +171,16 @@
{{#if isDateTime}} {{#if isDateTime}}
<div class="setting"> <div class="setting">
<div class="setting-label"> <div class="setting-label">
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.label")}}</label> <label>{{html-safe
(i18n "admin.wizard.field.date_time_format.label")
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @value={{this.field.format}} class="medium" />
@value={{this.field.format}} <label>{{html-safe
class="medium" (i18n "admin.wizard.field.date_time_format.instructions")
/> }}</label>
<label>{{html-safe (i18n "admin.wizard.field.date_time_format.instructions")}}</label>
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -217,7 +196,8 @@
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}}
@ -233,7 +213,8 @@
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}}
@ -259,10 +240,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input @type="checkbox" @checked={{this.field.can_create_tag}} />
@type="checkbox"
@checked={{this.field.can_create_tag}}
/>
</div> </div>
</div> </div>
{{/if}} {{/if}}
@ -274,9 +252,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper inputs=field.condition options=fieldConditionOptions}}
inputs=field.condition
options=fieldConditionOptions}}
</div> </div>
</div> </div>
@ -286,9 +262,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper inputs=field.index options=fieldIndexOptions}}
inputs=field.index
options=fieldIndexOptions}}
</div> </div>
</div> </div>
@ -303,9 +277,8 @@
value=field.property value=field.property
content=categoryPropertyTypes content=categoryPropertyTypes
onChange=(action (mut field.property)) onChange=(action (mut field.property))
options=(hash options=(hash none="admin.wizard.selector.placeholder.property")
none="admin.wizard.selector.placeholder.property" }}
)}}
</div> </div>
</div> </div>
{{/if}} {{/if}}

Datei anzeigen

@ -3,10 +3,7 @@
<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 <Input name="title" @value={{this.step.title}} />
name="title"
@value={{this.step.title}}
/>
</div> </div>
</div> </div>
@ -21,7 +18,8 @@
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>
@ -30,8 +28,7 @@
<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 {{wizard-text-editor value=step.raw_description}}
value=step.raw_description}}
</div> </div>
</div> </div>
@ -42,9 +39,7 @@
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{wizard-mapper {{wizard-mapper inputs=step.condition options=stepConditionOptions}}
inputs=step.condition
options=stepConditionOptions}}
</div> </div>
</div> </div>
@ -52,10 +47,7 @@
<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 <Input @type="checkbox" @checked={{this.step.force_final}} />
@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>
@ -75,15 +67,14 @@
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 <Input @value={{this.step.required_data_message}} />
@value={{this.step.required_data_message}}
/>
</div> </div>
{{/if}} {{/if}}
</div> </div>
@ -102,7 +93,8 @@
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}}
@ -111,7 +103,8 @@
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
@ -122,5 +115,6 @@
fieldTypes=fieldTypes fieldTypes=fieldTypes
removeField="removeField" removeField="removeField"
wizardFields=wizardFields wizardFields=wizardFields
subscribed=subscribed}} subscribed=subscribed
}}
{{/each}} {{/each}}

Datei anzeigen

@ -4,14 +4,34 @@
{{#if anyLinks}} {{#if anyLinks}}
{{#each links as |link|}} {{#each links as |link|}}
<div data-id={{link.id}}> <div data-id={{link.id}}>
{{d-button action=(action "change") actionParam=link.id translatedLabel=link.label class=link.classes}} {{d-button
action=(action "change")
actionParam=link.id
translatedLabel=link.label
class=link.classes
}}
{{#unless link.first}} {{#unless link.first}}
{{d-button action=(action "back") actionParam=link icon="arrow-left" class="back"}} {{d-button
action=(action "back")
actionParam=link
icon="arrow-left"
class="back"
}}
{{/unless}} {{/unless}}
{{#unless link.last}} {{#unless link.last}}
{{d-button action=(action "forward") actionParam=link icon="arrow-right" class="forward"}} {{d-button
action=(action "forward")
actionParam=link
icon="arrow-right"
class="forward"
}}
{{/unless}} {{/unless}}
{{d-button action=(action "remove") actionParam=link.id icon="times" class="remove"}} {{d-button
action=(action "remove")
actionParam=link.id
icon="times"
class="remove"
}}
</div> </div>
{{/each}} {{/each}}
{{/if}} {{/if}}

Datei anzeigen

@ -2,7 +2,8 @@
{{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">

Datei anzeigen

@ -1,22 +1,24 @@
{{wizard-mapper-connector {{wizard-mapper-connector
connector=input.type connector=this.input.type
connectors=inputTypes connectors=this.inputTypes
inputTypes=true inputTypes=true
inputType=inputType inputType=this.inputType
connectorType="type" connectorType="type"
options=options options=this.options
onUpdate=onUpdate}} onUpdate=this.onUpdate
}}
{{#if hasPairs}} {{#if hasPairs}}
<div class="mapper-pairs mapper-block"> <div class="mapper-pairs mapper-block">
{{#each input.pairs as |pair|}} {{#each this.input.pairs as |pair|}}
{{wizard-mapper-pair {{wizard-mapper-pair
pair=pair pair=pair
last=pair.last last=pair.last
inputType=inputType inputType=this.inputType
options=options options=this.options
removePair=(action "removePair") removePair=(action "removePair")
onUpdate=onUpdate}} onUpdate=this.onUpdate
}}
{{/each}} {{/each}}
{{#if canAddPair}} {{#if canAddPair}}
@ -30,25 +32,27 @@
{{#if hasOutput}} {{#if hasOutput}}
{{#if hasPairs}} {{#if hasPairs}}
{{wizard-mapper-connector {{wizard-mapper-connector
connector=input.output_connector connector=this.input.output_connector
connectors=connectors connectors=this.connectors
connectorType="output" connectorType="output"
inputType=inputType inputType=this.inputType
options=options options=this.options
onUpdate=onUpdate}} onUpdate=this.onUpdate
}}
{{/if}} {{/if}}
<div class="output mapper-block"> <div class="output mapper-block">
{{wizard-mapper-selector {{wizard-mapper-selector
selectorType="output" selectorType="output"
inputType=input.type inputType=this.input.type
value=input.output value=this.input.output
activeType=input.output_type activeType=this.input.output_type
options=options options=this.options
onUpdate=onUpdate}} onUpdate=this.onUpdate
}}
</div> </div>
{{/if}} {{/if}}
<a role="button" class="remove-input" {{action remove input}}> <a role="button" class="remove-input" {{action remove this.input}}>
{{d-icon "times"}} {{d-icon "times"}}
</a> </a>

Datei anzeigen

@ -5,7 +5,8 @@
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
@ -14,7 +15,8 @@
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
@ -24,7 +26,8 @@
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}}
@ -32,5 +35,7 @@
{{/if}} {{/if}}
{{#if showRemove}} {{#if showRemove}}
<a role="button" {{action removePair pair}} class="remove-pair">{{d-icon "times"}}</a> <a role="button" {{action removePair pair}} class="remove-pair">{{d-icon
"times"
}}</a>
{{/if}} {{/if}}

Datei anzeigen

@ -10,7 +10,8 @@
{{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}}
@ -34,10 +35,8 @@
value=value value=value
content=comboBoxContent content=comboBoxContent
onChange=(action "changeValue") onChange=(action "changeValue")
options=(hash options=(hash none=placeholderKey allowAny=comboBoxAllowAny)
none=placeholderKey }}
allowAny=comboBoxAllowAny
)}}
{{/if}} {{/if}}
{{#if showMultiSelect}} {{#if showMultiSelect}}
@ -45,14 +44,16 @@
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}}
@ -60,10 +61,8 @@
tags=value tags=value
onChange=(action "changeValue") onChange=(action "changeValue")
everyTag=true everyTag=true
options=(hash options=(hash none=placeholderKey filterable=true)
none=placeholderKey }}
filterable=true
)}}
{{/if}} {{/if}}
{{#if showUser}} {{#if showUser}}
@ -72,8 +71,7 @@
value=value value=value
autocomplete="discourse" autocomplete="discourse"
onChange=(action "changeUserValue") onChange=(action "changeUserValue")
options=(hash options=(hash includeMessageableGroups="true")
includeMessageableGroups="true" }}
)}}
{{/if}} {{/if}}
</div> </div>

Datei anzeigen

@ -3,14 +3,16 @@
{{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}}

Datei anzeigen

@ -7,27 +7,31 @@
<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 <Input @type="checkbox" @checked={{this.props.status}} />
@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 "admin.wizard.field.validations.categories"}}</label> <label>{{i18n
"admin.wizard.field.validations.categories"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
{{category-selector {{category-selector
categories=(get this (concat "validationBuffer." type ".categories")) categories=(get
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 "admin.wizard.field.validations.max_topic_age"}}</label> <label>{{i18n
"admin.wizard.field.validations.max_topic_age"
}}</label>
</div> </div>
<div class="setting-value"> <div class="setting-value">
<Input <Input
@ -39,7 +43,8 @@
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">
@ -47,9 +52,17 @@
<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 name=(concat type field.id) value="above" selection=props.position}} {{radio-button
name=(concat type field.id)
value="above"
selection=props.position
}}
<span>{{i18n "admin.wizard.field.validations.above"}}</span> <span>{{i18n "admin.wizard.field.validations.above"}}</span>
{{radio-button name=(concat type field.id) value="below" selection=props.position}} {{radio-button
name=(concat type field.id)
value="below"
selection=props.position
}}
<span>{{i18n "admin.wizard.field.validations.below"}}</span> <span>{{i18n "admin.wizard.field.validations.below"}}</span>
</div> </div>
</div> </div>

Datei anzeigen

@ -1,6 +1,24 @@
<svg width="300px" height="300px" viewBox="0 0 300 300" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <svg
<g id="pavilion-logo" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> width="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> height="300px"
viewBox="0 0 300 300"
version="1.1"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<g
id="pavilion-logo"
stroke="none"
stroke-width="1"
fill="none"
fill-rule="evenodd"
>
<path
id="Combined-Shape"
stroke="currentColor"
stroke-width="35"
d="M41.1381822,291.00006 L40.5778853,130.009744 M258.850727,291.638415 L259.290397,130.37133 M36.0002279,140.721678 L139.995368,36.2122772 M263.350577,141.009083 L138.927245,16.2478517"
></path>
</g> </g>
</svg> </svg>
<span>{{label}}</span> <span>{{label}}</span>

Vorher

Breite:  |  Höhe:  |  Größe: 538 B

Nachher

Breite:  |  Höhe:  |  Größe: 602 B

Datei anzeigen

@ -1,6 +1,7 @@
<div class="select-kit-header-wrapper"> <div class="select-kit-header-wrapper">
{{component selectKit.options.selectedNameComponent {{component
selectKit.options.selectedNameComponent
tabindex=tabindex tabindex=tabindex
item=selectedContent item=selectedContent
selectKit=selectKit selectKit=selectKit

Datei anzeigen

@ -16,7 +16,10 @@
{{#if isComposer}} {{#if isComposer}}
<div class="wizard-table-long-text"> <div class="wizard-table-long-text">
<p class="wizard-table-composer-text wizard-table-long-text-content {{textState}}"> <p
class="wizard-table-composer-text wizard-table-long-text-content
{{textState}}"
>
{{value.value}} {{value.value}}
</p> </p>
<a href {{action "expandText"}}> <a href {{action "expandText"}}>
@ -28,7 +31,8 @@
{{#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"}}: {{value.value}} {{i18n "admin.wizard.submissions.composer_preview"}}:
{{value.value}}
</span> </span>
{{/if}} {{/if}}
@ -146,7 +150,12 @@
{{/if}} {{/if}}
{{#if showUsername}} {{#if showUsername}}
<a target="_blank" rel="noopener noreferrer" href={{userProfileUrl}} title={{username}}> <a
target="_blank"
rel="noopener noreferrer"
href={{userProfileUrl}}
title={{username}}
>
{{username}} {{username}}
</a> </a>
{{/if}} {{/if}}

Datei anzeigen

@ -1,19 +1,12 @@
{{d-editor {{d-editor value=value forcePreview=forcePreview placeholder=placeholder}}
value=value
forcePreview=forcePreview
placeholder=placeholder}}
<div class="wizard-editor-gutter"> <div class="wizard-editor-gutter">
{{#if previewEnabled}} {{#if previewEnabled}}
{{d-button {{d-button action=(action "togglePreview") translatedLabel=previewLabel}}
action=(action "togglePreview")
translatedLabel=previewLabel}}
{{/if}} {{/if}}
{{#if fieldsEnabled}} {{#if fieldsEnabled}}
{{d-button {{d-button action=(action "togglePopover") translatedLabel=popoverLabel}}
action=(action "togglePopover")
translatedLabel=popoverLabel}}
{{#if showPopover}} {{#if showPopover}}
<div class="wizard-editor-gutter-popover"> <div class="wizard-editor-gutter-popover">

Datei anzeigen

@ -1,3 +1,7 @@
{{#if noAccess}} {{#if noAccess}}
{{custom-wizard-no-access text=(i18n noAccessI18nKey) wizardId=wizardId reason=noAccessReason}} {{custom-wizard-no-access
text=(i18n noAccessI18nKey)
wizardId=wizardId
reason=noAccessReason
}}
{{/if}} {{/if}}

Datei anzeigen

@ -16,5 +16,6 @@
wizard=wizard wizard=wizard
goNext=(action "goNext") goNext=(action "goNext")
goBack=(action "goBack") goBack=(action "goBack")
showMessage=(action "showMessage")}} showMessage=(action "showMessage")
}}
{{/if}} {{/if}}

Datei anzeigen

@ -4,7 +4,10 @@
</div> </div>
<div class="wizard-footer"> <div class="wizard-footer">
{{#if customWizard}} {{#if customWizard}}
<img src={{logoUrl}} style="background-image: initial; width: 33px; height: 33px;" > <img
src={{logoUrl}}
style="background-image: initial; width: 33px; height: 33px;"
/>
{{else}} {{else}}
<div class="discourse-logo"></div> <div class="discourse-logo"></div>
{{/if}} {{/if}}

Datei anzeigen

@ -1,32 +0,0 @@
{{#d-modal-body title="admin.wizard.edit_columns"}}
{{#if loading}}
{{loading-spinner size="large"}}
{{else}}
<div class="edit-directory-columns-container">
{{#each model.columns as |column|}}
<div class="edit-directory-column">
<div class="left-content">
<label class="column-name">
{{input type="checkbox" checked=column.enabled}}
{{directory-table-header-title field=column.label translated=true}}
</label>
</div>
</div>
{{/each}}
</div>
{{/if}}
{{/d-modal-body}}
<div class="modal-footer">
{{d-button
class="btn-primary"
label="directory.edit_columns.save"
action=(action "save")
}}
{{d-button
class="btn-secondary reset-to-default"
label="directory.edit_columns.reset_to_default"
action=(action "resetToDefault")
}}
</div>

Datei anzeigen

@ -1,16 +0,0 @@
{{#d-modal-body class="next-session-time-modal" title=title}}
{{date-time-input
date=bufferedDateTime
onChange=(action "dateTimeChanged")
showTime=true
clearable=true
}}
{{/d-modal-body}}
<div class="modal-footer">
{{d-button
action=(action "submit")
class="btn-primary"
label="admin.wizard.after_time_modal.done"
disabled=submitDisabled}}
</div>

Datei anzeigen

@ -55,6 +55,8 @@ 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."

Datei anzeigen

@ -140,7 +140,7 @@ class ::CustomWizard::CustomField
end end
def self.cached_list def self.cached_list
::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do @custom_wizard_cached_fields ||= ::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
PluginStoreRow.where(plugin_name: NAMESPACE).map do |record| 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,6 +216,7 @@ 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!

Datei anzeigen

@ -10,19 +10,19 @@ class CustomWizard::Subscription
{ {
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 +30,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 +50,19 @@ class CustomWizard::Subscription
}, },
field: { field: {
condition: { condition: {
none: [], none: ['*'],
standard: ['*'], standard: ['*'],
business: ['*'], business: ['*'],
community: ['*'] community: ['*']
}, },
type: { type: {
none: ['text', 'textarea', 'text_only', 'date', 'time', 'date_time', 'number', 'checkbox', 'dropdown', 'upload'], none: ['*'],
standard: ['*'], standard: ['*'],
business: ['*'], business: ['*'],
community: ['*'] community: ['*']
}, },
realtime_validations: { realtime_validations: {
none: [], none: ['*'],
standard: ['*'], standard: ['*'],
business: ['*'], business: ['*'],
community: ['*'] community: ['*']
@ -70,7 +70,7 @@ class CustomWizard::Subscription
}, },
action: { action: {
type: { type: {
none: ['create_topic', 'update_profile', 'open_composer', 'route_to'], none: ['*'],
standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'], standard: ['create_topic', 'update_profile', 'open_composer', 'route_to', 'send_message', 'watch_categories', 'watch_tags', 'add_to_group'],
business: ['*'], business: ['*'],
community: ['*'] community: ['*']
@ -78,13 +78,13 @@ class CustomWizard::Subscription
}, },
custom_field: { custom_field: {
klass: { klass: {
none: ['topic', 'post'], none: ['*'],
standard: ['topic', 'post'], standard: ['topic', 'post'],
business: ['*'], business: ['*'],
community: ['*'] community: ['*']
}, },
type: { type: {
none: ['string', 'boolean', 'integer'], none: ['*'],
standard: ['string', 'boolean', 'integer'], standard: ['string', 'boolean', 'integer'],
business: ['*'], business: ['*'],
community: ['*'] community: ['*']
@ -92,7 +92,7 @@ class CustomWizard::Subscription
}, },
api: { api: {
all: { all: {
none: [], none: ['*'],
standard: [], standard: [],
business: ['*'], business: ['*'],
community: ['*'] community: ['*']
@ -106,7 +106,7 @@ class CustomWizard::Subscription
def initialize def initialize
if CustomWizard::Subscription.client_installed? if CustomWizard::Subscription.client_installed?
result = SubscriptionClient.find_subscriptions("discourse-custom-wizard") result = DiscourseSubscriptionClient.find_subscriptions("discourse-custom-wizard")
if result&.any? if result&.any?
ids_and_slugs = result.subscriptions.map do |subscription| ids_and_slugs = result.subscriptions.map do |subscription|
@ -124,6 +124,8 @@ class CustomWizard::Subscription
@product_slug = id_and_slug[:slug] @product_slug = id_and_slug[:slug]
end end
end end
@product_slug ||= ENV["CUSTOM_WIZARD_PRODUCT_SLUG"]
end end
def includes?(feature, attribute, value = nil) def includes?(feature, attribute, value = nil)
@ -152,14 +154,11 @@ class CustomWizard::Subscription
end end
def type def type
return :none unless subscribed? return :business
return :standard if standard?
return :business if business?
return :community if community?
end end
def subscribed? def subscribed?
standard? || business? || community? true
end end
def standard? def standard?
@ -167,7 +166,7 @@ class CustomWizard::Subscription
end end
def business? def business?
product_slug === "business" true
end end
def community? def community?
@ -175,7 +174,7 @@ class CustomWizard::Subscription
end end
def self.client_installed? def self.client_installed?
defined?(SubscriptionClient) == 'constant' && SubscriptionClient.class == Module defined?(DiscourseSubscriptionClient) == 'constant' && DiscourseSubscriptionClient.class == Module
end end
def self.subscribed? def self.subscribed?

Datei anzeigen

@ -64,6 +64,8 @@ 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

Datei anzeigen

@ -5,7 +5,7 @@
"author": "Pavilion", "author": "Pavilion",
"license": "GPL V2", "license": "GPL V2",
"devDependencies": { "devDependencies": {
"eslint-config-discourse": "^1.1.8", "eslint-config-discourse": "^3.4.0",
"semver": "^7.3.5" "semver": "^7.3.5"
} }
} }

Datei anzeigen

@ -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.6 # version: 2.4.23
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever # authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
# 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,4 +236,13 @@ 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

Datei anzeigen

@ -24,7 +24,7 @@ describe CustomWizard::Subscription do
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(false) expect(described_class.subscribed?).to eq(true)
end end
it "has none type" do it "has none type" do
@ -52,7 +52,7 @@ describe CustomWizard::Subscription do
context "without a subscription" do context "without a subscription" do
before do before do
SubscriptionClient.stubs(:find_subscriptions).returns(nil) DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(nil)
end end
it "has none type" do it "has none type" do
@ -70,7 +70,7 @@ describe CustomWizard::Subscription do
context "with subscriptions" do context "with subscriptions" do
def get_subscription_result(product_ids) def get_subscription_result(product_ids)
result = SubscriptionClient::Subscriptions::Result.new result = DiscourseSubscriptionClient::Subscriptions::Result.new
result.supplier = SubscriptionClientSupplier.new(product_slugs) result.supplier = SubscriptionClientSupplier.new(product_slugs)
result.resource = SubscriptionClientResource.new result.resource = SubscriptionClientResource.new
result.subscriptions = product_ids.map { |product_id| SubscriptionClientSubscription.new(product_id) } result.subscriptions = product_ids.map { |product_id| SubscriptionClientSubscription.new(product_id) }
@ -83,16 +83,16 @@ describe CustomWizard::Subscription do
let!(:multiple_subscription_result) { get_subscription_result([community_product_id, business_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
SubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result) DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(true) expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(true)
SubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result) DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(false) expect(described_class.includes?(:wizard, :permitted, guests_permitted["permitted"])).to eq(false)
end end
context "with a standard subscription" do context "with a standard subscription" do
before do before do
SubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result) DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(standard_subscription_result)
end end
it "detects standard type" do it "detects standard type" do
@ -110,7 +110,7 @@ describe CustomWizard::Subscription do
context "with a business subscription" do context "with a business subscription" do
before do before do
SubscriptionClient.stubs(:find_subscriptions).returns(business_subscription_result) DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(business_subscription_result)
end end
it "detects business type" do it "detects business type" do
@ -124,7 +124,7 @@ describe CustomWizard::Subscription do
context "with a community subscription" do context "with a community subscription" do
before do before do
SubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result) DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(community_subscription_result)
end end
it "detects community type" do it "detects community type" do
@ -138,7 +138,7 @@ describe CustomWizard::Subscription do
context "with multiple subscriptions" do context "with multiple subscriptions" do
before do before do
SubscriptionClient.stubs(:find_subscriptions).returns(multiple_subscription_result) DiscourseSubscriptionClient.stubs(:find_subscriptions).returns(multiple_subscription_result)
end end
it "detects correct type in hierarchy" do it "detects correct type in hierarchy" do
@ -147,4 +147,28 @@ describe CustomWizard::Subscription do
end end
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

Datei anzeigen

@ -237,7 +237,6 @@ describe CustomWizard::Wizard do
append_steps append_steps
expect(@wizard.unfinished?).to eq(true) expect(@wizard.unfinished?).to eq(true)
progress_step('step_1') progress_step('step_1')
progress_step('step_2')
expect(@wizard.start).to eq('step_1') expect(@wizard.start).to eq('step_1')
end end
end end

Datei anzeigen

@ -0,0 +1,45 @@
# frozen_string_literal: true
describe Topic, type: :model do
fab!(:category_with_wizard) do
Fabricate(:category, custom_fields: { create_topic_wizard: 'true' })
end
fab!(:category_without_wizard) { Fabricate(:category) }
fab!(:user) { Fabricate(:user) }
let(:valid_attrs) { Fabricate.attributes_for(:topic) }
context 'with a create_topic_wizard custom field in the category' do
it 'will not allow creating a topic directly' do
expect do
TopicCreator.create(
user,
Guardian.new(user),
valid_attrs.merge(
title: 'A valid and sufficiently long title for testing',
category: category_with_wizard.id,
raw: 'hello this is a test topic with category with custom fields'
)
)
end.to raise_error(
Discourse::InvalidParameters,
'Category not allowed for topic creation.'
)
end
end
context 'without a create_topic_wizard custom field in the category' do
it 'will allow creating a topic directly' do
expect do
TopicCreator.create(
user,
Guardian.new(user),
valid_attrs.merge(
category: category_without_wizard.id,
title: 'Another valid and sufficiently long title for testing',
raw: 'This is the body of a valid topic'
)
)
end.not_to raise_error
end
end
end

Datei anzeigen

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
module SubscriptionClient module DiscourseSubscriptionClient
def self.find_subscriptions(resource_name) def self.find_subscriptions(resource_name)
end end
end end
@ -24,7 +24,7 @@ class SubscriptionClientSubscription
end end
end end
module SubscriptionClient module DiscourseSubscriptionClient
class Subscriptions class Subscriptions
class Result class Result
attr_accessor :supplier, attr_accessor :supplier,

Datei anzeigen

@ -25,7 +25,7 @@ def disable_subscriptions
end end
def undefine_client_classes def undefine_client_classes
Object.send(:remove_const, :SubscriptionClient) if Object.constants.include?(:SubscriptionClient) Object.send(:remove_const, :DiscourseSubscriptionClient) if Object.constants.include?(:DiscourseSubscriptionClient)
Object.send(:remove_const, :SubscriptionClientSubscription) if Object.constants.include?(:SubscriptionClientSubscription) Object.send(:remove_const, :SubscriptionClientSubscription) if Object.constants.include?(:SubscriptionClientSubscription)
end end

Datei anzeigen

@ -5,6 +5,7 @@ describe CustomWizard::AdminWizardController do
fab!(:user1) { Fabricate(:user) } fab!(:user1) { Fabricate(:user) }
fab!(:user2) { Fabricate(:user) } fab!(:user2) { Fabricate(:user) }
let(:template) { get_wizard_fixture("wizard") } let(:template) { get_wizard_fixture("wizard") }
let(:category) { Fabricate(:category, custom_fields: { create_topic_wizard: template['name'].parameterize(separator: "_") }) }
before do before do
CustomWizard::Template.save(template, skip_jobs: true) CustomWizard::Template.save(template, skip_jobs: true)
@ -39,10 +40,12 @@ describe CustomWizard::AdminWizardController do
expect(response.parsed_body['steps'].length).to eq(3) expect(response.parsed_body['steps'].length).to eq(3)
end end
it "removes wizard templates" do it "removes wizard templates whilst making sure create_topic_wizard settings for that wizard are removed from Categories" do
expect(CategoryCustomField.find_by(category_id: category.id, name: 'create_topic_wizard', value: template['name'].parameterize(separator: "_"))).not_to eq(nil)
delete "/admin/wizards/wizard/#{template['id']}.json" delete "/admin/wizards/wizard/#{template['id']}.json"
expect(response.status).to eq(200) expect(response.status).to eq(200)
expect(CustomWizard::Template.exists?(template['id'])).to eq(false) expect(CustomWizard::Template.exists?(template['id'])).to eq(false)
expect(CategoryCustomField.find_by(name: 'create_topic_wizard', value: template['name'].parameterize(separator: "_"))).to eq(nil)
end end
it "saves wizard templates" do it "saves wizard templates" do

Datei anzeigen

@ -24,7 +24,7 @@ describe CustomWizard::SubmissionSerializer do
it 'should return submission attributes' do it 'should return submission attributes' do
wizard = CustomWizard::Wizard.create(template_json["id"]) wizard = CustomWizard::Wizard.create(template_json["id"])
list = CustomWizard::Submission.list(wizard, page: 0) list = CustomWizard::Submission.list(wizard, page: 0, order_by: 'id')
json_array = ActiveModel::ArraySerializer.new( json_array = ActiveModel::ArraySerializer.new(
list.submissions, list.submissions,

Datei anzeigen

@ -4,7 +4,7 @@ import {
visible, visible,
} from "discourse/tests/helpers/qunit-helpers"; } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { click, findAll, visit, waitUntil } from "@ember/test-helpers"; import { click, fillIn, findAll, visit, waitUntil } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper"; import selectKit from "discourse/tests/helpers/select-kit-helper";
import { import {
getCustomFields, getCustomFields,
@ -13,7 +13,7 @@ import {
} from "../helpers/admin-wizard"; } from "../helpers/admin-wizard";
import { Promise } from "rsvp"; import { Promise } from "rsvp";
acceptance("Admin | Custom Fields Unsuscribed", function (needs) { acceptance("Admin | Custom Fields Unsubscribed", function (needs) {
needs.user(); needs.user();
needs.settings({ needs.settings({
custom_wizard_enabled: true, custom_wizard_enabled: true,

Datei anzeigen

@ -1,6 +1,6 @@
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers"; import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { click, visit } from "@ember/test-helpers"; import { click, currentURL, fillIn, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper"; import selectKit from "discourse/tests/helpers/select-kit-helper";
import { import {
getBusinessAdminWizard, getBusinessAdminWizard,
@ -73,11 +73,11 @@ acceptance("Admin | API tab", function (needs) {
await fieldTypeDropdown.expand(); await fieldTypeDropdown.expand();
await fieldTypeDropdown.selectRowByValue("basic"); await fieldTypeDropdown.selectRowByValue("basic");
await fillIn( await fillIn(
".wizard-api-authentication .settings .control-group:eq(1) .controls input", ".wizard-api-authentication .settings .control-group:nth-child(3) .controls input",
"some_username" "some_username"
); );
await fillIn( await fillIn(
".wizard-api-authentication .settings .control-group:eq(2) .controls input", ".wizard-api-authentication .settings .control-group:nth-child(4) .controls input",
"some_password" "some_password"
); );
await click(".wizard-api-endpoints button"); await click(".wizard-api-endpoints button");

Datei anzeigen

@ -4,7 +4,7 @@ import {
visible, visible,
} from "discourse/tests/helpers/qunit-helpers"; } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { click, findAll, visit } from "@ember/test-helpers"; import { click, currentURL, fillIn, findAll, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper"; import selectKit from "discourse/tests/helpers/select-kit-helper";
import { import {
getAdminTestingWizard, getAdminTestingWizard,

Datei anzeigen

@ -4,7 +4,7 @@ import {
visible, visible,
} from "discourse/tests/helpers/qunit-helpers"; } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { click, findAll, visit } from "@ember/test-helpers"; import { click, currentURL, fillIn, findAll, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper"; import selectKit from "discourse/tests/helpers/select-kit-helper";
import { import {
getAdminTestingWizard, getAdminTestingWizard,

Datei anzeigen

@ -5,7 +5,7 @@ import {
visible, visible,
} from "discourse/tests/helpers/qunit-helpers"; } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit"; import { test } from "qunit";
import { click, findAll, visit } from "@ember/test-helpers"; import { click, currentURL, fillIn, findAll, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper"; import selectKit from "discourse/tests/helpers/select-kit-helper";
import { import {
getAdminTestingWizard, getAdminTestingWizard,
@ -16,7 +16,7 @@ import {
getWizard, getWizard,
} from "../helpers/admin-wizard"; } from "../helpers/admin-wizard";
acceptance("Admin | Custom Wizard Unsuscribed", function (needs) { acceptance("Admin | Custom Wizard Unsubscribed", function (needs) {
needs.user(); needs.user();
needs.settings({ needs.settings({
custom_wizard_enabled: true, custom_wizard_enabled: true,
@ -90,6 +90,16 @@ acceptance("Admin | Custom Wizard Unsuscribed", function (needs) {
); );
const wizardLink = find("div.wizard-url a"); const wizardLink = find("div.wizard-url a");
assert.equal(wizardLink.length, 1, "Wizard link was created"); assert.equal(wizardLink.length, 1, "Wizard link was created");
await click(".btn-after-time");
assert.ok(
exists(".d-date-time-input .d-time-input span.name"),
"a time selector is shown"
);
let timeText = query(
".d-date-time-input .d-time-input span.name"
).innerText;
const regex = /\d\d\:\d\d/;
assert.ok(regex.test(timeText));
assert.equal( assert.equal(
$.trim($("a[title='Subscribe to use these features']").text()), $.trim($("a[title='Subscribe to use these features']").text()),
"Not Subscribed", "Not Subscribed",
@ -441,38 +451,6 @@ acceptance("Admin | Custom Wizard Unsuscribed", function (needs) {
assert.strictEqual(actualValue, "Some value", "Value is correct"); assert.strictEqual(actualValue, "Some value", "Value is correct");
assert.strictEqual(actualResultText, "Result text", "Text is correct"); assert.strictEqual(actualResultText, "Result text", "Text is correct");
} }
const fieldsContentSet = [
[6, "bug", "1"],
[7, "gazelle", "gazelle"],
];
for (let [
fieldIndex,
expectedDataName,
expectedDataValue,
] of fieldsContentSet) {
await click(
`.admin-wizard-container .wizard-custom-action .setting:nth-of-type(${fieldIndex}) button`
);
let selectKitInsideThirdSetting = await selectKit(
`.admin-wizard-container .wizard-custom-action .setting:nth-of-type(${fieldIndex}) .output .select-kit`
);
await selectKitInsideThirdSetting.expand();
await selectKitInsideThirdSetting.selectRowByIndex(1);
let selectKitElement = document.querySelector(
`.admin-wizard-container .wizard-custom-action .setting:nth-of-type(${fieldIndex}) .output .select-kit`
);
let summaryElement = selectKitElement.querySelector("summary");
assert.equal(
summaryElement.getAttribute("data-name"),
expectedDataName,
"The correct data-name is selected"
);
assert.equal(
summaryElement.getAttribute("data-value"),
expectedDataValue,
"The correct data-value is selected"
);
}
assert.ok( assert.ok(
!visible('.admin-wizard-buttons button:contains("Delete Wizard")'), !visible('.admin-wizard-buttons button:contains("Delete Wizard")'),
"delete wizard button not displayed" "delete wizard button not displayed"

Datei anzeigen

@ -0,0 +1,82 @@
import { click, visit } from "@ember/test-helpers";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import { test } from "qunit";
acceptance("Category Chooser Initializer", function (needs) {
needs.user();
needs.settings({
allow_uncategorized_topics: false,
});
needs.site({
can_tag_topics: true,
categories: [
{
id: 1,
name: "General",
slug: "general",
permission: 1,
topic_template: null,
},
{
id: 2,
name: "Category with custom field",
slug: "category-custom-field",
permission: 1,
topic_template: "",
custom_fields: {
create_topic_wizard: "21",
},
},
{
id: 3,
name: "Category 1",
slug: "category-1",
permission: 1,
topic_template: "",
},
{
id: 4,
name: "Category 2",
slug: "category-2",
permission: 1,
topic_template: "",
},
],
});
test("does not display category with create_topic_wizard custom field", async function (assert) {
const categoryChooser = selectKit(".category-chooser");
await visit("/");
await click("#create-topic");
await categoryChooser.expand();
let categories = Array.from(
document.querySelectorAll(".category-chooser .category-row")
).filter((category) => category.getAttribute("data-name")); // Filter elements with a data-name attribute
assert.equal(
categories.length,
3,
"Correct number of categories are displayed"
);
const categoryNames = ["General", "Category 1", "Category 2"];
categoryNames.forEach((categoryName) => {
assert.ok(
categories.some(
(category) => category.getAttribute("data-name") === categoryName
),
`Category '${categoryName}' is displayed`
);
});
const categoryNameWithCustomField = "Category with custom field";
assert.notOk(
categories.some(
(category) =>
category.getAttribute("data-name") === categoryNameWithCustomField
),
`Category '${categoryNameWithCustomField}' is not displayed`
);
});
});

Datei anzeigen

@ -13,6 +13,8 @@ import {
wizardNoUser, wizardNoUser,
wizardNotPermitted, wizardNotPermitted,
} from "../helpers/wizard"; } from "../helpers/wizard";
import DiscourseURL from "discourse/lib/url";
import sinon from "sinon";
acceptance("Wizard | Not logged in", function (needs) { acceptance("Wizard | Not logged in", function (needs) {
needs.pretender((server, helper) => { needs.pretender((server, helper) => {
@ -54,6 +56,35 @@ acceptance("Wizard | Completed", function (needs) {
}); });
}); });
acceptance("Wizard | Redirect", function (needs) {
needs.user({
redirect_to_wizard: "wizard",
});
needs.pretender((server, helper) => {
server.get("/w/wizard.json", () => {
return helper.response(wizard);
});
});
test("Redirect to pending Wizard", async function (assert) {
sinon.stub(DiscourseURL, "routeTo");
await visit("/latest");
assert.ok(
DiscourseURL.routeTo.calledWith("/w/wizard"),
"pending wizard routing works"
);
});
test("Don't redirect to pending Wizard when ingore redirect param is supplied", async function (assert) {
sinon.stub(DiscourseURL, "routeTo");
await visit("/latest?ignore_redirect=1");
assert.notOk(
DiscourseURL.routeTo.calledWith("/w/wizard"),
"pending wizard routing blocked"
);
});
});
acceptance("Wizard | Wizard", function (needs) { acceptance("Wizard | Wizard", function (needs) {
needs.user(); needs.user();
needs.pretender((server, helper) => { needs.pretender((server, helper) => {

Datei anzeigen

@ -121,19 +121,19 @@ const getUnsubscribedAdminWizards = {
subscription_attributes: { subscription_attributes: {
wizard: { wizard: {
required: { required: {
none: [], none: ['*'],
standard: ["*"], standard: ["*"],
business: ["*"], business: ["*"],
community: ["*"], community: ["*"],
}, },
permitted: { permitted: {
none: [], none: ['*'],
standard: ["*"], standard: ["*"],
business: ["*"], business: ["*"],
community: ["*"], community: ["*"],
}, },
restart_on_revisit: { restart_on_revisit: {
none: [], none: ['*'],
standard: ["*"], standard: ["*"],
business: ["*"], business: ["*"],
community: ["*"], community: ["*"],
@ -141,19 +141,19 @@ const getUnsubscribedAdminWizards = {
}, },
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: ["*"],
@ -161,30 +161,19 @@ const getUnsubscribedAdminWizards = {
}, },
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: ["*"],
@ -192,7 +181,7 @@ const getUnsubscribedAdminWizards = {
}, },
action: { action: {
type: { type: {
none: ["create_topic", "update_profile", "open_composer", "route_to"], none: ['*'],
standard: [ standard: [
"create_topic", "create_topic",
"update_profile", "update_profile",
@ -208,20 +197,20 @@ const getUnsubscribedAdminWizards = {
}, },
custom_field: { custom_field: {
klass: { klass: {
none: ["topic", "post"], none: ['*'],
standard: ["topic", "post"], standard: ["topic", "post"],
business: ["*"], business: ["*"],
community: ["*"], community: ["*"],
}, },
type: { type: {
none: ["string", "boolean", "integer"], none: ['*'],
standard: ["string", "boolean", "integer"], standard: ["string", "boolean", "integer"],
business: ["*"], business: ["*"],
community: ["*"], community: ["*"],
}, },
}, },
api: { api: {
all: { none: [], standard: [], business: ["*"], community: ["*"] }, all: { none: ["*"], standard: [], business: ["*"], community: ["*"] },
}, },
}, },
subscription_client_installed: false, subscription_client_installed: false,

2654
yarn.lock

Datei-Diff unterdrückt, da er zu groß ist Diff laden