fix(react/bulk_actions): delete button not working

This commit is contained in:
Elian Doran
2025-08-09 10:12:26 +03:00
parent 54f9ce87f9
commit 40c7ad4b46
5 changed files with 11 additions and 2 deletions

View File

@@ -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>
); );

View File

@@ -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>

View File

@@ -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

View File

@@ -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

View File

@@ -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>