1
0
Fork 0

Commits vergleichen

...

66 Commits

Autor SHA1 Nachricht Datum
merefield
e120a1a426 one more try 2023-09-28 17:56:27 +01:00
merefield
fdfccf51e2 fix titles & labels on sub button 2023-09-28 17:10:11 +01:00
merefield
e17f90c5fd fix title 2023-09-28 16:31:58 +01:00
merefield
df9a3c6e6e fix title 2023-09-28 15:51:47 +01:00
merefield
4007fd9c65 fix localisation for deauthorize 2023-09-28 15:23:15 +01:00
merefield
c8263ed6aa change name of subscription stubbing method to add clarity of intent 2023-09-28 14:27:24 +01:00
merefield
13fb5dc1ea remove redundant code 2023-09-28 13:48:18 +01:00
merefield
da2a56adc6 specs: ensure sub client code is mocked out 2023-09-28 13:47:22 +01:00
merefield
4422badf6a locale changes 2023-09-28 12:27:49 +01:00
merefield
c0082b82b9 instantiate mocked up interface for more tests 2023-09-28 12:13:45 +01:00
merefield
6aa68ebd5f overcome inheritance that was forcing table look up on tests 2023-09-28 10:07:57 +01:00
merefield
1a32862fd1 namespace fix 2023-09-25 17:00:39 +01:00
merefield
c5d8003761 prettier 2023-09-25 16:10:15 +01:00
merefield
ea02e53882 prettier 2023-09-25 16:07:41 +01:00
merefield
80fcddc45f fix front end tests 2023-09-25 15:41:01 +01:00
merefield
45db2270ec add FE get suppliers stub 2023-09-24 18:22:39 +01:00
merefield
43ad5785e1 update FE tests 2023-09-24 17:35:20 +01:00
merefield
8407227f53 update back-end tests 2023-09-24 17:18:40 +01:00
merefield
2c109c54f5 update front-end tests 2023-09-24 17:16:40 +01:00
merefield
0ad8616239 linting 2023-09-24 13:13:32 +01:00
merefield
6755c70d31 simplify buttons 2023-09-24 13:01:46 +01:00
merefield
648b976ee0 fix button close 2023-09-24 12:54:05 +01:00
merefield
1fdd78bc7e convert buttons to DButton 2023-09-24 12:52:42 +01:00
merefield
c89dbbb7a8 linting 2023-09-24 12:43:20 +01:00
merefield
74a96af622 linting 2023-09-24 12:38:13 +01:00
merefield
0399cff6a5 remove redundant import 2023-09-24 12:27:28 +01:00
merefield
885fdd1215 remove redundant controller link 2023-09-24 12:26:26 +01:00
merefield
18001bebc1 rubocop 2023-09-24 12:20:57 +01:00
merefield
56181f65f4 linting 2023-09-24 12:16:41 +01:00
merefield
15f596e8ec merge in main 2023-09-24 12:12:23 +01:00
merefield
db7d9c14bc strip out redundant code from admin wizards route and controller 2023-09-24 12:05:07 +01:00
merefield
d5bd3c3c47 prettier 2023-09-24 11:58:20 +01:00
merefield
73e8b0a7fc remove debugging 2023-09-24 11:55:48 +01:00
merefield
5192e08893 change copy for deauthorize label 2023-09-24 10:58:59 +01:00
merefield
9cc65d24b5 revert 2023-09-24 10:46:00 +01:00
merefield
dd7f2a7e52 attempted fix 2023-09-24 10:31:42 +01:00
merefield
f97d15ac42 debug 2023-09-24 10:19:07 +01:00
merefield
a8af37b334 remove redundant sub client check 2023-09-24 10:03:38 +01:00
merefield
7f245d6a59 fix spelling mistake 2023-09-24 10:02:52 +01:00
merefield
e43fbd0b50 move subscription container to Glimmer 2023-09-24 10:01:08 +01:00
merefield
0b2e66ba0e tweak route 2023-09-24 09:11:37 +01:00
merefield
390f53a8a2 tweak route 2023-09-24 09:00:28 +01:00
merefield
ca11dacf8e tweak route 2023-09-24 08:44:27 +01:00
merefield
f012dc2407 fix file inclusion 2023-09-24 08:25:42 +01:00
merefield
26e4267d23 move subscription back-end call 2023-09-24 07:56:39 +01:00
merefield
6a1ead0322 debug 2023-09-24 07:45:12 +01:00
merefield
eefbe0a1fc debug 2023-09-24 07:43:42 +01:00
merefield
b1fddc33a7 evolve service 2023-09-23 22:52:46 +01:00
merefield
a558e19a54 fix variable reference 2023-09-23 18:38:22 +01:00
merefield
d6ca154668 rename service class 2023-09-23 18:33:18 +01:00
merefield
b454340263 convert subscription mixin to service, colocate glimmer files 2023-09-23 18:30:11 +01:00
merefield
4f8ab0b249 fix 2023-09-22 21:04:42 +01:00
merefield
4f887a858e fix 2023-09-22 20:47:52 +01:00
merefield
2f206f60c7 remove redundant client installed check code 2023-09-22 17:08:03 +01:00
merefield
051d1dbcfd eslint 2023-09-22 14:38:06 +01:00
merefield
437709446e prettier 2023-09-22 14:35:50 +01:00
merefield
baf533a8f4 clean up 2023-09-22 14:08:29 +01:00
merefield
76288932c8 Merge branch 'use_subscription_gem' of github.com:paviliondev/discourse-custom-wizard into use_subscription_gem 2023-09-22 14:05:47 +01:00
merefield
b78914e4fd evolve 2023-09-22 14:05:05 +01:00
merefield
28f17045c5 debug 2023-09-22 11:22:27 +01:00
merefield
07bed7ec86 evolve 2023-09-22 11:02:44 +01:00
merefield
bcd6f86fc8 debug 2023-09-22 10:20:22 +01:00
merefield
f1e3db48a3 point to new sub client gem update, add deauthorize action 2023-09-22 08:17:52 +01:00
merefield
3a0ba4589d wip 2023-09-08 19:14:36 +01:00
merefield
c2ffa7699b wip 2023-09-08 10:54:41 +01:00
merefield
27cde861b6 wip 2023-09-04 14:55:51 +01:00
71 geänderte Dateien mit 463 neuen und 307 gelöschten Zeilen

Datei anzeigen

@ -2,16 +2,6 @@
class CustomWizard::AdminController < ::Admin::AdminController
before_action :ensure_admin
def index
subcription = CustomWizard::Subscription.new
render_json_dump(
subscribed: subcription.subscribed?,
subscription_type: subcription.type,
subscription_attributes: CustomWizard::Subscription.attributes,
subscription_client_installed: CustomWizard::Subscription.client_installed?
)
end
private
def find_wizard

Datei anzeigen

@ -0,0 +1,13 @@
# frozen_string_literal: true
class CustomWizard::SubscriptionController < ::Admin::AdminController
before_action :ensure_admin
def index
subscription = CustomWizard::Subscription.new
render_json_dump(
subscribed: subscription.subscribed?,
subscription_type: subscription.type,
subscription_attributes: CustomWizard::Subscription.attributes,
)
end
end

Datei anzeigen

@ -5,11 +5,13 @@ import I18n from "I18n";
export default class AdminWizardsColumnComponent extends Component {
title = I18n.t("admin.wizard.edit_columns");
@action save() {
@action
save() {
this.args.closeModal();
}
@action resetToDefault() {
@action
resetToDefault() {
this.args.model.reset();
}
}

Datei anzeigen

@ -18,13 +18,15 @@ export default class NextSessionScheduledComponent extends Component {
return moment().isAfter(this.bufferedDateTime);
}
@action submit() {
@action
submit() {
const dateTime = this.bufferedDateTime;
this.args.model.update(moment(dateTime).utc().toISOString());
this.args.closeModal();
}
@action dateTimeChanged(dateTime) {
@action
dateTimeChanged(dateTime) {
this.bufferedDateTime = dateTime;
}
}

Datei anzeigen

@ -15,7 +15,7 @@ import {
import Component from "@ember/component";
import { bind, later } from "@ember/runloop";
import I18n from "I18n";
import Subscription from "../mixins/subscription";
import { inject as service } from "@ember/service";
const customFieldActionMap = {
topic: ["create_topic", "send_message"],
@ -27,8 +27,9 @@ const customFieldActionMap = {
const values = ["present", "true", "false"];
export default Component.extend(Subscription, {
export default Component.extend({
classNameBindings: [":mapper-selector", "activeType"],
subscription: service(),
showText: computed("activeType", function () {
return this.showInput("text");
@ -130,7 +131,11 @@ export default Component.extend(Subscription, {
return this.connector === "is";
}),
@discourseComputed("site.groups", "guestGroup", "subscriptionType")
@discourseComputed(
"site.groups",
"guestGroup",
"subscription.subscriptionType"
)
groups(groups, guestGroup, subscriptionType) {
let result = groups;
if (!guestGroup) {

Datei anzeigen

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

Datei anzeigen

@ -0,0 +1,33 @@
import { inject as service } from "@ember/service";
import { action, computed } from "@ember/object";
import Component from "@glimmer/component";
import DiscourseURL from "discourse/lib/url";
import I18n from "I18n";
export default class WizardSubscriptionBadge extends Component {
@service subscription;
@computed("subscription.subscriptionType")
get i18nKey() {
return `admin.wizard.subscription.type.${
this.subscription.subscriptionType
? this.subscription.subscriptionType
: "none"
}`;
}
@computed("i18nKey")
get title() {
return `${this.i18nKey}.title`;
}
@computed("i18nKey")
get label() {
return I18n.t(`${this.i18nKey}.label`);
}
@action
click() {
DiscourseURL.routeTo(this.subscription.subscriptionLink);
}
}

Datei anzeigen

@ -1,30 +0,0 @@
import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import Subscription from "../mixins/subscription";
import DiscourseURL from "discourse/lib/url";
import I18n from "I18n";
export default Component.extend(Subscription, {
tagName: "a",
classNameBindings: [":wizard-subscription-badge", "subscriptionType"],
attributeBindings: ["title"],
@discourseComputed("subscriptionType")
i18nKey(type) {
return `admin.wizard.subscription.type.${type ? type : "none"}`;
},
@discourseComputed("i18nKey")
title(i18nKey) {
return I18n.t(`${i18nKey}.title`);
},
@discourseComputed("i18nKey")
label(i18nKey) {
return I18n.t(`${i18nKey}.label`);
},
click() {
DiscourseURL.routeTo(this.subscriptionLink);
},
});

Datei anzeigen

@ -0,0 +1,17 @@
<div
class="wizard-subscription-container
{{if this.subscription.subscribed 'subscribed'}}"
>
<div class="subscription-header">
<h4>{{i18n "admin.wizard.subscription.title"}}</h4>
<a href={{subscriptionLink}} title={{i18n subscribedTitle}}>
{{d-icon subscribedIcon}}
{{i18n subscribedLabel}}
</a>
</div>
<div class="subscription-settings">
{{yield}}
</div>
</div>

Datei anzeigen

@ -0,0 +1,26 @@
import Component from "@glimmer/component";
import { computed } from "@ember/object";
import { inject as service } from "@ember/service";
export default class WizardSubscriptionContainer extends Component {
@service subscription;
@computed("subscription.subscribed")
get subscribedIcon() {
return this.subscription.subscribed ? "check" : "times";
}
@computed("subscription.subscribed")
get subscribedLabel() {
return `admin.wizard.subscription.${
this.subscription.subscribed ? "subscribed" : "not_subscribed"
}.label`;
}
@computed("subscription.subscribed")
get subscribedTitle() {
return `admin.wizard.subscription.${
this.subscription.subscribed ? "subscribed" : "not_subscribed"
}.title`;
}
}

Datei anzeigen

@ -1,26 +0,0 @@
import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import Subscription from "../mixins/subscription";
export default Component.extend(Subscription, {
classNameBindings: [":wizard-subscription-container", "subscribed"],
@discourseComputed("subscribed")
subscribedIcon(subscribed) {
return subscribed ? "check" : "times";
},
@discourseComputed("subscribed")
subscribedLabel(subscribed) {
return `admin.wizard.subscription.${
subscribed ? "subscribed" : "not_subscribed"
}.label`;
},
@discourseComputed("subscribed")
subscribedTitle(subscribed) {
return `admin.wizard.subscription.${
subscribed ? "subscribed" : "not_subscribed"
}.title`;
},
});

Datei anzeigen

@ -0,0 +1,7 @@
<DButton
@action={{this.click}}
class="btn btn-pavilion-support {{this.subscription.subscriptionType}}"
@title={{this.title}}
@label={{this.label}}
@icon={{this.icon}}
/>

Datei anzeigen

@ -0,0 +1,34 @@
import { inject as service } from "@ember/service";
import { action, computed } from "@ember/object";
import Component from "@glimmer/component";
export default class WizardSubscriptionCta extends Component {
@service subscription;
@computed("subscription.subscribed")
get i18nKey() {
return `admin.wizard.subscription.cta.${
this.subscription.subscribed ? "subscribed" : "none"
}`;
}
@computed("subscription.subscribed")
get icon() {
return this.subscription.subscribed ? "far-life-ring" : "external-link-alt";
}
@computed("i18nKey")
get title() {
return `${this.i18nKey}.title`;
}
@computed("i18nKey")
get label() {
return `${this.i18nKey}.label`;
}
@action
click() {
window.open(this.subscription.subscriptionCtaLink, "_blank").focus();
}
}

Datei anzeigen

@ -1,36 +0,0 @@
import Component from "@ember/component";
import discourseComputed from "discourse-common/utils/decorators";
import Subscription from "../mixins/subscription";
import I18n from "I18n";
export default Component.extend(Subscription, {
tagName: "a",
classNameBindings: [":btn", ":btn-pavilion-support", "subscriptionType"],
attributeBindings: ["title"],
@discourseComputed("subscribed")
i18nKey(subscribed) {
return `admin.wizard.subscription.cta.${
subscribed ? "subscribed" : "none"
}`;
},
@discourseComputed("subscribed")
icon(subscribed) {
return subscribed ? "far-life-ring" : "external-link-alt";
},
@discourseComputed("i18nKey")
title(i18nKey) {
return I18n.t(`${i18nKey}.title`);
},
@discourseComputed("i18nKey")
label(i18nKey) {
return I18n.t(`${i18nKey}.label`);
},
click() {
window.open(this.subscriptionCtaLink, "_blank").focus();
},
});

Datei anzeigen

@ -1,5 +1,5 @@
import SingleSelectComponent from "select-kit/components/single-select";
import Subscription from "../mixins/subscription";
import { inject as service } from "@ember/service";
import { filterValues } from "discourse/plugins/discourse-custom-wizard/discourse/lib/wizard-schema";
import discourseComputed from "discourse-common/utils/decorators";
import I18n from "I18n";
@ -12,8 +12,9 @@ const nameKey = function (feature, attribute, value) {
}
};
export default SingleSelectComponent.extend(Subscription, {
export default SingleSelectComponent.extend({
classNames: ["combo-box", "wizard-subscription-selector"],
subscription: service(),
selectKitOptions: {
autoFilterable: false,
@ -26,7 +27,7 @@ export default SingleSelectComponent.extend(Subscription, {
},
allowedSubscriptionTypes(feature, attribute, value) {
let attributes = this.subscriptionAttributes[feature];
let attributes = this.subscription.subscriptionAttributes[feature];
if (!attributes || !attributes[attribute]) {
return ["none"];
}
@ -59,10 +60,9 @@ export default SingleSelectComponent.extend(Subscription, {
name: I18n.t(nameKey(feature, attribute, value)),
subscriptionRequired,
};
if (subscriptionRequired) {
let subscribed = allowedSubscriptionTypes.includes(
this.subscriptionType
this.subscription.subscriptionType
);
let selectorKey = subscribed ? "subscribed" : "not_subscribed";
let selectorLabel = `admin.wizard.subscription.${selectorKey}.selector`;

Datei anzeigen

@ -0,0 +1,23 @@
<div class="supplier-authorize">
{{#if authorized}}
{{conditional-loading-spinner size="small" condition=unauthorizing}}
<DButton
class="deauthorize"
@title=admin.wizard.subscription.deauthorize.title
@disabled={{unauthorizing}}
@action={{this.deauthorize}}
>
{{i18n "admin.wizard.subscription.deauthorize.label"}}
</DButton>
{{else}}
<DButton
@icon="id-card"
class="btn-primary"
@label=admin.wizard.subscription.authorize.label
@title=admin.wizard.subscription.authorize.title
@action={{this.authorize}}
/>
{{/if}}
<WizardSubscriptionBadge />
<WizardSubscriptionCta />
</div>

Datei anzeigen

@ -0,0 +1,54 @@
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
export default class WizardSubscriptionStatus extends Component {
@service siteSettings;
@service subscription;
@tracked supplierId = null;
@tracked authorized = false;
@tracked unauthorizing = false;
basePath = "/admin/plugins/subscription-client/suppliers";
constructor() {
super(...arguments);
ajax(`${this.basePath}`)
.then((result) => {
this.supplierId = result.suppliers[0].id;
this.authorized = result.suppliers[0].authorized;
})
.finally(() => {
this.subscription.retrieveSubscriptionStatus();
});
}
@action
authorize() {
window.location.href = `${this.basePath}/authorize?supplier_id=${this.supplierId}&final_landing_path=/admin/wizards/wizard`;
}
@action
deauthorize() {
this.unauthorizing = true;
ajax(`${this.basePath}/authorize`, {
type: "DELETE",
data: {
supplier_id: this.supplierId,
},
})
.then((result) => {
this.supplierId = result.supplier.id;
this.authorized = !(result.supplier.authorized_at === null);
})
.finally(() => {
this.unauthorizing = false;
this.subscription.retrieveSubscriptionStatus();
//window.location.reload();
})
.catch(popupAjaxError);
}
}

Datei anzeigen

@ -1,9 +1,12 @@
import Controller from "@ember/controller";
import { equal, or } from "@ember/object/computed";
import { or } from "@ember/object/computed";
import { inject as service } from "@ember/service";
export default Controller.extend({
businessSubscription: equal("subscriptionType", "business"),
communitySubscription: equal("subscriptionType", "community"),
standardSubscription: equal("subscriptionType", "standard"),
showApi: or("businessSubscription", "communitySubscription"),
subscription: service(),
showApi: or(
"subscription.businessSubscription",
"subscription.communitySubscription"
),
});

Datei anzeigen

@ -1,53 +0,0 @@
import Mixin from "@ember/object/mixin";
import { getOwner } from "discourse-common/lib/get-owner";
import { readOnly } from "@ember/object/computed";
import discourseComputed from "discourse-common/utils/decorators";
const PRODUCT_PAGE = "https://custom-wizard.pavilion.tech";
const SUPPORT_MESSAGE =
"https://coop.pavilion.tech/new-message?username=support&title=Custom%20Wizard%20Support";
const MANAGER_CATEGORY =
"https://discourse.pluginmanager.org/c/discourse-custom-wizard";
export default Mixin.create({
subscriptionLandingUrl: PRODUCT_PAGE,
subscriptionClientUrl: "/admin/plugins/subscription-client",
@discourseComputed
adminWizards() {
return getOwner(this).lookup("controller:admin-wizards");
},
subscribed: readOnly("adminWizards.subscribed"),
subscriptionType: readOnly("adminWizards.subscriptionType"),
businessSubscription: readOnly("adminWizards.businessSubscription"),
communitySubscription: readOnly("adminWizards.communitySubscription"),
standardSubscription: readOnly("adminWizards.standardSubscription"),
subscriptionAttributes: readOnly("adminWizards.subscriptionAttributes"),
subscriptionClientInstalled: readOnly(
"adminWizards.subscriptionClientInstalled"
),
@discourseComputed("subscriptionClientInstalled")
subscriptionLink(subscriptionClientInstalled) {
return subscriptionClientInstalled
? this.subscriptionClientUrl
: this.subscriptionLandingUrl;
},
@discourseComputed("subscriptionType")
subscriptionCtaLink(subscriptionType) {
switch (subscriptionType) {
case "none":
return PRODUCT_PAGE;
case "standard":
return SUPPORT_MESSAGE;
case "business":
return SUPPORT_MESSAGE;
case "community":
return MANAGER_CATEGORY;
default:
return PRODUCT_PAGE;
}
},
});

Datei anzeigen

@ -1,23 +1,9 @@
import DiscourseRoute from "discourse/routes/discourse";
import { ajax } from "discourse/lib/ajax";
import { inject as service } from "@ember/service";
export default DiscourseRoute.extend({
router: service(),
model() {
return ajax("/admin/wizards");
},
setupController(controller, model) {
controller.setProperties({
subscribed: model.subscribed,
subscriptionType: model.subscription_type,
subscriptionAttributes: model.subscription_attributes,
subscriptionClientInstalled: model.subscription_client_installed,
});
},
afterModel(model, transition) {
if (transition.targetName === "adminWizards.index") {
this.router.transitionTo("adminWizardsWizard");

Datei anzeigen

@ -0,0 +1,57 @@
import Service from "@ember/service";
import { tracked } from "@glimmer/tracking";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
const PRODUCT_PAGE = "https://custom-wizard.pavilion.tech";
const SUPPORT_MESSAGE =
"https://coop.pavilion.tech/new-message?username=support&title=Custom%20Wizard%20Support";
const MANAGER_CATEGORY =
"https://discourse.pluginmanager.org/c/discourse-custom-wizard";
export default class SubscriptionService extends Service {
@tracked subscribed = false;
@tracked subscriptionType = "";
@tracked businessSubscription = false;
@tracked communitySubscription = false;
@tracked standardSubscription = false;
@tracked subscriptionAttributes = {};
subscriptionLandingUrl = PRODUCT_PAGE;
init() {
super.init(...arguments);
this.retrieveSubscriptionStatus();
}
retrieveSubscriptionStatus() {
ajax("/admin/wizards/subscription")
.then((result) => {
this.subscribed = result.subscribed;
this.subscriptionType = result.subscription_type;
this.subscriptionAttributes = result.subscription_attributes;
this.businessSubscription = this.subscriptionType === "business";
this.communitySubscription = this.subscriptionType === "community";
this.standardSubscription = this.subscriptionType === "standard";
})
.catch(popupAjaxError);
}
get subscriptionLink() {
return this.subscriptionLandingUrl;
}
get subscriptionCtaLink() {
switch (this.subscriptionType) {
case "none":
return PRODUCT_PAGE;
case "standard":
return SUPPORT_MESSAGE;
case "business":
return SUPPORT_MESSAGE;
case "community":
return MANAGER_CATEGORY;
default:
return PRODUCT_PAGE;
}
}
}

Datei anzeigen

@ -18,8 +18,7 @@
}}
<div class="admin-actions">
{{wizard-subscription-badge}}
{{wizard-subscription-cta}}
<WizardSubscriptionStatus />
</div>
{{/admin-nav}}

Datei anzeigen

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

Vorher

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

Datei anzeigen

@ -1,12 +0,0 @@
<div class="subscription-header">
<h4>{{i18n "admin.wizard.subscription.title"}}</h4>
<a href={{subscriptionLink}} title={{i18n subscribedTitle}}>
{{d-icon subscribedIcon}}
{{i18n subscribedLabel}}
</a>
</div>
<div class="subscription-settings">
{{yield}}
</div>

Datei anzeigen

@ -1 +0,0 @@
{{d-icon icon}}{{label}}

Datei anzeigen

@ -49,6 +49,10 @@ $error: #ef1700;
.btn-pavilion-support {
margin-left: 10px;
}
.supplier-authorize .btn-primary {
margin-right: 10px;
}
}
.wizard-message {

Datei anzeigen

@ -545,6 +545,12 @@ en:
subscription:
title: Subscriber Features
authorize:
label: Authorize
title: Authorize your subscription on this site
deauthorize:
label: deauthorize
title: Deauthorize your subscription on this site
subscribed:
label: Subscribed
title: You're subscribed and can use these features

Datei anzeigen

@ -14,6 +14,7 @@ Discourse::Application.routes.append do
scope module: 'custom_wizard', constraints: AdminConstraint.new do
get 'admin/wizards' => 'admin#index'
get 'admin/wizards/subscription' => 'subscription#index'
get 'admin/wizards/wizard' => 'admin_wizard#index'
get 'admin/wizards/wizard/create' => 'admin#index'

Datei anzeigen

@ -1,4 +1,6 @@
# frozen_string_literal: true
require "discourse_subscription_client"
class CustomWizard::Subscription
PRODUCT_HIERARCHY = %w[
community
@ -105,8 +107,7 @@ class CustomWizard::Subscription
:product_slug
def initialize
if CustomWizard::Subscription.client_installed?
result = DiscourseSubscriptionClient.find_subscriptions("discourse-custom-wizard")
result = ::DiscourseSubscriptionClient.find_subscriptions("discourse-custom-wizard")
if result&.any?
ids_and_slugs = result.subscriptions.map do |subscription|
@ -123,7 +124,6 @@ class CustomWizard::Subscription
@product_id = id_and_slug[:id]
@product_slug = id_and_slug[:slug]
end
end
@product_slug ||= ENV["CUSTOM_WIZARD_PRODUCT_SLUG"]
end
@ -157,7 +157,7 @@ class CustomWizard::Subscription
return :none unless subscribed?
return :business if business?
return :standard if standard?
return :community if community?
:community if community?
end
def subscribed?
@ -176,10 +176,6 @@ class CustomWizard::Subscription
product_slug === "community"
end
def self.client_installed?
defined?(DiscourseSubscriptionClient) == 'constant' && DiscourseSubscriptionClient.class == Module
end
def self.subscribed?
new.subscribed?
end

Datei anzeigen

@ -1,13 +1,15 @@
# frozen_string_literal: true
# name: discourse-custom-wizard
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
# version: 2.4.23
# version: 2.4.24
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
# url: https://github.com/paviliondev/discourse-custom-wizard
# contact_emails: development@pavilion.tech
# subscription_url: https://coop.pavilion.tech
gem 'liquid', '5.0.1', require: true
gem "discourse_subscription_client", "0.1.0.pre15", require_name: "discourse_subscription_client"
register_asset 'stylesheets/common/admin.scss'
register_asset 'stylesheets/common/wizard.scss'
@ -35,6 +37,7 @@ after_initialize do
../lib/custom_wizard/engine.rb
../config/routes.rb
../app/controllers/custom_wizard/admin/admin.rb
../app/controllers/custom_wizard/admin/subscription.rb
../app/controllers/custom_wizard/admin/wizard.rb
../app/controllers/custom_wizard/admin/submissions.rb
../app/controllers/custom_wizard/admin/api.rb

Datei anzeigen

@ -42,6 +42,7 @@ describe CustomWizard::Action do
}
before do
stub_out_subscription_classes
Group.refresh_automatic_group!(:trust_level_2)
update_template(wizard_template)
end

Datei anzeigen

@ -29,6 +29,7 @@ describe CustomWizard::Builder do
}
before do
stub_out_subscription_classes
Group.refresh_automatic_group!(:trust_level_3)
CustomWizard::Template.save(wizard_template, skip_jobs: true)
@template = CustomWizard::Template.find('super_mega_fun_wizard')

Datei anzeigen

@ -5,6 +5,7 @@ describe CustomWizard::CustomField do
let(:custom_field_subscription_json) { get_wizard_fixture("custom_field/subscription_custom_fields") }
before do
stub_out_subscription_classes
CustomWizard::CustomField.invalidate_cache
end

Datei anzeigen

@ -7,6 +7,7 @@ describe CustomWizard::Submission do
let(:guest_id) { CustomWizard::Wizard.generate_guest_id }
before do
stub_out_subscription_classes
CustomWizard::Template.save(template_json, skip_jobs: true)
@wizard = CustomWizard::Wizard.create(template_json["id"], user)
described_class.new(@wizard, step_1_field_1: "I am user submission").save

Datei anzeigen

@ -13,41 +13,9 @@ describe CustomWizard::Subscription do
}
}
after do
undefine_client_classes
end
it "detects the subscription client" do
undefine_client_classes
expect(described_class.client_installed?).to eq(false)
end
context "without a subscription client" do
it "is not subscribed" do
expect(described_class.subscribed?).to eq(false)
end
it "has none type" do
subscription = described_class.new
expect(subscription.type).to eq(:none)
end
it "non subscriber features are included" do
expect(described_class.includes?(:wizard, :after_signup, true)).to eq(true)
end
it "subscriber features are not included" do
expect(described_class.includes?(:wizard, :permitted, {})).to eq(false)
end
end
context "with subscription client" do
context "with subscription client gem mocked out" do
before do
define_client_classes
end
it "detects the subscription client" do
expect(described_class.client_installed?).to eq(true)
stub_out_subscription_classes
end
context "without a subscription" do
@ -69,11 +37,12 @@ describe CustomWizard::Subscription do
end
context "with subscriptions" do
def get_subscription_result(product_ids)
result = DiscourseSubscriptionClient::Subscriptions::Result.new
result.supplier = SubscriptionClientSupplier.new(product_slugs)
result.resource = SubscriptionClientResource.new
result.subscriptions = product_ids.map { |product_id| SubscriptionClientSubscription.new(product_id) }
result.subscriptions = product_ids.map { |product_id| ::SubscriptionClientSubscription.new(product_id) }
result.products = product_slugs
result
end

Datei anzeigen

@ -7,6 +7,7 @@ describe CustomWizard::Template do
fab!(:upload) { Fabricate(:upload) }
before do
stub_out_subscription_classes
CustomWizard::Template.save(template_json, skip_jobs: true)
end

Datei anzeigen

@ -39,6 +39,10 @@ describe CustomWizard::TemplateValidator do
expect(validator.errors.first.message).to eq("Liquid syntax error in #{object_id}: #{message}")
end
before do
stub_out_subscription_classes
end
it "validates valid templates" do
expect(
CustomWizard::TemplateValidator.new(template).perform

Datei anzeigen

@ -6,6 +6,7 @@ describe CustomWizard::UpdateValidator do
let(:url_field) { get_wizard_fixture("field/url") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(template, skip_jobs: true)
@template = CustomWizard::Template.find('super_mega_fun_wizard')
end

Datei anzeigen

@ -10,6 +10,7 @@ describe CustomWizard::Wizard do
let(:step_json) { get_wizard_fixture("step/step") }
before do
stub_out_subscription_classes
Group.refresh_automatic_group!(:trust_level_3)
@permitted_template = template_json.dup
@permitted_template["permitted"] = permitted_json["permitted"]

Datei anzeigen

@ -11,6 +11,7 @@ describe "custom field extensions" do
let(:subscription_custom_field_json) { get_wizard_fixture("custom_field/subscription_custom_fields") }
before do
stub_out_subscription_classes
custom_field_json['custom_fields'].each do |field_json|
custom_field = CustomWizard::CustomField.new(nil, field_json)
custom_field.save

Datei anzeigen

@ -7,6 +7,7 @@ describe ExtraLocalesControllerCustomWizard, type: :request do
let(:permitted) { get_wizard_fixture("wizard/permitted") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(template, skip_jobs: true)
end

Datei anzeigen

@ -33,6 +33,7 @@ describe ::Guardian do
end
before do
stub_out_subscription_classes
CustomWizard::Template.save(wizard_template, skip_jobs: true)
@template = CustomWizard::Template.find('super_mega_fun_wizard')
end

Datei anzeigen

@ -6,6 +6,7 @@ describe InvitesControllerCustomWizard, type: :request do
let(:template) { get_wizard_fixture("wizard") }
before do
stub_out_subscription_classes
@controller = InvitesController.new
end

Datei anzeigen

@ -4,6 +4,7 @@ describe CustomWizardUsersController, type: :request do
let(:template) { get_wizard_fixture("wizard") }
before do
stub_out_subscription_classes
@controller = UsersController.new
end

Datei anzeigen

@ -5,7 +5,7 @@ module DiscourseSubscriptionClient
end
end
class SubscriptionClientSupplier
SubscriptionClientSupplier = Class.new Object do
attr_reader :product_slugs
def initialize(product_slugs)
@ -13,10 +13,10 @@ class SubscriptionClientSupplier
end
end
class SubscriptionClientResource
SubscriptionClientResource = Class.new Object do
end
class SubscriptionClientSubscription
SubscriptionClientSubscription = Class.new Object do
attr_reader :product_id
def initialize(product_id)

Datei anzeigen

@ -9,11 +9,13 @@ def get_wizard_fixture(path)
end
def enable_subscription(type)
stub_out_subscription_classes
CustomWizard::Subscription.stubs("#{type}?".to_sym).returns(true)
CustomWizard::Subscription.any_instance.stubs("#{type}?".to_sym).returns(true)
end
def disable_subscriptions
stub_out_subscription_classes
%w[
standard
business
@ -24,11 +26,11 @@ def disable_subscriptions
end
end
def undefine_client_classes
def unstub_out_subscription_classes
Object.send(:remove_const, :DiscourseSubscriptionClient) if Object.constants.include?(:DiscourseSubscriptionClient)
Object.send(:remove_const, :SubscriptionClientSubscription) if Object.constants.include?(:SubscriptionClientSubscription)
end
def define_client_classes
def stub_out_subscription_classes
load File.expand_path("#{Rails.root}/plugins/discourse-custom-wizard/spec/fixtures/subscription_client.rb", __FILE__)
end

Datei anzeigen

@ -5,6 +5,7 @@ describe CustomWizard::AdminApiController do
let(:api_json) { get_wizard_fixture("api/api") }
before do
stub_out_subscription_classes
sign_in(admin_user)
end

Datei anzeigen

@ -5,6 +5,7 @@ describe CustomWizard::AdminCustomFieldsController do
let(:custom_field_json) { get_wizard_fixture("custom_field/custom_fields") }
before do
stub_out_subscription_classes
custom_field_json['custom_fields'].each do |field_json|
CustomWizard::CustomField.new(nil, field_json).save
end

Datei anzeigen

@ -5,6 +5,7 @@ describe CustomWizard::AdminLogsController do
let(:template) { get_wizard_fixture("wizard") }
before do
stub_out_subscription_classes
["first", "second", "third"].each_with_index do |key, index|
temp = template.dup
temp["id"] = "#{key}_test_wizard"

Datei anzeigen

@ -5,6 +5,7 @@ describe CustomWizard::AdminManagerController do
let(:template) { get_wizard_fixture("wizard") }
before do
stub_out_subscription_classes
sign_in(admin_user)
template_2 = template.dup

Datei anzeigen

@ -1,6 +1,6 @@
# frozen_string_literal: true
describe CustomWizard::AdminController do
describe CustomWizard::SubscriptionController do
fab!(:admin_user) { Fabricate(:user, admin: true) }
it "requires an admin" do
@ -16,28 +16,26 @@ describe CustomWizard::AdminController do
context "without a subscription" do
before do
disable_subscriptions
define_client_classes
stub_out_subscription_classes
end
it "returns the right subscription details" do
get "/admin/wizards.json"
get "/admin/wizards/subscription.json"
expect(response.parsed_body["subscribed"]).to eq(false)
expect(response.parsed_body["subscription_attributes"]).to eq(CustomWizard::Subscription.attributes.as_json)
expect(response.parsed_body["subscription_client_installed"]).to eq(true)
end
end
context "with a subscription" do
before do
enable_subscription("standard")
define_client_classes
stub_out_subscription_classes
end
it "returns the right subscription details" do
get "/admin/wizards.json"
get "/admin/wizards/subscription.json"
expect(response.parsed_body["subscribed"]).to eq(true)
expect(response.parsed_body["subscription_type"]).to eq("standard")
expect(response.parsed_body["subscription_client_installed"]).to eq(true)
end
end
end

Datei anzeigen

@ -8,9 +8,8 @@ describe CustomWizard::AdminWizardController do
let(:category) { Fabricate(:category, custom_fields: { create_topic_wizard: template['name'].parameterize(separator: "_") }) }
before do
CustomWizard::Template.save(template, skip_jobs: true)
enable_subscription("standard")
CustomWizard::Template.save(template, skip_jobs: true)
template_2 = template.dup
template_2["id"] = 'super_mega_fun_wizard_2'
template_2["permitted"] = template_2['permitted']

Datei anzeigen

@ -5,6 +5,7 @@ describe ApplicationController do
let(:wizard_template) { get_wizard_fixture("wizard") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(wizard_template, skip_jobs: true)
@template = CustomWizard::Template.find('super_mega_fun_wizard')
end

Datei anzeigen

@ -10,6 +10,7 @@ describe "custom field extensions" do
let(:subscription_custom_field_json) { get_wizard_fixture("custom_field/subscription_custom_fields") }
before do
stub_out_subscription_classes
custom_field_json['custom_fields'].each do |field_json|
custom_field = CustomWizard::CustomField.new(nil, field_json)
custom_field.save

Datei anzeigen

@ -11,6 +11,7 @@ describe CustomWizard::StepsController do
let(:guests_permitted) { get_wizard_fixture("wizard/guests_permitted") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(wizard_template, skip_jobs: true)
end

Datei anzeigen

@ -6,6 +6,7 @@ describe CustomWizard::WizardController do
let(:permitted_json) { get_wizard_fixture("wizard/permitted") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(wizard_template, skip_jobs: true)
@template = CustomWizard::Template.find("super_mega_fun_wizard")
end

Datei anzeigen

@ -4,6 +4,10 @@ describe CustomWizard::BasicWizardSerializer do
fab!(:user) { Fabricate(:user) }
let(:template) { get_wizard_fixture("wizard") }
before do
stub_out_subscription_classes
end
it 'should return basic wizard attributes' do
CustomWizard::Template.save(template, skip_jobs: true)
json = CustomWizard::BasicWizardSerializer.new(

Datei anzeigen

@ -4,6 +4,10 @@ describe CustomWizard::CustomFieldSerializer do
fab!(:user) { Fabricate(:user) }
let(:custom_field_json) { get_wizard_fixture("custom_field/custom_fields") }
before do
stub_out_subscription_classes
end
it 'should return custom field attributes' do
custom_field_json['custom_fields'].each do |field_json|
CustomWizard::CustomField.new(nil, field_json).save

Datei anzeigen

@ -13,6 +13,7 @@ describe CustomWizard::SubmissionSerializer do
}
before do
stub_out_subscription_classes
CustomWizard::Template.save(template_json, skip_jobs: true)
wizard = CustomWizard::Wizard.create(template_json["id"], user1)

Datei anzeigen

@ -5,6 +5,7 @@ describe CustomWizard::FieldSerializer do
let(:template) { get_wizard_fixture("wizard") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(template, skip_jobs: true)
@wizard = CustomWizard::Builder.new("super_mega_fun_wizard", user).build
end

Datei anzeigen

@ -8,6 +8,7 @@ describe CustomWizard::WizardSerializer do
let(:advanced_fields) { get_wizard_fixture("field/advanced_types") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(template, skip_jobs: true)
@template = CustomWizard::Template.find('super_mega_fun_wizard')
end

Datei anzeigen

@ -6,6 +6,7 @@ describe CustomWizard::StepSerializer do
let(:required_data_json) { get_wizard_fixture("step/required_data") }
before do
stub_out_subscription_classes
CustomWizard::Template.save(wizard_template, skip_jobs: true)
@wizard = CustomWizard::Builder.new("super_mega_fun_wizard", user).build
end

Datei anzeigen

@ -8,6 +8,7 @@ import { click, fillIn, findAll, visit, waitUntil } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import {
getCustomFields,
getSuppliers,
getUnsubscribedAdminWizards,
getWizard,
} from "../helpers/admin-wizard";
@ -24,7 +25,7 @@ acceptance("Admin | Custom Fields Unsubscribed", function (needs) {
server.get("/admin/wizards/wizard", () => {
return helper.response(getWizard);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getUnsubscribedAdminWizards);
});
server.get("/admin/wizards/custom-fields", () => {
@ -36,6 +37,9 @@ acceptance("Admin | Custom Fields Unsubscribed", function (needs) {
server.delete("/admin/wizards/custom-fields/topic_custom_field", () => {
return helper.response({ success: "OK" });
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
async function selectTypeAndSerializerAndFillInName(

Datei anzeigen

@ -3,6 +3,7 @@ import { test } from "qunit";
import { click, findAll, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import {
getSuppliers,
getUnsubscribedAdminWizards,
getWizard,
getWizardTestingLog,
@ -23,12 +24,15 @@ acceptance("Admin | Logs", function (needs) {
server.get("/admin/wizards/logs/this_is_testing_wizard", () => {
return helper.response(getWizardTestingLog);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getUnsubscribedAdminWizards);
});
server.get("/admin/wizards/wizard", () => {
return helper.response(getWizard);
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
test("viewing logs fields tab", async (assert) => {
await visit("/admin/wizards/logs");

Datei anzeigen

@ -2,6 +2,7 @@ import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
import { test } from "qunit";
import { click, find, findAll, visit, waitUntil } from "@ember/test-helpers";
import {
getSuppliers,
getUnsubscribedAdminWizards,
getWizard,
getWizardTestingLog,
@ -18,7 +19,7 @@ acceptance("Admin | Manager", function (needs) {
server.get("/admin/wizards/manager/this_is_testing_wizard", () => {
return helper.response(getWizardTestingLog);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getUnsubscribedAdminWizards);
});
server.get("/admin/wizards/wizard", () => {
@ -33,6 +34,9 @@ acceptance("Admin | Manager", function (needs) {
failures: [],
});
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
async function waitForDestructionAndResetMessage() {
await waitUntil(

Datei anzeigen

@ -4,6 +4,7 @@ import { click, findAll, visit } from "@ember/test-helpers";
import selectKit from "discourse/tests/helpers/select-kit-helper";
import {
getAnotherWizardSubmission,
getSuppliers,
getUnsubscribedAdminWizards,
getWizard,
getWizardSubmissions,
@ -28,12 +29,15 @@ acceptance("Admin | Submissions", function (needs) {
server.get("/admin/wizards/submissions/another_wizard", () => {
return helper.response(getAnotherWizardSubmission);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getUnsubscribedAdminWizards);
});
server.get("/admin/wizards/wizard", () => {
return helper.response(getWizard);
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
test("View submissions fields tab and content", async (assert) => {
await visit("/admin/wizards/submissions");

Datei anzeigen

@ -6,6 +6,7 @@ import {
getBusinessAdminWizard,
getCustomFields,
getNewApi,
getSuppliers,
getWizard,
putNewApi,
} from "../helpers/admin-wizard";
@ -21,7 +22,7 @@ acceptance("Admin | API tab", function (needs) {
server.get("/admin/wizards/wizard", () => {
return helper.response(getWizard);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getBusinessAdminWizard);
});
server.get("/admin/wizards/custom-fields", () => {
@ -45,6 +46,9 @@ acceptance("Admin | API tab", function (needs) {
server.get("/admin/wizards/api/new_api", () => {
return helper.response(getNewApi);
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
test("Visit API tab and fill data", async function (assert) {

Datei anzeigen

@ -11,6 +11,7 @@ import {
getBusinessAdminWizard,
getCreatedWizard,
getCustomFields,
getSuppliers,
getWizard,
} from "../helpers/admin-wizard";
@ -28,7 +29,7 @@ acceptance("Admin | Custom Wizard Business Subscription", function (needs) {
server.get("/admin/wizards/custom-fields", () => {
return helper.response(getCustomFields);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getBusinessAdminWizard);
});
server.get("/admin/wizards/api", () => {
@ -49,6 +50,9 @@ acceptance("Admin | Custom Wizard Business Subscription", function (needs) {
server.get("/admin/wizards/wizard/new_wizard_for_testing", () => {
return helper.response(getCreatedWizard);
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
test("Displaying all tabs including API", async (assert) => {

Datei anzeigen

@ -11,6 +11,7 @@ import {
getCreatedWizard,
getCustomFields,
getStandardAdminWizard,
getSuppliers,
getWizard,
} from "../helpers/admin-wizard";
@ -28,7 +29,7 @@ acceptance("Admin | Custom Wizard Standard Subscription", function (needs) {
server.get("/admin/wizards/custom-fields", () => {
return helper.response(getCustomFields);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getStandardAdminWizard);
});
server.get("/admin/wizards/api", () => {
@ -49,6 +50,9 @@ acceptance("Admin | Custom Wizard Standard Subscription", function (needs) {
server.get("/admin/wizards/wizard/new_wizard_for_testing", () => {
return helper.response(getCreatedWizard);
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
test("Displaying all tabs except API", async (assert) => {

Datei anzeigen

@ -11,6 +11,7 @@ import {
getAdminTestingWizard,
getCreatedWizard,
getCustomFields,
getSuppliers,
getUniqueWizard,
getUnsubscribedAdminWizards,
getWizard,
@ -30,7 +31,7 @@ acceptance("Admin | Custom Wizard Unsubscribed", function (needs) {
server.get("/admin/wizards/custom-fields", () => {
return helper.response(getCustomFields);
});
server.get("/admin/wizards", () => {
server.get("/admin/wizards/subscription", () => {
return helper.response(getUnsubscribedAdminWizards);
});
server.get("/admin/wizards/api", () => {
@ -54,6 +55,9 @@ acceptance("Admin | Custom Wizard Unsubscribed", function (needs) {
server.get("/admin/wizards/wizard/unique_wizard", () => {
return helper.response(getUniqueWizard);
});
server.get("/admin/plugins/subscription-client/suppliers", () => {
return helper.response(getSuppliers);
});
});
async function appendText(selector, text) {

Datei anzeigen

@ -224,7 +224,6 @@ const getUnsubscribedAdminWizards = {
all: { none: [], standard: [], business: ["*"], community: ["*"] },
},
},
subscription_client_installed: false,
};
const getCustomFields = {
custom_fields: [
@ -478,7 +477,6 @@ const getBusinessAdminWizard = {
all: { none: [], standard: [], business: ["*"], community: ["*"] },
},
},
subscription_client_installed: false,
};
const getStandardAdminWizard = {
subscribed: true,
@ -589,7 +587,6 @@ const getStandardAdminWizard = {
all: { none: [], standard: [], business: ["*"], community: ["*"] },
},
},
subscription_client_installed: false,
};
const getAdminTestingWizard = {
id: "this_is_testing_wizard",
@ -917,6 +914,19 @@ const putNewApi = {
log: [],
},
};
const getSuppliers = {
suppliers: [
{
id: 1,
name: "Pavilion",
authorized: false,
authorized_at: null,
user: null,
},
],
};
export {
getWizard,
getUnsubscribedAdminWizards,
@ -931,4 +941,5 @@ export {
putNewApi,
getAnotherWizardSubmission,
getUniqueWizard,
getSuppliers,
};