mirror of
https://github.com/documize/community.git
synced 2025-08-02 20:15:26 +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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue