Merge pull request 'ranjith-dev' (#919) from ranjith-dev into master
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
Reviewed-on: #919
This commit was merged in pull request #919.
This commit is contained in:
@@ -31,7 +31,7 @@ class EquipmentMasterResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Testing Panel';
|
protected static ?string $navigationGroup = 'Motor Testing Panel';
|
||||||
|
|
||||||
protected static ?int $navigationSort = 2;
|
protected static ?int $navigationSort = 2;
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class LeakTestReadingResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Testing Panel';
|
protected static ?string $navigationGroup = 'Motor Testing Panel';
|
||||||
|
|
||||||
protected static ?int $navigationSort = 3;
|
protected static ?int $navigationSort = 3;
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ use Filament\Facades\Filament;
|
|||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
use Filament\Forms\Components\DateTimePicker;
|
use Filament\Forms\Components\DateTimePicker;
|
||||||
use Filament\Forms\Components\Radio;
|
use Filament\Forms\Components\Radio;
|
||||||
|
use Filament\Forms\Components\Section;
|
||||||
use Filament\Forms\Components\Select;
|
use Filament\Forms\Components\Select;
|
||||||
use Filament\Forms\Components\TextInput;
|
use Filament\Forms\Components\TextInput;
|
||||||
use Filament\Forms\Form;
|
use Filament\Forms\Form;
|
||||||
@@ -33,17 +34,20 @@ class MotorTestingMasterResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Testing Panel';
|
protected static ?string $navigationGroup = 'Motor Testing Panel';
|
||||||
|
|
||||||
protected static ?int $navigationSort = 1;
|
protected static ?int $navigationSort = 1;
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
|
->schema([
|
||||||
|
Section::make('')
|
||||||
->schema([
|
->schema([
|
||||||
Forms\Components\Select::make('plant_id')
|
Forms\Components\Select::make('plant_id')
|
||||||
->label('Plant Name')
|
->label('Plant Name')
|
||||||
->relationship('plant', 'name')
|
->relationship('plant', 'name')
|
||||||
|
->columnSpan(1) // (['default' => 1, 'sm' => 2])
|
||||||
->required()
|
->required()
|
||||||
->searchable()
|
->searchable()
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -53,7 +57,9 @@ class MotorTestingMasterResource extends Resource
|
|||||||
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
|
||||||
})
|
})
|
||||||
->default(function () {
|
->default(function () {
|
||||||
return optional(MotorTestingMaster::latest()->first())->plant_id;
|
$userHas = Filament::auth()->user()->plant_id;
|
||||||
|
|
||||||
|
return ($userHas && strlen($userHas) > 0) ? $userHas : optional(MotorTestingMaster::latest()->first())->plant_id ?? null;
|
||||||
})
|
})
|
||||||
->disabled(fn (Get $get) => ! empty($get('id')))
|
->disabled(fn (Get $get) => ! empty($get('id')))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
@@ -76,6 +82,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TimePicker::make('routine_test_time')
|
Forms\Components\TimePicker::make('routine_test_time')
|
||||||
->label('Routine Test Time')
|
->label('Routine Test Time')
|
||||||
->default('00:40:00')
|
->default('00:40:00')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -105,6 +112,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
}
|
}
|
||||||
// return Item::where('plant_id', $plantId)->pluck('code', 'id')->toArray();
|
// return Item::where('plant_id', $plantId)->pluck('code', 'id')->toArray();
|
||||||
})
|
})
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->searchable()
|
->searchable()
|
||||||
->reactive()
|
->reactive()
|
||||||
@@ -120,6 +128,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
->label('Subassembly Code')
|
->label('Subassembly Code')
|
||||||
// ->required()
|
// ->required()
|
||||||
->placeholder('Scan the subassembly code')
|
->placeholder('Scan the subassembly code')
|
||||||
|
->columnSpan(1)
|
||||||
->reactive()
|
->reactive()
|
||||||
->alphaNum()
|
->alphaNum()
|
||||||
->minLength(6)
|
->minLength(6)
|
||||||
@@ -159,6 +168,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
])
|
])
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
->default(1)
|
->default(1)
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -191,11 +201,13 @@ class MotorTestingMasterResource extends Resource
|
|||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
})
|
})
|
||||||
->default('Single')
|
->default('Single')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->reactive(),
|
->reactive(),
|
||||||
Forms\Components\TextInput::make('hp')
|
Forms\Components\TextInput::make('hp')
|
||||||
->label('HP')
|
->label('HP')
|
||||||
->placeholder('Scan the HP')
|
->placeholder('Scan the HP')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -203,6 +215,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('kw')
|
Forms\Components\TextInput::make('kw')
|
||||||
->label('KW')
|
->label('KW')
|
||||||
->placeholder('Scan the KW')
|
->placeholder('Scan the KW')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -210,6 +223,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('volt')
|
Forms\Components\TextInput::make('volt')
|
||||||
->label('Volt')
|
->label('Volt')
|
||||||
->placeholder('Scan the volt')
|
->placeholder('Scan the volt')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -217,6 +231,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('current')
|
Forms\Components\TextInput::make('current')
|
||||||
->label('Current')
|
->label('Current')
|
||||||
->placeholder('Scan the current')
|
->placeholder('Scan the current')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -224,6 +239,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('rpm')
|
Forms\Components\TextInput::make('rpm')
|
||||||
->label('RPM')
|
->label('RPM')
|
||||||
->placeholder('Scan the RPM')
|
->placeholder('Scan the RPM')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -231,6 +247,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('torque')
|
Forms\Components\TextInput::make('torque')
|
||||||
->label('Torque')
|
->label('Torque')
|
||||||
->placeholder('Scan the torque')
|
->placeholder('Scan the torque')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -238,6 +255,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('frequency')
|
Forms\Components\TextInput::make('frequency')
|
||||||
->label('Frequency')
|
->label('Frequency')
|
||||||
->placeholder('Scan the frequency')
|
->placeholder('Scan the frequency')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -267,6 +285,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
|
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
})
|
})
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->default('Star')
|
->default('Star')
|
||||||
->reactive(),
|
->reactive(),
|
||||||
@@ -276,10 +295,12 @@ class MotorTestingMasterResource extends Resource
|
|||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
})
|
})
|
||||||
|
->columnSpan(1)
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\Select::make('ins_res_type')
|
Forms\Components\Select::make('ins_res_type')
|
||||||
->label('Insulation Resistance Type')
|
->label('Insulation Resistance Type')
|
||||||
->placeholder('Scan the insulation resistance type')
|
->placeholder('Scan the insulation resistance type')
|
||||||
|
->columnSpan(1)
|
||||||
->default('O')
|
->default('O')
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
->options(function (callable $get) {
|
->options(function (callable $get) {
|
||||||
@@ -304,6 +325,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('res_ry_ll')
|
Forms\Components\TextInput::make('res_ry_ll')
|
||||||
->label('Resistance RY LL')
|
->label('Resistance RY LL')
|
||||||
->placeholder('Scan the resistance RY LL')
|
->placeholder('Scan the resistance RY LL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -311,6 +333,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('res_ry_ul')
|
Forms\Components\TextInput::make('res_ry_ul')
|
||||||
->label('Resistance RY UL')
|
->label('Resistance RY UL')
|
||||||
->placeholder('Scan the resistance RY UL')
|
->placeholder('Scan the resistance RY UL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -318,6 +341,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('res_yb_ll')
|
Forms\Components\TextInput::make('res_yb_ll')
|
||||||
->label('Resistance YB LL')
|
->label('Resistance YB LL')
|
||||||
->placeholder('Scan the resistance YB LL')
|
->placeholder('Scan the resistance YB LL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -325,6 +349,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('res_yb_ul')
|
Forms\Components\TextInput::make('res_yb_ul')
|
||||||
->label('Resistance YB UL')
|
->label('Resistance YB UL')
|
||||||
->placeholder('Scan the resistance YB UL')
|
->placeholder('Scan the resistance YB UL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -332,6 +357,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('res_br_ll')
|
Forms\Components\TextInput::make('res_br_ll')
|
||||||
->label('Resistance BR LL')
|
->label('Resistance BR LL')
|
||||||
->placeholder('Scan the resistance BR LL')
|
->placeholder('Scan the resistance BR LL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -339,6 +365,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('res_br_ul')
|
Forms\Components\TextInput::make('res_br_ul')
|
||||||
->label('Resistance BR UL')
|
->label('Resistance BR UL')
|
||||||
->placeholder('Scan the resistance BR UL')
|
->placeholder('Scan the resistance BR UL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -346,6 +373,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('lock_volt_limit')
|
Forms\Components\TextInput::make('lock_volt_limit')
|
||||||
->label('Lock Volt Limit')
|
->label('Lock Volt Limit')
|
||||||
->placeholder('Scan the lock volt limit')
|
->placeholder('Scan the lock volt limit')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -353,6 +381,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('leak_cur_limit')
|
Forms\Components\TextInput::make('leak_cur_limit')
|
||||||
->label('Leakage Current Limit')
|
->label('Leakage Current Limit')
|
||||||
->placeholder('Scan the leakage current limit')
|
->placeholder('Scan the leakage current limit')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -360,6 +389,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('lock_cur_ll')
|
Forms\Components\TextInput::make('lock_cur_ll')
|
||||||
->label('Lock Current LL')
|
->label('Lock Current LL')
|
||||||
->placeholder('Scan the lock current LL')
|
->placeholder('Scan the lock current LL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -367,6 +397,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('lock_cur_ul')
|
Forms\Components\TextInput::make('lock_cur_ul')
|
||||||
->label('Lock Current UL')
|
->label('Lock Current UL')
|
||||||
->placeholder('Scan the lock current UL')
|
->placeholder('Scan the lock current UL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -374,6 +405,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('noload_cur_ll')
|
Forms\Components\TextInput::make('noload_cur_ll')
|
||||||
->label('No Load Current LL')
|
->label('No Load Current LL')
|
||||||
->placeholder('Scan the no load current LL')
|
->placeholder('Scan the no load current LL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -381,6 +413,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('noload_cur_ul')
|
Forms\Components\TextInput::make('noload_cur_ul')
|
||||||
->label('No Load Current UL')
|
->label('No Load Current UL')
|
||||||
->placeholder('Scan the no load current UL')
|
->placeholder('Scan the no load current UL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -388,6 +421,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('noload_pow_ll')
|
Forms\Components\TextInput::make('noload_pow_ll')
|
||||||
->label('No Load Power LL')
|
->label('No Load Power LL')
|
||||||
->placeholder('Scan the no load power LL')
|
->placeholder('Scan the no load power LL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -395,6 +429,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('noload_pow_ul')
|
Forms\Components\TextInput::make('noload_pow_ul')
|
||||||
->label('No Load Power UL')
|
->label('No Load Power UL')
|
||||||
->placeholder('Scan the no load power UL')
|
->placeholder('Scan the no load power UL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -402,6 +437,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('noload_spd_ll')
|
Forms\Components\TextInput::make('noload_spd_ll')
|
||||||
->label('No Load Speed LL')
|
->label('No Load Speed LL')
|
||||||
->placeholder('Scan the no load speed LL')
|
->placeholder('Scan the no load speed LL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
@@ -409,19 +445,26 @@ class MotorTestingMasterResource extends Resource
|
|||||||
Forms\Components\TextInput::make('noload_spd_ul')
|
Forms\Components\TextInput::make('noload_spd_ul')
|
||||||
->label('No Load Speed UL')
|
->label('No Load Speed UL')
|
||||||
->placeholder('Scan the no load speed UL')
|
->placeholder('Scan the no load speed UL')
|
||||||
|
->columnSpan(1)
|
||||||
->required()
|
->required()
|
||||||
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
->afterStateUpdated(function (callable $set, callable $get, ?string $state) {
|
||||||
$set('updated_by', Filament::auth()->user()?->name);
|
$set('updated_by', Filament::auth()->user()?->name);
|
||||||
}),
|
}),
|
||||||
Forms\Components\Hidden::make('created_by')
|
Forms\Components\Hidden::make('created_by')
|
||||||
->default(fn () => Filament::auth()->user()?->name)
|
->default(fn () => Filament::auth()->user()?->name)
|
||||||
|
->columnSpan(1)
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\Hidden::make('updated_by')
|
Forms\Components\Hidden::make('updated_by')
|
||||||
->default(fn () => Filament::auth()->user()?->name)
|
->default(fn () => Filament::auth()->user()?->name)
|
||||||
|
->columnSpan(1)
|
||||||
->required(),
|
->required(),
|
||||||
Forms\Components\TextInput::make('id')
|
Forms\Components\TextInput::make('id')
|
||||||
->hidden()
|
->hidden()
|
||||||
|
->columnSpan(1)
|
||||||
->readOnly(),
|
->readOnly(),
|
||||||
|
|
||||||
|
])
|
||||||
|
->columns(['default' => 1, 'sm' => 2]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -577,6 +620,7 @@ class MotorTestingMasterResource extends Resource
|
|||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable(),
|
->sortable(),
|
||||||
Tables\Columns\TextColumn::make('deleted_at')
|
Tables\Columns\TextColumn::make('deleted_at')
|
||||||
|
->label('Deleted At')
|
||||||
->dateTime()
|
->dateTime()
|
||||||
->alignCenter()
|
->alignCenter()
|
||||||
->sortable()
|
->sortable()
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class TestingPanelReadingResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
protected static ?string $navigationGroup = 'Testing Panel';
|
protected static ?string $navigationGroup = 'Motor Testing Panel';
|
||||||
|
|
||||||
protected static ?int $navigationSort = 4;
|
protected static ?int $navigationSort = 4;
|
||||||
|
|
||||||
@@ -995,13 +995,11 @@ class TestingPanelReadingResource extends Resource
|
|||||||
|
|
||||||
// dd($data);
|
// dd($data);
|
||||||
// Hide all records initially if no filters are applied
|
// Hide all records initially if no filters are applied
|
||||||
if (empty($data['Plant']) && empty($data['Line']) && empty($data['item_code']) && empty($data['subassembly_code']) && empty($data['machine_name']) && empty($data['item_description']) && empty($data['serial_number']) && empty($data['winded_serial_number']) && empty($data['output']) && empty($data['phase']) && empty($data['connection']) && empty($data['remark']) && empty($data['batch_no']) && empty($data['result']) && empty($data['tested_by']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['updated_from']) && empty($data['updated_to'])) {
|
if (empty($data['Plant']) && empty($data['Line']) && empty($data['item_code']) && empty($data['subassembly_code']) && empty($data['machine_name']) && empty($data['item_description']) && empty($data['serial_number']) && empty($data['winded_serial_number']) && empty($data['output']) && empty($data['connection']) && empty($data['remark']) && empty($data['batch_no']) && empty($data['result']) && empty($data['tested_by']) && empty($data['created_from']) && empty($data['created_to']) && empty($data['updated_by']) && empty($data['updated_from']) && empty($data['updated_to'])) {
|
||||||
return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (empty($data['Plant']) && empty($data['Line']) && empty($data['item_code']) && empty($data['machine_name']) && empty($data['item_description']) && empty($data['serial_number']) && empty($data['output']) && empty($data['phase']) && !empty($data['connection']) && empty($data['remark']) && empty($data['batch_no'])&& empty($data['result']) && empty($data['created_from']) && empty($data['created_to'])) {
|
// empty($data['phase']) &&
|
||||||
// return $query->whereRaw('1 = 0');
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (! empty($data['Plant'])) {
|
if (! empty($data['Plant'])) {
|
||||||
$query->where('plant_id', $data['Plant']);
|
$query->where('plant_id', $data['Plant']);
|
||||||
@@ -1174,11 +1172,11 @@ class TestingPanelReadingResource extends Resource
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($data['created_from'])) {
|
if (! empty($data['created_from'])) {
|
||||||
$indicators[] = 'From: '.$data['created_from'];
|
$indicators[] = 'Created From: '.$data['created_from'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($data['created_to'])) {
|
if (! empty($data['created_to'])) {
|
||||||
$indicators[] = 'To: '.$data['created_to'];
|
$indicators[] = 'Created To: '.$data['created_to'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($data['updated_by'])) {
|
if (! empty($data['updated_by'])) {
|
||||||
|
|||||||
Reference in New Issue
Block a user