Added Stop request_type and updated validations on resource file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 6m14s
Laravel Larastan / larastan (pull_request) Failing after 10m51s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 17s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 23s
Laravel Pint / pint (pull_request) Successful in 6m14s
Laravel Larastan / larastan (pull_request) Failing after 10m51s
This commit is contained in:
@@ -10,7 +10,6 @@ use App\Models\Item;
|
|||||||
use App\Models\Machine;
|
use App\Models\Machine;
|
||||||
use App\Models\Plant;
|
use App\Models\Plant;
|
||||||
use App\Models\RequestCharacteristic;
|
use App\Models\RequestCharacteristic;
|
||||||
use App\Models\StickerMaster;
|
|
||||||
use Closure;
|
use Closure;
|
||||||
use Filament\Facades\Filament;
|
use Filament\Facades\Filament;
|
||||||
use Filament\Forms;
|
use Filament\Forms;
|
||||||
@@ -30,7 +29,6 @@ use Filament\Tables\Filters\Filter;
|
|||||||
use Filament\Tables\Table;
|
use Filament\Tables\Table;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
|
||||||
@@ -42,6 +40,8 @@ class RequestCharacteristicResource extends Resource
|
|||||||
|
|
||||||
protected static ?string $navigationGroup = 'Laser Marking';
|
protected static ?string $navigationGroup = 'Laser Marking';
|
||||||
|
|
||||||
|
protected static ?int $navigationSort = 3;
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -133,8 +133,8 @@ class RequestCharacteristicResource extends Resource
|
|||||||
})
|
})
|
||||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||||
Forms\Components\Hidden::make('show_validation_image')
|
Forms\Components\Hidden::make('show_validation_image')
|
||||||
->reactive()
|
->reactive()
|
||||||
->default(false),
|
->default(false),
|
||||||
Forms\Components\Hidden::make('validation1_image_url')
|
Forms\Components\Hidden::make('validation1_image_url')
|
||||||
->reactive(),
|
->reactive(),
|
||||||
|
|
||||||
@@ -165,17 +165,19 @@ class RequestCharacteristicResource extends Resource
|
|||||||
|
|
||||||
if ($currentState == true) {
|
if ($currentState == true) {
|
||||||
$set('validation1_image_url', null);
|
$set('validation1_image_url', null);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$workFlowId = $get('work_flow_id');
|
$workFlowId = $get('work_flow_id');
|
||||||
|
|
||||||
if (!$workFlowId) {
|
if (! $workFlowId) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Missing Workflow ID')
|
->title('Missing Workflow ID')
|
||||||
->body('Please select a Workflow ID.')
|
->body('Please select a Workflow ID.')
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,11 +322,13 @@ class RequestCharacteristicResource extends Resource
|
|||||||
return [
|
return [
|
||||||
'Characteristic' => 'Characteristic',
|
'Characteristic' => 'Characteristic',
|
||||||
'Quality' => 'Quality',
|
'Quality' => 'Quality',
|
||||||
|
'Stop' => 'Stop',
|
||||||
];
|
];
|
||||||
})
|
})
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
$appTyp = $get('approver_type');
|
||||||
$set('characteristic_approver_master_id', null);
|
$set('characteristic_approver_master_id', null);
|
||||||
if ($get('approver_type') != 'Characteristic') {
|
if ($appTyp != 'Characteristic') {
|
||||||
$set('characteristic_name', null);
|
$set('characteristic_name', null);
|
||||||
$set('current_value', null);
|
$set('current_value', null);
|
||||||
$set('update_value', null);
|
$set('update_value', null);
|
||||||
@@ -1245,6 +1249,7 @@ class RequestCharacteristicResource extends Resource
|
|||||||
->options([
|
->options([
|
||||||
'Characteristic' => 'Characteristic',
|
'Characteristic' => 'Characteristic',
|
||||||
'Quality' => 'Quality',
|
'Quality' => 'Quality',
|
||||||
|
'Stop' => 'Stop',
|
||||||
])
|
])
|
||||||
->placeholder('Select Request Type'),
|
->placeholder('Select Request Type'),
|
||||||
TextInput::make('master_characteristic_field')
|
TextInput::make('master_characteristic_field')
|
||||||
@@ -1308,7 +1313,7 @@ class RequestCharacteristicResource extends Resource
|
|||||||
])
|
])
|
||||||
->query(function ($query, array $data) {
|
->query(function ($query, array $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['machine']) && empty($data['item_id']) && empty($data['aufnr']) && empty($data['model_type']) && empty($data['work_flow_id']) && empty($data['machine_name']) && empty($data['request_type']) && empty($data['master_characteristic_field'])&& empty($data['approver_status1']) && empty($data['approver_status2']) && empty($data['approver_status3']) && empty($data['approver_status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
if (empty($data['Plant']) && empty($data['machine']) && empty($data['item_id']) && empty($data['aufnr']) && empty($data['model_type']) && empty($data['work_flow_id']) && empty($data['machine_name']) && empty($data['request_type']) && empty($data['master_characteristic_field']) && empty($data['approver_status1']) && empty($data['approver_status2']) && empty($data['approver_status3']) && empty($data['approver_status']) && empty($data['created_from']) && empty($data['created_to'])) {
|
||||||
return $query->whereRaw('1 = 0');
|
return $query->whereRaw('1 = 0');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1342,19 +1347,19 @@ class RequestCharacteristicResource extends Resource
|
|||||||
$query->where('work_flow_id', 'like', '%'.$data['work_flow_id'].'%');
|
$query->where('work_flow_id', 'like', '%'.$data['work_flow_id'].'%');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($data['machine_name'])) {
|
if (! empty($data['machine_name'])) {
|
||||||
$query->whereHas('characteristicApproverMaster', function ($q) use ($data) {
|
$query->whereHas('characteristicApproverMaster', function ($q) use ($data) {
|
||||||
$q->where('characteristic_approver_masters.machine_name', '=', (string) $data['machine_name']);
|
$q->where('characteristic_approver_masters.machine_name', '=', (string) $data['machine_name']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($data['request_type'])) {
|
if (! empty($data['request_type'])) {
|
||||||
$query->whereHas('characteristicApproverMaster', function ($q) use ($data) {
|
$query->whereHas('characteristicApproverMaster', function ($q) use ($data) {
|
||||||
$q->where('characteristic_approver_masters.approver_type', '=', (string) $data['request_type']);
|
$q->where('characteristic_approver_masters.approver_type', '=', (string) $data['request_type']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($data['master_characteristic_field'])) {
|
if (! empty($data['master_characteristic_field'])) {
|
||||||
$query->whereHas('characteristicApproverMaster', function ($q) use ($data) {
|
$query->whereHas('characteristicApproverMaster', function ($q) use ($data) {
|
||||||
$q->where('characteristic_approver_masters.characteristic_field', '=', (string) $data['master_characteristic_field']);
|
$q->where('characteristic_approver_masters.characteristic_field', '=', (string) $data['master_characteristic_field']);
|
||||||
});
|
});
|
||||||
@@ -1372,7 +1377,7 @@ class RequestCharacteristicResource extends Resource
|
|||||||
$query->where('approver_status3', 'like', '%'.$data['approver_status3'].'%');
|
$query->where('approver_status3', 'like', '%'.$data['approver_status3'].'%');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($data['approver_status'])) {
|
if (! empty($data['approver_status'])) {
|
||||||
|
|
||||||
$status = $data['approver_status'];
|
$status = $data['approver_status'];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user