mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +02:00
Fix Ember lint issues and print view
This commit is contained in:
parent
40237344e2
commit
715c31a1da
15 changed files with 53 additions and 37 deletions
|
@ -9,6 +9,7 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import $ from 'jquery';
|
||||
import { computed } from '@ember/object';
|
||||
import { empty } from '@ember/object/computed';
|
||||
import { set } from '@ember/object';
|
||||
|
@ -169,27 +170,27 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
|
||||
case constants.AuthProvider.Keycloak:
|
||||
if (this.get('KeycloakUrlError')) {
|
||||
this.$("#keycloak-url").focus();
|
||||
$("#keycloak-url").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakRealmError')) {
|
||||
this.$("#keycloak-realm").focus();
|
||||
$("#keycloak-realm").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakClientIdError')) {
|
||||
this.$("#keycloak-clientId").focus();
|
||||
$("#keycloak-clientId").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakPublicKeyError')) {
|
||||
this.$("#keycloak-publicKey").focus();
|
||||
$("#keycloak-publicKey").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakAdminUserError')) {
|
||||
this.$("#keycloak-admin-user").focus();
|
||||
$("#keycloak-admin-user").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('KeycloakAdminPasswordError')) {
|
||||
this.$("#keycloak-admin-password").focus();
|
||||
$("#keycloak-admin-password").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -213,11 +214,11 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
|
||||
case constants.AuthProvider.LDAP:
|
||||
if (this.get('ldapErrorServerHost')) {
|
||||
this.$("#ldap-host").focus();
|
||||
$("#ldap-host").focus();
|
||||
return;
|
||||
}
|
||||
if (this.get('ldapErrorServerPort')) {
|
||||
this.$("#ldap-port").focus();
|
||||
$("#ldap-port").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -226,7 +227,7 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
config.serverPort = parseInt(this.get('ldapConfig.serverPort'));
|
||||
|
||||
if (!_.isEmpty(config.groupFilter) && _.isEmpty(config.attributeGroupMember)) {
|
||||
this.$('#ldap-attributeGroupMember').focus();
|
||||
$('#ldap-attributeGroupMember').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ export default Component.extend(Notifier, Modal, {
|
|||
didInsertElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.$('#restore-file').on('change', function(){
|
||||
$('#restore-file').on('change', function(){
|
||||
var fileName = document.getElementById("restore-file").files[0].name;
|
||||
$(this).next('.custom-file-label').html(fileName);
|
||||
});
|
||||
|
|
|
@ -84,7 +84,7 @@ export default Component.extend(Notifier, {
|
|||
|
||||
actions: {
|
||||
change() {
|
||||
const selectEl = this.$('#maxTags')[0];
|
||||
const selectEl = $('#maxTags')[0];
|
||||
const selection = selectEl.selectedOptions[0].value;
|
||||
|
||||
this.set('maxTags', parseInt(selection));
|
||||
|
|
|
@ -63,9 +63,9 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
this.set('showPermExplain', !this.get('showPermExplain'));
|
||||
|
||||
if (this.showPermExplain) {
|
||||
this.$(".perms").show();
|
||||
$(".perms").show();
|
||||
} else {
|
||||
this.$(".perms").hide();
|
||||
$(".perms").hide();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import $ from 'jquery';
|
||||
import { debounce } from '@ember/runloop';
|
||||
import { computed, set } from '@ember/object';
|
||||
import { inject as service } from '@ember/service';
|
||||
|
@ -83,7 +84,7 @@ export default Component.extend(ModalMixin, {
|
|||
didRender() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.$('#content-linker-networklocation').removeClass('is-invalid');
|
||||
$('#content-linker-networklocation').removeClass('is-invalid');
|
||||
},
|
||||
|
||||
willDestroyElement() {
|
||||
|
@ -149,7 +150,7 @@ export default Component.extend(ModalMixin, {
|
|||
}
|
||||
|
||||
if (_.isNull(selection)) {
|
||||
if (this.get('tab4Selected')) this.$('#content-linker-networklocation').addClass('is-invalid').focus();
|
||||
if (this.get('tab4Selected')) $('#content-linker-networklocation').addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,8 @@ import Modals from '../../mixins/modal';
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(Modals, {
|
||||
classNames: ['document-meta-wrapper', 'non-printable'],
|
||||
appMeta: service(),
|
||||
documentService: service('document'),
|
||||
sessionService: service('session'),
|
||||
categoryService: service('category'),
|
||||
|
@ -62,6 +64,12 @@ export default Component.extend(Modals, {
|
|||
if (!this.get('permissions.documentEdit')) return;
|
||||
|
||||
this.get('router').transitionTo('document.settings', {queryParams: {tab: 'category'}});
|
||||
},
|
||||
|
||||
onSelectVersion(version) {
|
||||
let space = this.get('space');
|
||||
|
||||
this.get('router').transitionTo('document', space.get('id'), space.get('slug'), version.documentId, this.get('document.slug'));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -167,9 +167,9 @@ export default Component.extend(Notifier, {
|
|||
if (tag.length> 0) {
|
||||
if (!_.includes(tagzToSave, tag) && !_.startsWith(tag, '-')) {
|
||||
tagzToSave.push(tag);
|
||||
this.$('#add-tag-field-' + t.number).removeClass('is-invalid');
|
||||
$('#add-tag-field-' + t.number).removeClass('is-invalid');
|
||||
} else {
|
||||
this.$('#add-tag-field-' + t.number).addClass('is-invalid');
|
||||
$('#add-tag-field-' + t.number).addClass('is-invalid');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -168,9 +168,9 @@ export default Component.extend(Notifier, {
|
|||
if (tag.length> 0) {
|
||||
if (!_.includes(tagzToSave, tag) && !_.startsWith(tag, '-')) {
|
||||
tagzToSave.push(tag);
|
||||
this.$('#add-tag-field-' + t.number).removeClass('is-invalid');
|
||||
$('#add-tag-field-' + t.number).removeClass('is-invalid');
|
||||
} else {
|
||||
this.$('#add-tag-field-' + t.number).addClass('is-invalid');
|
||||
$('#add-tag-field-' + t.number).addClass('is-invalid');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -17,7 +17,7 @@ import Notifier from '../../mixins/notifier';
|
|||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(Modals, Notifier, {
|
||||
classNames: ["document-meta"],
|
||||
classNames: ["document-meta", ' non-printable'],
|
||||
documentService: service('document'),
|
||||
browserSvc: service('browser'),
|
||||
appMeta: service(),
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
//
|
||||
// https://documize.com
|
||||
|
||||
import $ from 'jquery';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { A } from '@ember/array';
|
||||
import { debounce } from '@ember/runloop';
|
||||
|
@ -152,9 +153,9 @@ export default Component.extend(Notifier, Modals, {
|
|||
this.set('showSpacePermExplain', !this.get('showSpacePermExplain'));
|
||||
|
||||
if (this.showSpacePermExplain) {
|
||||
this.$(".space-perms").show();
|
||||
$(".space-perms").show();
|
||||
} else {
|
||||
this.$(".space-perms").hide();
|
||||
$(".space-perms").hide();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -162,9 +163,9 @@ export default Component.extend(Notifier, Modals, {
|
|||
this.set('showDocumentPermExplain', !this.get('showDocumentPermExplain'));
|
||||
|
||||
if (this.showDocumentPermExplain) {
|
||||
this.$(".document-perms").show();
|
||||
$(".document-perms").show();
|
||||
} else {
|
||||
this.$(".document-perms").hide();
|
||||
$(".document-perms").hide();
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -257,7 +258,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
}
|
||||
|
||||
if (email.length === 0) {
|
||||
this.$('#space-invite-email').addClass('is-invalid').focus();
|
||||
$('#space-invite-email').addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -283,7 +284,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
|
||||
this.get('spaceSvc').share(this.get('folder.id'), result).then(() => {
|
||||
this.notifySuccess('Invites sent');
|
||||
this.$('#space-invite-email').removeClass('is-invalid');
|
||||
$('#space-invite-email').removeClass('is-invalid');
|
||||
this.modalClose("#space-invite-user-modal");
|
||||
this.load();
|
||||
});
|
||||
|
|
|
@ -13,5 +13,5 @@ import Component from '@ember/component';
|
|||
|
||||
export default Component.extend({
|
||||
tagName: 'div',
|
||||
classNames: ['master-sidebar'],
|
||||
classNames: ['master-sidebar', 'non-printable'],
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue