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\Plant;
|
||||
use App\Models\RequestCharacteristic;
|
||||
use App\Models\StickerMaster;
|
||||
use Closure;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Forms;
|
||||
@@ -30,7 +29,6 @@ use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Table;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
@@ -42,6 +40,8 @@ class RequestCharacteristicResource extends Resource
|
||||
|
||||
protected static ?string $navigationGroup = 'Laser Marking';
|
||||
|
||||
protected static ?int $navigationSort = 3;
|
||||
|
||||
public static function form(Form $form): Form
|
||||
{
|
||||
|
||||
@@ -133,8 +133,8 @@ class RequestCharacteristicResource extends Resource
|
||||
})
|
||||
->disabled(fn ($get) => self::isFieldDisabled($get)),
|
||||
Forms\Components\Hidden::make('show_validation_image')
|
||||
->reactive()
|
||||
->default(false),
|
||||
->reactive()
|
||||
->default(false),
|
||||
Forms\Components\Hidden::make('validation1_image_url')
|
||||
->reactive(),
|
||||
|
||||
@@ -165,17 +165,19 @@ class RequestCharacteristicResource extends Resource
|
||||
|
||||
if ($currentState == true) {
|
||||
$set('validation1_image_url', null);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
$workFlowId = $get('work_flow_id');
|
||||
|
||||
if (!$workFlowId) {
|
||||
if (! $workFlowId) {
|
||||
Notification::make()
|
||||
->title('Missing Workflow ID')
|
||||
->body('Please select a Workflow ID.')
|
||||
->danger()
|
||||
->send();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -320,11 +322,13 @@ class RequestCharacteristicResource extends Resource
|
||||
return [
|
||||
'Characteristic' => 'Characteristic',
|
||||
'Quality' => 'Quality',
|
||||
'Stop' => 'Stop',
|
||||
];
|
||||
})
|
||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||
$appTyp = $get('approver_type');
|
||||
$set('characteristic_approver_master_id', null);
|
||||
if ($get('approver_type') != 'Characteristic') {
|
||||
if ($appTyp != 'Characteristic') {
|
||||
$set('characteristic_name', null);
|
||||
$set('current_value', null);
|
||||
$set('update_value', null);
|
||||
@@ -1245,6 +1249,7 @@ class RequestCharacteristicResource extends Resource
|
||||
->options([
|
||||
'Characteristic' => 'Characteristic',
|
||||
'Quality' => 'Quality',
|
||||
'Stop' => 'Stop',
|
||||
])
|
||||
->placeholder('Select Request Type'),
|
||||
TextInput::make('master_characteristic_field')
|
||||
@@ -1308,7 +1313,7 @@ class RequestCharacteristicResource extends Resource
|
||||
])
|
||||
->query(function ($query, array $data) {
|
||||
// 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');
|
||||
}
|
||||
|
||||
@@ -1342,19 +1347,19 @@ class RequestCharacteristicResource extends Resource
|
||||
$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) {
|
||||
$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) {
|
||||
$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) {
|
||||
$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'].'%');
|
||||
}
|
||||
|
||||
if (!empty($data['approver_status'])) {
|
||||
if (! empty($data['approver_status'])) {
|
||||
|
||||
$status = $data['approver_status'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user