Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2025-03-15 04:07:01 +01:00
DEV: subscription management improvements
Dieser Commit ist enthalten in:
Ursprung
ce8ec8e514
Commit
d2ff1b5f5a
4 geänderte Dateien mit 30 neuen und 2 gelöschten Zeilen
|
@ -18,3 +18,6 @@ plugins:
|
||||||
wizard_important_notices_on_dashboard:
|
wizard_important_notices_on_dashboard:
|
||||||
client: true
|
client: true
|
||||||
default: true
|
default: true
|
||||||
|
wizard_subscription_product_key:
|
||||||
|
hidden: true
|
||||||
|
default: ''
|
||||||
|
|
|
@ -136,7 +136,14 @@ class CustomWizard::Subscription
|
||||||
@product_slug = id_and_slug[:slug]
|
@product_slug = id_and_slug[:slug]
|
||||||
end
|
end
|
||||||
|
|
||||||
@product_slug ||= ENV["CUSTOM_WIZARD_PRODUCT_SLUG"]
|
@product_slug ||=
|
||||||
|
(
|
||||||
|
if ENV["CUSTOM_WIZARD_PRODUCT_SLUG"].present?
|
||||||
|
ENV["CUSTOM_WIZARD_PRODUCT_SLUG"]
|
||||||
|
else
|
||||||
|
SiteSetting.wizard_subscription_product_key
|
||||||
|
end
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
def includes?(feature, attribute, value = nil)
|
def includes?(feature, attribute, value = nil)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# 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.11.2
|
# version: 2.11.3
|
||||||
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
|
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, 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
|
||||||
|
|
|
@ -146,4 +146,22 @@ describe CustomWizard::Subscription do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with a site setting" do
|
||||||
|
before { SiteSetting.wizard_subscription_product_key = "standard" }
|
||||||
|
|
||||||
|
after { SiteSetting.wizard_subscription_product_key = nil }
|
||||||
|
|
||||||
|
it "enables the relevant subscription" do
|
||||||
|
expect(described_class.type).to eq(:standard)
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with a subscription" do
|
||||||
|
before { enable_subscription("business") }
|
||||||
|
|
||||||
|
it "respects the subscription" do
|
||||||
|
expect(described_class.type).to eq(:business)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren