From 75f48d72fa05ff7b747eecbaaf4f48e396de56ce Mon Sep 17 00:00:00 2001 From: Arthur Monney Date: Mon, 14 Oct 2024 18:23:44 +0200 Subject: [PATCH] Feature/lar 13 modification navigation (#155) * wip * style: update header and footer navigation * Fix code styling * fix: phpunit.xml conflit * fix: remove Integration Testsuite --------- Co-authored-by: mckenziearts --- .../Commands/NotifyPendingArticles.php | 4 +- app/Console/Kernel.php | 2 +- .../PendingArticlesNotification.php | 8 +- lang/en/global.php | 5 + lang/fr/global.php | 5 + phpunit.xml | 70 +-- resources/css/header.css | 2 +- resources/views/articles/show.blade.php | 2 +- resources/views/auth/login.blade.php | 4 +- .../components/buttons/default.blade.php | 15 +- .../components/buttons/primary.blade.php | 15 +- .../components/dropdown-profile.blade.php | 6 +- .../views/components/layouts/footer.blade.php | 5 +- .../views/components/layouts/header.blade.php | 574 +++++------------- resources/views/components/nav/item.blade.php | 20 +- .../views/components/user/articles.blade.php | 2 +- .../views/components/user/avatar.blade.php | 2 +- .../components/user/discussions.blade.php | 2 +- .../components/user/page-heading.blade.php | 2 +- .../views/components/user/threads.blade.php | 2 +- resources/views/forum/_channels.blade.php | 2 +- resources/views/forum/thread.blade.php | 2 +- resources/views/home.blade.php | 43 +- resources/views/layouts/app.blade.php | 2 +- .../livewire/discussions/browse.blade.php | 2 +- .../views/partials/_navigation.blade.php | 20 + resources/views/partials/_search.blade.php | 23 +- .../views/partials/_socials-link.blade.php | 2 +- resources/views/slack.blade.php | 6 +- resources/views/user/profile.blade.php | 4 +- tests/Feature/Forum/DiscussionTest.php | 2 +- tests/Feature/Forum/ThreadTest.php | 2 +- tests/Feature/NotifyPendingArticlesTest.php | 4 +- 33 files changed, 259 insertions(+), 602 deletions(-) create mode 100644 resources/views/partials/_navigation.blade.php diff --git a/app/Console/Commands/NotifyPendingArticles.php b/app/Console/Commands/NotifyPendingArticles.php index b34572da..447cae17 100644 --- a/app/Console/Commands/NotifyPendingArticles.php +++ b/app/Console/Commands/NotifyPendingArticles.php @@ -5,9 +5,9 @@ namespace App\Console\Commands; use App\Models\Article; +use App\Notifications\PendingArticlesNotification; use Illuminate\Console\Command; use Illuminate\Notifications\AnonymousNotifiable; -use App\Notifications\PendingArticlesNotification; final class NotifyPendingArticles extends Command { @@ -23,4 +23,4 @@ public function handle(AnonymousNotifiable $notifiable): void $notifiable->notify(new PendingArticlesNotification($pendingArticles)); } } -} \ No newline at end of file +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 3ee86670..a86cf296 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -31,4 +31,4 @@ protected function commands(): void { $this->load(__DIR__.'/Commands'); } -} \ No newline at end of file +} diff --git a/app/Notifications/PendingArticlesNotification.php b/app/Notifications/PendingArticlesNotification.php index 9288cd45..51f7167a 100644 --- a/app/Notifications/PendingArticlesNotification.php +++ b/app/Notifications/PendingArticlesNotification.php @@ -5,10 +5,8 @@ namespace App\Notifications; use Illuminate\Bus\Queueable; -use Illuminate\Notifications\Notification; -use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Database\Eloquent\Collection; -use Illuminate\Notifications\Messages\MailMessage; +use Illuminate\Notifications\Notification; use NotificationChannels\Telegram\TelegramChannel; use NotificationChannels\Telegram\TelegramMessage; @@ -42,11 +40,11 @@ private function content(): string 'profile_url' => route('profile', $article->user?->username), 'title' => $article->title, 'url' => route('articles.show', $article->slug), - 'date' => $article->submitted_at->translatedFormat('d/m/Y') + 'date' => $article->submitted_at->translatedFormat('d/m/Y'), ] ); } return $message; } -} \ No newline at end of file +} diff --git a/lang/en/global.php b/lang/en/global.php index f3eaf03e..ca581280 100644 --- a/lang/en/global.php +++ b/lang/en/global.php @@ -12,10 +12,12 @@ 'forum' => 'Forum', 'articles' => 'Posts', 'discussions' => 'Discussions', + 'community' => 'Community', 'about' => 'About', 'podcasts' => 'Podcasts', 'jobs' => 'Jobs', 'sponsors' => 'Sponsors', + 'snippets' => 'Snippets', 'branding' => 'Branding', 'faq' => 'FAQ', 'rules' => 'Rules', @@ -45,5 +47,8 @@ 'sponsored' => 'Sponsored', 'read_time' => ':time min reading', 'page_views' => ':number views', + 'open_navigation' => 'Open main menu', + 'close_navigation' => 'Close menu', + 'view_notifications' => 'View notifications', ]; diff --git a/lang/fr/global.php b/lang/fr/global.php index e322dc7a..348aa942 100644 --- a/lang/fr/global.php +++ b/lang/fr/global.php @@ -12,10 +12,12 @@ 'forum' => 'Forum', 'articles' => 'Articles', 'discussions' => 'Discussions', + 'community' => 'Communauté', 'about' => 'A propos', 'podcasts' => 'Podcasts', 'jobs' => 'Offres', 'sponsors' => 'Soutien', + 'snippets' => 'Snippets', 'branding' => 'Branding', 'faq' => 'FAQ', 'rules' => 'Code de conduite', @@ -45,5 +47,8 @@ 'sponsored' => 'Sponsorisé', 'read_time' => ':time min de lecture', 'page_views' => ':number vues', + 'open_navigation' => 'Ouvrir le menu', + 'close_navigation' => 'Fermer le menu', + 'view_notifications' => 'Voir les notifications', ]; diff --git a/phpunit.xml b/phpunit.xml index e835e094..c2a617c7 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,69 +1,12 @@ -<<<<<<< HEAD - - - - tests/Unit - - - tests/Feature - - - - - app - - - - - - - - - - - - - - -||||||| parent of db5bfeb (refactoring: Drop laravel world dependencies and apply refactoring to views and tests) - - - ./tests/Integration - - - ./tests/Feature - - - - - - - - - - - - - - - - - - ./app - - -======= - - - - ./tests/Unit - ./tests/Feature @@ -86,5 +29,4 @@ ./app ->>>>>>> db5bfeb (refactoring: Drop laravel world dependencies and apply refactoring to views and tests) diff --git a/resources/css/header.css b/resources/css/header.css index 32a932af..836da972 100644 --- a/resources/css/header.css +++ b/resources/css/header.css @@ -1,5 +1,5 @@ .header.is-fixed { - @apply fixed inset-x-0 transform bg-white/80 duration-300; + @apply fixed inset-x-0 bg-white/80 transition-all duration-300; } .header.is-hidden { diff --git a/resources/views/articles/show.blade.php b/resources/views/articles/show.blade.php index 72b6ffdf..0a7a8ab4 100644 --- a/resources/views/articles/show.blade.php +++ b/resources/views/articles/show.blade.php @@ -289,7 +289,7 @@ class="inline-flex items-center rounded-md border border-skin-base bg-skin-butto
{{ __('actions.edit') }} diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 6897ba4e..5f3d7079 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,5 +1,5 @@ -
+

@@ -62,7 +62,7 @@ class="font-medium text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hov @include('partials._socials-link')

-
+
diff --git a/resources/views/components/buttons/default.blade.php b/resources/views/components/buttons/default.blade.php index b1717b19..246d616f 100644 --- a/resources/views/components/buttons/default.blade.php +++ b/resources/views/components/buttons/default.blade.php @@ -1,16 +1,13 @@ -@props(['link' => null]) +@php + $classes = 'inline-flex justify-center py-2 px-4 bg-white border-0 ring-1 ring-gray-200 rounded-lg shadow-sm text-sm text-gray-700 hover:text-gray-900 dark:text-gray-400 hover:bg-gray-50/50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-green-500 dark:bg-gray-800 dark:focus:ring-offset-gray-900'; +@endphp -@if ($link) - twMerge(['class' => 'inline-flex justify-center py-2 px-4 bg-white border border-gray-200 rounded-lg shadow-sm text-sm text-gray-700 hover:text-gray-900 dark:text-gray-400 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-green-500 dark:bg-gray-800 dark:focus:ring-offset-gray-900']) }} - > +@if ($attributes->hasAny(['href', ':href'])) + twMerge(['class' => $classes]) }}> {{ $slot }} @else - @endif diff --git a/resources/views/components/buttons/primary.blade.php b/resources/views/components/buttons/primary.blade.php index 0a934423..9e8f4df0 100644 --- a/resources/views/components/buttons/primary.blade.php +++ b/resources/views/components/buttons/primary.blade.php @@ -1,16 +1,13 @@ -@props(['link' => null]) +@php + $classes = 'inline-flex items-center justify-center py-2 px-4 border-0 text-sm font-medium rounded-lg text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-green-500 dark:ring-offset-gray-900'; +@endphp -@if ($link) - twMerge(['class' => 'inline-flex items-center justify-center py-2 px-4 border-0 text-sm font-medium rounded-lg text-white bg-green-600 hover:bg-green-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-white focus:ring-green-500 dark:ring-offset-gray-900']) }} - > +@if ($attributes->hasAny(['href', ':href'])) + twMerge(['class' => $classes]) }}> {{ $slot }} @else - @endif diff --git a/resources/views/components/dropdown-profile.blade.php b/resources/views/components/dropdown-profile.blade.php index fabb806e..08283f99 100644 --- a/resources/views/components/dropdown-profile.blade.php +++ b/resources/views/components/dropdown-profile.blade.php @@ -1,4 +1,4 @@ -
+
@@ -24,7 +24,7 @@ class="flex rounded-full bg-skin-menu text-sm focus:outline-none focus:ring-2 fo x-transition:leave-start="scale-100 transform opacity-100" x-transition:leave-end="scale-95 transform opacity-0" class="absolute right-0 mt-2 w-60 origin-top-right divide-y divide-skin-light rounded-md bg-skin-menu py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none" - x-ref="menu-items" + x-ref="menu" role="menu" aria-orientation="vertical" aria-labelledby="user-menu-button" diff --git a/resources/views/components/layouts/footer.blade.php b/resources/views/components/layouts/footer.blade.php index d8c5851f..e6b5cf75 100644 --- a/resources/views/components/layouts/footer.blade.php +++ b/resources/views/components/layouts/footer.blade.php @@ -3,7 +3,7 @@
- +
- Souscrire Maintenant + Souscrire Maintenant
@endforeach
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 68129f52..ece9960c 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -32,7 +32,7 @@
- + class($attributes->get('header-class')) }} />
{{ $slot }} diff --git a/resources/views/livewire/discussions/browse.blade.php b/resources/views/livewire/discussions/browse.blade.php index e2c4b08d..47338e53 100644 --- a/resources/views/livewire/discussions/browse.blade.php +++ b/resources/views/livewire/discussions/browse.blade.php @@ -16,7 +16,7 @@ class="inline-flex items-center rounded-md bg-skin-link px-2 py-1 font-sans text @auth

Vous avez un sujet passionnant ?

- Nouvelle discussion + Nouvelle discussion
@endauth diff --git a/resources/views/partials/_navigation.blade.php b/resources/views/partials/_navigation.blade.php new file mode 100644 index 00000000..d481b8a2 --- /dev/null +++ b/resources/views/partials/_navigation.blade.php @@ -0,0 +1,20 @@ + + + + diff --git a/resources/views/partials/_search.blade.php b/resources/views/partials/_search.blade.php index d0bde441..3943d33f 100644 --- a/resources/views/partials/_search.blade.php +++ b/resources/views/partials/_search.blade.php @@ -1,13 +1,18 @@ -
- -
-
- {{ __('global.search_placeholder') }} -
-
- +
+ diff --git a/resources/views/partials/_socials-link.blade.php b/resources/views/partials/_socials-link.blade.php index e638e700..d29bf886 100644 --- a/resources/views/partials/_socials-link.blade.php +++ b/resources/views/partials/_socials-link.blade.php @@ -12,7 +12,7 @@
- + {{ __('pages/auth.continue_with', ['social' => 'Github']) }}
@@ -93,7 +93,7 @@ Avec le plus grand nombre de membres c'est la plateforme qui nous affectionne le plus alors n'hésitez surtout pas à nous rejoindre.

