mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	feat(react/bulk_actions): port delete revisions
This commit is contained in:
		| @@ -9,11 +9,11 @@ function DeleteNoteBulkActionComponent({ bulkAction }: { bulkAction: AbstractBul | |||||||
|             bulkAction={bulkAction} |             bulkAction={bulkAction} | ||||||
|             label={<><Icon icon="bx bx-trash" /> {t("delete_note.delete_matched_notes")}</>} |             label={<><Icon icon="bx bx-trash" /> {t("delete_note.delete_matched_notes")}</>} | ||||||
|             helpText={<> |             helpText={<> | ||||||
|                 <p>${t("delete_note.delete_matched_notes_description")}</p> |                 <p>{t("delete_note.delete_matched_notes_description")}</p> | ||||||
|  |  | ||||||
|                 <p>${t("delete_note.undelete_notes_instruction")}</p> |                 <p>{t("delete_note.undelete_notes_instruction")}</p> | ||||||
|  |  | ||||||
|                 ${t("delete_note.erase_notes_instruction")} |                 {t("delete_note.erase_notes_instruction")} | ||||||
|             </>} |             </>} | ||||||
|         /> |         /> | ||||||
|     ); |     ); | ||||||
|   | |||||||
| @@ -1,32 +0,0 @@ | |||||||
| import { t } from "../../../services/i18n.js"; |  | ||||||
| import AbstractBulkAction from "../abstract_bulk_action.js"; |  | ||||||
|  |  | ||||||
| const TPL = /*html*/` |  | ||||||
| <tr> |  | ||||||
|     <td colspan="2"> |  | ||||||
|         <span class="bx bx-trash"></span> |  | ||||||
|         ${t("delete_revisions.delete_note_revisions")} |  | ||||||
|     </td> |  | ||||||
|     <td class="button-column"> |  | ||||||
|         <div class="dropdown help-dropdown"> |  | ||||||
|             <span class="bx bx-help-circle icon-action" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span> |  | ||||||
|             <div class="dropdown-menu dropdown-menu-right p-4"> |  | ||||||
|                 ${t("delete_revisions.all_past_note_revisions")} |  | ||||||
|             </div> |  | ||||||
|         </div> |  | ||||||
|         <span class="bx bx-x icon-action action-conf-del"></span> |  | ||||||
|     </td> |  | ||||||
| </tr>`; |  | ||||||
|  |  | ||||||
| export default class DeleteRevisionsBulkAction extends AbstractBulkAction { |  | ||||||
|     static get actionName() { |  | ||||||
|         return "deleteRevisions"; |  | ||||||
|     } |  | ||||||
|     static get actionTitle() { |  | ||||||
|         return t("delete_revisions.delete_note_revisions"); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     doRender() { |  | ||||||
|         return $(TPL); |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @@ -0,0 +1,28 @@ | |||||||
|  | import { t } from "../../../services/i18n.js"; | ||||||
|  | import Icon from "../../react/Icon.jsx"; | ||||||
|  | import AbstractBulkAction from "../abstract_bulk_action.js"; | ||||||
|  | import BulkAction from "../BulkAction.jsx"; | ||||||
|  |  | ||||||
|  | function DeleteRevisionsBulkActionComponent({ bulkAction }: { bulkAction: AbstractBulkAction }) { | ||||||
|  |     return ( | ||||||
|  |         <BulkAction | ||||||
|  |             bulkAction={bulkAction} | ||||||
|  |             label={<><Icon icon="bx bx-trash" /> {t("delete_revisions.delete_note_revisions")}</>} | ||||||
|  |             helpText={t("delete_revisions.all_past_note_revisions")} | ||||||
|  |         /> | ||||||
|  |     ) | ||||||
|  | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | export default class DeleteRevisionsBulkAction extends AbstractBulkAction { | ||||||
|  |     static get actionName() { | ||||||
|  |         return "deleteRevisions"; | ||||||
|  |     } | ||||||
|  |     static get actionTitle() { | ||||||
|  |         return t("delete_revisions.delete_note_revisions"); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     doRender() { | ||||||
|  |         return <DeleteRevisionsBulkActionComponent bulkAction={this} /> | ||||||
|  |     } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user