Merge branch 'next58'

# Conflicts:
#	src/public/app/widgets/note_tree.js
#	src/services/tree.js
This commit is contained in:
zadam
2022-12-14 23:48:58 +01:00
257 changed files with 5132 additions and 3384 deletions

View File

@@ -11,7 +11,6 @@ const NoteRevision = require("./note_revision");
const TaskContext = require("../../services/task_context");
const dayjs = require("dayjs");
const utc = require('dayjs/plugin/utc');
const searchService = require("../../services/search/services/search.js");
dayjs.extend(utc)
const LABEL = 'label';
@@ -73,6 +72,8 @@ class Note extends AbstractEntity {
this.utcDateCreated = utcDateCreated || dateUtils.utcNowDateTime();
/** @type {string} */
this.utcDateModified = utcDateModified;
/** @type {boolean} - set during the deletion operation, before it is completed (removed from becca completely) */
this.isBeingDeleted = false;
// ------ Derived attributes ------
@@ -155,6 +156,15 @@ class Note extends AbstractEntity {
return this.parentBranches;
}
/**
* Returns <i>strong</i> (as opposed to <i>weak</i>) parent branches. See isWeak for details.
*
* @returns {Branch[]}
*/
getStrongParentBranches() {
return this.getParentBranches().filter(branch => !branch.isWeak);
}
/**
* @returns {Branch[]}
* @deprecated use getParentBranches() instead
@@ -1319,8 +1329,16 @@ class Note extends AbstractEntity {
}
}
isLaunchBarConfig() {
return this.type === 'launcher' || ['lbRoot', 'lbAvailableLaunchers', 'lbVisibleLaunchers'].includes(this.noteId);
}
isOptions() {
return this.noteId.startsWith("options");
}
get isDeleted() {
return !(this.noteId in this.becca.notes);
return !(this.noteId in this.becca.notes) || this.isBeingDeleted;
}
/**