[PR #3556] [MERGED] refactor: allow banner service to hold multiple banners and display the banner with the highest score #4430

Closed
opened 2026-03-17 01:57:56 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/3556
Author: @joeljstephen
Created: 11/16/2023
Status: Merged
Merged: 11/17/2023
Merged by: @AndrewBastin

Base: release/2023.12.0Head: refactor/banner-service


📝 Commits (6)

  • e466144 refactor: i18n strings are used by default by banner service
  • d22333e feat: score replaces priority and a new id property is added to banner service
  • f7016ab refactor: updated header to call remove banner function with id
  • baa8dc1 chore: rearranged code for better readability
  • 678b492 refactor: updated banner test to follow new banner service update
  • 88fc03a refactor: improvements to banner test

📊 Changes

4 files changed (+110 additions, -46 deletions)

View changed files

📝 packages/hoppscotch-common/src/components/app/Banner.vue (+6 -4)
📝 packages/hoppscotch-common/src/components/app/Header.vue (+26 -11)
📝 packages/hoppscotch-common/src/services/__tests__/banner.service.spec.ts (+35 -20)
📝 packages/hoppscotch-common/src/services/banner.service.ts (+43 -11)

📄 Description

Ticket

Closes HFE-317

Description

This PR focuses on allowing the banner service to handle multiple banners. Currently, the service can hold only one banner at a time. However, there can be instances where multiple services or components may access the banner at the same time. This is solved by allowing the banner service to hold multiple banners and display the banner which has the highest priority score.

Objectives

  • The Banner Service should be able to hold multiple banners instead of one.
  • The Banner Service should display the banner which has the highest score value.

Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

🔄 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/3556 **Author:** [@joeljstephen](https://github.com/joeljstephen) **Created:** 11/16/2023 **Status:** ✅ Merged **Merged:** 11/17/2023 **Merged by:** [@AndrewBastin](https://github.com/AndrewBastin) **Base:** `release/2023.12.0` ← **Head:** `refactor/banner-service` --- ### 📝 Commits (6) - [`e466144`](https://github.com/hoppscotch/hoppscotch/commit/e4661445257bb991c6e92e83ff122653f6c6f0e2) refactor: i18n strings are used by default by banner service - [`d22333e`](https://github.com/hoppscotch/hoppscotch/commit/d22333e5b2ef1b7243f159b5fa9b8b920278dfdc) feat: score replaces priority and a new id property is added to banner service - [`f7016ab`](https://github.com/hoppscotch/hoppscotch/commit/f7016ab71c3b1dd2338d75f4e6c4eac173ece50c) refactor: updated header to call remove banner function with id - [`baa8dc1`](https://github.com/hoppscotch/hoppscotch/commit/baa8dc1e7e52b1c200a7a806657436a6b4fdc855) chore: rearranged code for better readability - [`678b492`](https://github.com/hoppscotch/hoppscotch/commit/678b492823ce1f020245c331fe53afee4052d596) refactor: updated banner test to follow new banner service update - [`88fc03a`](https://github.com/hoppscotch/hoppscotch/commit/88fc03a9e0b441e6aa3d46649176adfc800df3e1) refactor: improvements to banner test ### 📊 Changes **4 files changed** (+110 additions, -46 deletions) <details> <summary>View changed files</summary> 📝 `packages/hoppscotch-common/src/components/app/Banner.vue` (+6 -4) 📝 `packages/hoppscotch-common/src/components/app/Header.vue` (+26 -11) 📝 `packages/hoppscotch-common/src/services/__tests__/banner.service.spec.ts` (+35 -20) 📝 `packages/hoppscotch-common/src/services/banner.service.ts` (+43 -11) </details> ### 📄 Description ### Ticket Closes HFE-317 ### Description This PR focuses on allowing the banner service to handle multiple banners. Currently, the service can hold only one banner at a time. However, there can be instances where multiple services or components may access the banner at the same time. This is solved by allowing the banner service to hold multiple banners and display the banner which has the highest priority score. ### Objectives - [x] The Banner Service should be able to hold multiple banners instead of one. - [x] The Banner Service should display the banner which has the highest score value. ### Checks <!-- Make sure your pull request passes the CI checks and do check the following fields as needed - --> - [x] My pull request adheres to the code style of this project - [ ] My code requires changes to the documentation - [ ] I have updated the documentation as required - [x] All the tests have passed --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 01:57:56 +03:00
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#4430
No description provided.