From 93c9c71ec9e6d0899d97a0d13bfcd1482894db75 Mon Sep 17 00:00:00 2001 From: zurdi Date: Thu, 18 Dec 2025 13:29:59 +0000 Subject: [PATCH] feat: implement PlatformGroupList component for managing platform selections in Setup.vue --- .../components/Setup/PlatformGroupList.vue | 80 +++++++ frontend/src/views/Auth/Setup.vue | 214 ++---------------- 2 files changed, 103 insertions(+), 191 deletions(-) create mode 100644 frontend/src/components/Setup/PlatformGroupList.vue diff --git a/frontend/src/components/Setup/PlatformGroupList.vue b/frontend/src/components/Setup/PlatformGroupList.vue new file mode 100644 index 000000000..dd3093bb8 --- /dev/null +++ b/frontend/src/components/Setup/PlatformGroupList.vue @@ -0,0 +1,80 @@ + + + diff --git a/frontend/src/views/Auth/Setup.vue b/frontend/src/views/Auth/Setup.vue index 0525e99f9..3a73040e4 100644 --- a/frontend/src/views/Auth/Setup.vue +++ b/frontend/src/views/Auth/Setup.vue @@ -3,7 +3,7 @@ import type { Emitter } from "mitt"; import { computed, inject, onMounted, ref, watch } from "vue"; import { useI18n } from "vue-i18n"; import { useDisplay } from "vuetify"; -import PlatformListItem from "@/components/common/Platform/ListItem.vue"; +import PlatformGroupList from "@/components/Setup/PlatformGroupList.vue"; import router from "@/plugins/router"; import { ROUTES } from "@/plugins/router"; import { refetchCSRFToken } from "@/services/api"; @@ -189,12 +189,6 @@ const hasExistingPlatforms = computed(() => { return (libraryInfo.value?.existing_platforms.length ?? 0) > 0; }); -// Count selected platforms in a group -const countSelectedInGroup = (platforms: Platform[]) => { - return platforms.filter((p) => selectedPlatforms.value.includes(p.fs_slug)) - .length; -}; - // Check if platform already exists const isPlatformExisting = (fsSlug: string) => { return libraryInfo.value?.existing_platforms.includes(fsSlug) ?? false; @@ -425,43 +419,10 @@ onMounted(() => { class="overflow-y-auto pr-4" style="max-height: 45dvh" > - - - - {{ groupName }} - ({{ platforms.length }}) - - - - - - - - + @@ -478,61 +439,13 @@ onMounted(() => { class="overflow-y-auto pr-4" style="max-height: 45dvh" > - - - - {{ groupName }} - - ({{ platforms.length }}) - - - {{ countSelectedInGroup(platforms) }} selected - - - - - - - - - - - + @@ -562,43 +475,10 @@ onMounted(() => { class="overflow-y-auto pr-4" style="max-height: 50dvh" > - - - - {{ groupName }} - ({{ platforms.length }}) - - - - - - - - + @@ -608,61 +488,13 @@ onMounted(() => { class="overflow-y-auto pr-4" style="max-height: 50dvh" > - - - - {{ groupName }} - - ({{ platforms.length }}) - - - {{ countSelectedInGroup(platforms) }} selected - - - - - - - - - - - +