Updated error logic on plant change
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-05-29 15:39:51 +05:30
parent e27326258e
commit 8c362bd83f

View File

@@ -56,17 +56,20 @@ class WorkGroupMasterResource extends Resource
->afterStateUpdated(function ($state, $set, callable $get) {
$plantId = $get('plant_id');
$set('pqPlantError', null);
$set('wgmPlantError', null);
$set('name', null);
$set('description', null);
$set('operation_number', null);
if (! $plantId) {
$set('pqPlantError', 'Please select a plant first.');
$set('wgmPlantError', 'Please select a plant first.');
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'),
Forms\Components\TextInput::make('name')
->label('Group Work Center')