Skip to content

Commit

Permalink
Merge pull request #57 from devaslanphp/dev
Browse files Browse the repository at this point in the history
Bug-fix: Ticket number button
  • Loading branch information
heloufir committed Sep 19, 2022
2 parents fe8718b + e7fa24e commit e83f4e4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 4 additions & 2 deletions app/Http/Livewire/TicketDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ public function ticketSaved(): void
/**
* Copy a ticket url
*
* @param Ticket $ticket
* @param int $ticketId
* @return void
*/
public function copyTicketUrl(Ticket $ticket): void {
public function copyTicketUrl(int $ticketId): void
{
$ticket = Ticket::where('id', $ticketId)->first();
Notification::make()
->success()
->title(__('Ticket url copied'))
Expand Down
10 changes: 4 additions & 6 deletions app/Http/Livewire/Tickets.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,15 @@

namespace App\Http\Livewire;

use App\Models\FavoriteProject;
use App\Models\Project;
use App\Models\Ticket;
use App\Models\User;
use Filament\Forms\Components\Grid;
use Filament\Forms\Components\MultiSelect;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Concerns\InteractsWithForms;
use Filament\Forms\Contracts\HasForms;
use Filament\Notifications\Actions\Action;
use Filament\Notifications\Notification;
use Illuminate\Support\Str;
use Livewire\Component;

class Tickets extends Component implements HasForms
Expand Down Expand Up @@ -237,10 +233,12 @@ public function ticketDeleted()
/**
* Copy a ticket url
*
* @param Ticket $ticket
* @param int $ticketId
* @return void
*/
public function copyTicketUrl(Ticket $ticket): void {
public function copyTicketUrl(int $ticketId): void
{
$ticket = Ticket::where('id', $ticketId)->first();
Notification::make()
->success()
->title(__('Ticket url copied'))
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/ticket-details.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<i class="fa fa-tag"></i>
{{ $ticket->project->name }}
<span class="text-xs text-gray-300">/</span>
<button type="button" class="font-normal hover:cursor-pointer hover:underline" wire:click="copyTicketUrl({{ $ticket }})" title="@lang('Click to copy url to ticket')">{{ $ticket->ticket_number }}</button>
<button type="button" class="font-normal hover:cursor-pointer hover:underline" wire:click="copyTicketUrl('{{ $ticket->id }}')" title="@lang('Click to copy url to ticket')">{{ $ticket->ticket_number }}</button>
</span>
<div class="w-full">
@livewire('ticket-details.title', ['ticket' => $ticket])
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/tickets.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
<i class="fa fa-tag"></i>
{{ $ticket->project->name }}
<span class="text-xs text-gray-300">/</span>
<button type="button" class="font-normal hover:cursor-pointer hover:underline" wire:click="copyTicketUrl({{ $ticket }})" title="@lang('Click to copy url to ticket')">{{ $ticket->ticket_number }}</button>
<button type="button" class="font-normal hover:cursor-pointer hover:underline" wire:click="copyTicketUrl('{{ $ticket->id }}')" title="@lang('Click to copy url to ticket')">{{ $ticket->ticket_number }}</button>
</span>
<div class="w-full flex flex-row justify-between items-start gap-5">
<a href="{{ route('tickets.details', ['ticket' => $ticket, 'slug' => Str::slug($ticket->title)]) }}" class="text-lg font-medium text-gray-700 hover:underline">
Expand Down

0 comments on commit e83f4e4

Please sign in to comment.