Compare commits

...

5 Commits

Author SHA1 Message Date
zadam
d357943ebb release 0.37.3 2019-11-19 23:05:54 +01:00
zadam
07043fb177 switch search in subtree to ctrl+shift+s to stay consistent with ctrl+s 2019-11-19 23:04:43 +01:00
zadam
1f8d382b1f added "search in subtree" context menu, #534 2019-11-19 21:11:20 +01:00
zadam
61e8cbbcba add log for content hash failures 2019-11-19 19:07:14 +01:00
zadam
86c5dd6494 fix recent changes, closes #713 2019-11-19 19:02:16 +01:00
8 changed files with 26 additions and 5 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.36.5",
"version": "0.37.2",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.37.2",
"version": "0.37.3",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {

View File

@@ -142,6 +142,12 @@ async function refreshSearch() {
toastService.showMessage("Saved search note refreshed.");
}
function searchInSubtree(noteId) {
showSearch();
$searchInput.val(`@in=${noteId} @text*=*`);
}
function init() {
const hashValue = document.location.hash ? document.location.hash.substr(1) : ""; // strip initial #
@@ -178,5 +184,6 @@ export default {
refreshSearch,
doSearch,
init,
searchInSubtree,
getHelpText: () => helpText
};

View File

@@ -9,6 +9,7 @@ import hoistedNoteService from './hoisted_note.js';
import noteDetailService from './note_detail.js';
import clipboard from './clipboard.js';
import protectedSessionHolder from "./protected_session_holder.js";
import searchNotesService from "./search_notes.js";
class TreeContextMenu {
constructor(node) {
@@ -55,6 +56,8 @@ class TreeContextMenu {
{ title: "Delete <kbd>Delete</kbd>", cmd: "delete", uiIcon: "trash",
enabled: isNotRoot && !isHoisted && parentNotSearch },
{ title: "----" },
{ title: "Search in subtree <kbd>Ctrl+Shift+S</kbd>", cmd: "searchInSubtree", uiIcon: "search",
enabled: notSearch && noSelectedNotes },
isHoisted ? null : { title: "Hoist note <kbd>Ctrl-H</kbd>", cmd: "hoist", uiIcon: "empty", enabled: noSelectedNotes && notSearch },
!isHoisted || !isNotRoot ? null : { title: "Unhoist note <kbd>Ctrl-H</kbd>", cmd: "unhoist", uiIcon: "arrow-up" },
{ title: "Edit branch prefix <kbd>F2</kbd>", cmd: "editBranchPrefix", uiIcon: "empty",
@@ -177,6 +180,9 @@ class TreeContextMenu {
treeService.duplicateNote(this.node.data.noteId, branch.parentNoteId);
}
else if (cmd === "searchInSubtree") {
searchNotesService.searchInSubtree(this.node.data.noteId);
}
else {
ws.logError("Unknown command: " + cmd);
}

View File

@@ -4,6 +4,7 @@ import treeService from "./tree.js";
import hoistedNoteService from "./hoisted_note.js";
import clipboard from "./clipboard.js";
import treeCache from "./tree_cache.js";
import searchNoteService from "./search_notes.js";
const keyBindings = {
"del": node => {
@@ -167,6 +168,11 @@ const keyBindings = {
"down": node => {
node.navigate($.ui.keyCode.DOWN, true).then(treeService.clearSelectedNodes);
return false;
},
"ctrl+shift+s": node => {
searchNoteService.searchInSubtree(node.data.noteId);
return false;
}
};

View File

@@ -17,8 +17,8 @@ async function getRecentChanges() {
FROM
note_revisions
JOIN notes USING(noteId)
ORDER BY
utcDateCreated DESC
ORDER BY
note_revisions.utcDateCreated DESC
LIMIT 1000
)
UNION ALL SELECT * FROM (

View File

@@ -1 +1 @@
module.exports = { buildDate:"2019-11-18T23:04:09+01:00", buildRevision: "834e1f7253186922d2b5df2f6a01c34f7c2d7fe4" };
module.exports = { buildDate:"2019-11-19T23:05:54+01:00", buildRevision: "07043fb177afb9d754428a410b3019d53d7b6fa0" };

View File

@@ -56,6 +56,8 @@ async function checkContentHashes(otherHashes) {
if (hashes[key] !== otherHashes[key]) {
allChecksPassed = false;
log.info(`Content hash check for ${key} FAILED. Local is ${hashes[key]}, remote is ${otherHashes[key]}`);
if (key !== 'recent_notes') {
// let's not get alarmed about recent notes which get updated often and can cause failures in race conditions
ws.sendMessageToAllClients({type: 'sync-hash-check-failed'});