1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-24 15:49:44 +02:00

Introduce new nofications framework

Integrated https://github.com/documize/iziToast and added 4 log levels.
This commit is contained in:
sauls8t 2018-12-05 13:44:10 +00:00
parent f44cda66e6
commit f05a6fc999
40 changed files with 4187 additions and 1031 deletions

View file

@ -141,15 +141,13 @@ export default Component.extend(ModalMixin, Notifier, {
},
onLDAPPreview() {
this.showWait();
let config = this.get('ldapConfig');
config.serverPort = parseInt(this.get('ldapConfig.serverPort'));
this.get('globalSvc').previewLDAP(config).then((preview) => {
this.set('ldapPreview', preview);
this.modalOpen("#ldap-preview-modal", {"show": true});
this.showDone();
this.notifySuccess('Saved');
});
},
@ -231,8 +229,6 @@ export default Component.extend(ModalMixin, Notifier, {
break;
}
this.showWait();
let data = { authProvider: provider, authConfig: JSON.stringify(config) };
this.get('onSave')(data).then(() => {
@ -274,7 +270,7 @@ export default Component.extend(ModalMixin, Notifier, {
});
}
this.showDone();
this.notifySuccess('Saved');
});
}
}

View file

@ -60,7 +60,6 @@ export default Component.extend(Notifier, Modal, {
},
doBackup() {
this.showWait();
this.set('backupFilename', '');
this.set('backupSuccess', false);
this.set('backupFailed', false);
@ -69,13 +68,13 @@ export default Component.extend(Notifier, Modal, {
let spec = this.get('backupSpec');
this.get('onBackup')(spec).then((filename) => {
this.showDone();
this.notifySuccess('Completed');
this.set('backupLabel', 'Start Backup');
this.set('backupSuccess', true);
this.set('backupFilename', filename);
this.set('backupRunning', false);
}, ()=> {
this.showDone();
this.notifyError('Failed');
this.set('backupLabel', 'Run Backup');
this.set('backupFailed', true);
this.set('backupRunning', false);
@ -134,7 +133,6 @@ export default Component.extend(Notifier, Modal, {
}
// start restore process
this.showWait();
this.set('restoreButtonLabel', 'Please wait, restore running...');
this.set('restoreSuccess', false);
this.set('restoreFailed', false);
@ -147,12 +145,12 @@ export default Component.extend(Notifier, Modal, {
}
this.get('onRestore')(spec, filedata).then(() => {
this.showDone();
this.notifySuccess('Completed');
this.set('backupLabel', 'Restore');
this.set('restoreSuccess', true);
this.get('router').transitionTo('auth.logout');
}, ()=> {
this.showDone();
this.notifyError('Failed');
this.set('restorbackupLabel', 'Restore');
this.set('restoreFailed', true);
});

View file

@ -64,10 +64,8 @@ export default Component.extend(Notifier, {
this.set('model.general.maxTags', this.get('maxTags'));
this.model.general.set('allowAnonymousAccess', $("#allowAnonymousAccess").prop('checked'));
this.showWait();
this.get('save')().then(() => {
this.showDone();
this.notifySuccess('Saved');
set(this, 'titleError', false);
set(this, 'messageError', false);
set(this, 'conversionEndpointError', false);

View file

@ -56,13 +56,12 @@ export default Component.extend(Notifier, {
this.set('jiraCreds.url', url.substring(0, url.length-1));
}
this.showWait();
this.get('orgSvc').saveOrgSetting(orgId, 'jira', this.get('jiraCreds')).then(() => {
if (this.get('session.isGlobalAdmin')) {
this.get('orgSvc').saveGlobalSetting('SECTION-TRELLO', this.get('trelloCreds'));
}
this.showDone();
this.notifySuccess('Saved');
});
}
}

View file

@ -40,10 +40,8 @@ export default Component.extend(Notifier, Modals, {
actions: {
saveLicense() {
this.showWait();
this.get('global').setLicense(this.get('license')).then(() => {
this.showDone();
this.notifySuccess('Saved');
window.location.reload();
});
},
@ -57,7 +55,7 @@ export default Component.extend(Notifier, Modals, {
let comment = this.get('comment');
this.get('global').deactivate(comment).then(() => {
this.showDone();
this.notifySuccess('Saved');
this.modalOpen("#deactivation-confirmation-modal", {"show": true});
});
}

View file

@ -48,11 +48,10 @@ export default Component.extend(Notifier, {
},
);
this.showWait();
this.set('buttonText', 'Please wait...');
this.get('saveSMTP')().then((result) => {
this.showDone();
this.notifySuccess('Saved');
this.set('buttonText', 'Save & Test');
this.set('testSMTP', result);
});

View file

@ -80,8 +80,6 @@ export default Component.extend(Notifier, Modals, {
},
onExport() {
this.showWait();
let spec = {
spaceId: '',
data: _.pluck(this.get('folders'), 'id'),
@ -90,15 +88,13 @@ export default Component.extend(Notifier, Modals, {
this.get('documentSvc').export(spec).then((htmlExport) => {
this.get('browserSvc').downloadFile(htmlExport, 'documize.html');
this.showDone();
this.notifySuccess('Exported');
});
},
onOwner(spaceId) {
this.showWait();
this.get('spaceSvc').grantOwnerPermission(spaceId).then(() => { /* jshint ignore:line */
this.showDone();
this.notifySuccess('Saved');
});
}
}