mirror of
https://github.com/documize/community.git
synced 2025-07-18 20:59:43 +02:00
Replaced underscore.js & is.js with lodash.js
This commit is contained in:
parent
df8e843bf5
commit
566807bc14
93 changed files with 17379 additions and 2056 deletions
|
@ -1,9 +0,0 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
indent_style = space
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
indent_size = 4
|
||||
insert_final_newline = true
|
|
@ -1,62 +0,0 @@
|
|||
{
|
||||
"css": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"newline_between_rules": true,
|
||||
"selector_separator_newlines": true
|
||||
},
|
||||
"scss": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"newline_between_rules": true,
|
||||
"selector_separator_newlines": true
|
||||
},
|
||||
"html": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"wrap_line_length": 0,
|
||||
"indent_handlebars": true,
|
||||
"indent_inner_html": false,
|
||||
"indent_scripts": "keep"
|
||||
},
|
||||
"hbs": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"max_preserve_newlines": 2,
|
||||
"preserve_newlines": true,
|
||||
"wrap_line_length": 0
|
||||
},
|
||||
"js": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true,
|
||||
"preserve_newlines": true,
|
||||
"wrap_line_length": 0,
|
||||
"break_chained_methods": false,
|
||||
"max_preserve_newlines": 2,
|
||||
"jslint_happy": true,
|
||||
"brace_style": "collapse-preserve-inline",
|
||||
"keep_function_indentation": false,
|
||||
"space_after_anon_function": false,
|
||||
"space_before_anon_function": false,
|
||||
"space_before_conditional": true,
|
||||
"space_in_empty_paren": false,
|
||||
"space_before_func_paren": false,
|
||||
"space_in_paren": false
|
||||
},
|
||||
"sql": {
|
||||
"indent_size": 4,
|
||||
"indent_level": 0,
|
||||
"indent_with_tabs": true
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
gui/public/tinymce/**
|
||||
gui/public/tinymce/
|
||||
gui/public/tinymce
|
|
@ -1,3 +0,0 @@
|
|||
{
|
||||
"esversion":6
|
||||
}
|
|
@ -19,9 +19,9 @@ All you need to provide is PostgreSQL or any MySQL variant.
|
|||
|
||||
## Latest Release
|
||||
|
||||
[Community Edition: v2.0.6](https://github.com/documize/community/releases)
|
||||
[Community Edition: v2.1.0](https://github.com/documize/community/releases)
|
||||
|
||||
[Enterprise Edition: v2.0.6](https://www.documize.com/downloads)
|
||||
[Enterprise Edition: v2.1.0](https://www.documize.com/downloads)
|
||||
|
||||
## OS support
|
||||
|
||||
|
@ -50,8 +50,8 @@ Heck, Documize will probably run just fine on a Raspberry Pi 3.
|
|||
|
||||
## Technology Stack
|
||||
|
||||
- Go (v1.11.5)
|
||||
- Ember JS (v3.7.2)
|
||||
- Go (v1.12.0)
|
||||
- Ember JS (v3.8.0)
|
||||
|
||||
## Authentication Options
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
# EditorConfig helps developers define and maintain consistent
|
||||
# coding styles between different editors and IDEs
|
||||
# editorconfig.org
|
||||
|
||||
root = true
|
||||
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
indent_style = tab
|
||||
indent_size = 4
|
||||
|
||||
[*.hbs]
|
||||
insert_final_newline = false
|
||||
|
||||
[*.{diff,md}]
|
||||
trim_trailing_whitespace = false
|
|
@ -1,11 +1,4 @@
|
|||
public/tinymce/**
|
||||
public/tinymce/
|
||||
public/tinymce
|
||||
public/codemirror/**
|
||||
public/codemirror/
|
||||
public/codemirror
|
||||
|
||||
# unconventional js
|
||||
/public/
|
||||
/blueprints/*/files/
|
||||
/vendor/
|
||||
|
||||
|
|
|
@ -46,7 +46,6 @@ module.exports = {
|
|||
}
|
||||
],
|
||||
globals: {
|
||||
"is": true,
|
||||
"mermaid": true,
|
||||
"_": true,
|
||||
"tinymce": true,
|
||||
|
|
|
@ -43,19 +43,19 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
|
||||
ldapErrorServerHost: empty('ldapConfig.serverHost'),
|
||||
ldapErrorServerPort: computed('ldapConfig.serverPort', function() {
|
||||
return is.empty(this.get('ldapConfig.serverPort')) || is.not.number(parseInt(this.get('ldapConfig.serverPort')));
|
||||
return _.isEmpty(this.get('ldapConfig.serverPort')) || !_.isNumber(parseInt(this.get('ldapConfig.serverPort')));
|
||||
}),
|
||||
ldapErrorBindDN: empty('ldapConfig.bindDN'),
|
||||
ldapErrorBindPassword: empty('ldapConfig.bindPassword'),
|
||||
ldapErrorNoFilter: computed('ldapConfig.{userFilter,groupFilter}', function() {
|
||||
return is.empty(this.get('ldapConfig.userFilter')) && is.empty(this.get('ldapConfig.groupFilter'));
|
||||
return _.isEmpty(this.get('ldapConfig.userFilter')) && _.isEmpty(this.get('ldapConfig.groupFilter'));
|
||||
}),
|
||||
ldapErrorAttributeUserRDN: empty('ldapConfig.attributeUserRDN'),
|
||||
ldapErrorAttributeUserFirstname: empty('ldapConfig.attributeUserFirstname'),
|
||||
ldapErrorAttributeUserLastname: empty('ldapConfig.attributeUserLastname'),
|
||||
ldapErrorAttributeUserEmail: empty('ldapConfig.attributeUserEmail'),
|
||||
ldapErrorAttributeGroupMember: computed('ldapConfig.{groupFilter,attributeGroupMember}', function() {
|
||||
return is.not.empty(this.get('ldapConfig.groupFilter')) && is.empty(this.get('ldapConfig.attributeGroupMember'));
|
||||
return !_.isEmpty(this.get('ldapConfig.groupFilter')) && _.isEmpty(this.get('ldapConfig.attributeGroupMember'));
|
||||
}),
|
||||
ldapPreview: null,
|
||||
ldapConfig: null,
|
||||
|
@ -92,7 +92,7 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
case constants.AuthProvider.Keycloak: // eslint-disable-line no-case-declarations
|
||||
let config = this.get('authConfig');
|
||||
|
||||
if (is.undefined(config) || is.null(config) || is.empty(config) ) {
|
||||
if (_.isUndefined(config) || _.isNull(config) || _.isEmpty(config) ) {
|
||||
config = {};
|
||||
} else {
|
||||
config = JSON.parse(config);
|
||||
|
@ -107,7 +107,7 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
case constants.AuthProvider.LDAP: // eslint-disable-line no-case-declarations
|
||||
let ldapConfig = this.get('authConfig');
|
||||
|
||||
if (is.undefined(ldapConfig) || is.null(ldapConfig) || is.empty(ldapConfig) ) {
|
||||
if (_.isUndefined(ldapConfig) || _.isNull(ldapConfig) || _.isEmpty(ldapConfig) ) {
|
||||
ldapConfig = {};
|
||||
} else {
|
||||
ldapConfig = JSON.parse(ldapConfig);
|
||||
|
@ -194,13 +194,13 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
config.realm = config.realm.trim();
|
||||
config.clientId = config.clientId.trim();
|
||||
config.publicKey = config.publicKey.trim();
|
||||
config.group = is.undefined(config.group) ? '' : config.group.trim();
|
||||
config.group = _.isUndefined(config.group) ? '' : config.group.trim();
|
||||
config.adminUser = config.adminUser.trim();
|
||||
config.adminPassword = config.adminPassword.trim();
|
||||
config.defaultPermissionAddSpace = config.hasOwnProperty('defaultPermissionAddSpace') ? config.defaultPermissionAddSpace : true;
|
||||
config.disableLogout = config.hasOwnProperty('disableLogout') ? config.disableLogout : true;
|
||||
|
||||
if (is.endWith(config.url, '/')) {
|
||||
if (_.endsWith(config.url, '/')) {
|
||||
config.url = config.url.substring(0, config.url.length-1);
|
||||
}
|
||||
|
||||
|
@ -221,7 +221,7 @@ export default Component.extend(ModalMixin, Notifier, {
|
|||
config.serverHost = config.serverHost.trim();
|
||||
config.serverPort = parseInt(this.get('ldapConfig.serverPort'));
|
||||
|
||||
if (is.not.empty(config.groupFilter) && is.empty(config.attributeGroupMember)) {
|
||||
if (!_.isEmpty(config.groupFilter) && _.isEmpty(config.attributeGroupMember)) {
|
||||
this.$('#ldap-attributeGroupMember').focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -118,17 +118,17 @@ export default Component.extend(Notifier, Modal, {
|
|||
|
||||
// do we have upload file?
|
||||
// let files = document.getElementById("restore-file").files;
|
||||
// if (is.undefined(files) || is.null(files)) {
|
||||
// if (_.isUndefined(files) || _.isNull(files)) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// let file = document.getElementById("restore-file").files[0];
|
||||
// if (is.undefined(file) || is.null(file)) {
|
||||
// if (_.isUndefined(file) || _.isNull(file)) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
let filedata = this.get('restoreFile');
|
||||
if (is.null(filedata)) {
|
||||
if (_.isNull(filedata)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ export default Component.extend(Notifier, {
|
|||
}
|
||||
|
||||
let e = this.get('model.general.conversionEndpoint');
|
||||
if (is.endWith(e, '/')) {
|
||||
if (_.endsWith(e, '/')) {
|
||||
this.set('model.general.conversionEndpoint', e.substring(0, e.length-1));
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ export default Component.extend(Notifier, {
|
|||
// Jira specific.
|
||||
let jira = this.get('jira');
|
||||
|
||||
if (is.empty(jira) || is.not.object(jira)) {
|
||||
if (_.isEmpty(jira) || !_.isObject(jira)) {
|
||||
jira = {
|
||||
url: '',
|
||||
username: '',
|
||||
|
@ -37,7 +37,7 @@ export default Component.extend(Notifier, {
|
|||
// Trello specific.
|
||||
let trello = this.get('trello');
|
||||
|
||||
if (is.not.object(trello)) {
|
||||
if (!_.isObject(trello)) {
|
||||
trello = {
|
||||
appKey: ''
|
||||
};
|
||||
|
@ -52,7 +52,7 @@ export default Component.extend(Notifier, {
|
|||
let orgId = this.get("appMeta.orgId");
|
||||
let url = this.get('jiraCreds.url');
|
||||
|
||||
if (is.endWith(url, '/')) {
|
||||
if (_.endsWith(url, '/')) {
|
||||
this.set('jiraCreds.url', url.substring(0, url.length-1));
|
||||
}
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
onExport() {
|
||||
let spec = {
|
||||
spaceId: '',
|
||||
data: _.pluck(this.get('folders'), 'id'),
|
||||
data: _.map(this.get('folders'), 'id'),
|
||||
filterType: 'space',
|
||||
};
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ export default Component.extend(Modals, {
|
|||
label.color = '#263238';
|
||||
}
|
||||
|
||||
if (is.empty(label.name)) {
|
||||
if (_.isEmpty(label.name)) {
|
||||
$('#add-label-name').addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ export default Component.extend(Modals, {
|
|||
let color = this.get('labelColor').trim();
|
||||
let label = this.get('editLabel');
|
||||
|
||||
if (is.empty(name)) {
|
||||
if (_.isEmpty(name)) {
|
||||
$('#edit-label-name').addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import $ from 'jquery';
|
|||
import AuthProvider from '../../mixins/auth';
|
||||
import ModalMixin from '../../mixins/modal';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import stringUtil from '../../utils/string';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
||||
|
@ -30,19 +31,19 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
},
|
||||
|
||||
onAddUser() {
|
||||
if (is.empty(this.get('newUser.firstname'))) {
|
||||
if (_.isEmpty(this.get('newUser.firstname'))) {
|
||||
$("#newUserFirstname").addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
$("#newUserFirstname").removeClass('is-invalid');
|
||||
|
||||
if (is.empty(this.get('newUser.lastname'))) {
|
||||
if (_.isEmpty(this.get('newUser.lastname'))) {
|
||||
$("#newUserLastname").addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
$("#newUserLastname").removeClass('is-invalid');
|
||||
|
||||
if (is.empty(this.get('newUser.email')) || is.not.email(this.get('newUser.email'))) {
|
||||
if (_.isEmpty(this.get('newUser.email')) || !stringUtil.isEmail(this.get('newUser.email'))) {
|
||||
$("#newUserEmail").addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
@ -59,7 +60,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
},
|
||||
|
||||
onAddUsers() {
|
||||
if (is.empty(this.get('bulkUsers'))) {
|
||||
if (_.isEmpty(this.get('bulkUsers'))) {
|
||||
$("#bulkUsers").addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
let filteredUsers = A([]);
|
||||
users.forEach(user => {
|
||||
let m = members.findBy('userId', user.get('id'));
|
||||
if (is.undefined(m)) filteredUsers.pushObject(user);
|
||||
if (_.isUndefined(m)) filteredUsers.pushObject(user);
|
||||
});
|
||||
|
||||
this.set('users', filteredUsers);
|
||||
|
@ -75,7 +75,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
|
||||
let newGroup = this.get('newGroup');
|
||||
|
||||
if (is.empty(newGroup.name)) {
|
||||
if (_.isEmpty(newGroup.name)) {
|
||||
$('#new-group-name')
|
||||
.addClass('is-invalid')
|
||||
.focus();
|
||||
|
@ -108,7 +108,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
let group = this.get('groups').findBy('id', deleteGroup.id);
|
||||
|
||||
if (
|
||||
is.empty(deleteGroup.name) ||
|
||||
_.isEmpty(deleteGroup.name) ||
|
||||
group.get('name') !== deleteGroup.name
|
||||
) {
|
||||
$('#delete-group-name')
|
||||
|
@ -141,7 +141,7 @@ export default Component.extend(AuthProvider, ModalMixin, {
|
|||
|
||||
let group = this.get('editGroup');
|
||||
|
||||
if (is.empty(group.get('name'))) {
|
||||
if (_.isEmpty(group.get('name'))) {
|
||||
$('#edit-group-name')
|
||||
.addClass('is-invalid')
|
||||
.focus();
|
||||
|
|
|
@ -16,6 +16,7 @@ import { schedule, debounce } from '@ember/runloop';
|
|||
import AuthProvider from '../../mixins/auth';
|
||||
import ModalMixin from '../../mixins/modal';
|
||||
import Notifier from '../../mixins/notifier';
|
||||
import stringUtil from '../../utils/string';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
||||
|
@ -142,15 +143,15 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
let user = this.get('editUser');
|
||||
let password = this.get('password');
|
||||
|
||||
if (is.empty(user.firstname)) {
|
||||
if (_.isEmpty(user.firstname)) {
|
||||
$("#edit-firstname").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(user.lastname)) {
|
||||
if (_.isEmpty(user.lastname)) {
|
||||
$("#edit-lastname").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(user.email) || is.not.email(user.email)) {
|
||||
if (_.isEmpty(user.email) || !stringUtil.isEmail(user.email)) {
|
||||
$("#edit-email").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
|
@ -161,7 +162,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
let cb = this.get('onSave');
|
||||
cb(user);
|
||||
|
||||
if (is.not.empty(password.password) && is.not.empty(password.confirmation) &&
|
||||
if (!_.isEmpty(password.password) && !_.isEmpty(password.confirmation) &&
|
||||
password.password === password.confirmation) {
|
||||
|
||||
let pw = this.get('onPassword');
|
||||
|
@ -218,7 +219,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
let groups = this.get('groups');
|
||||
groups.forEach((g) => {
|
||||
let hasGroup = userGroups.findBy('groupId', g.get('id'));
|
||||
g.set('isMember', is.not.undefined(hasGroup));
|
||||
g.set('isMember', !_.isUndefined(hasGroup));
|
||||
})
|
||||
this.set('groups', groups);
|
||||
|
||||
|
@ -230,7 +231,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
let group = this.get('groups').findBy('id', groupId);
|
||||
group.set('isMember', false);
|
||||
|
||||
if (is.undefined(groupId) || is.undefined(userId)) {
|
||||
if (_.isUndefined(groupId) || _.isUndefined(userId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -244,7 +245,7 @@ export default Component.extend(AuthProvider, ModalMixin, Notifier, {
|
|||
let group = this.get('groups').findBy('id', groupId);
|
||||
group.set('isMember', true);
|
||||
|
||||
if (is.undefined(groupId) || is.undefined(userId)) {
|
||||
if (_.isUndefined(groupId) || _.isUndefined(userId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,7 +67,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
}
|
||||
|
||||
// But, if we can work work correct placement, we put new content as best we can.
|
||||
if (is.object(beforePage)) {
|
||||
if (_.isObject(beforePage)) {
|
||||
level = beforePage.get('level');
|
||||
|
||||
// get any page before the beforePage so we can insert this new section between them
|
||||
|
@ -76,7 +76,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
if (index !== -1) {
|
||||
let beforeBeforePage = this.get('pages')[index-1];
|
||||
|
||||
if (is.not.undefined(beforeBeforePage)) {
|
||||
if (!_.isUndefined(beforeBeforePage)) {
|
||||
sequence = (beforePage.get('sequence') + beforeBeforePage.get('page.sequence')) / 2;
|
||||
} else {
|
||||
sequence = beforePage.get('sequence') / 2;
|
||||
|
@ -97,7 +97,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
actions: {
|
||||
onInsertSection(section) {
|
||||
let sectionName = this.get('newSectionName');
|
||||
if (is.empty(sectionName)) {
|
||||
if (_.isEmpty(sectionName)) {
|
||||
$("#new-section-name").focus();
|
||||
return;
|
||||
}
|
||||
|
@ -127,7 +127,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
|
||||
onInsertBlock(block) {
|
||||
let sectionName = this.get('newSectionName');
|
||||
if (is.empty(sectionName)) {
|
||||
if (_.isEmpty(sectionName)) {
|
||||
$("#new-section-name").focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -62,8 +62,8 @@ export default Component.extend(ModalMixin, {
|
|||
|
||||
this.get('link').getCandidates(folderId, documentId, pageId).then(function (candidates) {
|
||||
self.set('candidates', candidates);
|
||||
self.set('hasSections', is.not.null(candidates.pages) && candidates.pages.length);
|
||||
self.set('hasAttachments', is.not.null(candidates.attachments) && candidates.attachments.length);
|
||||
self.set('hasSections', !_.isNull(candidates.pages) && candidates.pages.length);
|
||||
self.set('hasAttachments', !_.isNull(candidates.attachments) && candidates.attachments.length);
|
||||
|
||||
if (!self.get('hasSections') && !self.get('hasAttachments')) {
|
||||
self.set('tab1Selected', false);
|
||||
|
@ -148,7 +148,7 @@ export default Component.extend(ModalMixin, {
|
|||
}
|
||||
}
|
||||
|
||||
if (is.null(selection)) {
|
||||
if (_.isNull(selection)) {
|
||||
if (this.get('tab4Selected')) this.$('#content-linker-networklocation').addClass('is-invalid').focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ export default Component.extend({
|
|||
onDeletePage(deleteChildren) {
|
||||
let page = this.get('page');
|
||||
|
||||
if (is.undefined(page)) {
|
||||
if (_.isUndefined(page)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -57,6 +57,7 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
pinId: '',
|
||||
newName: ''
|
||||
};
|
||||
|
||||
this.saveTemplate = {
|
||||
name: '',
|
||||
description: ''
|
||||
|
@ -130,12 +131,12 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
let name = this.get('saveTemplate.name');
|
||||
let excerpt = this.get('saveTemplate.description');
|
||||
|
||||
if (is.empty(name)) {
|
||||
if (_.isEmpty(name)) {
|
||||
$("#new-template-name").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (is.empty(excerpt)) {
|
||||
if (_.isEmpty(excerpt)) {
|
||||
$("#new-template-desc").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ export default Component.extend(ModalMixin, {
|
|||
let page = this.get('page');
|
||||
let titleElem = '#block-title-' + page.get('id');
|
||||
let blockTitle = this.get('blockTitle');
|
||||
if (is.empty(blockTitle)) {
|
||||
if (_.isEmpty(blockTitle)) {
|
||||
$(titleElem).addClass('is-invalid');
|
||||
return;
|
||||
}
|
||||
|
@ -135,7 +135,7 @@ export default Component.extend(ModalMixin, {
|
|||
let excerptElem = '#block-desc-' + page.get('id');
|
||||
let blockExcerpt = this.get('blockExcerpt');
|
||||
blockExcerpt = blockExcerpt.replace(/\n/g, "");
|
||||
if (is.empty(blockExcerpt)) {
|
||||
if (_.isEmpty(blockExcerpt)) {
|
||||
$(excerptElem).addClass('is-invalid');
|
||||
return;
|
||||
}
|
||||
|
@ -178,9 +178,9 @@ export default Component.extend(ModalMixin, {
|
|||
|
||||
onCopyPage() {
|
||||
let item = this.get('docSearchResults').findBy('selected', true);
|
||||
let documentId = is.not.undefined(item) ? item.get('documentId') : '';
|
||||
let documentId = !_.isUndefined(item) ? item.get('documentId') : '';
|
||||
|
||||
if (is.empty(documentId)) return;
|
||||
if (_.isEmpty(documentId)) return;
|
||||
|
||||
this.modalClose('#copy-page-modal-' + this.get('page.id'));
|
||||
|
||||
|
@ -193,9 +193,9 @@ export default Component.extend(ModalMixin, {
|
|||
|
||||
onMovePage() {
|
||||
let item = this.get('docSearchResults').findBy('selected', true);
|
||||
let documentId = is.not.undefined(item) ? item.get('documentId') : '';
|
||||
let documentId = !_.isUndefined(item) ? item.get('documentId') : '';
|
||||
|
||||
if (is.empty(documentId)) return;
|
||||
if (_.isEmpty(documentId)) return;
|
||||
|
||||
// can't move into self
|
||||
if (documentId === this.get('document.id')) return;
|
||||
|
@ -219,7 +219,7 @@ export default Component.extend(ModalMixin, {
|
|||
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.moveUp(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -235,7 +235,7 @@ export default Component.extend(ModalMixin, {
|
|||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.moveDown(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -251,7 +251,7 @@ export default Component.extend(ModalMixin, {
|
|||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.indent(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -267,7 +267,7 @@ export default Component.extend(ModalMixin, {
|
|||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.outdent(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
|
|
@ -92,7 +92,7 @@ export default Component.extend(Notifier, {
|
|||
this.set('selectedCategories', selected);
|
||||
selected.forEach((s) => {
|
||||
let cat = cats.findBy('id', s.id);
|
||||
if (is.not.undefined(cat)) {
|
||||
if (!_.isUndefined(cat)) {
|
||||
cat.set('selected', true);
|
||||
this.set('categories', cats);
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ export default Component.extend(Notifier, {
|
|||
_.each(tagz, (t) => {
|
||||
let tag = t.value.toLowerCase().trim();
|
||||
if (tag.length> 0) {
|
||||
if (!_.contains(tagzToSave, tag) && is.not.startWith(tag, '-')) {
|
||||
if (!_.includes(tagzToSave, tag) && !_.startsWith(tag, '-')) {
|
||||
tagzToSave.push(tag);
|
||||
this.$('#add-tag-field-' + t.number).removeClass('is-invalid');
|
||||
} else {
|
||||
|
|
|
@ -92,7 +92,7 @@ export default Component.extend(Notifier, {
|
|||
this.set('selectedCategories', selected);
|
||||
selected.forEach((s) => {
|
||||
let cat = cats.findBy('id', s.id);
|
||||
if (is.not.undefined(cat)) {
|
||||
if (!_.isUndefined(cat)) {
|
||||
cat.set('selected', true);
|
||||
this.set('categories', cats);
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ export default Component.extend(Notifier, {
|
|||
_.each(tagz, (t) => {
|
||||
let tag = t.value.toLowerCase().trim();
|
||||
if (tag.length> 0) {
|
||||
if (!_.contains(tagzToSave, tag) && is.not.startWith(tag, '-')) {
|
||||
if (!_.includes(tagzToSave, tag) && !_.startsWith(tag, '-')) {
|
||||
tagzToSave.push(tag);
|
||||
this.$('#add-tag-field-' + t.number).removeClass('is-invalid');
|
||||
} else {
|
||||
|
|
|
@ -48,7 +48,7 @@ export default Component.extend({
|
|||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
let cp = this.get('currentPageId');
|
||||
this.setState(is.empty(cp) ? '' : cp);
|
||||
this.setState(_.isEmpty(cp) ? '' : cp);
|
||||
},
|
||||
|
||||
didInsertElement() {
|
||||
|
@ -71,7 +71,7 @@ export default Component.extend({
|
|||
setState(pageId) {
|
||||
let toc = this.get('pages');
|
||||
let page = _.find(toc, function(i) { return i.get('page.id') === pageId; });
|
||||
let state = tocUtil.getState(toc, is.not.undefined(page) ? page.get('page') : page);
|
||||
let state = tocUtil.getState(toc, !_.isUndefined(page) ? page.get('page') : page);
|
||||
|
||||
if (!this.get('canEdit')) {
|
||||
state.actionablePage = false;
|
||||
|
@ -92,7 +92,7 @@ export default Component.extend({
|
|||
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.moveUp(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -108,7 +108,7 @@ export default Component.extend({
|
|||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.moveDown(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -124,7 +124,7 @@ export default Component.extend({
|
|||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.indent(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
@ -140,7 +140,7 @@ export default Component.extend({
|
|||
let state = this.get('state');
|
||||
let pages = this.get('pages');
|
||||
let page = _.find(pages, function(i) { return i.get('page.id') === state.pageId; });
|
||||
if (is.not.undefined(page)) page = page.get('page');
|
||||
if (!_.isUndefined(page)) page = page.get('page');
|
||||
|
||||
let pendingChanges = tocUtil.outdent(state, pages, page);
|
||||
if (pendingChanges.length > 0) {
|
||||
|
|
|
@ -90,7 +90,7 @@ export default Component.extend(Notifier, {
|
|||
},
|
||||
|
||||
jumpToSection(cp) {
|
||||
if (is.not.empty(cp) && is.not.undefined(cp) && is.not.null(cp)) {
|
||||
if (!_.isEmpty(cp) && !_.isUndefined(cp) && !_.isNull(cp)) {
|
||||
this.get('browser').scrollTo(`#page-${cp}`)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -35,7 +35,7 @@ export default Component.extend(ModalMixin, {
|
|||
|
||||
let revision = this.get('revision');
|
||||
|
||||
if (is.not.null(revision)) {
|
||||
if (!_.isNull(revision)) {
|
||||
if (!revision.deleted) {
|
||||
this.fetchDiff(revision.pageId, revision.id);
|
||||
}
|
||||
|
|
|
@ -48,11 +48,11 @@ export default Component.extend(ModalMixin, Notifer, {
|
|||
// get summary of documents and users for each category in space
|
||||
this.get('categorySvc').getSummary(this.get('space.id')).then((s) => {
|
||||
c.forEach((cat) => {
|
||||
let docs = _.where(s, {categoryId: cat.get('id'), type: 'documents'});
|
||||
let docs = _.filter(s, {categoryId: cat.get('id'), type: 'documents'});
|
||||
let docCount = 0;
|
||||
docs.forEach((d) => { docCount = docCount + d.count });
|
||||
|
||||
let users = _.where(s, {categoryId: cat.get('id'), type: 'users'});
|
||||
let users = _.filter(s, {categoryId: cat.get('id'), type: 'users'});
|
||||
let userCount = 0;
|
||||
users.forEach((u) => { userCount = userCount + u.count });
|
||||
|
||||
|
@ -62,9 +62,9 @@ export default Component.extend(ModalMixin, Notifer, {
|
|||
|
||||
this.get('categorySvc').getUserVisible(this.get('space.id')).then((cm) => {
|
||||
cm.forEach((cm) => {
|
||||
let cat = _.findWhere(c, {id: cm.get('id') });
|
||||
if (is.not.undefined(cat)) {
|
||||
cat.set('access', is.not.undefined(cat));
|
||||
let cat = _.find(c, {id: cm.get('id') });
|
||||
if (!_.isUndefined(cat)) {
|
||||
cat.set('access', !_.isUndefined(cat));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -91,7 +91,7 @@ export default Component.extend(ModalMixin, Notifer, {
|
|||
let cats = this.get('category');
|
||||
let cat = cats.findBy('id', id);
|
||||
|
||||
if (is.not.undefined(cat)) {
|
||||
if (!_.isUndefined(cat)) {
|
||||
cat.set('editMode', val);
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ export default Component.extend(ModalMixin, Notifer, {
|
|||
// mark those users as selected that have permission to see the current category
|
||||
perms.forEach((perm) => {
|
||||
let c = categoryPermissions.findBy('whoId', perm.get('whoId'));
|
||||
if (is.not.undefined(c)) {
|
||||
if (!_.isUndefined(c)) {
|
||||
c.set('selected', true);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -70,7 +70,7 @@ export default Component.extend(AuthMixin, Notifier, {
|
|||
this.set('spaceLabel', this.get('space.labelId'));
|
||||
|
||||
let icon = this.get('space.icon');
|
||||
if (is.empty(icon)) {
|
||||
if (_.isEmpty(icon)) {
|
||||
icon = constants.IconMeta.Apps;
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
users.forEach((user) => {
|
||||
let exists = spacePermissions.findBy('whoId', user.get('id'));
|
||||
|
||||
if (is.undefined(exists)) {
|
||||
if (_.isUndefined(exists)) {
|
||||
filteredUsers.pushObject(user);
|
||||
}
|
||||
});
|
||||
|
@ -203,7 +203,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
}
|
||||
});
|
||||
|
||||
if (is.not.undefined(hasEveryone)) {
|
||||
if (!_.isUndefined(hasEveryone)) {
|
||||
folder.markAsPublic();
|
||||
} else {
|
||||
if (roleCount > 1) {
|
||||
|
@ -238,7 +238,7 @@ export default Component.extend(Notifier, Modals, {
|
|||
|
||||
let exists = spacePermissions.findBy('whoId', user.get('id'));
|
||||
|
||||
if (is.undefined(exists)) {
|
||||
if (_.isUndefined(exists)) {
|
||||
spacePermissions.pushObject(this.permissionRecord(constants.WhoType.User, user.get('id'), user.get('fullname')));
|
||||
this.set('spacePermissions', spacePermissions);
|
||||
this.send('onSearch');
|
||||
|
|
|
@ -46,8 +46,8 @@ export default Component.extend(AuthMixin, {
|
|||
let selectedCategory = '';
|
||||
|
||||
categories.forEach((cat)=> {
|
||||
let summary = _.findWhere(categorySummary, {type: "documents", categoryId: cat.get('id')});
|
||||
let docCount = is.not.undefined(summary) ? summary.count : 0;
|
||||
let summary = _.find(categorySummary, {type: "documents", categoryId: cat.get('id')});
|
||||
let docCount = !_.isUndefined(summary) ? summary.count : 0;
|
||||
cat.set('docCount', docCount);
|
||||
if (docCount > 0 && selectedCategory === '') {
|
||||
selectedCategory = cat.get('id');
|
||||
|
@ -56,7 +56,7 @@ export default Component.extend(AuthMixin, {
|
|||
|
||||
this.set('categories', categories);
|
||||
this.set('categoryLinkName', categories.length > 0 ? 'Manage' : 'Add');
|
||||
this.set('spaceLabel', _.findWhere(this.get('labels'), {id: this.get('space.labelId')}));
|
||||
this.set('spaceLabel', _.find(this.get('labels'), {id: this.get('space.labelId')}));
|
||||
|
||||
schedule('afterRender', () => {
|
||||
if (this.get('categoryFilter') !== '') {
|
||||
|
@ -77,9 +77,9 @@ export default Component.extend(AuthMixin, {
|
|||
|
||||
switch (filter) {
|
||||
case 'category':
|
||||
allowed = _.pluck(_.where(categoryMembers, {'categoryId': id}), 'documentId');
|
||||
allowed = _.map(_.filter(categoryMembers, {'categoryId': id}), 'documentId');
|
||||
docs.forEach((d) => {
|
||||
if (_.contains(allowed, d.get('id'))) {
|
||||
if (_.includes(allowed, d.get('id'))) {
|
||||
filtered.pushObject(d);
|
||||
}
|
||||
});
|
||||
|
@ -88,9 +88,9 @@ export default Component.extend(AuthMixin, {
|
|||
break;
|
||||
|
||||
case 'uncategorized':
|
||||
allowed = _.pluck(categoryMembers, 'documentId');
|
||||
allowed = _.map(categoryMembers, 'documentId');
|
||||
docs.forEach((d) => {
|
||||
if (!_.contains(allowed, d.get('id'))) {
|
||||
if (!_.includes(allowed, d.get('id'))) {
|
||||
filtered.pushObject(d);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -92,7 +92,7 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
willDestroyElement() {
|
||||
this._super(...arguments);
|
||||
|
||||
if (is.not.null(this.get('dropzone'))) {
|
||||
if (!_.isNull(this.get('dropzone'))) {
|
||||
this.get('dropzone').destroy();
|
||||
this.set('dropzone', null);
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
|
||||
setupImport() {
|
||||
// already done init?
|
||||
if (is.not.null(this.get('dropzone'))) {
|
||||
if (!_.isNull(this.get('dropzone'))) {
|
||||
this.get('dropzone').destroy();
|
||||
this.set('dropzone', null);
|
||||
}
|
||||
|
@ -180,7 +180,7 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
e.preventDefault();
|
||||
let docName = this.get('emptyDocName');
|
||||
|
||||
if (is.empty(docName)) {
|
||||
if (_.isEmpty(docName)) {
|
||||
this.set('emptyDocNameError', true);
|
||||
$('#empty-doc-name').focus();
|
||||
return;
|
||||
|
@ -217,14 +217,14 @@ export default Component.extend(ModalMixin, AuthMixin, Notifier, {
|
|||
e.preventDefault();
|
||||
let docName = this.get('templateDocName');
|
||||
|
||||
if (is.empty(docName)) {
|
||||
if (_.isEmpty(docName)) {
|
||||
this.set('templateDocNameError', true);
|
||||
$('#template-doc-name').focus();
|
||||
return;
|
||||
}
|
||||
|
||||
let id = this.get('selectedTemplate');
|
||||
if (is.empty(id)) {
|
||||
if (_.isEmpty(id)) {
|
||||
$('#widget-list-picker').addClass('is-invalid');
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -100,7 +100,7 @@ export default Component.extend(Modals, {
|
|||
processNotification(msg, type) {
|
||||
if (this.get('isDestroyed') || this.get('isDestroying')) return;
|
||||
|
||||
if (is.not.undefined(type)) {
|
||||
if (!_.isUndefined(type)) {
|
||||
switch (type) {
|
||||
case 'info':
|
||||
iziToast.info({
|
||||
|
|
|
@ -38,7 +38,7 @@ export default Component.extend(ModalMixin, {
|
|||
|
||||
let msContainer = document.getElementById('section-editor-' + this.get('containerId'));
|
||||
let mousetrap = this.get('mousetrap');
|
||||
if (is.null(mousetrap)) {
|
||||
if (_.isNull(mousetrap)) {
|
||||
mousetrap = new Mousetrap(msContainer);
|
||||
}
|
||||
|
||||
|
@ -63,7 +63,7 @@ export default Component.extend(ModalMixin, {
|
|||
this.set('showLinkModal', false);
|
||||
|
||||
let mousetrap = this.get('mousetrap');
|
||||
if (is.not.null(mousetrap)) {
|
||||
if (!_.isNull(mousetrap)) {
|
||||
mousetrap.unbind('esc');
|
||||
mousetrap.unbind(['ctrl+s', 'command+s']);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ export default Component.extend(ModalMixin, {
|
|||
|
||||
actions: {
|
||||
onAction() {
|
||||
if (this.get('busy') || is.empty(this.get('pageTitle'))) {
|
||||
if (this.get('busy') || _.isEmpty(this.get('pageTitle'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -67,12 +67,12 @@ export default Component.extend(ModalMixin, {
|
|||
return;
|
||||
}
|
||||
|
||||
if (is.empty(this.get('page.title'))) {
|
||||
if (_.isEmpty(this.get('page.title'))) {
|
||||
$("#page-title").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.get('hasExcerpt') && is.empty(this.get('page.excerpt'))) {
|
||||
if (this.get('hasExcerpt') && _.isEmpty(this.get('page.excerpt'))) {
|
||||
$("#page-excerpt").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ export default Component.extend({
|
|||
this.set('syntaxOptions', opts);
|
||||
|
||||
// default check
|
||||
if (is.null(this.get("codeSyntax"))) {
|
||||
if (_.isNull(this.get("codeSyntax"))) {
|
||||
this.set("codeSyntax", opts.findBy("mode", "htmlmixed"));
|
||||
}
|
||||
},
|
||||
|
@ -83,7 +83,7 @@ export default Component.extend({
|
|||
};
|
||||
|
||||
let syntax = this.get("codeSyntax");
|
||||
if (is.not.undefined(syntax)) {
|
||||
if (!_.isUndefined(syntax)) {
|
||||
CodeMirror.autoLoadMode(editor, syntax.mode);
|
||||
editor.setOption("mode", syntax.mode);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ export default Component.extend({
|
|||
willDestroyElement() {
|
||||
let editor = this.get('codeEditor');
|
||||
|
||||
if (is.not.null(editor)) {
|
||||
if (!_.isNull(editor)) {
|
||||
editor.toTextArea();
|
||||
editor = null;
|
||||
this.set('codeEditor', null);
|
||||
|
|
|
@ -63,7 +63,7 @@ export default Component.extend({
|
|||
});
|
||||
|
||||
let syntax = this.get("codeSyntax");
|
||||
if (is.not.undefined(syntax)) {
|
||||
if (!_.isUndefined(syntax)) {
|
||||
CodeMirror.autoLoadMode(editor, syntax.mode);
|
||||
editor.setOption("mode", syntax.mode);
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ export default Component.extend({
|
|||
this._super(...arguments);
|
||||
|
||||
let editor = this.get('codeEditor');
|
||||
if (is.not.null(editor)) {
|
||||
if (!_.isNull(editor)) {
|
||||
editor.toTextArea();
|
||||
editor = null;
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ export default Component.extend({
|
|||
invokeExport() {
|
||||
// Cannot export if nothing has been changed
|
||||
// so we skip straight to the save process.
|
||||
if (is.empty(this.get('diagramXML'))) {
|
||||
if (_.isEmpty(this.get('diagramXML'))) {
|
||||
this.set('readyToSave', true);
|
||||
return;
|
||||
}
|
||||
|
@ -137,7 +137,7 @@ export default Component.extend({
|
|||
|
||||
// handle case where no diagram changes were made
|
||||
let dg = this.get('diagram');
|
||||
if (is.empty(dg)) dg = this.get('meta.rawBody');
|
||||
if (_.isEmpty(dg)) dg = this.get('meta.rawBody');
|
||||
|
||||
meta.set('rawBody', dg);
|
||||
page.set('title', this.get('title'));
|
||||
|
|
|
@ -36,7 +36,7 @@ export default Component.extend(SectionMixin, {
|
|||
config = JSON.parse(this.get('meta.config'));
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (is.empty(config)) {
|
||||
if (_.isEmpty(config)) {
|
||||
config = {
|
||||
APIKey: "",
|
||||
filter: {},
|
||||
|
@ -148,15 +148,15 @@ export default Component.extend(SectionMixin, {
|
|||
|
||||
auth() {
|
||||
// missing data?
|
||||
if (is.empty(this.get('config.url'))) {
|
||||
if (_.isEmpty(this.get('config.url'))) {
|
||||
$("#gemini-url").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(this.get('config.username'))) {
|
||||
if (_.isEmpty(this.get('config.username'))) {
|
||||
$("#gemini-username").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
if (is.empty(this.get('config.APIKey'))) {
|
||||
if (_.isEmpty(this.get('config.APIKey'))) {
|
||||
$("#gemini-apikey").addClass("is-invalid").focus();
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
let self = this;
|
||||
let page = this.get('page');
|
||||
|
||||
if (is.undefined(this.get('config.clientId')) || is.undefined(this.get('config.callbackUrl'))) {
|
||||
if (_.isUndefined(this.get('config.clientId')) || _.isUndefined(this.get('config.callbackUrl'))) {
|
||||
self.get('sectionService').fetch(page, "config", {})
|
||||
.then(function (cfg) {
|
||||
let config = {};
|
||||
|
@ -77,7 +77,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
let code = window.location.search;
|
||||
code = code.replace("?mode=edit", "");
|
||||
|
||||
if (is.not.undefined(code) && is.not.null(code) && is.not.empty(code) && code !== "") {
|
||||
if (!_.isUndefined(code) && !_.isNull(code) && !_.isEmpty(code) && code !== "") {
|
||||
let tok = code.replace("&code=", "");
|
||||
self.get('sectionService').fetch(page, "saveSecret", { "token": tok })
|
||||
.then(function () {
|
||||
|
@ -111,7 +111,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
let owners = this.get('owners');
|
||||
let thisOwner = this.get('config.owner');
|
||||
|
||||
if (is.null(thisOwner) || is.undefined(thisOwner)) {
|
||||
if (_.isNull(thisOwner) || _.isUndefined(thisOwner)) {
|
||||
if (owners.length) {
|
||||
thisOwner = owners[0];
|
||||
this.set('config.owner', thisOwner);
|
||||
|
@ -124,7 +124,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
|
||||
this.getOrgReposLists();
|
||||
|
||||
if (is.undefined(this.get('initDateTimePicker'))) {
|
||||
if (_.isUndefined(this.get('initDateTimePicker'))) {
|
||||
$.datetimepicker.setLocale('en');
|
||||
$('#branch-since').datetimepicker();
|
||||
this.set('initDateTimePicker', "Done");
|
||||
|
@ -157,10 +157,10 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
lists2.forEach(function (list) {
|
||||
let included = false;
|
||||
var saved;
|
||||
if (is.not.undefined(savedLists)) {
|
||||
if (!_.isUndefined(savedLists)) {
|
||||
saved = savedLists.findBy("id", list.id);
|
||||
}
|
||||
if (is.not.undefined(saved)) {
|
||||
if (!_.isUndefined(saved)) {
|
||||
included = saved.selected;
|
||||
noIncluded = false;
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ export default Component.extend(SectionMixin, {
|
|||
config = JSON.parse(this.get('meta.config'));
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (is.empty(config)) {
|
||||
if (_.isEmpty(config)) {
|
||||
config = {
|
||||
jql: '',
|
||||
itemCount: 0,
|
||||
|
|
|
@ -32,7 +32,7 @@ export default Component.extend({
|
|||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
let body = (is.not.undefined(this.get('meta'))) ? this.get('meta.rawBody').trim() : '';
|
||||
let body = (!_.isUndefined(this.get('meta'))) ? this.get('meta.rawBody').trim() : '';
|
||||
this.set('pageBody', body);
|
||||
},
|
||||
|
||||
|
@ -76,7 +76,7 @@ export default Component.extend({
|
|||
|
||||
let syntax = this.get("codeSyntax");
|
||||
|
||||
if (is.not.undefined(syntax)) {
|
||||
if (!_.isUndefined(syntax)) {
|
||||
CodeMirror.autoLoadMode(editor, "markdown");
|
||||
editor.setOption("mode", "markdown");
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
config = JSON.parse(this.get('meta.config'));
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (is.empty(config)) {
|
||||
if (_.isEmpty(config)) {
|
||||
config = {
|
||||
APIToken: "",
|
||||
query: "",
|
||||
|
@ -78,12 +78,12 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
|
||||
let options = self.get('options');
|
||||
let group = {};
|
||||
if (is.not.null(config.group)) {
|
||||
group = _.findWhere(options.groups, { id: config.group.id });
|
||||
if (!_.isNull(config.group)) {
|
||||
group = _.find(options.groups, { id: config.group.id });
|
||||
} else {
|
||||
group = options.groups[0];
|
||||
}
|
||||
if (is.not.undefined(group)) {
|
||||
if (!_.isUndefined(group)) {
|
||||
set(config, 'group', group);
|
||||
}
|
||||
}, function (reason) {
|
||||
|
@ -152,7 +152,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
|
||||
let config = this.get('config');
|
||||
let max = 10;
|
||||
if (is.number(parseInt(config.max))) {
|
||||
if (_.isNumber(parseInt(config.max))) {
|
||||
max = parseInt(config.max);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ export default Component.extend({
|
|||
|
||||
this.set('pageBody', this.get('meta.rawBody'));
|
||||
|
||||
if (is.empty(this.get('pageBody'))) {
|
||||
if (_.isEmpty(this.get('pageBody'))) {
|
||||
this.set('pageBody', this.get('defaultTable'));
|
||||
}
|
||||
},
|
||||
|
@ -74,7 +74,7 @@ export default Component.extend({
|
|||
let body = $('#' + this.get('editorId')).froalaEditor('html.get', true);
|
||||
page.set('title', title);
|
||||
|
||||
if (is.empty(body)) {
|
||||
if (_.isEmpty(body)) {
|
||||
body = this.get('defaultTable');
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
|
||||
this.set('pageBody', this.get('meta.rawBody'));
|
||||
|
||||
if (is.empty(this.get('pageBody'))) {
|
||||
if (_.isEmpty(this.get('pageBody'))) {
|
||||
this.set('pageBody', this.get('defaultTable'));
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
|
||||
generateImportTable(results) {
|
||||
// nothing to import?
|
||||
if (is.undefined(results) || results.data.length === 0) {
|
||||
if (_.isUndefined(results) || results.data.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
let table = '<table class="wysiwyg-table" style="width: 100%;"><thead><tr>';
|
||||
|
||||
// Setup the table headers
|
||||
if (opts.headers && is.array(results.meta.fields)) {
|
||||
if (opts.headers && _.isArray(results.meta.fields)) {
|
||||
// use headers from file
|
||||
results.meta.fields.forEach((header) => {
|
||||
table = table + '<th>' + header.trim() + '</th>';
|
||||
|
@ -155,7 +155,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
results.data.forEach(row => {
|
||||
table = table + '<tr>';
|
||||
|
||||
if (is.array(row)) {
|
||||
if (_.isArray(row)) {
|
||||
row.forEach((cell) => {
|
||||
table = table + '<td>' + cell.trim() + '</td>';
|
||||
});
|
||||
|
@ -189,7 +189,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
|
||||
this.modalClose('#' + this.get('modalId'));
|
||||
|
||||
if (is.empty(csv)) {
|
||||
if (_.isEmpty(csv)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ export default Component.extend(Modals, Notifier, {
|
|||
let editor = tinymce.EditorManager.get(this.get('editorId'));
|
||||
let userSelection = editor.selection.getContent();
|
||||
|
||||
if (is.not.empty(userSelection)) {
|
||||
if (!_.isEmpty(userSelection)) {
|
||||
set(link, 'title', userSelection);
|
||||
}
|
||||
|
||||
|
@ -219,8 +219,8 @@ export default Component.extend(Modals, Notifier, {
|
|||
isDirty() {
|
||||
let editor = tinymce.EditorManager.get(this.get('editorId'));
|
||||
return (
|
||||
is.not.undefined(tinymce) &&
|
||||
is.not.undefined(editor) &&
|
||||
!_.isUndefined(tinymce) &&
|
||||
!_.isUndefined(editor) &&
|
||||
editor.isDirty()
|
||||
);
|
||||
},
|
||||
|
|
|
@ -27,13 +27,13 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
noBoards: false,
|
||||
appKey: "",
|
||||
trelloConfigured: computed('appKey', function () {
|
||||
return is.not.empty(this.get('appKey'));
|
||||
return !_.isEmpty(this.get('appKey'));
|
||||
}),
|
||||
|
||||
boardStyle: computed('config.board', function () {
|
||||
let board = this.get('config.board');
|
||||
|
||||
if (is.null(board) || is.undefined(board)) {
|
||||
if (_.isNull(board) || _.isUndefined(board)) {
|
||||
return "#4c4c4c";
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
config = JSON.parse(this.get('meta.config'));
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
|
||||
if (is.empty(config)) {
|
||||
if (_.isEmpty(config)) {
|
||||
config = {
|
||||
token: "",
|
||||
user: null,
|
||||
|
@ -73,9 +73,9 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
|
||||
// On auth callback capture user token
|
||||
let hashToken = window.location.hash;
|
||||
if (is.not.undefined(hashToken) && is.not.null(hashToken)) {
|
||||
if (!_.isUndefined(hashToken) && !_.isNull(hashToken)) {
|
||||
let token = hashToken.replace("#token=", "");
|
||||
if (is.not.empty(token)) {
|
||||
if (!_.isEmpty(token)) {
|
||||
self.set('config.token', token);
|
||||
}
|
||||
}
|
||||
|
@ -100,14 +100,14 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
let board = this.get('config.board');
|
||||
let page = this.get('page');
|
||||
|
||||
if (is.null(boards) || is.undefined(boards) || boards.length === 0) {
|
||||
if (_.isNull(boards) || _.isUndefined(boards) || boards.length === 0) {
|
||||
this.set('noBoards', true);
|
||||
return;
|
||||
}
|
||||
|
||||
this.set('noBoards', false);
|
||||
|
||||
if (is.null(board) || is.undefined(board)) {
|
||||
if (_.isNull(board) || _.isUndefined(board)) {
|
||||
if (boards.length) {
|
||||
board = boards[0];
|
||||
this.set('config.board', board);
|
||||
|
@ -126,7 +126,7 @@ export default Component.extend(SectionMixin, NotifierMixin, {
|
|||
lists.forEach(function (list) {
|
||||
let saved = savedLists.findBy("id", list.id);
|
||||
let included = true;
|
||||
if (is.not.undefined(saved)) {
|
||||
if (!_.isUndefined(saved)) {
|
||||
included = saved.included;
|
||||
}
|
||||
list.included = included;
|
||||
|
|
|
@ -138,7 +138,7 @@ export default Component.extend({
|
|||
let editor = tinymce.EditorManager.get(this.get('editorId'));
|
||||
let userSelection = editor.selection.getContent();
|
||||
|
||||
if (is.not.empty(userSelection)) {
|
||||
if (!_.isEmpty(userSelection)) {
|
||||
set(link, 'title', userSelection);
|
||||
}
|
||||
|
||||
|
@ -151,8 +151,8 @@ export default Component.extend({
|
|||
isDirty() {
|
||||
let editor = tinymce.EditorManager.get(this.get('editorId'));
|
||||
return (
|
||||
is.not.undefined(tinymce) &&
|
||||
is.not.undefined(editor) &&
|
||||
!_.isUndefined(tinymce) &&
|
||||
!_.isUndefined(editor) &&
|
||||
editor.isDirty()
|
||||
);
|
||||
},
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
import $ from 'jquery';
|
||||
import { empty, and } from '@ember/object/computed';
|
||||
import { isEmpty } from '@ember/utils';
|
||||
import stringUtil from '../utils/string';
|
||||
import { set } from '@ember/object';
|
||||
import Component from '@ember/component';
|
||||
|
||||
|
@ -45,7 +46,7 @@ export default Component.extend({
|
|||
return $("#adminLastname").focus();
|
||||
}
|
||||
|
||||
if (isEmpty(this.get('model.email')) || !is.email(this.get('model.email'))) {
|
||||
if (isEmpty(this.get('model.email')) || !stringUtil.isEmail(this.get('model.email'))) {
|
||||
set(this, 'adminEmailError', true);
|
||||
return $("#adminEmail").focus();
|
||||
}
|
||||
|
|
|
@ -24,6 +24,6 @@ export default Component.extend({
|
|||
didReceiveAttrs() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.set('label', _.findWhere(this.get('labels'), {id: this.get('labelId')}));
|
||||
this.set('label', _.find(this.get('labels'), {id: this.get('labelId')}));
|
||||
}
|
||||
});
|
||||
|
|
|
@ -76,7 +76,7 @@ export default Component.extend({
|
|||
}),
|
||||
|
||||
click(e) {
|
||||
if (is.not.undefined(this.onClick)) {
|
||||
if (!_.isUndefined(this.onClick)) {
|
||||
e.preventDefault();
|
||||
this.onClick(e);
|
||||
}
|
||||
|
|
|
@ -22,11 +22,11 @@ export default Component.extend({
|
|||
let icon = this.icon;
|
||||
let constants = this.get('constants');
|
||||
|
||||
if (is.null(icon)) {
|
||||
if (_.isNull(icon)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (is.empty(icon)) {
|
||||
if (_.isEmpty(icon)) {
|
||||
icon = constants.IconMeta.Apps;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,12 +37,12 @@ export default Component.extend({
|
|||
}),
|
||||
|
||||
click(e) {
|
||||
if (is.not.undefined(this.onClick)) {
|
||||
if (!_.isUndefined(this.onClick)) {
|
||||
this.onClick(e);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is.not.undefined(this.linkTo)) {
|
||||
if (!_.isUndefined(this.linkTo)) {
|
||||
// TODO: pass in linkModel, linkOptions
|
||||
// https://emberjs.com/api/ember/3.5/classes/RouterService/methods/transitionTo?anchor=transitionTo
|
||||
this.router.transitionTo(this.get('linkTo'));
|
||||
|
|
|
@ -33,11 +33,11 @@ export default Component.extend({
|
|||
}),
|
||||
|
||||
click(e) {
|
||||
if (is.not.undefined(this.onClick)) {
|
||||
if (!_.isUndefined(this.onClick)) {
|
||||
this.onClick(e);
|
||||
return;
|
||||
}
|
||||
if (is.not.undefined(this.linkTo)) {
|
||||
if (!_.isUndefined(this.linkTo)) {
|
||||
// TODO: pass in linkModel, linkOptions
|
||||
// https://emberjs.com/api/ember/3.5/classes/RouterService/methods/transitionTo?anchor=transitionTo
|
||||
this.router.transitionTo(this.linkTo);
|
||||
|
|
|
@ -15,6 +15,7 @@ import { computed, set } from '@ember/object';
|
|||
import { isPresent, isEqual, isEmpty } from '@ember/utils';
|
||||
import { inject as service } from '@ember/service';
|
||||
import AuthProvider from '../../mixins/auth';
|
||||
import stringUtil from '../../utils/string';
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend(AuthProvider, {
|
||||
|
@ -23,7 +24,7 @@ export default Component.extend(AuthProvider, {
|
|||
hasLastnameError: empty('model.lastname'),
|
||||
hasEmailError: computed('model.email', function() {
|
||||
let email = this.get('model.email');
|
||||
return isEmpty(email) || is.not.email(email);
|
||||
return isEmpty(email) || !stringUtil.isEmail(email);
|
||||
}),
|
||||
hasPasswordError: computed('passwordError', 'password.password', {
|
||||
get() {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { helper } from '@ember/component/helper';
|
|||
export function formattedDate(params) {
|
||||
let date = params[0];
|
||||
let format = params[1];
|
||||
if (is.undefined(format)) format = 'Do MMMM YYYY, HH:mm';
|
||||
if (_.isUndefined(format)) format = 'Do MMMM YYYY, HH:mm';
|
||||
|
||||
// https://momentjs.com/docs/#/manipulating/local/
|
||||
return moment.utc(date).local().format(format);
|
||||
|
|
|
@ -14,7 +14,7 @@ import { helper } from '@ember/component/helper';
|
|||
export function formattedPrice(params) {
|
||||
let pence = params[0];
|
||||
|
||||
if(is.not.number(pence)) {
|
||||
if(!_.isNumber(pence)) {
|
||||
return '$0'
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
import { helper } from '@ember/component/helper';
|
||||
|
||||
export function isOneOf(params/*, hash*/) {
|
||||
if (is.not.undefined(params) || is.not.null(params)) {
|
||||
if (!_.isUndefined(params) || !_.isNull(params)) {
|
||||
if (params.length >= 2) {
|
||||
let value = params[0];
|
||||
for (let i=1; i < params.length; i++) {
|
||||
|
|
|
@ -16,10 +16,10 @@ export function userInitials(params) {
|
|||
let firstname = params[0];
|
||||
let lastname = params[1];
|
||||
|
||||
if (is.undefined(firstname)) {
|
||||
if (_.isUndefined(firstname)) {
|
||||
firstname = " ";
|
||||
}
|
||||
if (is.undefined(lastname)) {
|
||||
if (_.isUndefined(lastname)) {
|
||||
lastname = " ";
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@ import $ from 'jquery';
|
|||
import constants from '../constants/constants';
|
||||
|
||||
export function initialize(application) {
|
||||
// address insecure jquery defaults (kudos: @nathanhammond)
|
||||
$.globalEval = function() {};
|
||||
$.ajaxSetup({
|
||||
crossDomain: true,
|
||||
|
@ -22,10 +21,6 @@ export function initialize(application) {
|
|||
}
|
||||
});
|
||||
|
||||
// required since Ember 3.8.0 upgrade to avoid clash with underscore.js
|
||||
window.lodash = _.noConflict();
|
||||
// window.underscore = _.noConflict();
|
||||
|
||||
let cs = constants.constants;
|
||||
application.register('constants:main', cs);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ export default Mixin.create({
|
|||
$(modalId).modal('dispose');
|
||||
$(modalId).modal(options);
|
||||
|
||||
if (is.not.undefined(focusId)) {
|
||||
if (!_.isUndefined(focusId)) {
|
||||
$(focusId).trigger('focus');
|
||||
}
|
||||
},
|
||||
|
|
|
@ -28,7 +28,7 @@ export default Model.extend({
|
|||
countContent: attr('number', { defaultValue: 0 }),
|
||||
|
||||
allowLikes: computed('likes', function () {
|
||||
return is.not.empty(this.get('likes')) && is.not.undefined(this.get('likes'));
|
||||
return !_.isEmpty(this.get('likes')) && !_.isUndefined(this.get('likes'));
|
||||
}),
|
||||
|
||||
slug: computed('name', function () {
|
||||
|
|
|
@ -29,7 +29,7 @@ export default Route.extend({
|
|||
return new EmberPromise((resolve) => {
|
||||
let constants = this.get('constants');
|
||||
|
||||
this.set('mode', is.not.undefined(transition.to.queryParams.mode) ? transition.to.queryParams.mode : 'reject');
|
||||
this.set('mode', !_.isUndefined(transition.to.queryParams.mode) ? transition.to.queryParams.mode : 'reject');
|
||||
|
||||
if (this.get('mode') === 'reject' || this.get('appMeta.authProvider') !== constants.AuthProvider.Keycloak) {
|
||||
resolve();
|
||||
|
@ -41,7 +41,7 @@ export default Route.extend({
|
|||
this.get("session").authenticate('authenticator:keycloak', data).then(() => {
|
||||
this.transitionTo('folders');
|
||||
}, (reject) => {
|
||||
if (is.not.undefined(reject.Error)) {
|
||||
if (!_.isUndefined(reject.Error)) {
|
||||
this.set('message', reject.Error);
|
||||
} else {
|
||||
this.set('message', reject);
|
||||
|
|
|
@ -14,7 +14,7 @@ import Route from '@ember/routing/route';
|
|||
|
||||
export default Route.extend(AuthenticatedRouteMixin, {
|
||||
beforeModel: function (transition) {
|
||||
if (is.equal(transition.targetName, 'customize.index')) {
|
||||
if (_.isEqual(transition.targetName, 'customize.index')) {
|
||||
this.transitionTo('customize.general');
|
||||
}
|
||||
},
|
||||
|
|
|
@ -25,7 +25,7 @@ export default Route.extend(AuthenticatedRouteMixin, {
|
|||
beforeModel(transition) {
|
||||
// Note the source that sent user to this document.
|
||||
let source = transition.to.queryParams.source;
|
||||
if (is.null(source) || is.undefined(source)) source = "";
|
||||
if (_.isNull(source) || _.isUndefined(source)) source = "";
|
||||
|
||||
return new EmberPromise((resolve) => {
|
||||
this.get('documentService').fetchPages(this.paramsFor('document').document_id, this.get('session.user.id'), source).then((data) => {
|
||||
|
|
|
@ -67,7 +67,7 @@ export default Route.extend(AuthenticatedRouteMixin, {
|
|||
let rootDocCount = 0;
|
||||
|
||||
// get documentId's from category members
|
||||
let withCat = _.pluck(categoryMembers, 'documentId');
|
||||
let withCat = _.map(categoryMembers, 'documentId');
|
||||
|
||||
// calculate documents without category;
|
||||
docs.forEach((d) => {
|
||||
|
|
|
@ -61,7 +61,7 @@ export default Controller.extend(AuthMixin, Modals, {
|
|||
let spaceLabel = this.get('spaceLabel');
|
||||
let clonedId = this.get('clonedSpace.id');
|
||||
|
||||
if (is.empty(spaceName)) {
|
||||
if (_.isEmpty(spaceName)) {
|
||||
$("#new-space-name").addClass("is-invalid").focus();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ export default Route.extend(AuthenticatedRouteMixin, {
|
|||
});
|
||||
|
||||
_.each(model.labels, label => {
|
||||
let spaces = _.where(model.spaces, {labelId: label.get('id')});
|
||||
let spaces = _.filter(model.spaces, {labelId: label.get('id')});
|
||||
label.set('count', spaces.length);
|
||||
controller.set(label.get('id'), spaces);
|
||||
});
|
||||
|
|
|
@ -17,11 +17,11 @@ export default Route.extend(AuthenticatedRouteMixin, {
|
|||
|
||||
beforeModel(transition) {
|
||||
let matchFilter = {
|
||||
matchDoc: is.undefined(transition.to.queryParams.matchDoc) ? true : (transition.to.queryParams.matchDoc == 'true'),
|
||||
matchContent: is.undefined(transition.to.queryParams.matchContent) ? true : (transition.to.queryParams.matchContent == 'true'),
|
||||
matchTag: is.undefined(transition.to.queryParams.matchTag) ? true : (transition.to.queryParams.matchTag == 'true'),
|
||||
matchFile: is.undefined(transition.to.queryParams.matchFile) ? true : (transition.to.queryParams.matchFile == 'true'),
|
||||
slog: is.undefined(transition.to.queryParams.slog) ? false : (transition.to.queryParams.slog === 'true'),
|
||||
matchDoc: _.isUndefined(transition.to.queryParams.matchDoc) ? true : (transition.to.queryParams.matchDoc == 'true'),
|
||||
matchContent: _.isUndefined(transition.to.queryParams.matchContent) ? true : (transition.to.queryParams.matchContent == 'true'),
|
||||
matchTag: _.isUndefined(transition.to.queryParams.matchTag) ? true : (transition.to.queryParams.matchTag == 'true'),
|
||||
matchFile: _.isUndefined(transition.to.queryParams.matchFile) ? true : (transition.to.queryParams.matchFile == 'true'),
|
||||
slog: _.isUndefined(transition.to.queryParams.slog) ? false : (transition.to.queryParams.slog === 'true'),
|
||||
};
|
||||
|
||||
this.set('matchFilter', matchFilter);
|
||||
|
|
|
@ -42,10 +42,10 @@ export default Route.extend(ApplicationRouteMixin, {
|
|||
|
||||
let next = this.get('localStorage').getSessionItem('entryUrl');
|
||||
|
||||
if (is.not.null(next) && is.not.undefined(next)) {
|
||||
if (!_.isNull(next) && !_.isUndefined(next)) {
|
||||
this.get('localStorage').clearSessionItem('entryUrl')
|
||||
|
||||
if (is.not.include(next, '/auth/')) {
|
||||
if (!_.includes(next, '/auth/')) {
|
||||
window.location.href= next;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ export default AjaxService.extend({
|
|||
let appVersion = headers['x-documize-version'];
|
||||
|
||||
// Unauthorized local API AJAX calls redirect to app root.
|
||||
if (status === 401 && is.not.undefined(appVersion) && is.not.include(window.location.href, '/auth')) {
|
||||
if (status === 401 && !_.isUndefined(appVersion) && !_.includes(window.location.href, '/auth')) {
|
||||
this.get('localStorage').clearAll();
|
||||
window.location.href = 'auth/login';
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ export default AjaxService.extend({
|
|||
this.set('appMeta.valid', false);
|
||||
}
|
||||
|
||||
if (this.get('session.authenticated') && is.not.empty(userUpdate) && is.not.undefined(userUpdate)) {
|
||||
if (this.get('session.authenticated') && !_.isEmpty(userUpdate) && !_.isUndefined(userUpdate)) {
|
||||
let latest = JSON.parse(userUpdate);
|
||||
// Permission change means re-validation.
|
||||
if (!latest.active || user.editor !== latest.editor || user.admin !== latest.admin ||
|
||||
|
|
|
@ -53,7 +53,7 @@ export default Service.extend({
|
|||
this.set('authProvider', constants.AuthProvider.Documize);
|
||||
|
||||
let dbhash;
|
||||
if (is.not.null(document.head.querySelector("[property=dbhash]"))) {
|
||||
if (!_.isNull(document.head.querySelector("[property=dbhash]"))) {
|
||||
dbhash = document.head.querySelector("[property=dbhash]").content;
|
||||
}
|
||||
|
||||
|
@ -89,7 +89,7 @@ export default Service.extend({
|
|||
|
||||
this.get('localStorage').clearAll();
|
||||
return resolve(this);
|
||||
} else if (is.not.include(requestedUrl, '/auth/')) {
|
||||
} else if (!_.includes(requestedUrl, '/auth/')) {
|
||||
this.get('localStorage').storeSessionItem('entryUrl', requestedUrl);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ export default Service.extend({
|
|||
setMetaDescription(description) {
|
||||
$('meta[name=description]').remove();
|
||||
|
||||
if (is.null(description) || is.undefined(description)) {
|
||||
if (_.isNull(description) || _.isUndefined(description)) {
|
||||
description = this.get('sessionService.appMeta.message');
|
||||
}
|
||||
},
|
||||
|
@ -44,7 +44,7 @@ export default Service.extend({
|
|||
scrollTo(id) {
|
||||
schedule('afterRender', () => {
|
||||
let elem = $(id).offset();
|
||||
if (is.undefined(elem)) return;
|
||||
if (_.isUndefined(elem)) return;
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: elem.top
|
||||
|
|
|
@ -36,7 +36,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('category', obj);
|
||||
|
@ -53,7 +53,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('category', obj);
|
||||
|
@ -91,7 +91,7 @@ export default BaseService.extend({
|
|||
}).then((response) => {
|
||||
// return response;
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('category-permission', obj);
|
||||
|
@ -108,7 +108,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
|
|
@ -47,7 +47,7 @@ export default Service.extend({
|
|||
let documents = ArrayProxy.create({
|
||||
content: A([])
|
||||
});
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
documents = response.map((doc) => {
|
||||
let data = this.get('store').normalize('document', doc);
|
||||
|
@ -115,7 +115,7 @@ export default Service.extend({
|
|||
return this.get('ajax').request(`documents/${documentId}/pages`, {
|
||||
method: 'GET'
|
||||
}).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
let pages = [];
|
||||
|
||||
pages = response.map((page) => {
|
||||
|
@ -218,7 +218,7 @@ export default Service.extend({
|
|||
return this.get('ajax').request(`documents/${documentId}/pages?content=0`, {
|
||||
method: 'GET'
|
||||
}).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
let data = [];
|
||||
data = response.map((obj) => {
|
||||
|
@ -288,7 +288,7 @@ export default Service.extend({
|
|||
return this.get('ajax').request(`sections/targets`, {
|
||||
method: 'GET'
|
||||
}).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
let data = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
|
@ -335,7 +335,7 @@ export default Service.extend({
|
|||
} else {
|
||||
let id = this.get('storageSvc').getSessionItem('anonId');
|
||||
|
||||
if (is.not.null(id) && is.not.undefined(id) && id.length >= 16) {
|
||||
if (!_.isNull(id) && !_.isUndefined(id) && id.length >= 16) {
|
||||
userId = id;
|
||||
} else {
|
||||
userId = stringUtil.anonUserId();
|
||||
|
@ -443,7 +443,7 @@ export default Service.extend({
|
|||
let userHasChangeAwaitingReview = false;
|
||||
let userHasChangeRejected = false;
|
||||
|
||||
if (is.null(source) || is.undefined(source)) source = "";
|
||||
if (_.isNull(source) || _.isUndefined(source)) source = "";
|
||||
|
||||
return this.get('ajax').request(`fetch/page/${documentId}?source=${source}`, {
|
||||
method: 'GET'
|
||||
|
|
|
@ -102,7 +102,7 @@ export default BaseService.extend({
|
|||
method: "GET"
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('folder', obj);
|
||||
|
@ -125,7 +125,7 @@ export default BaseService.extend({
|
|||
method: "GET"
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
obj.id = 'sp-' + obj.id;
|
||||
|
@ -156,7 +156,7 @@ export default BaseService.extend({
|
|||
|
||||
// Current folder caching
|
||||
setCurrentFolder(folder) {
|
||||
if (is.undefined(folder) || is.null(folder)) {
|
||||
if (_.isUndefined(folder) || _.isNull(folder)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -187,7 +187,7 @@ export default BaseService.extend({
|
|||
method: "GET"
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('folder', obj);
|
||||
|
|
|
@ -35,7 +35,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('group', obj);
|
||||
|
|
|
@ -26,7 +26,7 @@ export default Service.extend({
|
|||
|
||||
boot() {
|
||||
return new EmberPromise((resolve, reject) => {
|
||||
if (is.not.undefined(this.get('keycloak')) && is.not.null(this.get('keycloak')) ) {
|
||||
if (!_.isUndefined(this.get('keycloak')) && !_.isNull(this.get('keycloak')) ) {
|
||||
resolve(this.get('keycloak'));
|
||||
return;
|
||||
}
|
||||
|
@ -94,12 +94,12 @@ export default Service.extend({
|
|||
return {
|
||||
domain: '',
|
||||
token: this.get('keycloak').token,
|
||||
remoteId: is.null(profile.id) || is.undefined(profile.id) ? profile.email: profile.id,
|
||||
email: is.null(profile.email) || is.undefined(profile.email) ? '': profile.email,
|
||||
username: is.null(profile.username) || is.undefined(profile.username) ? '': profile.username,
|
||||
firstname: is.null(profile.firstName) || is.undefined(profile.firstName) ? profile.username: profile.firstName,
|
||||
lastname: is.null(profile.lastName) || is.undefined(profile.lastName) ? profile.username: profile.lastName,
|
||||
enabled: is.null(profile.enabled) || is.undefined(profile.enabled) ? true: profile.enabled
|
||||
remoteId: _.isNull(profile.id) || _.isUndefined(profile.id) ? profile.email: profile.id,
|
||||
email: _.isNull(profile.email) || _.isUndefined(profile.email) ? '': profile.email,
|
||||
username: _.isNull(profile.username) || _.isUndefined(profile.username) ? '': profile.username,
|
||||
firstname: _.isNull(profile.firstName) || _.isUndefined(profile.firstName) ? profile.username: profile.firstName,
|
||||
lastname: _.isNull(profile.lastName) || _.isUndefined(profile.lastName) ? profile.username: profile.lastName,
|
||||
enabled: _.isNull(profile.enabled) || _.isUndefined(profile.enabled) ? true: profile.enabled
|
||||
};
|
||||
}
|
||||
});
|
||||
|
|
|
@ -34,7 +34,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.null(response)) response = [];
|
||||
if (_.isNull(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('label', obj);
|
||||
|
|
|
@ -84,7 +84,7 @@ export default Service.extend(Notifier, {
|
|||
documentId: a.attributes["data-link-target-document-id"].value,
|
||||
spaceId: a.attributes["data-link-space-id"].value,
|
||||
targetId: a.attributes["data-link-target-id"].value,
|
||||
externalId: is.undefined(a.attributes["data-link-external-id"]) ? '' : a.attributes["data-link-external-id"].value,
|
||||
externalId: _.isUndefined(a.attributes["data-link-external-id"]) ? '' : a.attributes["data-link-external-id"].value,
|
||||
url: a.attributes["href"].value,
|
||||
orphan: false
|
||||
};
|
||||
|
@ -111,8 +111,8 @@ export default Service.extend(Notifier, {
|
|||
let router = this.get('router');
|
||||
let targetFolder = this.get('store').peekRecord('folder', link.spaceId);
|
||||
let targetDocument = this.get('store').peekRecord('document', link.documentId);
|
||||
let folderSlug = is.null(targetFolder) ? "s" : targetFolder.get('slug');
|
||||
let documentSlug = is.null(targetDocument) ? "d" : targetDocument.get('slug');
|
||||
let folderSlug = _.isNull(targetFolder) ? "s" : targetFolder.get('slug');
|
||||
let documentSlug = _.isNull(targetDocument) ? "d" : targetDocument.get('slug');
|
||||
|
||||
// handle section link
|
||||
if (link.linkType === "section" || link.linkType === "tab") {
|
||||
|
|
|
@ -39,7 +39,7 @@ export default Service.extend({
|
|||
return this.get('ajax').request(`pin/${userId}`, {
|
||||
method: 'GET'
|
||||
}).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
let pins = ArrayProxy.create({ content: A([]) });
|
||||
|
||||
pins = response.map((pin) => {
|
||||
|
@ -93,7 +93,7 @@ export default Service.extend({
|
|||
method: 'POST',
|
||||
data: JSON.stringify(data)
|
||||
}).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
let pins = ArrayProxy.create({
|
||||
content: A([])
|
||||
|
|
|
@ -25,7 +25,7 @@ export default Service.extend({
|
|||
data: JSON.stringify(payload),
|
||||
contentType: 'json'
|
||||
}).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
let results = ArrayProxy.create({
|
||||
content: A([])
|
||||
|
|
|
@ -24,7 +24,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('section', obj);
|
||||
|
@ -70,9 +70,9 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let pages = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
if (is.not.null(response) && is.array(response) && response.length > 0) {
|
||||
if (!_.isNull(response) && _.isArray(response) && response.length > 0) {
|
||||
pages = response.map((page) => {
|
||||
let data = this.get('store').normalize('page', page);
|
||||
return this.get('store').push(data);
|
||||
|
@ -119,7 +119,7 @@ export default BaseService.extend({
|
|||
method: 'GET'
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('block', obj);
|
||||
|
|
|
@ -23,13 +23,11 @@ export default SimpleAuthSession.extend({
|
|||
localStorage: service(),
|
||||
folderPermissions: null,
|
||||
currentFolder: null,
|
||||
isMac: false,
|
||||
isMobile: false,
|
||||
|
||||
secureToken: '',
|
||||
hasSecureToken: computed('secureToken', function () {
|
||||
let st = this.get('secureToken');
|
||||
return is.not.null(st) && is.not.undefined(st) && st.length > 0;
|
||||
return !_.isNull(st) && !_.isUndefined(st) && st.length > 0;
|
||||
}),
|
||||
|
||||
hasAccounts: computed('isAuthenticated', 'session.content.authenticated.user', function () {
|
||||
|
@ -51,7 +49,7 @@ export default SimpleAuthSession.extend({
|
|||
}),
|
||||
|
||||
authenticated: computed('session.content.authenticated.user', function () {
|
||||
if (is.null(this.get('session.authenticator')) || this.get('appMeta.secureMode')) return false;
|
||||
if (_.isNull(this.get('session.authenticator')) || this.get('appMeta.secureMode')) return false;
|
||||
return this.get('session.authenticator') !== 'authenticator:anonymous' && this.get('session.content.authenticated.user.id') !== '0';
|
||||
}),
|
||||
|
||||
|
@ -92,7 +90,7 @@ export default SimpleAuthSession.extend({
|
|||
}),
|
||||
|
||||
authToken: computed('session.content.authenticated.user', function () {
|
||||
if (is.null(this.get('session.authenticator')) ||
|
||||
if (_.isNull(this.get('session.authenticator')) ||
|
||||
this.get('appMeta.secureMode')) return '';
|
||||
|
||||
if (this.get('session.authenticator') === 'authenticator:anonymous' ||
|
||||
|
@ -103,9 +101,6 @@ export default SimpleAuthSession.extend({
|
|||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
this.set('isMac', is.mac());
|
||||
this.set('isMobile', is.mobile());
|
||||
},
|
||||
|
||||
logout() {
|
||||
|
|
|
@ -34,7 +34,7 @@ export default Service.extend({
|
|||
return this.get('ajax').request(`templates/${folderId}`, {
|
||||
method: 'GET'
|
||||
}).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
let templates = ArrayProxy.create({
|
||||
content: A([])
|
||||
|
|
|
@ -56,7 +56,7 @@ export default Service.extend({
|
|||
// Returns all active users for organization.
|
||||
getAll() {
|
||||
return this.get('ajax').request(`users?active=1`).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
return response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
@ -71,10 +71,10 @@ export default Service.extend({
|
|||
getComplete(filter, limit) {
|
||||
filter = filter.trim();
|
||||
if (filter.length > 0) filter = encodeURIComponent(filter);
|
||||
if (is.null(limit) || is.undefined(limit)) limit = 100;
|
||||
if (_.isNull(limit) || _.isUndefined(limit)) limit = 100;
|
||||
|
||||
return this.get('ajax').request(`users?active=0&filter=${filter}&limit=${limit}`).then((response) => {
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
return response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
@ -91,7 +91,7 @@ export default Service.extend({
|
|||
method: "GET"
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
@ -170,7 +170,7 @@ export default Service.extend({
|
|||
|
||||
// matchUsers on firstname, lastname, email
|
||||
matchUsers(text, limit) {
|
||||
if (is.null(limit) || is.undefined(limit)) limit = 100;
|
||||
if (_.isNull(limit) || _.isUndefined(limit)) limit = 100;
|
||||
|
||||
return this.get('ajax').request(`users/match?limit=${limit}`, {
|
||||
method: 'POST',
|
||||
|
@ -179,7 +179,7 @@ export default Service.extend({
|
|||
data: text
|
||||
}).then((response) => {
|
||||
let data = [];
|
||||
if (is.not.array(response)) response = [];
|
||||
if (!_.isArray(response)) response = [];
|
||||
|
||||
data = response.map((obj) => {
|
||||
let data = this.get('store').normalize('user', obj);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
// https://documize.com
|
||||
|
||||
function getSubdomain() {
|
||||
if (is.ipv4(window.location.host)) {
|
||||
if (isIPv4(window.location.host)) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@ function getAppUrl(domain) {
|
|||
|
||||
let leftOvers = parts.join(".");
|
||||
|
||||
if (is.empty(domain)) {
|
||||
if (_.isEmpty(domain)) {
|
||||
domain = "";
|
||||
} else {
|
||||
domain = domain + ".";
|
||||
|
@ -82,10 +82,16 @@ function isInvalidLicenseError(reason) {
|
|||
return false;
|
||||
}
|
||||
|
||||
function isIPv4(ip) {
|
||||
var re = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
||||
return re.test(ip);
|
||||
}
|
||||
|
||||
export default {
|
||||
getSubdomain,
|
||||
getAppUrl,
|
||||
isAjaxAccessError,
|
||||
isAjaxNotFoundError,
|
||||
isInvalidLicenseError,
|
||||
isIPv4,
|
||||
};
|
||||
|
|
|
@ -40,10 +40,16 @@ function anonUserId() {
|
|||
return 'anon_' + makeId(11);
|
||||
}
|
||||
|
||||
function isEmail(email) {
|
||||
var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
||||
return re.test(email);
|
||||
}
|
||||
|
||||
export default {
|
||||
makeSlug,
|
||||
makeId,
|
||||
endsWith,
|
||||
anonUserId
|
||||
anonUserId,
|
||||
isEmail
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ function getState(toc, page) {
|
|||
pageId: ''
|
||||
};
|
||||
|
||||
if (is.undefined(page)) {
|
||||
if (_.isUndefined(page)) {
|
||||
return state;
|
||||
}
|
||||
|
||||
|
@ -109,8 +109,8 @@ function getState(toc, page) {
|
|||
state.indentDisabled = !state.tocTools.allowIndent;
|
||||
state.outdentDisabled = !state.tocTools.allowOutdent;
|
||||
|
||||
state.actionablePage = is.not.empty(state.tocTools.upTarget) ||
|
||||
is.not.empty(state.tocTools.downTarget) ||
|
||||
state.actionablePage = !_.isEmpty(state.tocTools.upTarget) ||
|
||||
!_.isEmpty(state.tocTools.downTarget) ||
|
||||
state.tocTools.allowIndent || state.tocTools.allowOutdent;
|
||||
|
||||
return state;
|
||||
|
@ -122,20 +122,20 @@ function moveUp(state, pages, current) {
|
|||
var page2 = null;
|
||||
var pendingChanges = [];
|
||||
|
||||
if (is.not.undefined(page1)) page1 = page1.get('page');
|
||||
if (!_.isUndefined(page1)) page1 = page1.get('page');
|
||||
|
||||
if (is.undefined(current) || is.undefined(page1)) {
|
||||
if (_.isUndefined(current) || _.isUndefined(page1)) {
|
||||
return pendingChanges;
|
||||
}
|
||||
|
||||
var index1 = _.findIndex(pages, function(i) { return i.get('page.id') === page1.get('id'); });
|
||||
|
||||
if (index1 !== -1) {
|
||||
if (is.not.undefined(pages[index1 - 1])) page2 = pages[index1 - 1].get('page');
|
||||
if (!_.isUndefined(pages[index1 - 1])) page2 = pages[index1 - 1].get('page');
|
||||
}
|
||||
|
||||
var sequence1 = page1.get('sequence');
|
||||
var sequence2 = is.not.null(page2) && is.not.undefined(page2) ? page2.get('sequence') : 0;
|
||||
var sequence2 = !_.isNull(page2) && !_.isUndefined(page2) ? page2.get('sequence') : 0;
|
||||
var index = _.findIndex(pages, function(i) { return i.get('page.id') === current.get('id'); });
|
||||
|
||||
if (index !== -1) {
|
||||
|
@ -167,7 +167,7 @@ function moveUp(state, pages, current) {
|
|||
function moveDown(state, pages, current) {
|
||||
var pageIndex = _.findIndex(pages, function(i) { return i.get('page.id') === current.get('id'); });
|
||||
var downTarget = _.find(pages, function(i) { return i.get('page.id') === state.tocTools.downTarget; });
|
||||
if (is.not.undefined(downTarget)) downTarget = downTarget.get('page');
|
||||
if (!_.isUndefined(downTarget)) downTarget = downTarget.get('page');
|
||||
|
||||
var downTargetIndex = _.findIndex(pages, function(i) { return i.get('page.id') === downTarget.get('id'); });
|
||||
var pendingChanges = [];
|
||||
|
@ -188,9 +188,9 @@ function moveDown(state, pages, current) {
|
|||
var belowThisGuyIndex = _.findIndex(pages, function(i) { return i.get('page.id') === aboveThisGuy.get('id'); })
|
||||
var belowThisGuy = pages[belowThisGuyIndex - 1];
|
||||
|
||||
if (is.not.null(belowThisGuy)) belowThisGuy = belowThisGuy.get('page');
|
||||
if (!_.isNull(belowThisGuy)) belowThisGuy = belowThisGuy.get('page');
|
||||
|
||||
if (is.not.null(belowThisGuy) && belowThisGuy.get('level') > current.get('level')) {
|
||||
if (!_.isNull(belowThisGuy) && belowThisGuy.get('level') > current.get('level')) {
|
||||
startingSequence = (aboveThisGuy.get('sequence') + belowThisGuy.get('sequence')) / 2;
|
||||
upperSequence = aboveThisGuy.get('sequence');
|
||||
} else {
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
'use strict';
|
||||
|
||||
const browsers = [
|
||||
'last 1 Chrome versions',
|
||||
'last 1 Firefox versions',
|
||||
'last 1 Safari versions'
|
||||
'last 2 Edge versions',
|
||||
'last 1 Chrome versions',
|
||||
'last 1 Firefox versions',
|
||||
'last 1 Safari versions'
|
||||
];
|
||||
|
||||
const isCI = !!process.env.CI;
|
||||
const isProduction = process.env.EMBER_ENV === 'production';
|
||||
// const isCI = !!process.env.CI;
|
||||
// const isProduction = process.env.EMBER_ENV === 'production';
|
||||
|
||||
if (isCI || isProduction) {
|
||||
browsers.push('ie 11');
|
||||
}
|
||||
// if (isCI || isProduction) {
|
||||
// browsers.push('ie 11');
|
||||
// }
|
||||
|
||||
module.exports = {
|
||||
browsers
|
||||
browsers
|
||||
};
|
||||
|
|
|
@ -2,10 +2,15 @@
|
|||
|
||||
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
|
||||
var isDevelopment = EmberApp.env() === 'development';
|
||||
var nodeSass = require('node-sass');
|
||||
// var isTest = EmberApp.env() === 'test';
|
||||
|
||||
module.exports = function (defaults) {
|
||||
var app = new EmberApp(defaults, {
|
||||
sassOptions: {
|
||||
implementation: nodeSass
|
||||
},
|
||||
|
||||
fingerprint: {
|
||||
enabled: true,
|
||||
generateAssetMap: true,
|
||||
|
@ -59,6 +64,7 @@ module.exports = function (defaults) {
|
|||
app.import('vendor/is.js');
|
||||
app.import('vendor/iziToast.js');
|
||||
app.import('vendor/keycloak.js');
|
||||
app.import('vendor/lodash.js');
|
||||
app.import('vendor/markdown-it.min.js');
|
||||
app.import('vendor/md5.js');
|
||||
app.import('vendor/moment.js');
|
||||
|
@ -68,7 +74,6 @@ module.exports = function (defaults) {
|
|||
app.import('vendor/slug.js');
|
||||
app.import('vendor/sortable.js');
|
||||
app.import('vendor/table-editor.min.js');
|
||||
app.import('vendor/underscore.js');
|
||||
app.import('vendor/codemirror.js'); // core lib
|
||||
app.import('vendor/codemirror-boot.js'); // boot-up files
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
"@ember/jquery": "^0.6.0",
|
||||
"@ember/optional-features": "^0.7.0",
|
||||
"broccoli-asset-rev": "^3.0.0",
|
||||
"ember-ajax": "^4.0.1",
|
||||
"ember-ajax": "^3.1.0",
|
||||
"ember-attacher": "^0.13.10",
|
||||
"ember-cli": "~3.8.0",
|
||||
"ember-cli-app-version": "^3.2.0",
|
||||
|
|
17107
gui/vendor/lodash.js
vendored
Normal file
17107
gui/vendor/lodash.js
vendored
Normal file
File diff suppressed because it is too large
Load diff
1692
gui/vendor/underscore.js
vendored
1692
gui/vendor/underscore.js
vendored
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue