feat: ✨ added mep date on tickets

This commit is contained in:
Corentin Huet 2025-03-13 12:14:30 +01:00 • committed by Alexis Gousseau
parent 3836cc50e8
commit f9c02af11b
7 changed files with 62 additions and 18 deletions

View file

@ -96,6 +96,7 @@ class StoreTicket extends FormRequest
}
}
],
'date_mep' => 'required|date',
'text' => 'required|string|min:40',
'title' => 'required|string|between:3,255',
'file_tickets' => 'sometimes|array',

View file

@ -33,6 +33,7 @@ class Ticket extends Model
'type',
'status',
'order',
'date_mep',
'text',
'title',
'is_internal',
@ -48,6 +49,7 @@ class Ticket extends Model
'is_internal' => 'bool',
'type' => TicketTypeEnum::class,
'status' => TicketStatusEnum::class,
'date_mep' => 'date',
'last_activity' => 'timestamp',
];

View file

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
Schema::table('tickets', function (Blueprint $table) {
$table->date('date_mep')->nullable()->after('gitlab_issue')->comment('Date MEP souhaitée');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down(): void
{
Schema::table('tickets', function (Blueprint $table) {
$table->dropColumn('date_mep');
});
}
};

View file

@ -215,11 +215,13 @@ return [
'year' => 'year',
],
'custom' => [
'type' => 'type',
'tickets' => 'tickets',
'assigned_to' => 'assigned to',
'order' => 'order',
'priority' => 'priority',
'default' => 'default',
'type' => 'type',
'tickets' => 'tickets',
'assigned_to' => 'assigned to',
'order' => 'order',
'priority' => 'priority',
'default' => 'default',
'date_mep' => 'desired MEP date',
'date_mep_empty' => 'no date entered'
]
];

View file

@ -251,11 +251,13 @@ return [
'id' => 'identifiant'
],
'custom' => [
'type' => 'type',
'tickets' => 'étiquettes',
'assigned_to' => 'assigné à',
'order' => 'ordre',
'priority' => 'priorité',
'default' => 'défaut',
'type' => 'type',
'tickets' => 'étiquettes',
'assigned_to' => 'assigné à',
'order' => 'ordre',
'priority' => 'priorité',
'default' => 'défaut',
'date_mep' => 'date de MEP souhaitée',
'date_mep_empty' => 'aucune date renseignée'
]
];

View file

@ -93,6 +93,11 @@
</div>
@endcan
<div class="form-group col">
<label class="col-form-label" for="date_mep">{{ __('Date de mise en production souhaitée') }}</label>
<input class="form-control" id="date_mep" name="date_mep" type="date" min="{{ date('Y-m-j') }}" value="{{ old('date_mep') ?? (isset($ticket) && !is_null($ticket->date_mep) ? $ticket->date_mep->format('Y-m-j') : date('Y-m-j')) }}">
</div>
</div>
<div class="form-group mb-3">

View file

@ -198,11 +198,8 @@
if (Auth::user()->isAdmin()) {
$cols = array_merge($cols, [
'tickets' => Str::ucfirst(__('validation.custom.tickets')),
]);
}
if (Auth::user()->isAdmin()) {
$cols = array_merge($cols, [
'assigned_to' => Str::ucfirst(__('validation.custom.assigned_to')),
'date_mep' => Str::ucfirst(__('validation.custom.date_mep')),
]);
}
$cols = array_merge($cols, [
@ -211,7 +208,7 @@
@endphp
@include('bo.modules.table-col-sorter', [
'cols' => $cols,
'ignore' => ['id', 'tickets', 'order']
'ignore' => ['id', 'tickets'],
])
</thead>
<tbody>
@ -278,9 +275,12 @@
</span>
</td>
@endcan
{{-- assigned_to --}}
{{-- assigned_to / date_mep --}}
@if (Auth::user()->isAdmin())
<td>{{ $ticket->assignedUser ? $ticket->assignedUser->name : __('Personne') }}</td>
<td>
{{ is_null($ticket->date_mep) ? Str::ucfirst(__("validation.custom.date_mep_empty")) : $ticket->date_mep->format('d/m/Y') }}
</td>
@endif
<td>{{ Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }}</td>
<td>