From 9c6ea387984dcfa750842c7ad578b3835f43c1f9 Mon Sep 17 00:00:00 2001 From: Jam <1347620+JamsRepos@users.noreply.github.com> Date: Mon, 29 Apr 2024 20:09:24 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20Replaced=20the=20default=20?= =?UTF-8?q?homepage=20with=20the=20invite=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/NavBars/DefaultNavBar.vue | 18 +- .../admin/components/Forms/InvitationForm.vue | 2 +- .../InvitationManager/Invitation.vue | 2 +- .../InvitationList/InvitationItem.vue | 4 +- .../components/Invitations/ShareSheet.vue | 4 +- .../components/Users/UserManager/User.vue | 2 +- .../src/modules/{join => home}/events.ts | 0 .../modules/{join => home}/pages/Complete.vue | 4 +- .../{join => home}/pages/Emby/Signup.vue | 0 .../modules/{join => home}/pages/Error.vue | 0 .../{join => home}/pages/Jellyfin/Signup.vue | 0 .../modules/{join => home}/pages/JoinForm.vue | 6 +- .../modules/{join => home}/pages/Payment.vue | 0 .../{join => home}/pages/Plex/Signup.vue | 0 .../modules/{join => home}/pages/Signup.vue | 0 .../modules/{join => home}/pages/Stepper.vue | 0 .../src/modules/home/router/index.ts | 16 + .../modules/{join => home}/types/EmbyForm.ts | 0 .../{join => home}/types/EventRecords.ts | 0 .../{join => home}/types/JellyfinForm.ts | 0 .../src/modules/home/views/Home.vue | 333 ++++++++++++++++-- .../src/modules/join/router/index.ts | 16 - .../src/modules/join/views/Join.vue | 327 ----------------- apps/wizarr-frontend/src/router/index.ts | 4 +- apps/wizarr-frontend/tailwind.config.js | 5 - docs/getting-started/reverse-proxy.md | 4 +- 26 files changed, 351 insertions(+), 396 deletions(-) rename apps/wizarr-frontend/src/modules/{join => home}/events.ts (100%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Complete.vue (93%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Emby/Signup.vue (100%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Error.vue (100%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Jellyfin/Signup.vue (100%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/JoinForm.vue (88%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Payment.vue (100%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Plex/Signup.vue (100%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Signup.vue (100%) rename apps/wizarr-frontend/src/modules/{join => home}/pages/Stepper.vue (100%) rename apps/wizarr-frontend/src/modules/{join => home}/types/EmbyForm.ts (100%) rename apps/wizarr-frontend/src/modules/{join => home}/types/EventRecords.ts (100%) rename apps/wizarr-frontend/src/modules/{join => home}/types/JellyfinForm.ts (100%) delete mode 100644 apps/wizarr-frontend/src/modules/join/router/index.ts delete mode 100644 apps/wizarr-frontend/src/modules/join/views/Join.vue diff --git a/apps/wizarr-frontend/src/components/NavBars/DefaultNavBar.vue b/apps/wizarr-frontend/src/components/NavBars/DefaultNavBar.vue index 762227ff3..3bdbf9ded 100644 --- a/apps/wizarr-frontend/src/components/NavBars/DefaultNavBar.vue +++ b/apps/wizarr-frontend/src/components/NavBars/DefaultNavBar.vue @@ -1,9 +1,14 @@ diff --git a/apps/wizarr-frontend/src/modules/admin/components/Forms/InvitationForm.vue b/apps/wizarr-frontend/src/modules/admin/components/Forms/InvitationForm.vue index c384e1285..4c61e2f9c 100644 --- a/apps/wizarr-frontend/src/modules/admin/components/Forms/InvitationForm.vue +++ b/apps/wizarr-frontend/src/modules/admin/components/Forms/InvitationForm.vue @@ -377,7 +377,7 @@ export default defineComponent({ }); }, inviteLink() { - return `${window.location.origin}/j/${this.inviteCode}`; + return `${window.location.origin}/i/${this.inviteCode}`; }, ...mapState(useLibrariesStore, ["libraries"]), ...mapState(useServerStore, ["settings"]), diff --git a/apps/wizarr-frontend/src/modules/admin/components/InvitationManager/Invitation.vue b/apps/wizarr-frontend/src/modules/admin/components/InvitationManager/Invitation.vue index ec6e4bdf0..5a18e2abb 100644 --- a/apps/wizarr-frontend/src/modules/admin/components/InvitationManager/Invitation.vue +++ b/apps/wizarr-frontend/src/modules/admin/components/InvitationManager/Invitation.vue @@ -91,7 +91,7 @@ export default defineComponent({ active: true, }, { - value: `${window.location.origin}/j/${this.invitation.code}`, + value: `${window.location.origin}/i/${this.invitation.code}`, active: false, }, ], diff --git a/apps/wizarr-frontend/src/modules/admin/components/Invitations/InvitationList/InvitationItem.vue b/apps/wizarr-frontend/src/modules/admin/components/Invitations/InvitationList/InvitationItem.vue index 337eeefb1..de8df986e 100644 --- a/apps/wizarr-frontend/src/modules/admin/components/Invitations/InvitationList/InvitationItem.vue +++ b/apps/wizarr-frontend/src/modules/admin/components/Invitations/InvitationList/InvitationItem.vue @@ -105,7 +105,7 @@ export default defineComponent({ text: this.__( 'I wanted to invite you to join my media server.', ), - url: `${window.location.origin}/j/${this.invite.code}`, + url: `${window.location.origin}/i/${this.invite.code}`, }, }; }, @@ -138,7 +138,7 @@ export default defineComponent({ async copyToClipboard() { if (this.clipboard.isSupported) { this.clipboard.copy( - `${window.location.origin}/j/${this.invite.code}`, + `${window.location.origin}/i/${this.invite.code}`, ); this.$toast.info(this.__('Copied to clipboard')); } else { diff --git a/apps/wizarr-frontend/src/modules/admin/components/Invitations/ShareSheet.vue b/apps/wizarr-frontend/src/modules/admin/components/Invitations/ShareSheet.vue index 1e680e258..ee244c74c 100644 --- a/apps/wizarr-frontend/src/modules/admin/components/Invitations/ShareSheet.vue +++ b/apps/wizarr-frontend/src/modules/admin/components/Invitations/ShareSheet.vue @@ -66,9 +66,9 @@ export default defineComponent({ }, data() { return { - invitationLink: `${window.location.origin}/j/${this.code}`, + invitationLink: `${window.location.origin}/i/${this.code}`, QRcode: useQRCode( - `${window.location.origin}/j/${this.code}`, + `${window.location.origin}/i/${this.code}`, this.qrCodeOptions, ), clipboard: useClipboard({ diff --git a/apps/wizarr-frontend/src/modules/admin/components/Users/UserManager/User.vue b/apps/wizarr-frontend/src/modules/admin/components/Users/UserManager/User.vue index caf17377a..a7680b7bb 100644 --- a/apps/wizarr-frontend/src/modules/admin/components/Users/UserManager/User.vue +++ b/apps/wizarr-frontend/src/modules/admin/components/Users/UserManager/User.vue @@ -100,7 +100,7 @@ export default defineComponent({ active: true, }, { - value: `${window.location.origin}/j/${this.user.code}`, + value: `${window.location.origin}/i/${this.user.code}`, active: false, }, ], diff --git a/apps/wizarr-frontend/src/modules/join/events.ts b/apps/wizarr-frontend/src/modules/home/events.ts similarity index 100% rename from apps/wizarr-frontend/src/modules/join/events.ts rename to apps/wizarr-frontend/src/modules/home/events.ts diff --git a/apps/wizarr-frontend/src/modules/join/pages/Complete.vue b/apps/wizarr-frontend/src/modules/home/pages/Complete.vue similarity index 93% rename from apps/wizarr-frontend/src/modules/join/pages/Complete.vue rename to apps/wizarr-frontend/src/modules/home/pages/Complete.vue index 389343fff..8b5d48db2 100644 --- a/apps/wizarr-frontend/src/modules/join/pages/Complete.vue +++ b/apps/wizarr-frontend/src/modules/home/pages/Complete.vue @@ -29,12 +29,12 @@ import { defineComponent } from 'vue'; import { useServerStore } from '@/stores/server'; export default defineComponent({ - name: 'JoinCompleteView', + name: 'CompleteView', computed: { ...mapState(useServerStore, ['settings']), }, mounted() { - console.log('mounted join complete view'); + console.log('mounted complete view'); }, }); diff --git a/apps/wizarr-frontend/src/modules/join/pages/Emby/Signup.vue b/apps/wizarr-frontend/src/modules/home/pages/Emby/Signup.vue similarity index 100% rename from apps/wizarr-frontend/src/modules/join/pages/Emby/Signup.vue rename to apps/wizarr-frontend/src/modules/home/pages/Emby/Signup.vue diff --git a/apps/wizarr-frontend/src/modules/join/pages/Error.vue b/apps/wizarr-frontend/src/modules/home/pages/Error.vue similarity index 100% rename from apps/wizarr-frontend/src/modules/join/pages/Error.vue rename to apps/wizarr-frontend/src/modules/home/pages/Error.vue diff --git a/apps/wizarr-frontend/src/modules/join/pages/Jellyfin/Signup.vue b/apps/wizarr-frontend/src/modules/home/pages/Jellyfin/Signup.vue similarity index 100% rename from apps/wizarr-frontend/src/modules/join/pages/Jellyfin/Signup.vue rename to apps/wizarr-frontend/src/modules/home/pages/Jellyfin/Signup.vue diff --git a/apps/wizarr-frontend/src/modules/join/pages/JoinForm.vue b/apps/wizarr-frontend/src/modules/home/pages/JoinForm.vue similarity index 88% rename from apps/wizarr-frontend/src/modules/join/pages/JoinForm.vue rename to apps/wizarr-frontend/src/modules/home/pages/JoinForm.vue index ecd0a1876..0ea3933d0 100644 --- a/apps/wizarr-frontend/src/modules/join/pages/JoinForm.vue +++ b/apps/wizarr-frontend/src/modules/home/pages/JoinForm.vue @@ -54,9 +54,9 @@ export default defineComponent({ // Check if the code is valid if (!response) return; - // If the route is /join then change to /j/:code - if (this.$route.path === '/join') { - this.$router.replace(`/j/${this.code}`); + // If the route is /, /join, or /j, change to /i/:code + if (this.$route.path === '/' || this.$route.path === '/join' || this.$route.path === '/j') { + this.$router.replace(`/i/${this.code}`); } // Go to the next step diff --git a/apps/wizarr-frontend/src/modules/join/pages/Payment.vue b/apps/wizarr-frontend/src/modules/home/pages/Payment.vue similarity index 100% rename from apps/wizarr-frontend/src/modules/join/pages/Payment.vue rename to apps/wizarr-frontend/src/modules/home/pages/Payment.vue diff --git a/apps/wizarr-frontend/src/modules/join/pages/Plex/Signup.vue b/apps/wizarr-frontend/src/modules/home/pages/Plex/Signup.vue similarity index 100% rename from apps/wizarr-frontend/src/modules/join/pages/Plex/Signup.vue rename to apps/wizarr-frontend/src/modules/home/pages/Plex/Signup.vue diff --git a/apps/wizarr-frontend/src/modules/join/pages/Signup.vue b/apps/wizarr-frontend/src/modules/home/pages/Signup.vue similarity index 100% rename from apps/wizarr-frontend/src/modules/join/pages/Signup.vue rename to apps/wizarr-frontend/src/modules/home/pages/Signup.vue diff --git a/apps/wizarr-frontend/src/modules/join/pages/Stepper.vue b/apps/wizarr-frontend/src/modules/home/pages/Stepper.vue similarity index 100% rename from apps/wizarr-frontend/src/modules/join/pages/Stepper.vue rename to apps/wizarr-frontend/src/modules/home/pages/Stepper.vue diff --git a/apps/wizarr-frontend/src/modules/home/router/index.ts b/apps/wizarr-frontend/src/modules/home/router/index.ts index 2e983aed2..cb201995e 100644 --- a/apps/wizarr-frontend/src/modules/home/router/index.ts +++ b/apps/wizarr-frontend/src/modules/home/router/index.ts @@ -1,11 +1,27 @@ import type { RouteRecordRaw } from 'vue-router'; const routes: Readonly = [ + { + path: '/i/:invite', + name: 'invite', + component: () => import('../views/Home.vue'), + }, { path: '/', name: 'home', component: () => import('../views/Home.vue'), }, + // TODO: Remove this route after a few versions to allow users to get used to the new route + { + path: '/j/:invite', + name: 'invite', + component: () => import('../views/Home.vue'), + }, + { + path: '/join', + name: 'home', + component: () => import('../views/Home.vue'), + }, ]; export default routes; diff --git a/apps/wizarr-frontend/src/modules/join/types/EmbyForm.ts b/apps/wizarr-frontend/src/modules/home/types/EmbyForm.ts similarity index 100% rename from apps/wizarr-frontend/src/modules/join/types/EmbyForm.ts rename to apps/wizarr-frontend/src/modules/home/types/EmbyForm.ts diff --git a/apps/wizarr-frontend/src/modules/join/types/EventRecords.ts b/apps/wizarr-frontend/src/modules/home/types/EventRecords.ts similarity index 100% rename from apps/wizarr-frontend/src/modules/join/types/EventRecords.ts rename to apps/wizarr-frontend/src/modules/home/types/EventRecords.ts diff --git a/apps/wizarr-frontend/src/modules/join/types/JellyfinForm.ts b/apps/wizarr-frontend/src/modules/home/types/JellyfinForm.ts similarity index 100% rename from apps/wizarr-frontend/src/modules/join/types/JellyfinForm.ts rename to apps/wizarr-frontend/src/modules/home/types/JellyfinForm.ts diff --git a/apps/wizarr-frontend/src/modules/home/views/Home.vue b/apps/wizarr-frontend/src/modules/home/views/Home.vue index a962a3b3e..624ba34ba 100644 --- a/apps/wizarr-frontend/src/modules/home/views/Home.vue +++ b/apps/wizarr-frontend/src/modules/home/views/Home.vue @@ -1,50 +1,325 @@ diff --git a/apps/wizarr-frontend/src/modules/join/router/index.ts b/apps/wizarr-frontend/src/modules/join/router/index.ts deleted file mode 100644 index e7dbd5d03..000000000 --- a/apps/wizarr-frontend/src/modules/join/router/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import type { RouteRecordRaw } from 'vue-router'; - -const routes: Readonly = [ - { - path: '/j/:invite', - name: 'join-invite', - component: () => import('../views/Join.vue'), - }, - { - path: '/join', - name: 'join', - component: () => import('../views/Join.vue'), - }, -]; - -export default routes; diff --git a/apps/wizarr-frontend/src/modules/join/views/Join.vue b/apps/wizarr-frontend/src/modules/join/views/Join.vue deleted file mode 100644 index df51f56bb..000000000 --- a/apps/wizarr-frontend/src/modules/join/views/Join.vue +++ /dev/null @@ -1,327 +0,0 @@ - - - diff --git a/apps/wizarr-frontend/src/router/index.ts b/apps/wizarr-frontend/src/router/index.ts index 8b88cb1af..b4650d409 100644 --- a/apps/wizarr-frontend/src/router/index.ts +++ b/apps/wizarr-frontend/src/router/index.ts @@ -12,7 +12,6 @@ import middlewarePipeline from './middlewarePipeline'; // Import all Routes from the modules import homeRoutes from '@/modules/home/router'; import authenticationRoutes from '@/modules/authentication/router'; -import joinRoutes from '@/modules/join/router'; import adminRoutes from '@/modules/admin/router'; import settingsRoutes from '@/modules/settings/router'; import helpRoutes from '@/modules/help/router'; @@ -26,9 +25,8 @@ const router = createRouter({ ? createWebHistory() : createMemoryHistory(), routes: [ - ...homeRoutes, // Homepage routes ["/"] + ...homeRoutes, // Homepage routes ["/", "/i/:invite"] ...authenticationRoutes, // Authentication routes ["/login", "/register", "/forgot-password", "/reset-password"] - ...joinRoutes, // Join routes ["/join", "/j/:id"] ...adminRoutes, // Admin routes ["/admin", "/admin/:page"] ...settingsRoutes, // Settings routes ["/admin/settings", "/admin/settings/:page"] ...helpRoutes, // Help routes ["/help", "/open"] diff --git a/apps/wizarr-frontend/tailwind.config.js b/apps/wizarr-frontend/tailwind.config.js index c4fd78398..c4f54bd5e 100644 --- a/apps/wizarr-frontend/tailwind.config.js +++ b/apps/wizarr-frontend/tailwind.config.js @@ -21,7 +21,6 @@ export const theme = { }, animation: { wiggle: 'wiggle 0.5s ease-in-out infinite', - // animation: shake 0.82s cubic-bezier(.36,.07,.19,.97) both; shake: 'shake 0.82s cubic-bezier(.36,.07,.19,.97) both', }, keyframes: { @@ -37,10 +36,6 @@ export const theme = { }, }, }, - // fontFamily: { - // 'display': ['motiva sans', 'sans-serif'], - // 'body': ['motiva sans', 'sans-serif'], - // }, }; export const plugins = [ diff --git a/docs/getting-started/reverse-proxy.md b/docs/getting-started/reverse-proxy.md index 3dfc7a4cb..391303937 100644 --- a/docs/getting-started/reverse-proxy.md +++ b/docs/getting-started/reverse-proxy.md @@ -142,9 +142,9 @@ plex.example.com { "scan=\"/" "href=\"/wizarr/" "/scan" "/wizarr/scan" # include in join code path copy - "navigator.clipboard.writeText(url + \"/j/\" + invite_code);" "navigator.clipboard.writeText(url + \"/wizarr/j/\" + invite_code);" + "navigator.clipboard.writeText(url + \"/i/\" + invite_code);" "navigator.clipboard.writeText(url + \"/wizarr/i/\" + invite_code);" } - + # Your wizarr backend reverse_proxy http://127.0.0.1:5690 }