0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🐛 Disabled signup form embed menu when members are disabled

fixes https://github.com/TryGhost/Team/issues/3470

- When members are disabled or invite only, the signup form embed should be disabled
- The comments access setting is now also disabled if members are disabled
- The tiers menus are now also disabled if members are disabled
This commit is contained in:
Simon Backx 2023-06-14 14:49:07 +02:00
parent ecc28c5acd
commit 14e05a6f0f
4 changed files with 16 additions and 11 deletions

View file

@ -10,6 +10,7 @@
@options={{this.options}}
@selected={{this.selectedOption}}
@onChange={{this.setCommentAccess}}
@disabled={{eq this.settings.membersSignupAccess "none"}}
@triggerClass="gh-setting-dropdown"
@dropdownClass="gh-setting-dropdown-list"
as |option|

View file

@ -7,7 +7,7 @@
<h4 class="gh-expandable-title">Embeddable signup form</h4>
<p class="gh-expandable-description">Grow your audience from anywhere on the web</p>
</div>
<button type="button" class="gh-btn" {{on "click" this.open}}>
<button type="button" class="gh-btn" {{on "click" this.open}} disabled={{not (eq this.settings.membersSignupAccess "all")}}>
<span>Embed</span>
</button>
</div>

View file

@ -5,6 +5,7 @@ import {inject as service} from '@ember/service';
export default class SignupFormEmbed extends Component {
@service modals;
@service settings;
@action
open() {

View file

@ -79,11 +79,16 @@
<div class="gh-settings-members-tiersheader">
<h4 class="gh-main-section-header small bn">Membership tiers</h4>
{{#if this.session.user.isAdmin}}
<button type="button" class="gh-btn gh-btn-outline gh-btn-stripe-status {{if this.isConnectDisallowed "disabled"}} {{if this.membersUtils.isStripeEnabled "connected" ""}}" {{on "click" this.openStripeConnect}}>
<span>
{{if this.membersUtils.isStripeEnabled "Connected to Stripe" "Stripe not connected"}}
</span>
</button>
<button
type="button"
class="gh-btn gh-btn-outline gh-btn-stripe-status {{if this.isConnectDisallowed "disabled"}} {{if this.membersUtils.isStripeEnabled "connected" ""}}"
{{on "click" this.openStripeConnect}}
disabled={{and (eq this.settings.membersSignupAccess "none") (not this.membersUtils.isStripeEnabled)}}
>
<span>
{{if this.membersUtils.isStripeEnabled "Connected to Stripe" "Stripe not connected"}}
</span>
</button>
{{/if}}
</div>
<section class="gh-expandable gh-expendable-free-membership">
@ -93,7 +98,7 @@
<h4 class="gh-expandable-title">Free</h4>
<p class="gh-expandable-description">Free member sign up settings</p>
</div>
<button type="button" class="gh-btn" {{on "click" (toggle "freeOpen" this)}} data-test-button="toggle-free-settings"><span>{{if this.freeOpen "Close" "Expand"}}</span></button>
<button type="button" class="gh-btn" {{on "click" (toggle "freeOpen" this)}} data-test-button="toggle-free-settings" disabled={{eq this.settings.membersSignupAccess "none"}}><span>{{if this.freeOpen "Close" "Expand"}}</span></button>
</div>
<div class="gh-expandable-content">
{{#liquid-if this.freeOpen}}
@ -130,7 +135,7 @@
</div>
{{#if this.membersUtils.isStripeEnabled}}
<button type="button" class="gh-btn" {{on "click" (toggle "paidOpen" this)}} data-test-toggle-pub-info><span>{{if this.paidOpen "Close" "Expand"}}</span></button>
<button type="button" class="gh-btn" {{on "click" (toggle "paidOpen" this)}} disabled={{eq this.settings.membersSignupAccess "none"}} data-test-toggle-pub-info><span>{{if this.paidOpen "Close" "Expand"}}</span></button>
{{else}}
<button type="button" class="stripe-connect {{if (or (not this.session.user.isAdmin) this.isConnectDisallowed) "disabled"}}" {{on "click" this.openStripeConnect}}>
<span></span>
@ -166,9 +171,7 @@
</div>
</section>
{{#if (feature "signupForm")}}
<Settings::SignupFormEmbed />
{{/if}}
<Settings::SignupFormEmbed />
{{#if this.showPortalSettings}}
<GhFullscreenModal