Refactored form design, validation and Added items - description, category, uom in resource files
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s

This commit is contained in:
dhanabalan
2026-10-08 09:59:45 +05:30
parent 867c97288f
commit 110b8b2e92
4 changed files with 91 additions and 19 deletions

View File

@@ -1049,6 +1049,27 @@ class RequestCharacteristicResource extends Resource
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('item.description')
->label('Description')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.category')
->label('Category')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.uom')
->label('Unit of Measure')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('aufnr')
->label('Job Number')
->alignCenter()

View File

@@ -1183,6 +1183,27 @@ class TempClassCharacteristicResource extends Resource
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('item.description')
->label('DESCRIPTION')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.category')
->label('CATEGORY')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.uom')
->label('UNIT OF MEASURE')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('model_type')
->label('MODEL TYPE')
->alignCenter()

View File

@@ -128,7 +128,7 @@ class TempStopCharacteristicResource extends Resource
$set('updated_by', Filament::auth()->user()?->name);
})
->required()
->disabled(fn (Get $get) => ! empty($get('id'))),
->readonly(fn (Get $get) => ! empty($get('id'))),
Forms\Components\TextInput::make('aufnr')
->label('Job Number')
->reactive()
@@ -152,18 +152,16 @@ class TempStopCharacteristicResource extends Resource
return ($userHas && strlen($userHas) > 0) ? null : optional(TempStopCharacteristic::latest()->first())->aufnr ?? null;
})
->readOnly(fn ($get) => ($get('item_id') == null))
->disabled(fn (Get $get) => ! empty($get('id'))),
->readonly(fn (Get $get) => ! empty($get('id')) || ! $get('item_id')),
Forms\Components\TextInput::make('gernr')
->label('Serial Number')
->reactive()
->minLength(13)
->readOnly(fn (callable $get) => ! $get('aufnr'))
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required()
->disabled(fn (Get $get) => ! empty($get('id'))),
->readonly(fn (Get $get) => ! empty($get('id')) || ! $get('aufnr')),
Forms\Components\TextInput::make('zmm_heading')
->label('Zmm Heading')
->reactive()
@@ -172,7 +170,7 @@ class TempStopCharacteristicResource extends Resource
$set('updated_by', Filament::auth()->user()?->name);
})
->required()
->disabled(fn (Get $get) => ! empty($get('id'))),
->readonly(fn (Get $get) => ! empty($get('id'))),
Forms\Components\Select::make('model_type')
->label('Model Type')
->reactive()
@@ -200,7 +198,7 @@ class TempStopCharacteristicResource extends Resource
$set('updated_by', Filament::auth()->user()?->name);
})
->required()
->disabled(fn (Get $get) => ! empty($get('id'))),
->readonly(fn (Get $get) => ! empty($get('id'))),
Forms\Components\TextInput::make('samlight_logged_name')
->label('SAMLight Logged Name')
->reactive()
@@ -208,7 +206,7 @@ class TempStopCharacteristicResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('updated_by', Filament::auth()->user()?->name);
})
->disabled(fn (Get $get) => ! empty($get('id'))),
->readonly(fn (Get $get) => ! empty($get('id'))),
Forms\Components\DateTimePicker::make('stopped_at')
->label('Stopped At')
->default(now())
@@ -216,7 +214,8 @@ class TempStopCharacteristicResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
->required()
->disabled(fn (Get $get) => ! empty($get('id'))),
Forms\Components\TextInput::make('stopped_by')
->label('Stopped By')
->reactive()
@@ -224,7 +223,8 @@ class TempStopCharacteristicResource extends Resource
->afterStateUpdated(function ($state, callable $set, callable $get) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
->required()
->readonly(fn (Get $get) => ! empty($get('id'))),
Forms\Components\TextInput::make('has_stop_flow_id')
->label('Has Stop Flow ID')
->reactive()
@@ -236,7 +236,8 @@ class TempStopCharacteristicResource extends Resource
}
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
->required()
->readonly(fn (Get $get) => ! empty($get('id'))),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name),
@@ -284,6 +285,27 @@ class TempStopCharacteristicResource extends Resource
->alignCenter()
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('item.description')
->label('Description')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.category')
->label('Category')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('item.uom')
->label('Unit of Measure')
->default('-')
->searchable()
->alignCenter()
->sortable()
->toggleable(isToggledHiddenByDefault: true),
Tables\Columns\TextColumn::make('aufnr')
->label('Job Number')
->alignCenter()

View File

@@ -141,7 +141,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('aufnr')
->label('AUFNR')
->placeholder('Scan the AUFNR')
@@ -150,7 +151,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('gernr')
->label('GERNR')
->placeholder('Scan the GERNR')
@@ -159,7 +161,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('model_type')
->label('Model Type')
->placeholder('Scan the Model Type')
@@ -168,7 +171,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('winded_qr')
->label('Winded QR')
->placeholder('Scan the Winded QR')
@@ -176,7 +180,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('winded_code')
->label('Winded Code')
->placeholder('Scan the Winded Code')
@@ -184,7 +189,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('winded_serial_number')
->label('Winded Serial Number')
->placeholder('Scan the Winded Serial Number')
@@ -192,7 +198,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('winded_status')
->label('Winded Status')
->placeholder('Scan the Winded Status')
@@ -201,7 +208,8 @@ class WindedSerialValidationErrorResource extends Resource
->reactive()
->afterStateUpdated(function ($state, callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
})
->readOnly(fn (Get $get) => $get('id')),
Forms\Components\TextInput::make('created_by')
->default(fn () => Filament::auth()->user()?->name)
->readOnly()