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,12 @@
|
|||
// https://documize.com
|
||||
|
||||
import { set } from '@ember/object';
|
||||
|
||||
import { schedule } from '@ember/runloop';
|
||||
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';
|
||||
|
||||
export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
||||
export default Component.extend(SectionMixin, {
|
||||
sectionService: service('section'),
|
||||
isDirty: false,
|
||||
waiting: false,
|
||||
|
@ -69,10 +66,6 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
|||
});
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
this.destroyTooltips();
|
||||
},
|
||||
|
||||
getWorkspaces() {
|
||||
let page = this.get('page');
|
||||
let self = this;
|
||||
|
@ -155,15 +148,15 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
|||
auth() {
|
||||
// missing data?
|
||||
if (is.empty(this.get('config.url'))) {
|
||||
$("#gemini-url").addClass("error").focus();
|
||||
$("#gemini-url").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(this.get('config.username'))) {
|
||||
$("#gemini-username").addClass("error").focus();
|
||||
$("#gemini-username").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(this.get('config.APIKey'))) {
|
||||
$("#gemini-apikey").addClass("error").focus();
|
||||
$("#gemini-apikey").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -195,17 +188,6 @@ export default Component.extend(SectionMixin, NotifierMixin, TooltipMixin, {
|
|||
self.set('user', null);
|
||||
self.set('config.userId', 0);
|
||||
self.set('waiting', false);
|
||||
|
||||
switch (reason.status) {
|
||||
case 400:
|
||||
self.showNotification(`Unable to connect to Gemini URL`);
|
||||
break;
|
||||
case 403:
|
||||
self.showNotification(`Unable to authenticate`);
|
||||
break;
|
||||
default:
|
||||
self.showNotification(`Something went wrong, try again!`);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue