Skip to content

fix (LAR-107) correction du fichier verify-email #221

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 5 commits into from
Nov 12, 2024
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
5 changes: 5 additions & 0 deletions app/Filament/Resources/ArticleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Filament\Tables\Table;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\Gate;

final class ArticleResource extends Resource
{
Expand Down Expand Up @@ -86,6 +87,8 @@ public static function table(Table $table): Table
->requiresConfirmation()
->modalIcon('heroicon-s-check')
->action(function ($record): void {
Gate::authorize('approve', $record);

$record->approved_at = now();
$record->save();

Expand All @@ -101,6 +104,8 @@ public static function table(Table $table): Table
->requiresConfirmation()
->modalIcon('heroicon-s-x-mark')
->action(function ($record): void {
Gate::authorize('decline', $record);

$record->declined_at = now();
$record->save();
}),
Expand Down
3 changes: 1 addition & 2 deletions app/Http/Requests/UpdatePasswordRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace App\Http\Requests;

use App\Rules\PasswordCheck;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rules\Password;

Expand All @@ -18,7 +17,7 @@ public function authorize(): bool
public function rules(): array
{
return [
'current_password' => ['sometimes', 'required', new PasswordCheck],
'current_password' => ['sometimes', 'required'],
'password' => ['required', 'confirmed', Password::min(8)->uncompromised()],
];
}
Expand Down
2 changes: 1 addition & 1 deletion app/Livewire/Components/Forum/Reply.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function solutionAction(): Action
->authorize('manage', $this->thread)
->action(function (): void {
if ($this->thread->isSolved()) {
undoPoint(new BestReply($this->thread->solutionReply));
undoPoint(new BestReply($this->thread->solutionReply)); // @phpstan-ignore-line
}

$this->thread->markSolution($this->reply, Auth::user()); // @phpstan-ignore-line
Expand Down
11 changes: 7 additions & 4 deletions app/Livewire/Components/Slideovers/ArticleForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ final class ArticleForm extends SlideOverComponent implements HasForms

public function mount(?int $articleId = null): void
{
$this->article = $articleId
/** @var Article $article */
$article = $articleId
? Article::query()->findOrFail($articleId)
: new Article;

$this->form->fill(array_merge($this->article->toArray(), [
'is_draft' => ! $this->article->published_at,
'published_at' => $this->article->published_at,
$this->form->fill(array_merge($article->toArray(), [
'is_draft' => ! $article->published_at,
'published_at' => $article->published_at,
]));

$this->article = $article;
}

public static function panelMaxWidth(): string
Expand Down
53 changes: 0 additions & 53 deletions app/Livewire/Modals/ApprovedArticle.php

This file was deleted.

44 changes: 0 additions & 44 deletions app/Livewire/Modals/DeleteArticle.php

This file was deleted.

44 changes: 0 additions & 44 deletions app/Livewire/Modals/DeleteDiscussion.php

This file was deleted.

1 change: 1 addition & 0 deletions app/Livewire/Pages/Forum/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ protected function applySearch(Builder $query): Builder
protected function applySolved(Builder $query): Builder
{
if ($this->solved) {
// @phpstan-ignore-next-line
return match ($this->solved) {
'no' => $query->scopes('unresolved'),
'yes' => $query->scopes('resolved'),
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Reply.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function mentionedUsers(): array

public function to(ReplyInterface $replyable): void
{
$this->replyAble()->associate($replyable);
$this->replyAble()->associate($replyable); // @phpstan-ignore-line
}

public function allChildReplies(): MorphMany
Expand Down
33 changes: 0 additions & 33 deletions app/Notifications/SendApprovedArticle.php

This file was deleted.

2 changes: 1 addition & 1 deletion app/Policies/ArticlePolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function approve(User $user, Article $article): bool
return $user->isModerator() || $user->isAdmin();
}

public function disapprove(User $user, Article $article): bool
public function decline(User $user, Article $article): bool
{
return $user->isModerator() || $user->isAdmin();
}
Expand Down
1 change: 1 addition & 0 deletions app/Spotlight/Discussion.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function searchDiscussion(string $query): Collection
return DiscussionModel::with('user')
->where('title', 'like', "%{$query}%")
->get()
// @phpstan-ignore-next-line
->map(fn (DiscussionModel $discussion) => new SpotlightSearchResult(
$discussion->slug(),
$discussion->title,
Expand Down
8 changes: 4 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ parameters:
level: 8
excludePaths:
- app/Http/Resources/
- app/Http/Middleware/
- app/Actions/
- app/Notifications/
- app/Http/Controllers/OAuthController.php
- app/Http/Controllers/Api/Auth/LoginController.php
- app/Markdown/MarkdownHelper.php
# Remove this config after migrate everything to livewire
- app/Http/Controllers/*
- app/Markdown/*
- app/Traits/HasSlug
ignoreErrors:
- "#^Cannot access property \\$transaction on array\\|object\\.$#"
- identifier: missingType.iterableValue
Expand Down
37 changes: 0 additions & 37 deletions resources/views/components/forum/filters.blade.php

This file was deleted.

47 changes: 0 additions & 47 deletions resources/views/components/forum/thread-author.blade.php

This file was deleted.

Loading
Loading