From 8d227803c0befd7c272a66ceefbcd1fe1b917a14 Mon Sep 17 00:00:00 2001
From: Ilya Stepenko <38462532+VampireAotD@users.noreply.github.com>
Date: Fri, 10 Nov 2023 20:25:11 +0200
Subject: [PATCH] Refactored code
---
.github/workflows/frontend-build.yml | 2 +-
src/.prettierignore | 1 +
.../Controllers/Anime/AnimeController.php | 2 -
src/resources/js/Components/Carousel.vue | 7 +-
.../js/Components/DashboardSlider.vue | 89 ---------------
.../Components/DataTable/EasyTableWrapper.vue | 84 --------------
.../Telegram/TelegramLoginWidget.vue | 51 ---------
.../js/Components/TelegramLoginWidget.vue | 72 ++++++++++++
.../{Theme/Switcher.vue => ThemeSwitcher.vue} | 5 +-
.../js/Layouts/AuthenticatedLayout.vue | 6 +-
src/resources/js/Pages/Anime/Index.vue | 101 +----------------
.../js/Pages/Anime/Partials/AddAnimeForm.vue | 32 ++++--
.../Pages/Anime/Partials/AddMethodModal.vue | 13 +++
.../js/Pages/Anime/Partials/DataTable.vue | 103 ++++++++++++++++++
src/resources/js/Pages/Anime/Show.vue | 2 +-
.../js/Pages/Dashboard/Dashboard.vue | 2 +-
.../Dashboard/Partials/CountPerDomain.vue | 6 +-
.../Profile/Partials/IntegrationList.vue | 12 +-
src/resources/js/app.ts | 11 +-
src/resources/js/bootstrap.ts | 1 +
.../Components/TelegramLoginWidget.test.ts | 74 +++++++++++++
.../js/tests/Components/ThemeSwitcher.test.ts | 24 ++++
.../tests/Layouts/AuthenticatedLayout.test.ts | 5 +-
.../js/tests/plugins/user/authorize.test.ts | 12 +-
src/resources/js/types/anime/props.ts | 18 ---
.../js/types/anime/{models.ts => types.ts} | 6 +
src/resources/js/types/index.d.ts | 13 +++
src/resources/js/types/telegram/enums.ts | 10 ++
src/resources/js/types/telegram/types.ts | 21 ----
.../Controllers/Anime/AnimeControllerTest.php | 2 +-
src/tsconfig.json | 17 ++-
31 files changed, 403 insertions(+), 401 deletions(-)
delete mode 100644 src/resources/js/Components/DashboardSlider.vue
delete mode 100644 src/resources/js/Components/DataTable/EasyTableWrapper.vue
delete mode 100644 src/resources/js/Components/Telegram/TelegramLoginWidget.vue
create mode 100644 src/resources/js/Components/TelegramLoginWidget.vue
rename src/resources/js/Components/{Theme/Switcher.vue => ThemeSwitcher.vue} (65%)
create mode 100644 src/resources/js/Pages/Anime/Partials/AddMethodModal.vue
create mode 100644 src/resources/js/Pages/Anime/Partials/DataTable.vue
create mode 100644 src/resources/js/tests/Components/TelegramLoginWidget.test.ts
create mode 100644 src/resources/js/tests/Components/ThemeSwitcher.test.ts
delete mode 100644 src/resources/js/types/anime/props.ts
rename src/resources/js/types/anime/{models.ts => types.ts} (83%)
create mode 100644 src/resources/js/types/telegram/enums.ts
diff --git a/.github/workflows/frontend-build.yml b/.github/workflows/frontend-build.yml
index b4642e0f..dfdb4644 100644
--- a/.github/workflows/frontend-build.yml
+++ b/.github/workflows/frontend-build.yml
@@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
- node-version: [ 18.x ]
+ node-version: [ 20.x ]
steps:
- uses: actions/checkout@v4
diff --git a/src/.prettierignore b/src/.prettierignore
index 1da59b79..f3d38c2c 100644
--- a/src/.prettierignore
+++ b/src/.prettierignore
@@ -6,3 +6,4 @@
!*.vue
!*.ts
!*.js
+!tsconfig.json
diff --git a/src/app/Http/Controllers/Anime/AnimeController.php b/src/app/Http/Controllers/Anime/AnimeController.php
index 3cecfff5..b8af67e5 100644
--- a/src/app/Http/Controllers/Anime/AnimeController.php
+++ b/src/app/Http/Controllers/Anime/AnimeController.php
@@ -13,7 +13,6 @@
use App\Models\Anime;
use App\Repositories\Anime\AnimeRepositoryInterface;
use App\Repositories\Filters\ColumnFilter;
-use App\Repositories\Filters\RelationFilter;
use App\Repositories\Params\PaginationParams;
use App\Services\AnimeService;
use Illuminate\Http\RedirectResponse;
@@ -40,7 +39,6 @@ public function index(IndexRequest $request): Response
$filter = new PaginationParams($page, $perPage);
$pagination = $this->animeRepository->withFilters([
new ColumnFilter(['id', 'title', 'episodes', 'rating', 'status']),
- new RelationFilter(['image:model_id,path']),
])->paginate($filter);
return Inertia::render('Anime/Index', compact('pagination'));
diff --git a/src/resources/js/Components/Carousel.vue b/src/resources/js/Components/Carousel.vue
index 5154a3e3..6eebd351 100644
--- a/src/resources/js/Components/Carousel.vue
+++ b/src/resources/js/Components/Carousel.vue
@@ -1,8 +1,7 @@
-
-
-