Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-22 01:10:28 +01:00
point to new sub client gem update, add deauthorize action
Dieser Commit ist enthalten in:
Ursprung
3a0ba4589d
Commit
f1e3db48a3
2 geänderte Dateien mit 28 neuen und 8 gelöschten Zeilen
|
@ -1,22 +1,22 @@
|
|||
// import { geoLocationSearch, providerDetails } from "../lib/location-utilities";
|
||||
//import { ajax } from "discourse/lib/ajax";
|
||||
import { action, set } from "@ember/object";
|
||||
// import { equal } from "@ember/object/computed";
|
||||
// import { A } from "@ember/array";
|
||||
import { inject as service } from "@ember/service";
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { ajax } from "discourse/lib/ajax";
|
||||
// import I18n from "I18n";
|
||||
import { popupAjaxError } from "discourse/lib/ajax-error";
|
||||
|
||||
export default class WizardSubscriptionAuthorize extends Component {
|
||||
basePath = "/admin/plugins/subscription-client/suppliers";
|
||||
|
||||
@service siteSettings;
|
||||
|
||||
@tracked supplierId = null;
|
||||
@tracked authorized = false;
|
||||
@tracked unauthorizing = false;
|
||||
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
ajax("/admin/plugins/subscription-client/suppliers").then((result) => {
|
||||
ajax("/admin/plugins/subscription-client/suppliers?final_landing_path%3D%2Fadmin%2Fwizards%2Fwizard").then((result) => {
|
||||
this.supplierId = result.suppliers[0].id;
|
||||
this.authorized = result.suppliers[0].authorized;
|
||||
})
|
||||
|
@ -24,6 +24,26 @@ export default class WizardSubscriptionAuthorize extends Component {
|
|||
|
||||
@action
|
||||
authorize() {
|
||||
window.location.href = `/admin/plugins/subscription-client/suppliers/authorize?supplier_id=${this.supplierId}`;
|
||||
window.location.href = `${this.basePath}/authorize?supplier_id=${this.supplierId}`;
|
||||
}
|
||||
|
||||
@action
|
||||
deauthorize() {
|
||||
this.unauthorizing = true;
|
||||
|
||||
ajax(`${this.basePath}/authorize`, {
|
||||
type: "DELETE",
|
||||
data: {
|
||||
supplier_id: this.supplierId,
|
||||
},
|
||||
})
|
||||
.then((result) => {
|
||||
this.supplierId = result.suppliers[0].id;
|
||||
this.authorized = result.suppliers[0].authorized;
|
||||
})
|
||||
.finally(() => {
|
||||
this.unauthorizing = false;
|
||||
})
|
||||
.catch(popupAjaxError);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
# subscription_url: https://coop.pavilion.tech
|
||||
|
||||
gem 'liquid', '5.0.1', require: true
|
||||
gem "discourse_subscription_client", "0.1.0.pre14", require_name: "discourse_subscription_client"
|
||||
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'
|
||||
|
|
Laden …
In neuem Issue referenzieren