mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
reworked smart section UX
This commit is contained in:
parent
57b3801f87
commit
0eef10e586
6 changed files with 67 additions and 92 deletions
|
@ -10,15 +10,13 @@
|
|||
// https://documize.com
|
||||
|
||||
import { set } from '@ember/object';
|
||||
|
||||
import { inject as service } from '@ember/service';
|
||||
import Component from '@ember/component';
|
||||
import NotifierMixin from '../../../mixins/notifier';
|
||||
import TooltipMixin from '../../../mixins/tooltip';
|
||||
import SectionMixin from '../../../mixins/section';
|
||||
import netUtil from '../../../utils/net';
|
||||
|
||||
export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
||||
export default Component.extend(SectionMixin, NotifierMixin, {
|
||||
sectionService: service('section'),
|
||||
isDirty: false,
|
||||
waiting: false,
|
||||
|
@ -48,10 +46,6 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
|||
this.send('auth');
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
displayError(reason) {
|
||||
if (netUtil.isAjaxAccessError(reason)) {
|
||||
this.showNotification(`Unable to authenticate`);
|
||||
|
@ -93,17 +87,17 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
|||
if (is.not.undefined(group)) {
|
||||
set(config, 'group', group);
|
||||
}
|
||||
}, function (reason) {
|
||||
}, function (reason) {
|
||||
self.set('authenticated', false);
|
||||
self.set('waiting', false);
|
||||
self.set('config.APIToken', ''); // clear the api token
|
||||
self.set('config.APIToken', ''); // clear the api token
|
||||
self.displayError(reason);
|
||||
console.log("get options call failed"); // eslint-disable-line no-console
|
||||
});
|
||||
}, function (reason) {
|
||||
}, function (reason) {
|
||||
self.set('authenticated', false);
|
||||
self.set('waiting', false);
|
||||
self.set('config.APIToken', ''); // clear the api token
|
||||
self.set('config.APIToken', ''); // clear the api token
|
||||
self.displayError(reason);
|
||||
console.log("auth token invalid"); // eslint-disable-line no-console
|
||||
});
|
||||
|
@ -186,4 +180,4 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
|||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue