From cc4d04416b43fc83fd5186210b9e11192e951ccd Mon Sep 17 00:00:00 2001 From: zadam Date: Sun, 14 Feb 2021 21:35:13 +0100 Subject: [PATCH] added "delete note revisions" search action --- package-lock.json | 20 ++++++------- package.json | 4 +-- .../search_actions/delete_note_revisions.js | 28 +++++++++++++++++++ .../search_definition.js | 4 +++ src/routes/api/search.js | 6 +++- src/services/note_revisions.js | 2 ++ 6 files changed, 51 insertions(+), 13 deletions(-) create mode 100644 src/public/app/widgets/search_actions/delete_note_revisions.js diff --git a/package-lock.json b/package-lock.json index 4c8891139..a972b2b38 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "trilium", - "version": "0.45.9", + "version": "0.45.10", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2712,9 +2712,9 @@ } }, "electron-dl": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-3.0.2.tgz", - "integrity": "sha512-pRgE9Jbhoo5z6Vk3qi+vIrfpMDlCp2oB1UeR96SMnsfz073jj0AZGQwp69EdIcEvlUlwBSGyJK8Jt6OB6JLn+g==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/electron-dl/-/electron-dl-3.0.3.tgz", + "integrity": "sha512-eh1zDc+cffWQ0wVjZj7YGSq5qSYsD2vxIeojJt2hoV0/2fOlLv57pqeRkVfrDrocVYRwAytphctunTXRKj1GmA==", "requires": { "ext-name": "^5.0.0", "pupa": "^2.0.1", @@ -5180,9 +5180,9 @@ "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" }, "mime-db": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==" + "version": "1.46.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", + "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==" }, "mime-types": { "version": "2.1.28", @@ -5656,9 +5656,9 @@ } }, "open": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-7.4.0.tgz", - "integrity": "sha512-PGoBCX/lclIWlpS/R2PQuIR4NJoXh6X5AwVzE7WXnWRGvHg7+4TBCgsujUgiPpm0K1y4qvQeWnCWVTpTKZBtvA==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/open/-/open-7.4.1.tgz", + "integrity": "sha512-Pxv+fKRsd/Ozflgn2Gjev1HZveJJeKR6hKKmdaImJMuEZ6htAvCTbcMABJo+qevlAelTLCrEK3YTKZ9fVTcSPw==", "requires": { "is-docker": "^2.0.0", "is-wsl": "^2.1.1" diff --git a/package.json b/package.json index 67eb7f1cc..307f0484c 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "dayjs": "1.10.4", "ejs": "3.1.6", "electron-debug": "3.2.0", - "electron-dl": "3.0.2", + "electron-dl": "3.0.3", "electron-find": "1.0.6", "electron-window-state": "5.0.3", "express": "4.17.1", @@ -55,7 +55,7 @@ "mime-types": "2.1.28", "multer": "1.4.2", "node-abi": "2.19.3", - "open": "7.4.0", + "open": "7.4.1", "portscanner": "2.2.0", "rand-token": "1.0.1", "request": "^2.88.2", diff --git a/src/public/app/widgets/search_actions/delete_note_revisions.js b/src/public/app/widgets/search_actions/delete_note_revisions.js new file mode 100644 index 000000000..00e06c179 --- /dev/null +++ b/src/public/app/widgets/search_actions/delete_note_revisions.js @@ -0,0 +1,28 @@ +import AbstractSearchAction from "./abstract_search_action.js"; + +const TPL = ` + + + + + Delete note revisions + + + + + + +`; + +export default class DeleteNoteRevisionsSearchAction extends AbstractSearchAction { + static get actionName() { return "deleteNoteRevisions"; } + + doRender() { + return $(TPL); + } +} diff --git a/src/public/app/widgets/type_property_widgets/search_definition.js b/src/public/app/widgets/type_property_widgets/search_definition.js index 66c64d6b4..4b32be49d 100644 --- a/src/public/app/widgets/type_property_widgets/search_definition.js +++ b/src/public/app/widgets/type_property_widgets/search_definition.js @@ -19,6 +19,7 @@ import IncludeArchivedNotes from "../search_options/include_archived_notes.js"; import OrderBy from "../search_options/order_by.js"; import SearchScript from "../search_options/search_script.js"; import Limit from "../search_options/limit.js"; +import DeleteNoteRevisionsSearchAction from "../search_actions/delete_note_revisions.js"; const TPL = `
@@ -120,6 +121,8 @@ const TPL = `