diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..36a8e51 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,16 @@ +{ + "semi": true, + "singleQuote": true, + "tabWidth": 4, + "printWidth": 120, + "trailingComma": "none", + "bracketSpacing": true, + "arrowParens": "avoid", + "endOfLine": "lf", + "htmlWhitespaceSensitivity": "strict", + "singleAttributePerLine": false, + "jsxSingleQuote": false, + "jsxBracketSameLine": true, + "vueIndentScriptAndStyle": true, + "bracketSameLine": true +} \ No newline at end of file diff --git a/assets/vue/app/router/index.js b/assets/vue/app/router/index.js index a56c511..9da2d15 100644 --- a/assets/vue/app/router/index.js +++ b/assets/vue/app/router/index.js @@ -1,17 +1,17 @@ import { createRouter, createWebHistory } from 'vue-router'; import Layout from '../shared/components/layout/Layout.vue'; import HomePage from '../domain/manga/presentation/pages/HomePage.vue'; -import MangaDetails from "../domain/manga/presentation/pages/MangaDetails.vue"; +import MangaDetails from '../domain/manga/presentation/pages/MangaDetails.vue'; // Placeholder component for new routes const PlaceholderComponent = { - props: { - title: { - type: String, - required: true - } - }, - template: ` + props: { + title: { + type: String, + required: true + } + }, + template: `

{{ title }}

Cette fonctionnalité sera bientôt disponible.

@@ -20,118 +20,130 @@ const PlaceholderComponent = { }; const routes = [ - { - path: '/', - component: Layout, - children: [ - { - path: '', - name: 'home', - component: HomePage - }, - { - path: '/manga/:id', - name: 'manga-details', - component: MangaDetails - }, - { - path: '/add', - name: 'add-manga', - component: PlaceholderComponent, - props: { title: 'Ajouter un manga' } - }, - { - path: '/reader/:chapterId', - name: 'reader', - component: PlaceholderComponent, - props: { title: 'Lecteur' } - }, - // Pages placeholder avec chargement différé - { - path: '/import', - name: 'import', - component: PlaceholderComponent, - props: { title: 'Import de bibliothèque' } - }, - { - path: '/discover', - name: 'discover', - component: PlaceholderComponent, - props: { title: 'Découvrir' } - }, - { - path: '/convert', - name: 'convert', - component: PlaceholderComponent, - props: { title: 'Convertir CBR en CBZ' } - }, - { - path: '/calendar', - name: 'calendar', - component: PlaceholderComponent, - props: { title: 'Calendrier' } - }, - { - path: '/activity', - name: 'activity', - component: PlaceholderComponent, - props: { title: 'Activité' } - }, - // Paramètres - { - path: '/settings/general', - name: 'settings-general', - component: PlaceholderComponent, - props: { title: 'Paramètres généraux' } - }, - { - path: '/settings/folders', - name: 'settings-folders', - component: PlaceholderComponent, - props: { title: 'Gestion des dossiers' } - }, - { - path: '/settings/scrappers', - name: 'settings-scrappers', - component: PlaceholderComponent, - props: { title: 'Configuration des scrappers' } - }, - { - path: '/settings/ui', - name: 'settings-ui', - component: PlaceholderComponent, - props: { title: "Paramètres de l'interface" } - }, - // Système - { - path: '/system/status', - name: 'system-status', - component: PlaceholderComponent, - props: { title: 'Status du système' } - }, - { - path: '/system/backup', - name: 'system-backup', - component: PlaceholderComponent, - props: { title: 'Sauvegarde' } - }, - { - path: '/system/logs', - name: 'system-logs', - component: PlaceholderComponent, - props: { title: 'Journaux système' } - }, - { - path: '/system/updates', - name: 'system-updates', - component: PlaceholderComponent, - props: { title: 'Mises à jour' } - } - ] - } + { + path: '/', + component: Layout, + children: [ + { + path: '', + name: 'home', + component: HomePage + }, + { + path: '/manga/:id', + name: 'manga-details', + component: MangaDetails + }, + { + path: '/add', + name: 'add-manga', + component: PlaceholderComponent, + props: { title: 'Ajouter un manga' } + }, + { + path: '/reader/:chapterId', + name: 'reader', + component: PlaceholderComponent, + props: { title: 'Lecteur' } + }, + // Pages placeholder avec chargement différé + { + path: '/import', + name: 'import', + component: PlaceholderComponent, + props: { title: 'Import de bibliothèque' } + }, + { + path: '/discover', + name: 'discover', + component: PlaceholderComponent, + props: { title: 'Découvrir' } + }, + { + path: '/convert', + name: 'convert', + component: PlaceholderComponent, + props: { title: 'Convertir CBR en CBZ' } + }, + { + path: '/calendar', + name: 'calendar', + component: PlaceholderComponent, + props: { title: 'Calendrier' } + }, + { + path: '/activity', + name: 'activity', + component: PlaceholderComponent, + props: { title: 'Activité' } + }, + // Paramètres + { + path: '/settings', + name: 'settings', + component: PlaceholderComponent, + props: { title: 'Paramètres' } + }, + { + path: '/settings/general', + name: 'settings-general', + component: PlaceholderComponent, + props: { title: 'Paramètres généraux' } + }, + { + path: '/settings/folders', + name: 'settings-folders', + component: PlaceholderComponent, + props: { title: 'Gestion des dossiers' } + }, + { + path: '/settings/scrappers', + name: 'settings-scrappers', + component: PlaceholderComponent, + props: { title: 'Configuration des scrappers' } + }, + { + path: '/settings/ui', + name: 'settings-ui', + component: PlaceholderComponent, + props: { title: "Paramètres de l'interface" } + }, + // Système + { + path: '/system', + name: 'system', + component: PlaceholderComponent, + props: { title: 'Système' } + }, + { + path: '/system/status', + name: 'system-status', + component: PlaceholderComponent, + props: { title: 'Status du système' } + }, + { + path: '/system/backup', + name: 'system-backup', + component: PlaceholderComponent, + props: { title: 'Sauvegarde' } + }, + { + path: '/system/logs', + name: 'system-logs', + component: PlaceholderComponent, + props: { title: 'Journaux système' } + }, + { + path: '/system/updates', + name: 'system-updates', + component: PlaceholderComponent, + props: { title: 'Mises à jour' } + } + ] + } ]; export const router = createRouter({ - history: createWebHistory('/vue/'), - routes + history: createWebHistory('/vue/'), + routes }); diff --git a/assets/vue/app/shared/components/layout/Layout.vue b/assets/vue/app/shared/components/layout/Layout.vue index 071503d..ed9378b 100644 --- a/assets/vue/app/shared/components/layout/Layout.vue +++ b/assets/vue/app/shared/components/layout/Layout.vue @@ -1,36 +1,31 @@ \ No newline at end of file + defineEmits(['manga-click', 'add-manga-click']); + diff --git a/assets/vue/app/shared/components/layout/Sidebar.vue b/assets/vue/app/shared/components/layout/Sidebar.vue index b6496ce..3e06c94 100644 --- a/assets/vue/app/shared/components/layout/Sidebar.vue +++ b/assets/vue/app/shared/components/layout/Sidebar.vue @@ -1,155 +1,131 @@ \ No newline at end of file + return route.path.startsWith(item.to); + }; + + const menuItems = [ + { + icon: BookOpenIcon, + text: 'Mangas', + to: '/', + id: 'mangas', + subItems: [ + { icon: PlusIcon.render, text: 'Ajouter un nouveau', to: '/add' }, + { + icon: ArrowDownTrayIcon, + text: 'Import bibliothèque', + to: '/import' + }, + { icon: GlobeAltIcon, text: 'Découvrir', to: '/discover' } + ] + }, + { + icon: ArrowsRightLeftIcon, + text: 'Convertir CBR en CBZ', + to: '/convert' + }, + { + icon: CalendarIcon, + text: 'Calendrier', + to: '/calendar' + }, + { + icon: ClockIcon, + text: 'Activité', + to: '/activity', + badge: '3' + }, + { + icon: Cog6ToothIcon, + text: 'Paramètres', + to: '/settings', + id: 'settings', + subItems: [ + { icon: null, text: 'Général', to: '/settings/general' }, + { icon: null, text: 'Dossiers', to: '/settings/folders' }, + { icon: null, text: 'Scrappers', to: '/settings/scrappers' }, + { icon: null, text: 'UI', to: '/settings/ui' } + ] + }, + { + icon: ComputerDesktopIcon, + text: 'Système', + to: '/system', + id: 'system', + subItems: [ + { icon: null, text: 'Status', to: '/system/status' }, + { icon: null, text: 'Backup', to: '/system/backup' }, + { icon: null, text: 'Logs', to: '/system/logs' }, + { icon: null, text: 'Updates', to: '/system/updates' } + ] + } + ]; + diff --git a/assets/vue/app/shared/components/layout/sidebar/MenuGroup.vue b/assets/vue/app/shared/components/layout/sidebar/MenuGroup.vue new file mode 100644 index 0000000..9364fd8 --- /dev/null +++ b/assets/vue/app/shared/components/layout/sidebar/MenuGroup.vue @@ -0,0 +1,97 @@ + + + diff --git a/assets/vue/app/shared/components/layout/sidebar/MenuItem.vue b/assets/vue/app/shared/components/layout/sidebar/MenuItem.vue new file mode 100644 index 0000000..343db8e --- /dev/null +++ b/assets/vue/app/shared/components/layout/sidebar/MenuItem.vue @@ -0,0 +1,47 @@ + + + + + diff --git a/assets/vue/app/shared/components/layout/sidebar/SubMenuItem.vue b/assets/vue/app/shared/components/layout/sidebar/SubMenuItem.vue new file mode 100644 index 0000000..41fc550 --- /dev/null +++ b/assets/vue/app/shared/components/layout/sidebar/SubMenuItem.vue @@ -0,0 +1,31 @@ + + + + + diff --git a/assets/vue/app/shared/stores/menuStore.js b/assets/vue/app/shared/stores/menuStore.js new file mode 100644 index 0000000..896cd10 --- /dev/null +++ b/assets/vue/app/shared/stores/menuStore.js @@ -0,0 +1,12 @@ +import { defineStore } from 'pinia'; + +export const useMenuStore = defineStore('menu', { + state: () => ({ + activeMenuId: null + }), + actions: { + setActiveMenu(menuId) { + this.activeMenuId = menuId; + } + } +}); diff --git a/tests/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandlerTest.php b/tests/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandlerTest.php index fb1fcbc..eb98ebd 100644 --- a/tests/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandlerTest.php +++ b/tests/Domain/Manga/Application/QueryHandler/GetMangaBySlugHandlerTest.php @@ -27,17 +27,17 @@ class GetMangaBySlugHandlerTest extends TestCase { // Arrange $manga = new Manga( - new MangaId('1'), - new MangaTitle('One Piece'), - new MangaSlug('one-piece'), - 'Description', - 'Eiichiro Oda', - 1997, - ['Action', 'Adventure'], - 'ongoing', - null, - 'https://example.com/image.jpg', - 4.5 + id: new MangaId('1'), + title: new MangaTitle('One Piece'), + slug: new MangaSlug('one-piece'), + description: 'Description', + author: 'Eiichiro Oda', + publicationYear: 1997, + genres: ['Action', 'Adventure'], + status: 'ongoing', + externalId: null, + imageUrl: 'https://example.com/image.jpg', + rating: 4.5 ); $this->repository->save($manga); @@ -71,4 +71,4 @@ class GetMangaBySlugHandlerTest extends TestCase { $this->repository->clear(); } -} \ No newline at end of file +}