From aea9a2766dedd4033f07d0f48628363513d3b804 Mon Sep 17 00:00:00 2001 From: DecDucK Date: Sat, 24 Jan 2026 20:25:08 +1100 Subject: [PATCH 1/3] feat: add store nav and fixes --- components/Modal/CreateCollection.vue | 17 ++-------- components/UserHeader/StoreNav.vue | 39 ++++++++++++++++++++++ dev-tools/compose.yml | 6 ++-- layouts/default.vue | 3 +- nuxt.config.ts | 2 +- pages/store/[id]/index.vue | 4 ++- server/api/v1/client/user/webtoken.post.ts | 10 +++++- server/api/v1/collection/index.post.ts | 16 +++++---- 8 files changed, 69 insertions(+), 28 deletions(-) create mode 100644 components/UserHeader/StoreNav.vue diff --git a/components/Modal/CreateCollection.vue b/components/Modal/CreateCollection.vue index 9a8ddc05..32755152 100644 --- a/components/Modal/CreateCollection.vue +++ b/components/Modal/CreateCollection.vue @@ -59,7 +59,6 @@ const emit = defineEmits<{ const open = defineModel({ required: true }); -const { t } = useI18n(); const collectionName = ref(""); const createCollectionLoading = ref(false); const collections = await useCollections(); @@ -74,6 +73,7 @@ async function createCollection() { const response = await $dropFetch("/api/v1/collection", { method: "POST", body: { name: collectionName.value }, + failTitle: "Failed to create collection", }); // Add the game if provided @@ -83,6 +83,7 @@ async function createCollection() { >(`/api/v1/collection/${response.id}/entry`, { method: "POST", body: { id: props.gameId }, + failTitle: "Failed to add game to collection", }); response.entries.push(entry); } @@ -94,20 +95,6 @@ async function createCollection() { open.value = false; emit("created", response.id); - } catch (error) { - console.error("Failed to create collection:", error); - - const err = error as { statusMessage?: string }; - createModal( - ModalType.Notification, - { - title: t("errors.library.collection.create.title"), - description: t("errors.library.collection.create.desc", [ - err?.statusMessage ?? t("errors.unknown"), - ]), - }, - (_, c) => c(), - ); } finally { createCollectionLoading.value = false; } diff --git a/components/UserHeader/StoreNav.vue b/components/UserHeader/StoreNav.vue new file mode 100644 index 00000000..e93e3b82 --- /dev/null +++ b/components/UserHeader/StoreNav.vue @@ -0,0 +1,39 @@ + + diff --git a/dev-tools/compose.yml b/dev-tools/compose.yml index c2d81883..0dbe5ea4 100644 --- a/dev-tools/compose.yml +++ b/dev-tools/compose.yml @@ -1,12 +1,14 @@ services: postgres: image: postgres:14-alpine - user: "1000:1000" ports: - 5432:5432 volumes: - - ../.data/db:/var/lib/postgresql/data + - postgres-data:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD=drop - POSTGRES_USER=drop - POSTGRES_DB=drop + +volumes: + postgres-data: diff --git a/layouts/default.vue b/layouts/default.vue index 5b453632..f344fd47 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -9,8 +9,9 @@ -
+
+
diff --git a/nuxt.config.ts b/nuxt.config.ts index f5c2b7ef..707d8dad 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -250,7 +250,7 @@ export default defineNuxtConfig({ "https://images.pcgamingwiki.com", "https://images.igdb.com", "https://*.steamstatic.com", - ], + ] }, strictTransportSecurity: false, }, diff --git a/pages/store/[id]/index.vue b/pages/store/[id]/index.vue index b21e50a6..d39e184d 100644 --- a/pages/store/[id]/index.vue +++ b/pages/store/[id]/index.vue @@ -39,7 +39,7 @@
{ - const userId = await aclManager.getUserIdACL(h3, ["collections:read"]); + const userId = await aclManager.getUserIdACL(h3, ["collections:new"]); if (!userId) throw createError({ statusCode: 403, }); - const body = await readBody(h3); - - const name = body.name; - if (!name) - throw createError({ statusCode: 400, statusMessage: "Requires name" }); + const body = await readDropValidatedBody(h3, CreateCollection); // Create the collection using the manager - const newCollection = await userLibraryManager.collectionCreate(name, userId); + const newCollection = await userLibraryManager.collectionCreate(body.name, userId); return newCollection; }); From c51c3f1e1b9428f49c99949c1757ed38246dd6a6 Mon Sep 17 00:00:00 2001 From: DecDuck Date: Thu, 29 Jan 2026 20:23:45 +1100 Subject: [PATCH 2/3] fix: reduce password requirement & new task error ui --- i18n/locales/de.json | 2 +- i18n/locales/en_pirate.json | 2 +- i18n/locales/en_us.json | 2 +- i18n/locales/fr.json | 2 +- i18n/locales/pl.json | 2 +- pages/admin/task/[id]/index.vue | 50 +++++++++++------------- pages/auth/register.vue | 2 +- server/api/v1/auth/signup/simple.post.ts | 2 +- 8 files changed, 30 insertions(+), 34 deletions(-) diff --git a/i18n/locales/de.json b/i18n/locales/de.json index fc42fe9d..44d69bf8 100644 --- a/i18n/locales/de.json +++ b/i18n/locales/de.json @@ -70,7 +70,7 @@ "register": { "confirmPasswordFormat": "Muss mit oben genanntem übereinstimmen", "emailFormat": "Muss im Format nutzer{'@'}beispiel.de sein", - "passwordFormat": "Muss mindestens 14 Zeichen enthalten", + "passwordFormat": "Muss mindestens 8 Zeichen enthalten", "subheader": "Gebe unten deine Daten ein, um dein Konto zu erstellen.", "title": "Erstelle dein Drop Konto", "usernameFormat": "Muss mindestens 5 Zeichen enthalten und aus Kleinbuchstaben bestehen" diff --git a/i18n/locales/en_pirate.json b/i18n/locales/en_pirate.json index 01f5c3e3..6c17d3da 100644 --- a/i18n/locales/en_pirate.json +++ b/i18n/locales/en_pirate.json @@ -56,7 +56,7 @@ "register": { "confirmPasswordFormat": "Must be the same as above, savvy?", "emailFormat": "Must be in the fashion of a true scallywag {'@'} example.com", - "passwordFormat": "Must be 14 or more marks, ye landlubber!", + "passwordFormat": "Must be 8 or more marks, ye landlubber!", "subheader": "Fill in yer details below to make yer mark.", "title": "Forge yer Drop Mark", "usernameFormat": "Must be 5 or more marks, and all lowercase, argh!" diff --git a/i18n/locales/en_us.json b/i18n/locales/en_us.json index ed7a803f..2fb50d23 100644 --- a/i18n/locales/en_us.json +++ b/i18n/locales/en_us.json @@ -72,7 +72,7 @@ "register": { "confirmPasswordFormat": "Must be the same as above", "emailFormat": "Must be in the format user{'@'}example.com", - "passwordFormat": "Must be 14 or more characters", + "passwordFormat": "Must be 8 or more characters", "subheader": "Fill in your details below to create your account.", "title": "Create your Drop account", "usernameFormat": "Must be 5 or more characters, and lowercase" diff --git a/i18n/locales/fr.json b/i18n/locales/fr.json index f3d19e26..15ab17e5 100644 --- a/i18n/locales/fr.json +++ b/i18n/locales/fr.json @@ -70,7 +70,7 @@ "register": { "confirmPasswordFormat": "Doit être pareil qu'au dessus", "emailFormat": "Doit être au format utilisateur{'@'}exemple.com", - "passwordFormat": "Doit être au moins 14 caractères ou plus", + "passwordFormat": "Doit être au moins 8 caractères ou plus", "subheader": "Remplissez vos coordonnées pour créer votre compte.", "title": "Créer votre compte Drop", "usernameFormat": "Doit être au moins 5 caractères et en minuscules" diff --git a/i18n/locales/pl.json b/i18n/locales/pl.json index b7215ca5..1999d70d 100644 --- a/i18n/locales/pl.json +++ b/i18n/locales/pl.json @@ -70,7 +70,7 @@ "register": { "confirmPasswordFormat": "Musi być takie samo jak powyżej", "emailFormat": "Musi być w formacie uzytkownik{'@'}example.com", - "passwordFormat": "Musi mieć conajmniej 14 znaków", + "passwordFormat": "Musi mieć conajmniej 8 znaków", "subheader": "Wpisz poniżej swoje dane, aby utworzyć swoje konto.", "title": "Stwórz swoje konto Drop", "usernameFormat": "Musi mieć co najmniej 5 znaków i małe litery" diff --git a/pages/admin/task/[id]/index.vue b/pages/admin/task/[id]/index.vue index 26dc80b1..bfb710de 100644 --- a/pages/admin/task/[id]/index.vue +++ b/pages/admin/task/[id]/index.vue @@ -11,39 +11,35 @@ -
-
-
-
-
+

- + +
{{ task.name }}

+
+
+
+
+
+

+ {{ task.error.title }} +

+
+ {{ task.error.description }} +
+
+
+