|
@@ -666,7 +666,12 @@ class Record extends Component
|
|
|
|
|
|
|
|
public function exportWithDateRange()
|
|
public function exportWithDateRange()
|
|
|
{
|
|
{
|
|
|
- // Real-time validation for email fields
|
|
|
|
|
|
|
+
|
|
|
|
|
+ $this->isExporting = true;
|
|
|
|
|
+ $this->emit('$refresh'); // This forces Livewire to re-render
|
|
|
|
|
+
|
|
|
|
|
+ // Add a small delay to allow the view to update
|
|
|
|
|
+ usleep(100000);
|
|
|
if ($this->sendViaEmail) {
|
|
if ($this->sendViaEmail) {
|
|
|
$this->validate([
|
|
$this->validate([
|
|
|
'exportEmailAddress' => 'required|email',
|
|
'exportEmailAddress' => 'required|email',
|
|
@@ -689,7 +694,7 @@ class Record extends Component
|
|
|
}
|
|
}
|
|
|
} catch (\Illuminate\Validation\ValidationException $e) {
|
|
} catch (\Illuminate\Validation\ValidationException $e) {
|
|
|
$this->isExporting = false;
|
|
$this->isExporting = false;
|
|
|
- throw $e; // Re-throw validation exceptions to show field errors
|
|
|
|
|
|
|
+ throw $e;
|
|
|
} catch (\Exception $e) {
|
|
} catch (\Exception $e) {
|
|
|
$this->isExporting = false;
|
|
$this->isExporting = false;
|
|
|
Log::error('Export error: ' . $e->getMessage());
|
|
Log::error('Export error: ' . $e->getMessage());
|
|
@@ -701,6 +706,7 @@ class Record extends Component
|
|
|
}
|
|
}
|
|
|
} finally {
|
|
} finally {
|
|
|
$this->isExporting = false;
|
|
$this->isExporting = false;
|
|
|
|
|
+ $this->emit('export-complete');
|
|
|
$this->emit('hide-export-modal');
|
|
$this->emit('hide-export-modal');
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -721,7 +727,7 @@ class Record extends Component
|
|
|
return implode(', ', $causals);
|
|
return implode(', ', $causals);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function updatedExportFromDate()
|
|
|
|
|
|
|
+ public function updatedExportFromDate()
|
|
|
{
|
|
{
|
|
|
$this->updateEmailSubject();
|
|
$this->updateEmailSubject();
|
|
|
}
|
|
}
|