Updated validations and success durations and added serial_number maximum length should be 20 digit and clear field if invalid input
This commit is contained in:
@@ -64,6 +64,7 @@ class CreatePalletValidation extends CreateRecord
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->form->fill([
|
||||
'serial_number' => null,
|
||||
'plant_id' => $plantId,
|
||||
@@ -86,6 +87,7 @@ class CreatePalletValidation extends CreateRecord
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $palletNumber, $plantId);
|
||||
$this->form->fill([
|
||||
'serial_number' => null,
|
||||
@@ -98,13 +100,14 @@ class CreatePalletValidation extends CreateRecord
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNumber) < 9)
|
||||
else if (strlen($serialNumber) < 9 || strlen($serialNumber) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Serial number should contain minimum 9 digits.')
|
||||
->title('Serial number should contain minimum 9 digits and maximum 20 digits.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $palletNumber, $plantId);
|
||||
$this->form->fill([
|
||||
'serial_number' => null,
|
||||
@@ -124,6 +127,7 @@ class CreatePalletValidation extends CreateRecord
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $palletNumber, $plantId);
|
||||
$this->form->fill([
|
||||
'serial_number' => null,
|
||||
@@ -150,6 +154,7 @@ class CreatePalletValidation extends CreateRecord
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
$this->dispatch('loadData', $palletNumber, $plantId);
|
||||
$this->form->fill([
|
||||
'serial_number' => null,
|
||||
@@ -532,10 +537,10 @@ class CreatePalletValidation extends CreateRecord
|
||||
]);
|
||||
return;
|
||||
}
|
||||
else if (strlen($serialNumber) < 9)
|
||||
else if (strlen($serialNumber) < 9 || strlen($serialNumber) > 20)
|
||||
{
|
||||
Notification::make()
|
||||
->title('Serial number should contain minimum 9 digits.')
|
||||
->title('Serial number should contain minimum 9 digits and maximum 20 digits.')
|
||||
->danger()
|
||||
->duration(1200)
|
||||
->send();
|
||||
|
||||
Reference in New Issue
Block a user