Skip to content

Abhishek_Fix: Add Search and Clear buttons to Resource Management page#5360

Open
Abhi-R0211 wants to merge 2 commits into
developmentfrom
fix/resource-management-clear-button
Open

Abhishek_Fix: Add Search and Clear buttons to Resource Management page#5360
Abhi-R0211 wants to merge 2 commits into
developmentfrom
fix/resource-management-clear-button

Conversation

@Abhi-R0211

Copy link
Copy Markdown
Contributor

Related PRs: Supersedes #5068

Reason for new branch:

The older branch had drifted significantly from development - it was missing ~6 months of merged features including column sorting, XLSX/CSV export, pagination, lucide-react icons, toast notifications, and PropTypes validation. Rebasing it would have caused major regressions. Instead, this PR implements the same feature (Search + Clear button) cleanly on top of the current development branch, preserving all existing functionality.

What this PR does:

Implements the missing feature from issue (Phase 3 - Resource Management page Search Results Do Not Revert After Clearing Input; Missing Clear Filter Control) at /communityportal/activity/:activityId/resources:

  • Adds a Clear button to the SearchBar that resets the search term and returns pagination to page 1
  • Adds a Search button alongside the existing live-filter input
  • Adds CSS for both buttons with full light and dark mode support
  • All existing features preserved — sort toggle, column sorting, XLSX/CSV export, pagination, Add Log modal, form validation, dark mode

How to test:

  • Checkout branch fix/resource-management-clear-button
  • Start the backend using the development branch
  • Run npm install then npm run start:local
  • Log in as admin
  • Navigate to /communityportal/activity/:activityId/resources
  • Verify the following:
    • Typing in the search box filters the list live
PR5068_search_filtering_dark png PR5068_search_filtering_light png
  • Clearing the input manually restores the full list
PR5068_search_autorestore_light png
  • Clicking Clear resets the list and pagination to page 1
PR5068_clear_button_dark png
  • Searching for a term with no matches shows an empty table
PR5068_search_noresults_light png
  • Submitting the Add New Log form empty shows inline validation errors on all fields
PR5068_addlog_validation_empty_light png
  • Entering invalid format in Time/Duration and numbers in Facilities shows field-level errors
PR5068_addlog_validation_format_light png

Note:

The Add Log feature currently stores data in mock state only and does not persist to the backend — no backend endpoint exists in HGNRest for this feature. This is a pre-existing project-wide limitation and is out of scope for this PR. A separate backend PR would be needed to implement persistence.

@netlify

netlify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 3ae1ec2
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6a47214c51e4410008df5c8e
😎 Deploy Preview https://deploy-preview-5360--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

sonarqubecloud Bot commented Jul 3, 2026

Copy link
Copy Markdown

@Abhi-R0211

Copy link
Copy Markdown
Contributor Author

Hi @one-community, this is a quick follow-up to #5360 fixing the SonarQube contrast issue that surfaced after merge. Would appreciate a review when you have a moment. Thanks!

@Abhi-R0211 Abhi-R0211 changed the title Fix: Add Search and Clear buttons to Resource Management page Abhishek_Fix: Add Search and Clear buttons to Resource Management page Jul 3, 2026

@kzou55 kzou55 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Abhishek,

I ran and tested the PR locally.

Verified

  • Typing in the search box filters the list live
  • Clearing the search input restores the full list
  • Clicking clear resets the list and sets the pagination to page 1
  • Searching for an item that doesn't exist results in an empty table
  • The Add New Log form works and validates the inputs
  • Dark Mode works

Tests

  • Testing in Light Mode

    Recording.2026-07-03.162638.mp4
  • Testing in Dark Mode

    Recording.2026-07-03.162803.mp4

@HemanthNidamanuru HemanthNidamanuru left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I tested this PR locally.

Search filtering, Clear button, pagination reset, no-results state, and Add New Log form validations are all working fine.

Everything looks good.

Image Image Image Image Image

@DeepighaJ DeepighaJ left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested the PR and the search and clear functionalities working as expected, and other functionalities like export csv, add new log were working as expected too
Image
Image
Image
Image
Image
Image

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.

4 participants