mirror of
https://github.com/zadam/trilium.git
synced 2025-11-08 14:25:51 +01:00
fix(react/bulk_actions): delete button not working
This commit is contained in:
@@ -1,12 +1,14 @@
|
|||||||
import { ComponentChildren } from "preact";
|
import { ComponentChildren } from "preact";
|
||||||
|
import AbstractBulkAction from "./abstract_bulk_action";
|
||||||
|
|
||||||
interface BulkActionProps {
|
interface BulkActionProps {
|
||||||
label: string;
|
label: string;
|
||||||
children: ComponentChildren;
|
children: ComponentChildren;
|
||||||
helpText?: ComponentChildren;
|
helpText?: ComponentChildren;
|
||||||
|
bulkAction: AbstractBulkAction;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function BulkAction({ label, children, helpText }: BulkActionProps) {
|
export default function BulkAction({ label, children, helpText, bulkAction }: BulkActionProps) {
|
||||||
return (
|
return (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={2}>
|
<td colSpan={2}>
|
||||||
@@ -24,7 +26,10 @@ export default function BulkAction({ label, children, helpText }: BulkActionProp
|
|||||||
</div>
|
</div>
|
||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
<span className="bx bx-x icon-action action-conf-del"></span>
|
<span
|
||||||
|
className="bx bx-x icon-action action-conf-del"
|
||||||
|
onClick={() => bulkAction?.deleteAction()}
|
||||||
|
/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ function AddLabelBulkActionComponent({ bulkAction, actionDef }: { bulkAction: Ab
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<BulkAction
|
<BulkAction
|
||||||
|
bulkAction={bulkAction}
|
||||||
label={t("add_label.add_label")}
|
label={t("add_label.add_label")}
|
||||||
helpText={<>
|
helpText={<>
|
||||||
<p>{t("add_label.help_text")}</p>
|
<p>{t("add_label.help_text")}</p>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ function DeleteLabelBulkActionComponent({ bulkAction, actionDef }: { bulkAction:
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<BulkAction
|
<BulkAction
|
||||||
|
bulkAction={bulkAction}
|
||||||
label={t("delete_label.delete_label")}
|
label={t("delete_label.delete_label")}
|
||||||
>
|
>
|
||||||
<FormTextBox
|
<FormTextBox
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ function RenameLabelBulkActionComponent({ bulkAction, actionDef }: { bulkAction:
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<BulkAction
|
<BulkAction
|
||||||
|
bulkAction={bulkAction}
|
||||||
label={t("rename_label.rename_label_from")}
|
label={t("rename_label.rename_label_from")}
|
||||||
>
|
>
|
||||||
<FormTextBox
|
<FormTextBox
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ function UpdateLabelValueComponent({ bulkAction, actionDef }: { bulkAction: Abst
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<BulkAction
|
<BulkAction
|
||||||
|
bulkAction={bulkAction}
|
||||||
label={t("update_label_value.update_label_value")}
|
label={t("update_label_value.update_label_value")}
|
||||||
helpText={<>
|
helpText={<>
|
||||||
<p>${t("update_label_value.help_text")}</p>
|
<p>${t("update_label_value.help_text")}</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user