[PR #5051] Add Favorite Collections #5032

Open
opened 2026-03-17 02:31:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/5051
Author: @html1101
Created: 5/5/2025
Status: 🔄 Open

Base: mainHead: collection-ref


📝 Commits (10+)

  • 6490690 finished setup and now trying to remove sidebar functionality
  • 43b6e61 feat(collections): updates to database schema and minor front end modiifications
  • 7512d7f favoriting collections under more dropdown frontend complete
  • 5d3bd2d Merge branch 'eunice-frontend' into staging
  • 8b798fd feat: added conditional rendering of favorite icon
  • 20f8604 feat(favoriteCollections): made updates to backend, not able to call backend API endpoints
  • e708c05 feat: ensuring everything is pushed
  • 572db27 feat: ensuring everything is pushed
  • 0eb8743 unfavoriting ui change for smartitem & additional favoriting scripts
  • 0952069 feat: merging UI updates

📊 Changes

23 files changed (+371 additions, -4 deletions)

View changed files

📝 .env.example (+1 -1)
📝 packages/hoppscotch-backend/prisma/schema.prisma (+1 -0)
📝 packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts (+167 -1)
📝 packages/hoppscotch-backend/src/user-collection/user-collection.service.ts (+30 -0)
📝 packages/hoppscotch-backend/src/user-collection/user-collections.model.ts (+5 -0)
📝 packages/hoppscotch-common/locales/en.json (+2 -0)
📝 packages/hoppscotch-common/src/components/collections/Collection.vue (+33 -0)
📝 packages/hoppscotch-common/src/components/collections/MyCollections.vue (+16 -0)
📝 packages/hoppscotch-common/src/components/collections/TeamCollections.vue (+16 -0)
📝 packages/hoppscotch-common/src/components/collections/graphql/Add.vue (+1 -0)
📝 packages/hoppscotch-common/src/components/collections/graphql/index.vue (+6 -0)
📝 packages/hoppscotch-common/src/components/collections/index.vue (+12 -0)
📝 packages/hoppscotch-common/src/components/importExport/ImportExportSteps/AllCollectionImport.vue (+1 -0)
📝 packages/hoppscotch-common/src/helpers/backend/helpers.ts (+2 -0)
📝 packages/hoppscotch-common/src/helpers/import-export/import/har.ts (+1 -0)
📝 packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts (+1 -0)
📝 packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts (+2 -0)
📝 packages/hoppscotch-common/src/helpers/import-export/import/postman.ts (+1 -0)
📝 packages/hoppscotch-common/src/helpers/teams/TeamCollection.ts (+1 -0)
📝 packages/hoppscotch-common/src/newstore/collections.ts (+28 -0)

...and 3 more files

📄 Description

Closes #4989

image

See here for details; this adds the ability to star collections on the frontend.

What's changed

  • In the three-dot options to the right of a collection, there is now a 'Favorite Collection' option available.

  • On clicking, it adds a heart next to the favorited collection.

  • Collections can be unfavorited using the same button in the options menu.

  • This uses an attribute, favorited, to say whether a collection is favorited or not.

  • UI for favorited collection

  • Persistent changes in localstorage

  • Added migration via zod to update older versions of the database to include the favorited attribute

  • Tests should be included in hoppscotch-backend/src/user-collection/user-collection.service.spec.ts!

  • Sort favorited collections at the top

Notes to reviewers

  • Make sure to run npm run gen-gql to get changes in the GQL schemas to apply
  • Definitely squash changes when merging--this commit was a team effort with @Elizabetht1 and @eunilee2 , so the changes across each commit are a little messy!

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/5051 **Author:** [@html1101](https://github.com/html1101) **Created:** 5/5/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `collection-ref` --- ### 📝 Commits (10+) - [`6490690`](https://github.com/hoppscotch/hoppscotch/commit/6490690325108090e2fae99dbb3794550e39a784) finished setup and now trying to remove sidebar functionality - [`43b6e61`](https://github.com/hoppscotch/hoppscotch/commit/43b6e61391c111fd0d1e90f5a78f8b9f10847855) feat(collections): updates to database schema and minor front end modiifications - [`7512d7f`](https://github.com/hoppscotch/hoppscotch/commit/7512d7f181408572188c4b0437e2deeb05a3fd33) favoriting collections under more dropdown frontend complete - [`5d3bd2d`](https://github.com/hoppscotch/hoppscotch/commit/5d3bd2d34f9877187c95b782f03ac017c0358be6) Merge branch 'eunice-frontend' into staging - [`8b798fd`](https://github.com/hoppscotch/hoppscotch/commit/8b798fd697f6935c529e2836cf23c095b2e2beb2) feat: added conditional rendering of favorite icon - [`20f8604`](https://github.com/hoppscotch/hoppscotch/commit/20f86044e9b25bb7f65ca93a256473d5fedaea6f) feat(favoriteCollections): made updates to backend, not able to call backend API endpoints - [`e708c05`](https://github.com/hoppscotch/hoppscotch/commit/e708c052c2873b731d1468ee18233bd796c6d8e5) feat: ensuring everything is pushed - [`572db27`](https://github.com/hoppscotch/hoppscotch/commit/572db27b50162e5122bd54122202908cfe1cc320) feat: ensuring everything is pushed - [`0eb8743`](https://github.com/hoppscotch/hoppscotch/commit/0eb874327eba195a17f5c30a103092957f3feb25) unfavoriting ui change for smartitem & additional favoriting scripts - [`0952069`](https://github.com/hoppscotch/hoppscotch/commit/09520696e3f3e249b6813d2f7dd0c4eaf5b3a5fd) feat: merging UI updates ### 📊 Changes **23 files changed** (+371 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `.env.example` (+1 -1) 📝 `packages/hoppscotch-backend/prisma/schema.prisma` (+1 -0) 📝 `packages/hoppscotch-backend/src/user-collection/user-collection.service.spec.ts` (+167 -1) 📝 `packages/hoppscotch-backend/src/user-collection/user-collection.service.ts` (+30 -0) 📝 `packages/hoppscotch-backend/src/user-collection/user-collections.model.ts` (+5 -0) 📝 `packages/hoppscotch-common/locales/en.json` (+2 -0) 📝 `packages/hoppscotch-common/src/components/collections/Collection.vue` (+33 -0) 📝 `packages/hoppscotch-common/src/components/collections/MyCollections.vue` (+16 -0) 📝 `packages/hoppscotch-common/src/components/collections/TeamCollections.vue` (+16 -0) 📝 `packages/hoppscotch-common/src/components/collections/graphql/Add.vue` (+1 -0) 📝 `packages/hoppscotch-common/src/components/collections/graphql/index.vue` (+6 -0) 📝 `packages/hoppscotch-common/src/components/collections/index.vue` (+12 -0) 📝 `packages/hoppscotch-common/src/components/importExport/ImportExportSteps/AllCollectionImport.vue` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/backend/helpers.ts` (+2 -0) 📝 `packages/hoppscotch-common/src/helpers/import-export/import/har.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/import-export/import/insomnia.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/import-export/import/openapi.ts` (+2 -0) 📝 `packages/hoppscotch-common/src/helpers/import-export/import/postman.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/helpers/teams/TeamCollection.ts` (+1 -0) 📝 `packages/hoppscotch-common/src/newstore/collections.ts` (+28 -0) _...and 3 more files_ </details> ### 📄 Description <!-- Thanks for creating this pull request 🤗 Please make sure that the pull request is limited to one type (docs, feature, etc.) and keep it as small as possible. You can open multiple prs instead of opening a huge one. --> <!-- If this pull request closes an issue, please mention the issue number below --> Closes #4989 <!-- Add an introduction into what this PR tries to solve in a couple of sentences --> ![image](https://github.com/user-attachments/assets/31c1438c-31ef-45c4-8aca-af6595f7f4da) See [here](https://github.com/hoppscotch/hoppscotch/issues/4989) for details; this adds the ability to star collections on the frontend. ### What's changed <!-- Describe point by point the different things you have changed in this PR --> - In the three-dot options to the right of a collection, there is now a 'Favorite Collection' option available. - On clicking, it adds a heart next to the favorited collection. - Collections can be unfavorited using the same button in the options menu. - This uses an attribute, `favorited`, to say whether a collection is favorited or not. - [x] UI for favorited collection - [x] Persistent changes in localstorage - [x] Added migration via zod to update older versions of the database to include the `favorited` attribute - [x] Tests should be included in `hoppscotch-backend/src/user-collection/user-collection.service.spec.ts`! - [ ] Sort favorited collections at the top <!-- You can also choose to add a list of changes and if they have been completed or not by using the markdown to-do list syntax - [x] Not Completed - [x] Completed --> ### Notes to reviewers <!-- Any information you feel the reviewer should know about when reviewing your PR --> - Make sure to run `npm run gen-gql` to get changes in the GQL schemas to apply - Definitely squash changes when merging--this commit was a team effort with @Elizabetht1 and @eunilee2 , so the changes across each commit are a little messy! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#5032
No description provided.