Skip to content

Comments

Fix: selected filters badge deletion when x icon is clicked in task-requests page#717

Merged
prakashchoudhary07 merged 2 commits intodevelopfrom
fix/delete-badge
Mar 15, 2024
Merged

Fix: selected filters badge deletion when x icon is clicked in task-requests page#717
prakashchoudhary07 merged 2 commits intodevelopfrom
fix/delete-badge

Conversation

@VinayakaHegade
Copy link
Contributor

@VinayakaHegade VinayakaHegade commented Mar 14, 2024

Date: 15-03-2024

Developer Name: @VinayakaHegade


Issue Ticket Number

closes #715

Description

  • This PR addresses issue Selected Filters Badge in task-requests page not deleting when clicked on X-icon  #715, where the deleteBadge function was not correctly deleting badges when the delete icon was clicked.
  • The issue was that the deleteBadge function was using e.target.textContent to identify the badge to delete. However, when the delete icon (an image element) was clicked, e.target was the image element, which doesn't have a textContent property.
  • So the deleteBadge function has been updated to use the Element.closest() method to find the closest ancestor with the class 'badge' and get the textContent of span inside it.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Before the fix

filter-badge-bug.mp4

After the fix

fix-delete-badge.mp4

Test Coverage

Screenshot 1

test

Additional Notes

@VinayakaHegade VinayakaHegade self-assigned this Mar 14, 2024
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 15, 2024

Deploying dashboard-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 802f4dd
Status: ✅  Deploy successful!
Preview URL: https://c2398a2e.dashboard-rds.pages.dev
Branch Preview URL: https://fix-delete-badge.dashboard-rds.pages.dev

View logs

@prakashchoudhary07 prakashchoudhary07 merged commit 737a43b into develop Mar 15, 2024
@prakashchoudhary07 prakashchoudhary07 deleted the fix/delete-badge branch March 15, 2024 05:59
@VinayakaHegade VinayakaHegade mentioned this pull request Mar 15, 2024
10 tasks
rahul-singh04 pushed a commit to rahul-singh04/website-dashboard that referenced this pull request Mar 24, 2024
…equests page (RealDevSquad#717)

* fix deleteBadge function

* test: add test case for badge deletion via icon click
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selected Filters Badge in task-requests page not deleting when clicked on X-icon

3 participants