Skip to content

Conversation

@mosoriob
Copy link
Collaborator

  • refactor: migrate hooks to use react-query for data fetching
  • feat: add SensorStatistics model and integrate into GetSensorResponse and SensorItem
  • feat: update MeasurementsSummary and SensorTable to utilize SensorStatistics
  • fix: update MeasurementSummary to utilize statistics for displaying measurement data
  • feat: integrate @tanstack/react-query for improved data management

mosoriob added 5 commits May 24, 2025 16:19
- Replaced useState and useEffect with useQuery from react-query in multiple hooks, including useDetail, useList, and useProcessedMeasurements, to streamline data fetching and state management.
- Improved error handling and loading states across hooks, enhancing overall performance and user experience.
- Updated query keys and functions to ensure consistent data retrieval and handling.
… and SensorItem

- Introduced a new SensorStatistics model to encapsulate statistical data related to sensors.
- Updated GetSensorResponse and SensorItem models to include statistics as a property, enhancing data representation.
- Removed unused UploadfileApi from the API exports for cleaner code structure.
- Adjusted index files to reflect the addition of the new SensorStatistics model.
…tistics

- Enhanced MeasurementsSummary component to display sensor statistics (count, average, min, max) with proper null checks, ensuring accurate data representation.
- Modified SensorTable to include new columns for sensor statistics, improving data visibility and organization.
- Updated DataTable to format statistics values correctly, providing a consistent user experience across components.
…easurement data

- Enhanced MeasurementSummary component to use statistics for first and last measurement times, min, max, average values, and count, ensuring accurate data representation.
- Added null checks for statistics properties to handle cases where data may be unavailable, improving user experience by displaying 'N/A' when necessary.
- Added @tanstack/react-query as a dependency to enhance data fetching and state management across components.
- Wrapped the application in QueryClientProvider to enable query management.
- Simplified data fetching in CampaignList component by removing unnecessary destructuring.
- Updated LineConfidenceContext to handle sensor data more robustly with improved type definitions.
- Enhanced SensorDashboard to conditionally render MeasurementsSummary based on data availability.
@mosoriob mosoriob linked an issue May 24, 2025 that may be closed by this pull request
@netlify
Copy link

netlify bot commented May 24, 2025

Deploy Preview for dso-tacc failed.

Name Link
🔨 Latest commit ca873cc
🔍 Latest deploy log https://app.netlify.com/projects/dso-tacc/deploys/68322cf0034e130008d85e62

… handling

- Added optional showPoints prop to RouterMap for conditional rendering of measurement points.
- Updated StatsSection to fetch measurements using useList hook, improving data management.
- Integrated QueryWrapper in StatsSection for better loading and error handling during data fetching.
@mosoriob mosoriob merged commit 88f8790 into main May 24, 2025
0 of 5 checks passed
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.

Use tanstackquery

2 participants