Applied style rules to genocide all \t characters

This commit is contained in:
Stefan Zermatten
2022-10-09 16:01:36 +02:00
parent de598c70a7
commit 2fa913b09a
208 changed files with 6027 additions and 5801 deletions

View File

@@ -4,13 +4,13 @@ import { RateLimiterMixin } from 'ddp-rate-limiter-mixin';
import LibraryNodes from '/imports/api/library/LibraryNodes.js';
import { assertDocEditPermission } from '/imports/api/sharing/sharingPermissions.js';
import {
setLineageOfDocs,
renewDocIds
setLineageOfDocs,
renewDocIds
} from '/imports/api/parenting/parenting.js';
import { reorderDocs } from '/imports/api/parenting/order.js';
var snackbar;
if (Meteor.isClient){
if (Meteor.isClient) {
snackbar = require(
'/imports/ui/components/snackbars/SnackbarQueue.js'
).snackbar
@@ -20,7 +20,7 @@ const DUPLICATE_CHILDREN_LIMIT = 50;
const duplicateLibraryNode = new ValidatedMethod({
name: 'libraryNodes.duplicate',
validate: new SimpleSchema({
validate: new SimpleSchema({
_id: {
type: String,
regEx: SimpleSchema.RegEx.Id,
@@ -31,7 +31,7 @@ const duplicateLibraryNode = new ValidatedMethod({
numRequests: 5,
timeInterval: 5000,
},
run({_id}) {
run({ _id }) {
let libraryNode = LibraryNodes.findOne(_id);
assertDocEditPermission(libraryNode, this.userId);
@@ -40,16 +40,16 @@ const duplicateLibraryNode = new ValidatedMethod({
libraryNode._id = libraryNodeId;
let nodes = LibraryNodes.find({
'ancestors.id': _id,
removed: {$ne: true},
}, {
'ancestors.id': _id,
removed: { $ne: true },
}, {
limit: DUPLICATE_CHILDREN_LIMIT + 1,
sort: {order: 1},
sort: { order: 1 },
}).fetch();
if (nodes.length > DUPLICATE_CHILDREN_LIMIT){
if (nodes.length > DUPLICATE_CHILDREN_LIMIT) {
nodes.pop();
if (Meteor.isClient){
if (Meteor.isClient) {
snackbar({
text: `Only the first ${DUPLICATE_CHILDREN_LIMIT} children were duplicated`,
});
@@ -58,21 +58,21 @@ const duplicateLibraryNode = new ValidatedMethod({
// re-map all the ancestors
setLineageOfDocs({
docArray: nodes,
newAncestry : [
docArray: nodes,
newAncestry: [
...libraryNode.ancestors,
{id: libraryNodeId, collection: 'libraryNodes'}
{ id: libraryNodeId, collection: 'libraryNodes' }
],
oldParent : {id: _id, collection: 'libraryNodes'},
});
oldParent: { id: _id, collection: 'libraryNodes' },
});
// Give the docs new IDs without breaking internal references
renewDocIds({docArray: nodes});
renewDocIds({ docArray: nodes });
// Order the root node
libraryNode.order += 0.5;
LibraryNodes.batchInsert([libraryNode, ...nodes]);
LibraryNodes.batchInsert([libraryNode, ...nodes]);
// Tree structure changed by inserts, reorder the tree
reorderDocs({