mirror of
https://github.com/HDInnovations/UNIT3D.git
synced 2026-01-31 01:35:31 +01:00
chore: review cleanup
This commit is contained in:
@@ -41,6 +41,8 @@ class StoreTicketCategoryRequest extends FormRequest
|
||||
],
|
||||
'position' => [
|
||||
'required',
|
||||
'decimal:0',
|
||||
'min:0',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -41,6 +41,16 @@ class StoreTicketPriorityRequest extends FormRequest
|
||||
],
|
||||
'position' => [
|
||||
'required',
|
||||
'decimal:0',
|
||||
'min:0',
|
||||
],
|
||||
'color' => [
|
||||
'required',
|
||||
'string',
|
||||
],
|
||||
'icon' => [
|
||||
'required',
|
||||
'string',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ class UpdateTicketCategoryRequest extends FormRequest
|
||||
],
|
||||
'position' => [
|
||||
'required',
|
||||
'decimal:0',
|
||||
'min:0',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -41,6 +41,16 @@ class UpdateTicketPriorityRequest extends FormRequest
|
||||
],
|
||||
'position' => [
|
||||
'required',
|
||||
'decimal:0',
|
||||
'min:0',
|
||||
],
|
||||
'color' => [
|
||||
'required',
|
||||
'string',
|
||||
],
|
||||
'icon' => [
|
||||
'required',
|
||||
'string',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -41,5 +41,5 @@ class TicketCategory extends Model
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
protected $guarded = [];
|
||||
}
|
||||
|
||||
@@ -26,6 +26,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property int $position
|
||||
* @property string $color
|
||||
* @property string $icon
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
*/
|
||||
@@ -41,5 +43,5 @@ class TicketPriority extends Model
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||
protected $guarded = [];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* NOTICE OF LICENSE.
|
||||
*
|
||||
* UNIT3D Community Edition is open-sourced software licensed under the GNU Affero General Public License v3.0
|
||||
* The details is bundled with this project in the file LICENSE.txt.
|
||||
*
|
||||
* @project UNIT3D Community Edition
|
||||
*
|
||||
* @author HDVinnie <hdinnovations@protonmail.com>
|
||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0
|
||||
*/
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('ticket_priorities', function (Blueprint $table): void {
|
||||
$table->string('color')->after('position');
|
||||
$table->string('icon')->after('color');
|
||||
});
|
||||
|
||||
DB::table('ticket_priorities')->update([
|
||||
'color' => '#aaaaaa',
|
||||
'icon' => 'fas fa-circle',
|
||||
]);
|
||||
}
|
||||
};
|
||||
@@ -28,14 +28,20 @@ class TicketPrioritySeeder extends Seeder
|
||||
[
|
||||
'name' => 'Low',
|
||||
'position' => 0,
|
||||
'color' => '#FFDC00',
|
||||
'icon' => config('other.font-awesome').' fa-circle',
|
||||
],
|
||||
[
|
||||
'name' => 'Medium',
|
||||
'position' => 1,
|
||||
'color' => '#FF851B',
|
||||
'icon' => config('other.font-awesome').' fa-circle',
|
||||
],
|
||||
[
|
||||
'name' => 'High',
|
||||
'position' => 2,
|
||||
'color' => '#FF4136',
|
||||
'icon' => config('other.font-awesome').' fa-circle',
|
||||
],
|
||||
], ['id'], ['updated_at' => DB::raw('updated_at')]);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
class="form__text"
|
||||
inputmode="numeric"
|
||||
name="position"
|
||||
pattern="[0-9]*"
|
||||
pattern="[0-9]+"
|
||||
required
|
||||
type="text"
|
||||
/>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
class="form__text"
|
||||
inputmode="numeric"
|
||||
name="position"
|
||||
pattern="[0-9]*"
|
||||
pattern="[0-9]+"
|
||||
required
|
||||
type="text"
|
||||
value="{{ $ticketCategory->position }}"
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
class="form__text"
|
||||
inputmode="numeric"
|
||||
name="position"
|
||||
pattern="[0-9]*"
|
||||
pattern="[0-9]+"
|
||||
required
|
||||
type="text"
|
||||
/>
|
||||
@@ -48,6 +48,31 @@
|
||||
{{ __('common.position') }}
|
||||
</label>
|
||||
</p>
|
||||
<p class="form__group">
|
||||
<input
|
||||
id="color"
|
||||
class="form__text"
|
||||
name="color"
|
||||
required
|
||||
type="color"
|
||||
value="#FFDC00"
|
||||
/>
|
||||
<label class="form__label form__label--floating" for="color">
|
||||
{{ __('common.color') }}
|
||||
</label>
|
||||
</p>
|
||||
<p class="form__group">
|
||||
<input
|
||||
id="icon"
|
||||
class="form__text"
|
||||
name="icon"
|
||||
type="text"
|
||||
placeholder="fas fa-circle"
|
||||
/>
|
||||
<label class="form__label form__label--floating" for="icon">
|
||||
{{ __('common.icon') }}
|
||||
</label>
|
||||
</p>
|
||||
<p class="form__group">
|
||||
<button class="form__button form__button--filled">
|
||||
{{ __('common.add') }}
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
class="form__text"
|
||||
inputmode="numeric"
|
||||
name="position"
|
||||
pattern="[0-9]*"
|
||||
pattern="[0-9]+"
|
||||
required
|
||||
type="text"
|
||||
value="{{ $ticketPriority->position }}"
|
||||
@@ -64,6 +64,32 @@
|
||||
{{ __('common.position') }}
|
||||
</label>
|
||||
</p>
|
||||
<p class="form__group">
|
||||
<input
|
||||
id="color"
|
||||
class="form__text"
|
||||
name="color"
|
||||
required
|
||||
type="color"
|
||||
value="{{ $ticketPriority->color }}"
|
||||
/>
|
||||
<label class="form__label form__label--floating" for="color">
|
||||
{{ __('common.color') }}
|
||||
</label>
|
||||
</p>
|
||||
<p class="form__group">
|
||||
<input
|
||||
id="icon"
|
||||
class="form__text"
|
||||
name="icon"
|
||||
type="text"
|
||||
value="{{ $ticketPriority->icon }}"
|
||||
placeholder="fas fa-circle"
|
||||
/>
|
||||
<label class="form__label form__label--floating" for="icon">
|
||||
{{ __('common.icon') }}
|
||||
</label>
|
||||
</p>
|
||||
<p class="form__group">
|
||||
<button class="form__button form__button--filled">
|
||||
{{ __('common.submit') }}
|
||||
|
||||
@@ -121,25 +121,15 @@
|
||||
($ticket->user_id === auth()->id() && $ticket->user_read === false))
|
||||
<i
|
||||
style="color: #0dffff; vertical-align: 1px"
|
||||
class="fas fa-circle fa-xs"
|
||||
class="{{ config('other.font-awesome') }} fa-circle fa-xs"
|
||||
></i>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
@switch($ticket->priority->name)
|
||||
@case('Low')
|
||||
<i class="fas fa-circle text-yellow"></i>
|
||||
|
||||
@break
|
||||
@case('Medium')
|
||||
<i class="fas fa-circle text-orange"></i>
|
||||
|
||||
@break
|
||||
@case('High')
|
||||
<i class="fas fa-circle text-red"></i>
|
||||
|
||||
@break
|
||||
@endswitch
|
||||
<i
|
||||
class="{{ config('other.font-awesome') }} {{ $ticket->priority->icon }}"
|
||||
style="color: {{ $ticket->priority->color }}"
|
||||
></i>
|
||||
{{ $ticket->priority->name }}
|
||||
</td>
|
||||
<td>
|
||||
|
||||
@@ -157,20 +157,10 @@
|
||||
<div class="key-value__group">
|
||||
<dt>{{ __('ticket.priority') }}</dt>
|
||||
<dd>
|
||||
@switch($ticket->priority->name)
|
||||
@case('Low')
|
||||
<i class="fas fa-circle text-yellow"></i>
|
||||
|
||||
@break
|
||||
@case('Medium')
|
||||
<i class="fas fa-circle text-orange"></i>
|
||||
|
||||
@break
|
||||
@case('High')
|
||||
<i class="fas fa-circle text-red"></i>
|
||||
|
||||
@break
|
||||
@endswitch
|
||||
<i
|
||||
class="{{ config('other.font-awesome') }} {{ $ticket->priority->icon }}"
|
||||
style="color: {{ $ticket->priority->color }}"
|
||||
></i>
|
||||
{{ $ticket->priority->name }}
|
||||
</dd>
|
||||
</div>
|
||||
@@ -288,20 +278,10 @@
|
||||
@foreach ($pastUserTickets as $ticket)
|
||||
<tr>
|
||||
<td>
|
||||
@switch($ticket->priority->name)
|
||||
@case('Low')
|
||||
<i class="fas fa-circle text-yellow"></i>
|
||||
|
||||
@break
|
||||
@case('Medium')
|
||||
<i class="fas fa-circle text-orange"></i>
|
||||
|
||||
@break
|
||||
@case('High')
|
||||
<i class="fas fa-circle text-red"></i>
|
||||
|
||||
@break
|
||||
@endswitch
|
||||
<i
|
||||
class="{{ config('other.font-awesome') }} {{ $ticket->priority->icon }}"
|
||||
style="color: {{ $ticket->priority->color }}"
|
||||
></i>
|
||||
<a href="{{ route('tickets.show', ['ticket' => $ticket]) }}">
|
||||
{{ $ticket->subject }}
|
||||
</a>
|
||||
|
||||
Reference in New Issue
Block a user