mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +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'],
|
||||
});
|
||||
|
|
|
@ -9,14 +9,12 @@
|
|||
.master-sidebar {
|
||||
display: block;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
.master-content {
|
||||
display: block;
|
||||
height: auto;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +50,7 @@
|
|||
grid-template-columns: 240px auto;
|
||||
|
||||
.master-sidebar {
|
||||
width: 240px;
|
||||
width: 220px;
|
||||
}
|
||||
|
||||
.master-content {
|
||||
|
@ -70,7 +68,7 @@
|
|||
grid-template-columns: 300px auto;
|
||||
|
||||
.master-sidebar {
|
||||
width: 300px;
|
||||
width: 280px;
|
||||
margin: 40px 10px 40px 20px;
|
||||
height: calc(100vh - 90px - 80px);
|
||||
}
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
.document-meta-wrapper {
|
||||
padding: 20px 20px 0 20px;
|
||||
@include border-radius(7px);
|
||||
background-color: map-get($gray-shades, 100);
|
||||
}
|
||||
|
||||
.document-meta {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
@ -147,12 +153,12 @@
|
|||
@include border-radius(3px);
|
||||
@extend .no-select;
|
||||
display: inline-block;
|
||||
margin: 5px 5px 5px 0;
|
||||
margin: 5px 0 5px 0;
|
||||
padding: 0.3rem 0.7rem;
|
||||
font-size: 1.1rem;
|
||||
font-weight: 500;
|
||||
background-color: map-get($yellow-shades, 100);
|
||||
color: map-get($gray-shades, 700);
|
||||
background-color: map-get($gray-shades, 800);
|
||||
color: map-get($gray-shades, 100);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
|
@ -165,6 +171,7 @@
|
|||
|
||||
> .document-heading {
|
||||
.name {
|
||||
margin: 1.5rem 0 0.5rem 0;
|
||||
color: map-get($gray-shades, 900);
|
||||
font-size: 2.2rem;
|
||||
font-weight: 700;
|
||||
|
@ -177,7 +184,7 @@
|
|||
}
|
||||
|
||||
> .dates {
|
||||
margin-bottom: 2rem;
|
||||
margin-bottom: 3rem;
|
||||
font-size: 1rem;
|
||||
font-weight: 300;
|
||||
font-style: italic;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="document-meta">
|
||||
<div class="document-meta non-printable">
|
||||
<div class="title">STATUS</div>
|
||||
<div class="{{if (eq document.lifecycle constants.Lifecycle.Draft) "label-draft"}}
|
||||
{{if (eq document.lifecycle constants.Lifecycle.Live) "label-live"}}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"@ember/optional-features": "^0.7.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"ember-ajax": "^3.1.0",
|
||||
"ember-attacher": "^0.13.10",
|
||||
"ember-attacher": "^0.14.0",
|
||||
"ember-cli": "~3.10.0",
|
||||
"ember-cli-app-version": "^3.2.0",
|
||||
"ember-cli-babel": "^7.7.3",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue