Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(feat)O3-4308:Enable Filtering of Reports by Status, Location, Requested Date and Completion Date #255

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Bharath-K-Shetty
Copy link
Contributor

@Bharath-K-Shetty Bharath-K-Shetty commented Feb 1, 2025

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

  1. Added filtering functionality for reports based on:
  • Status – Users can filter reports by different stock operation statuses.

  • Location – Users can filter reports based on specific locations.

  • Requested Date – Users can filter reports by the date the report was requested.

  • Completed Date – Users can filter reports by the date the report was completed.

  1. Updated the StockReportsFilters component to support these filters.

  2. Ensured proper data fetching and mapping for each filter type.

  3. Improved filter handling logic to correctly update based on selected values.

Screenshots

Related Issue

https://openmrs.atlassian.net/browse/O3-4308

Other

@Bharath-K-Shetty
Copy link
Contributor Author

@jabahum needs review..!

@Bharath-K-Shetty Bharath-K-Shetty changed the title (feat)O3-4308:Enable Filtering of Reports by Status, Location, Requested Date, and Completion Date (feat)O3-4308:Enable Filtering of Reports by Status, Location, Requested Date and Completion Date Feb 1, 2025
@jabahum
Copy link
Collaborator

jabahum commented Feb 4, 2025

@Bharath-K-Shetty this is a video of what i am seeing.
comments

@jabahum
Copy link
Collaborator

jabahum commented Feb 4, 2025

This is also a preview of my userrolesescopes for my created user.
image

Copy link
Collaborator

@jabahum jabahum left a comment

Choose a reason for hiding this comment

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

Screen.Recording.2025-02-04.at.13.53.17.mov

more on how the filters work

export function useGetReports(filter: StockReportFilter) {
const apiUrl = `${restBaseUrl}/stockmanagement/batchjob?batchJobType=Report&${toQueryParams(
filter,
)}&limit=10&totalCount=true`;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can this limit be passed as an argument other than having a fixed value of limit sent to the api

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.

2 participants