Merged
Conversation
…tering options - Updated `/users/data/recent` endpoint to return a paginated list of user activity, including data submissions and usage. - Added query parameters for filtering by date range, data type, store ID, and search term. - Modified response structure to include pagination details. - Introduced new `/stores` endpoint for listing and searching stores with pagination. - Updated related service and controller methods to handle new parameters and logic. - Adjusted TypeScript types to reflect changes in API responses and request parameters.
… and filtering options" This reverts commit bb7831d.
…mproved flexibility
- Implemented search functionality for stores in UserDataSharingPage. - Added loading and error handling for store search results. - Improved UI for displaying opt-in and opt-out stores with conditional rendering. - Refactored UserPreferencesPage to include a modal for adding/editing interests. - Enhanced user experience with loading spinners and error alerts in both pages. - Updated form handling for user demographics and preferences with better state management.
…ences management UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces enhancements to the API and frontend, focusing on new features for filtering and searching user data and stores. It includes updates to the backend API, new query parameters for user data retrieval, and a new endpoint for store search. Corresponding frontend hooks and types are also updated to support these changes.
Backend Enhancements
API Updates:
dataType,storeId,startDate,endDate,searchTerm) to thegetRecentUserDataendpoint for filtering and searching user data. Updated the response description and added a 404 error response. (api-service/api/openapi.yaml: [1] [2] [3]GET /stores/searchendpoint to search for stores by name, supporting query parameters likequeryandlimit. (api-service/api/openapi.yaml: api-service/api/openapi.yamlR755-R794)Service Layer:
getRecentUserDatainUserProfileServiceto dynamically build MongoDB queries based on the new filtering parameters. Added validation forstoreIdand date formats. (api-service/service/UserProfileService.js: [1] [2]searchStoresinStoreProfileServiceto handle store search queries using regex and optional text indexing for performance. (api-service/service/StoreProfileService.js: api-service/service/StoreProfileService.jsR169-R205)Controllers:
getRecentUserDatainUserProfile.jsto pass the new query parameters to the service layer. (api-service/controllers/UserProfile.js: api-service/controllers/UserProfile.jsL35-R36)getStoreUserscontroller for handling store-related user queries. (api-service/controllers/StoreProfile.js: api-service/controllers/StoreProfile.jsR43-R52)Frontend Enhancements
Hooks:
useRecentUserDatato accept new filtering parameters (GetRecentUserDataParams) and dynamically construct query keys. (web/src/api/hooks/useUserHooks.ts: web/src/api/hooks/useUserHooks.tsL162-L176)useSearchStoreshook with debouncing for searching stores by name. (web/src/api/hooks/useStoreHooks.ts: web/src/api/hooks/useStoreHooks.tsR96-R138)Types and Utilities:
GetRecentUserDataParamsand introducedSearchStoresParamsto define the new query parameters for user data and store search. (web/src/api/types/data-contracts.ts: [1] [2]searchStoresmethod to theStoresclass for interacting with the new store search endpoint. (web/src/api/types/Stores.ts: web/src/api/types/Stores.tsR233-R254)Cache:
web/src/api/utils/cache.ts: web/src/api/utils/cache.tsL2-R3)These changes collectively enhance the application's capabilities for filtering and searching, improving the user experience and making the API more versatile.