mirror of
https://github.com/documize/community.git
synced 2025-07-25 08:09:43 +02:00
Allow admins to set subdomain for their instance
Fixes #209 Admins can see and set subdomain for their instance. Self-host customers only!
This commit is contained in:
parent
af9bc25660
commit
f828583b49
6 changed files with 25 additions and 3 deletions
|
@ -19,7 +19,9 @@ import Component from '@ember/component';
|
|||
|
||||
export default Component.extend(Notifier, {
|
||||
appMeta: service(),
|
||||
router: service(),
|
||||
maxTags: 3,
|
||||
domain: '',
|
||||
titleEmpty: empty('model.general.title'),
|
||||
messageEmpty: empty('model.general.message'),
|
||||
conversionEndpointEmpty: empty('model.general.conversionEndpoint'),
|
||||
|
@ -30,6 +32,7 @@ export default Component.extend(Notifier, {
|
|||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
this.set('maxTags', this.get('model.general.maxTags'));
|
||||
this.set('domain', this.get('model.general.domain'));
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
@ -110,11 +113,20 @@ export default Component.extend(Notifier, {
|
|||
|
||||
this.set('model.general.maxTags', this.get('maxTags'));
|
||||
|
||||
let domainChanged = this.get('model.general.domain') !== this.get('domain').toLowerCase();
|
||||
this.set('model.general.domain', this.get('domain').toLowerCase());
|
||||
|
||||
this.get('onUpdate')().then(() => {
|
||||
this.notifySuccess('Saved');
|
||||
set(this, 'titleError', false);
|
||||
set(this, 'messageError', false);
|
||||
set(this, 'conversionEndpointError', false);
|
||||
|
||||
|
||||
if (domainChanged) {
|
||||
let router = this.get('router');
|
||||
router.transitionTo('auth.login');
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue