Skip to content

Commit

Permalink
Merge branch 'main' into improve_subscription_classes_rspec_handling
Browse files Browse the repository at this point in the history
  • Loading branch information
merefield authored Dec 7, 2023
2 parents 2ad9665 + 4d2dfb9 commit 36d3486
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 166 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<DButton
@action={{this.click}}
class="wizard-subscription-badge {{this.subscription.subscriptionType}}"
@title={{this.title}}
>
{{d-icon "pavilion-logo"}}
<span>{{this.label}}</span>
</DButton>
<DButton
@icon={{this.updateIcon}}
@action={{this.update}}
class="btn btn-primary update"
class="btn update"
@disabled={{this.updating}}
@title="admin.wizard.subscription.update.title"
>
{{#if this.updating}}
{{loading-spinner size="small"}}
{{/if}}
</DButton>
<DButton
@action={{this.click}}
class="wizard-subscription-badge {{this.subscription.subscriptionType}}"
@title={{this.title}}
>
{{d-icon "pavilion-logo"}}
<span>{{this.label}}</span>
</DButton>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { inject as service } from "@ember/service";
import { action, computed } from "@ember/object";
import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import DiscourseURL from "discourse/lib/url";
import I18n from "I18n";

export default class WizardSubscriptionBadge extends Component {
Expand Down Expand Up @@ -32,7 +31,7 @@ export default class WizardSubscriptionBadge extends Component {

@action
click() {
DiscourseURL.routeTo(this.subscription.subscriptionLink);
window.open(this.subscription.subscriptionCtaLink, "_blank").focus();
}

@action
Expand Down

This file was deleted.

34 changes: 0 additions & 34 deletions assets/javascripts/discourse/components/wizard-subscription-cta.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<div class="supplier-authorize">
<WizardSubscriptionBadge />
{{#if authorized}}
{{conditional-loading-spinner size="small" condition=unauthorizing}}
<DButton
Expand All @@ -18,6 +19,4 @@
@action={{this.authorize}}
/>
{{/if}}
<WizardSubscriptionBadge />
<WizardSubscriptionCta />
</div>
7 changes: 1 addition & 6 deletions assets/javascripts/discourse/services/subscription.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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";
"https://coop.pavilion.tech/c/support/discourse-custom-wizard";

export default class SubscriptionService extends Service {
@tracked subscribed = false;
Expand All @@ -16,7 +16,6 @@ export default class SubscriptionService extends Service {
@tracked communitySubscription = false;
@tracked standardSubscription = false;
@tracked subscriptionAttributes = {};
subscriptionLandingUrl = PRODUCT_PAGE;

async init() {
super.init(...arguments);
Expand Down Expand Up @@ -49,10 +48,6 @@ export default class SubscriptionService extends Service {
this.standardSubscription = this.subscriptionType === "standard";
}

get subscriptionLink() {
return this.subscriptionLandingUrl;
}

get subscriptionCtaLink() {
switch (this.subscriptionType) {
case "none":
Expand Down
93 changes: 29 additions & 64 deletions assets/stylesheets/common/admin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -823,25 +823,6 @@ $error: #ef1700;
vertical-align: middle;
}

.btn.btn-pavilion-support {
background: var(--pavilion-primary);
color: var(--pavilion-secondary);

.d-icon {
color: var(--pavilion-secondary);
}

&:hover,
&:focus {
background: darken($pavilion_primary, 5%);

&[href],
svg.d-icon {
color: darken($pavilion_secondary, 10%);
}
}
}

.wizard-subscription-container {
width: 100%;
padding: 1em;
Expand All @@ -867,45 +848,49 @@ $error: #ef1700;
}
}

.wizard-subscription-badge {
.btn.wizard-subscription-badge {
display: inline-flex;
align-items: center;
max-height: 34px;
box-sizing: border-box;
position: relative;
cursor: pointer;
padding: 0.5em 0.65em;
background-color: rgba($primary-medium, 0.05);
border: 1.5px solid rgba($primary-medium, 0.5);
color: $primary-medium;
color: var(--secondary);

&:hover {
color: $primary-medium;
}

svg {
svg.d-icon-pavilion-logo {
width: 15px;
height: 15px;
margin-right: 0.45em;
margin-bottom: 0.15em;
color: var(--secondary);
}

&.none {
background-color: var(--subscription-none);
border: 1.5px solid var(--subscription-none);
}

&.standard {
background-color: rgba($subscription_standard, 0.05);
border: 1.5px solid rgba($subscription_standard, 0.5);
color: $subscription_standard;
background-color: var(--subscription-standard);
border: 1.5px solid var(--subscription-standard);
}

&.business {
background-color: $subscription_business;
border: 1.5px solid $subscription_business;
color: $secondary;
background-color: var(--subscription-business);
border: 1.5px solid var(--subscription-business);
}

&.community {
background-color: $subscription_community;
border: 1.5px solid $pavilion_primary;
color: $pavilion_primary;
background-color: var(--subscription-community);
border: 1.5px solid var(--pavilion-primary);
color: var(--pavilion-primary);

&:hover,
svg {
color: var(--pavilion-primary);
}
}

.d-icon {
Expand Down Expand Up @@ -939,45 +924,25 @@ $error: #ef1700;

button.update {
width: 40px;
height: 34px;
}

.btn-pavilion-support {
&:hover {
color: var(--pavilion-secondary);
}
}

.wizard-subscription-badge {
margin-right: 5px;
svg {
margin-right: 0.45em;
}
&.none {
svg {
color: #919191;
}
}
&.community,
&.standard,
&.business {
svg {
color: #fff;
}
}
}

.loading-container {
svg,
div {
vertical-align: -moz-middle-with-baseline;
vertical-align: -webkit-baseline-middle;
margin-right: 3px;
}
}

.btn-primary {
margin-right: 5px;
}

.deauthorize {
background-color: var(--secondary);

&:hover {
color: var(--primary);
}
}
}
}
2 changes: 2 additions & 0 deletions assets/stylesheets/common/admin/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ $pavilion_primary: #3c1c8c;
$pavilion_secondary: #ffffff;
$pavilion_warning: rgb(243, 163, 61);

$subscription_none: $pavilion_primary;
$subscription_standard: $pavilion_primary;
$subscription_business: #333;
$subscription_community: #fff;
Expand All @@ -10,6 +11,7 @@ $subscription_community: #fff;
--pavilion-primary: #{$pavilion_primary};
--pavilion-secondary: #{$pavilion_secondary};
--pavilion-warning: #{$pavilion_warning};
--subscription-none: #{$subscription_none};
--subscription-standard: #{$subscription_standard};
--subscription-business: #{$subscription_business};
--subscription-community: #{$subscription_community};
Expand Down
32 changes: 12 additions & 20 deletions config/locales/client.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ en:
destroy_complete: Destruction complete
subscription:
documentation: Check out the subscription documentation
authorize: "Authorize this forum to use your Custom Wizard subscription plan on %{server}."
not_subscribed: "You've authorized, but are not currently subscribed to a Custom Wizard plan on %{server}."
authorize: "Connect this forum to use your Custom Wizard subscription plan on %{server}."
not_subscribed: "You've connected, but are not currently subscribed to a Custom Wizard plan on %{server}."
subscription_expiring: "Your subscription is active, but will expire in the next 48 hours."
subscription_active: "Your subscription is active."
subscription_inactive: "Your subscription is inactive on this forum. Read more in <a href='https://pavilion.tech/products/discourse-custom-wizard-plugin/documentation/'>the documentation</a>."
unauthorized: "You're unauthorized. If you have a subscription, it will become inactive in the next 48 hours."
unauthorize_failed: Failed to unauthorize.
unauthorized: "You're not connected. If you have a subscription, it will become inactive in the next 48 hours."
unauthorize_failed: Failed to disconnect.
submissions:
select: "Select a wizard to see its submissions"
viewing: "You're viewing the submissions of the %{wizardName}"
Expand Down Expand Up @@ -546,11 +546,11 @@ en:
subscription:
title: Subscriber Features
authorize:
label: Authorize
title: Authorize your subscription on this site
label: Connect
title: Connect your subscription to this site
deauthorize:
label: deauthorize
title: Deauthorize your subscription on this site
label: Disconnect
title: Disconnect your subscription from this site
update:
title: "Update subscription status"
subscribed:
Expand All @@ -563,25 +563,17 @@ en:
selector: not subscribed
type:
none:
label: Not Subscribed
label: Subscribe
title: There is no Custom Wizard subscription active on this forum.
business:
label: Business
label: Support
title: There is a Custom Wizard Business subscription active on this forum.
standard:
label: Standard
label: Support
title: There is a Custom Wizard Standard subscription active on this forum.
community:
label: Community
title: There is a Custom Wizard Community subscription active on this forum.
cta:
none:
label: Get a Subscription
title: Get a subscription for this forum.
subscribed:
label: Support
title: Get support for your subscription.

title: There is a Custom Wizard Community subscription active on this forum.

wizard_js:
group:
Expand Down
Loading

0 comments on commit 36d3486

Please sign in to comment.