From 435252a9b55af64c79ed4db1e770d1901c00c1f7 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 30 Oct 2025 12:21:18 +0100 Subject: [PATCH 1/2] feat: Allow to create collections --- src/api.js | 7 + src/components/CollectionsSelector.vue | 171 ++++++++++++++++++++----- src/i18n.js | 6 + src/models/collection.js | 18 +++ src/models/link.js | 10 +- src/screens/LinkScreen.vue | 30 ----- 6 files changed, 179 insertions(+), 63 deletions(-) create mode 100644 src/models/collection.js diff --git a/src/api.js b/src/api.js index 3c21718..cae0890 100644 --- a/src/api.js +++ b/src/api.js @@ -42,6 +42,12 @@ function collections() { return http.get("/collections"); } +function createCollection(name) { + return http.post("/collections", { + name, + }); +} + function follow(collection) { return http.post(`/collections/${collection.id}/follow`); } @@ -72,6 +78,7 @@ export default { authenticate, logout, collections, + createCollection, follow, unfollow, addCollectionToLink, diff --git a/src/components/CollectionsSelector.vue b/src/components/CollectionsSelector.vue index f55414c..6b2c53d 100644 --- a/src/components/CollectionsSelector.vue +++ b/src/components/CollectionsSelector.vue @@ -21,7 +21,7 @@ @@ -32,14 +32,33 @@ v-if="notSelectedCollections.length > 0" @submit.prevent="addCollection" class="flow flow--small" - :disabled="props.disabled" + :disabled="form.inProgress() ? 'true' : null" > -
- - -
+
+
+ + +
+ +
+
+ + +
+
-
@@ -71,12 +117,14 @@ From 2f3e5a0ac74d1d05bf15009457f02905bfb53c6a Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Thu, 30 Oct 2025 14:16:03 +0100 Subject: [PATCH 2/2] chore: Rename CollectionsSelector component into Collections --- .../{CollectionsSelector.vue => Collections.vue} | 0 src/screens/LinkScreen.vue | 8 ++++---- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/components/{CollectionsSelector.vue => Collections.vue} (100%) diff --git a/src/components/CollectionsSelector.vue b/src/components/Collections.vue similarity index 100% rename from src/components/CollectionsSelector.vue rename to src/components/Collections.vue diff --git a/src/screens/LinkScreen.vue b/src/screens/LinkScreen.vue index a823f7a..c792c26 100644 --- a/src/screens/LinkScreen.vue +++ b/src/screens/LinkScreen.vue @@ -48,15 +48,15 @@ - @@ -103,7 +103,7 @@ import { store } from "../store.js"; import api from "../api.js"; import http from "../http.js"; import Link from "../models/link.js"; -import CollectionsSelector from "../components/CollectionsSelector.vue"; +import Collections from "../components/Collections.vue"; import Notes from "../components/Notes.vue"; const { t, locale } = useI18n();