- + Rejoindre
@@ -114,7 +114,7 @@ Discord est le dernier réseau rejoint par la communauté, vous pouvez nous rejoindre et participer à toutes nos activités.

- + Rejoindre
diff --git a/resources/views/user/profile.blade.php b/resources/views/user/profile.blade.php index f09fb584..48710003 100644 --- a/resources/views/user/profile.blade.php +++ b/resources/views/user/profile.blade.php @@ -34,7 +34,7 @@ class="size-24 !ring-4 ring-card sm:size-32"
@if ($user->isLoggedInUser()) - + {{ __(':name ne possède aucun badge', ['name' => $user->name]) }}

- Voir tous les badges + Voir tous les badges
diff --git a/tests/Feature/Forum/DiscussionTest.php b/tests/Feature/Forum/DiscussionTest.php index 28bd459b..796a0df4 100644 --- a/tests/Feature/Forum/DiscussionTest.php +++ b/tests/Feature/Forum/DiscussionTest.php @@ -69,4 +69,4 @@ // When providing a slug with invalid url characters, a random 5 character string is returned. expect($discussion->slug())->toMatch('/\w{5}/'); -}); \ No newline at end of file +}); diff --git a/tests/Feature/Forum/ThreadTest.php b/tests/Feature/Forum/ThreadTest.php index 0aaefeaa..a04623b7 100644 --- a/tests/Feature/Forum/ThreadTest.php +++ b/tests/Feature/Forum/ThreadTest.php @@ -187,4 +187,4 @@ function createActiveThread(): Thread $reply->save(); return $thread; -} \ No newline at end of file +} diff --git a/tests/Feature/NotifyPendingArticlesTest.php b/tests/Feature/NotifyPendingArticlesTest.php index 7e260cba..3567746e 100644 --- a/tests/Feature/NotifyPendingArticlesTest.php +++ b/tests/Feature/NotifyPendingArticlesTest.php @@ -6,7 +6,7 @@ use App\Models\Article; use Illuminate\Support\Facades\Notification; -beforeEach(fn() => Notification::fake()); +beforeEach(fn () => Notification::fake()); it('will send a notification when there are pending articles', function (): void { Article::factory()->createMany([ @@ -46,4 +46,4 @@ Notification::assertNothingSent(); Notification::assertCount(0); -}); \ No newline at end of file +});