From 0c0339c5a1c31ea98a8827f8d843b5315fee9936 Mon Sep 17 00:00:00 2001 From: Jeremie Alvin Date: Sat, 25 Jan 2025 09:09:10 +0100 Subject: [PATCH] Fix: Allow to override ExportFormat with custom enum instance --- .../actions/src/Exports/Contracts/ExportEnum.php | 14 ++++++++++++++ .../actions/src/Exports/Enums/ExportFormat.php | 3 ++- .../actions/src/Exports/Jobs/ExportCompletion.php | 6 +++--- 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 packages/actions/src/Exports/Contracts/ExportEnum.php diff --git a/packages/actions/src/Exports/Contracts/ExportEnum.php b/packages/actions/src/Exports/Contracts/ExportEnum.php new file mode 100644 index 00000000000..2d073528118 --- /dev/null +++ b/packages/actions/src/Exports/Contracts/ExportEnum.php @@ -0,0 +1,14 @@ + $columnMap - * @param array $formats + * @param array $formats * @param array $options */ public function __construct( @@ -70,7 +70,7 @@ public function handle(): void ->when( $failedRowsCount < $this->export->total_rows, fn (Notification $notification) => $notification->actions(array_map( - fn (ExportFormat $format): NotificationAction => $format->getDownloadNotificationAction($this->export), + fn (ExportEnum $format): NotificationAction => $format->getDownloadNotificationAction($this->export), $this->formats, )), )