2021-01-28 18:25:21 +03:00
|
|
|
/* eslint-disable ghost/ember/alias-model-in-controller */
|
|
|
|
import Controller from '@ember/controller';
|
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
|
|
|
export default Controller.extend({
|
|
|
|
|
|
|
|
settings: service(),
|
2021-03-05 17:23:23 +03:00
|
|
|
session: service(),
|
2021-01-28 18:25:21 +03:00
|
|
|
|
2021-02-15 13:17:31 +03:00
|
|
|
queryParams: ['showPortalSettings', 'showBrandingModal'],
|
|
|
|
|
2021-01-28 18:25:21 +03:00
|
|
|
showPortalSettings: false,
|
|
|
|
showBrandingModal: false,
|
|
|
|
showLeaveSettingsModal: false,
|
|
|
|
|
|
|
|
tagName: '',
|
2021-02-15 13:17:31 +03:00
|
|
|
|
2021-01-28 18:25:21 +03:00
|
|
|
actions: {
|
|
|
|
openStripeSettings() {
|
|
|
|
this.set('membersStripeOpen', true);
|
|
|
|
},
|
2021-02-15 13:17:31 +03:00
|
|
|
|
2021-01-28 18:25:21 +03:00
|
|
|
closePortalSettings() {
|
|
|
|
const changedAttributes = this.settings.changedAttributes();
|
|
|
|
if (changedAttributes && Object.keys(changedAttributes).length > 0) {
|
|
|
|
this.set('showLeaveSettingsModal', true);
|
|
|
|
} else {
|
|
|
|
this.set('showPortalSettings', false);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
closeLeaveSettingsModal() {
|
|
|
|
this.set('showLeaveSettingsModal', false);
|
|
|
|
},
|
|
|
|
|
2021-04-27 19:34:04 +03:00
|
|
|
async leavePortalSettings() {
|
2021-01-28 18:25:21 +03:00
|
|
|
this.settings.rollbackAttributes();
|
|
|
|
this.set('showPortalSettings', false);
|
|
|
|
this.set('showLeaveSettingsModal', false);
|
|
|
|
},
|
|
|
|
|
|
|
|
closeBrandingModal() {
|
|
|
|
this.set('showBrandingModal', false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-15 13:17:31 +03:00
|
|
|
});
|