added "delete note revisions" search action

This commit is contained in:
zadam
2021-02-14 21:35:13 +01:00
parent 66c5606d46
commit cc4d04416b
6 changed files with 51 additions and 13 deletions

View File

@@ -0,0 +1,28 @@
import AbstractSearchAction from "./abstract_search_action.js";
const TPL = `
<tr>
<td colspan="2">
<span class="bx bx-trash"></span>
Delete note revisions
</td>
<td class="button-column">
<div class="dropdown help-dropdown">
<span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span>
<div class="dropdown-menu dropdown-menu-right p-4">
All past note revisions of matched notes will be deleted. Note itself will be fully preserved. In other terms, note's history will be removed.
</div>
</div>
<span class="bx bx-x icon-action action-conf-del"></span>
</td>
</tr>`;
export default class DeleteNoteRevisionsSearchAction extends AbstractSearchAction {
static get actionName() { return "deleteNoteRevisions"; }
doRender() {
return $(TPL);
}
}

View File

@@ -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 = `
<div class="search-definition-widget">
@@ -120,6 +121,8 @@ const TPL = `
<div class="dropdown-menu">
<a class="dropdown-item" href="#" data-action-add="deleteNote">
Delete note</a>
<a class="dropdown-item" href="#" data-action-add="deleteNoteRevisions">
Delete note revisions</a>
<a class="dropdown-item" href="#" data-action-add="deleteLabel">
Delete label</a>
<a class="dropdown-item" href="#" data-action-add="deleteRelation">
@@ -177,6 +180,7 @@ const ACTION_CLASSES = {};
for (const clazz of [
DeleteNoteSearchAction,
DeleteNoteRevisionsSearchAction,
DeleteLabelSearchAction,
DeleteRelationSearchAction,
RenameLabelSearchAction,