Added basic portal settings in new membership area

no refs

Members related settings are being consolidated into a single screen.

- Adds basic portal settings UI
This commit is contained in:
Rishabh 2021-05-17 13:28:15 +05:30
parent de560733c5
commit 4c736d1c80
2 changed files with 50 additions and 0 deletions

View File

@ -8,6 +8,9 @@ export default class MembersAccessController extends Controller {
@service settings; @service settings;
@tracked showLeaveSettingsModal = false; @tracked showLeaveSettingsModal = false;
@tracked showPortalSettings = false;
queryParams = ['showPortalSettings'];
leaveRoute(transition) { leaveRoute(transition) {
if (this.settings.get('hasDirtyAttributes')) { if (this.settings.get('hasDirtyAttributes')) {
@ -17,6 +20,28 @@ export default class MembersAccessController extends Controller {
} }
} }
@action
async leavePortalSettings() {
this.settings.rollbackAttributes();
this.showPortalSettings = false;
this.showLeaveSettingsModal = false;
}
@action
openStripeSettings() {
// Open stripe settings here
}
@action
closePortalSettings() {
const changedAttributes = this.settings.changedAttributes();
if (changedAttributes && Object.keys(changedAttributes).length > 0) {
this.showLeaveSettingsModal = true;
} else {
this.showPortalSettings = false;
}
}
@action @action
async confirmLeave() { async confirmLeave() {
this.settings.rollbackAttributes(); this.settings.rollbackAttributes();

View File

@ -17,6 +17,23 @@
</section> </section>
</GhCanvasHeader> </GhCanvasHeader>
<section class="view-container settings-debug">
<div class="gh-main-section">
<h4 class="gh-main-section-header small">Portal settings</h4>
</div>
<div class="flex flex-row pa2">
<div class="flex-grow-1">
<h4>Portal Settings</h4>
<span>Customize members modal signup flow</span>
</div>
<div>
<button type="button" class="gh-btn gh-btn-green gh-btn-outline" {{action (toggle "showPortalSettings" this)}} data-test-toggle-membersFrom>
<span> Customise Portal </span>
</button>
</div>
</div>
</section>
<section class="view-container settings-debug"> <section class="view-container settings-debug">
<div class="gh-main-section"> <div class="gh-main-section">
<h4 class="gh-main-section-header small">Access and payments</h4> <h4 class="gh-main-section-header small">Access and payments</h4>
@ -33,4 +50,12 @@
@modifier="action wide" @modifier="action wide"
/> />
{{/if}} {{/if}}
{{#if this.showPortalSettings}}
<GhFullscreenModal @modal="portal-settings"
@model={{hash
openStripeSettings=(action "openStripeSettings")
}}
@close={{action "closePortalSettings"}}
@modifier="full-overlay portal-settings" />
{{/if}}
</section> </section>