Updated error logic on plant change
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
@@ -56,17 +56,20 @@ class WorkGroupMasterResource extends Resource
|
|||||||
->afterStateUpdated(function ($state, $set, callable $get) {
|
->afterStateUpdated(function ($state, $set, callable $get) {
|
||||||
$plantId = $get('plant_id');
|
$plantId = $get('plant_id');
|
||||||
|
|
||||||
$set('pqPlantError', null);
|
$set('wgmPlantError', null);
|
||||||
$set('name', null);
|
$set('name', null);
|
||||||
$set('description', null);
|
$set('description', null);
|
||||||
$set('operation_number', null);
|
$set('operation_number', null);
|
||||||
if (! $plantId) {
|
if (! $plantId) {
|
||||||
$set('pqPlantError', 'Please select a plant first.');
|
$set('wgmPlantError', 'Please select a plant first.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
->hint(fn ($get) => $get('pqPlantError') ? $get('pqPlantError') : null)
|
->extraAttributes(fn ($get) => [
|
||||||
|
'class' => $get('wgmPlantError') ? 'border-red-500' : '',
|
||||||
|
])
|
||||||
|
->hint(fn ($get) => $get('wgmPlantError') ? $get('wgmPlantError') : null)
|
||||||
->hintColor('danger'),
|
->hintColor('danger'),
|
||||||
Forms\Components\TextInput::make('name')
|
Forms\Components\TextInput::make('name')
|
||||||
->label('Group Work Center')
|
->label('Group Work Center')
|
||||||
|
|||||||
Reference in New Issue
Block a user