Skip to content

Fix bugs #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion app/Http/Controllers/Cpanel/AnalyticsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Cpanel;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class AnalyticsController extends Controller
{
Expand Down
1 change: 0 additions & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Kernel extends HttpKernel
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\AndreasElia\Analytics\Http\Middleware\Analytics::class,
];

/**
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Livewire/Discussions/Subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
use App\Models\Discussion;
use App\Models\Subscribe as SubscribeModel;
use App\Policies\DiscussionPolicy;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
use Ramsey\Uuid\Uuid;
use WireUi\Traits\Actions;

class Subscribe extends Component
{
use Actions, AuthorizesRequests;
use AuthorizesRequests;

public Discussion $discussion;

Expand All @@ -28,7 +28,7 @@ public function subscribe()
$subscribe->user()->associate(Auth::user());
$this->discussion->subscribes()->save($subscribe);

$this->notification()->success('Abonnement', 'Vous êtes maintenant abonné à cette discussion.');
// @ToDo Mettre un nouveau system de notification avec Livewire $this->notification()->success('Abonnement', 'Vous êtes maintenant abonné à cette discussion.');
$this->emitSelf('refresh');
}

Expand All @@ -40,11 +40,11 @@ public function unsubscribe()
->where('user_id', Auth::id())
->delete();

$this->notification()->success('Désabonnement', 'Vous êtes maintenant désabonné de cette discussion.');
// @ToDo Mettre un nouveau system de notification $this->notification()->success('Désabonnement', 'Vous êtes maintenant désabonné de cette discussion.');
$this->emitSelf('refresh');
}

public function render()
public function render(): View
{
return view('livewire.discussions.subscribe');
}
Expand Down
33 changes: 18 additions & 15 deletions app/Http/Livewire/Forum/Reply.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
use App\Models\Thread;
use App\Policies\ReplyPolicy;
use App\Policies\ThreadPolicy;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
use WireUi\Traits\Actions;

class Reply extends Component
{
use Actions, AuthorizesRequests;
use AuthorizesRequests;

public ReplyModel $reply;

Expand Down Expand Up @@ -53,10 +53,11 @@ public function edit()

$this->reply->update(['body' => $this->body]);

$this->notification()->success(
'Réponse modifié',
'Vous avez modifié cette solution avec succès.'
);
// @ToDo mettre un nouveau system de notification
// $this->notification()->success(
// 'Réponse modifié',
// 'Vous avez modifié cette solution avec succès.'
// );

$this->isUpdating = false;

Expand All @@ -73,10 +74,11 @@ public function UnMarkAsSolution(): void

$this->emitSelf('refresh');

$this->notification()->success(
'Réponse acceptée',
'Vous avez retiré cette réponse comme solution pour ce sujet.'
);
// @ToDo mettre un nouveau system de notification
// $this->notification()->success(
// 'Réponse acceptée',
// 'Vous avez retiré cette réponse comme solution pour ce sujet.'
// );
}

public function markAsSolution(): void
Expand All @@ -93,13 +95,14 @@ public function markAsSolution(): void

$this->emitSelf('refresh');

$this->notification()->success(
'Réponse acceptée',
'Vous avez accepté cette solution pour ce sujet.'
);
// @ToDo mettre un nouveau system de notification
// $this->notification()->success(
// 'Réponse acceptée',
// 'Vous avez accepté cette solution pour ce sujet.'
// );
}

public function render()
public function render(): View
{
return view('livewire.forum.reply');
}
Expand Down
12 changes: 7 additions & 5 deletions app/Http/Livewire/Forum/Subscribe.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
use App\Models\Subscribe as SubscribeModel;
use App\Models\Thread;
use App\Policies\ThreadPolicy;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
use Ramsey\Uuid\Uuid;
use WireUi\Traits\Actions;

class Subscribe extends Component
{
use Actions, AuthorizesRequests;
use AuthorizesRequests;

public Thread $thread;

Expand All @@ -28,7 +28,8 @@ public function subscribe()
$subscribe->user()->associate(Auth::user());
$this->thread->subscribes()->save($subscribe);

$this->notification()->success('Abonnement', 'Vous êtes maintenant abonné à ce sujet.');
// @ToDo mettre un nouveau system de notification
//$this->notification()->success('Abonnement', 'Vous êtes maintenant abonné à ce sujet.');
$this->emitSelf('refresh');
}

Expand All @@ -40,11 +41,12 @@ public function unsubscribe()
->where('user_id', Auth::id())
->delete();

$this->notification()->success('Désabonnement', 'Vous êtes maintenant désabonné de ce sujet.');
// @ToDo mettre un nouveau system de notification
// $this->notification()->success('Désabonnement', 'Vous êtes maintenant désabonné de ce sujet.');
$this->emitSelf('refresh');
}

public function render()
public function render(): View
{
return view('livewire.forum.subscribe');
}
Expand Down
9 changes: 5 additions & 4 deletions app/Http/Livewire/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

use App\Policies\NotificationPolicy;
use Carbon\Carbon;
use Illuminate\Contracts\View\View;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Notifications\DatabaseNotification;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
use WireUi\Traits\Actions;

class Notifications extends Component
{
use Actions, AuthorizesRequests;
use AuthorizesRequests;

public $notificationId;

Expand All @@ -36,12 +36,13 @@ public function markAsRead(string $notificationId): void
// @phpstan-ignore-next-line
$this->notification->markAsRead();

$this->notification()->success('Notification', 'Cette notification a été marquée comme lue.');
// @ToDo mettre un nouveau system de notification
// $this->notification()->success('Notification', 'Cette notification a été marquée comme lue.');

$this->emit('NotificationMarkedAsRead', Auth::user()->unreadNotifications()->count());
}

public function render()
public function render(): View
{
return view('livewire.notifications', [
'notifications' => Auth::user()
Expand Down
15 changes: 7 additions & 8 deletions app/Http/Livewire/Reactions.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
use WireUi\Traits\Actions;

class Reactions extends Component
{
use Actions;

public ReactableInterface $model;

public bool $withPlaceHolder = true;
Expand All @@ -24,12 +21,14 @@ class Reactions extends Component
public function userReacted(string $reaction): void
{
if (Auth::guest()) {
$this->notification()->error(
'Oh Oh! Erreur',
'Vous devez être connecté pour réagir à ce contenu!'
);
// @ToDo mettre un nouveau system de notification
// $this->notification()->error(
// 'Oh Oh! Erreur',
// 'Vous devez être connecté pour réagir à ce contenu!'
// );
} else {
$react = Reaction::where('name', $reaction)->first();
/** @var Reaction $react */
$react = Reaction::query()->where('name', $reaction)->first();
Auth::user()->reactTo($this->model, $react);
}
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Livewire/User/Settings/Notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;
use WireUi\Traits\Actions;

class Notifications extends Component
{
use Actions, AuthorizesRequests;
use AuthorizesRequests;

public $subscribeId;

Expand All @@ -22,7 +21,8 @@ public function unsubscribe(string $subscribeId)
// @phpstan-ignore-next-line
$this->subscribe->delete();

$this->notification()->success('Désabonnement', 'Vous êtes maintenant désabonné de cet fil.');
// @ToDo mettre un nouveau system de notification
// $this->notification()->success('Désabonnement', 'Vous êtes maintenant désabonné de cet fil.');
}

public function getSubscribeProperty(): Subscribe
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"php": "^8.0",
"ext-fileinfo": "*",
"ext-json": "*",
"andreaselia/analytics": "^1.5",
"archtechx/laravel-seo": "^0.4.0",
"arrilot/laravel-widgets": "^3.13",
"blade-ui-kit/blade-heroicons": "^1.3",
Expand Down
76 changes: 1 addition & 75 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
},
"dependencies": {
"@alpinejs/intersect": "^3.6.1",
"@headlessui/react": "^1.4.2",
"@heroicons/react": "^1.0.5",
"@headlessui/react": "^1.7.2",
"@heroicons/react": "^2.0.11",
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/line-clamp": "^0.3.0",
Expand Down
Loading