Skip to content

Commit 7887474

Browse files
committed
feat: add filament confirmation modal to start import action
1 parent 3ff6332 commit 7887474

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

app-modules/ImportWizard/resources/views/livewire/partials/step-preview.blade.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,5 @@
1616
{{-- Navigation buttons outside nested component --}}
1717
<div class="flex justify-between pt-4 border-t border-gray-200 dark:border-gray-700">
1818
<x-filament::button wire:click="previousStep" color="gray">Back</x-filament::button>
19-
<x-filament::button wire:click="executeImport">
20-
Start Import
21-
</x-filament::button>
19+
{{ $this->startImportAction }}
2220
</div>

app-modules/ImportWizard/src/Livewire/ImportWizard.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,21 @@ private function prepareForPreview(): void
224224
$this->generateImportPreview();
225225
}
226226

227+
/**
228+
* Start import action with confirmation modal.
229+
*/
230+
public function startImportAction(): Action
231+
{
232+
return Action::make('startImport')
233+
->label('Start Import')
234+
->icon(Heroicon::OutlinedArrowUpTray)
235+
->requiresConfirmation()
236+
->modalHeading('Confirm Import')
237+
->modalDescription('Are you sure you want to start this import? This action cannot be undone.')
238+
->modalSubmitActionLabel('Start Import')
239+
->action(fn () => $this->executeImport());
240+
}
241+
227242
/**
228243
* Execute the import.
229244
*/

0 commit comments

Comments
 (0)