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

Last twelve months view #91

Merged
merged 21 commits into from
Jan 3, 2025

Conversation

ElemarJR
Copy link
Contributor

@ElemarJR ElemarJR commented Jan 3, 2025

No description provided.

- Introduced the `TimesheetDataset` class to manage timesheet data, including methods for retrieving and enriching appointment data.
- Implemented a `TimesheetMemoryCache` class for efficient caching of timesheet data, improving performance by reducing redundant data fetching.
- Created an `__init__.py` file to facilitate module imports, exposing the `TimesheetDataset` and `TimesheetMemoryCache` classes.

These changes enhance the application's capability to handle timesheet data efficiently, providing a structured approach to data retrieval and caching.
- Added functionality to cache timesheet data to disk using the `TimesheetDiskCache` class, improving data persistence and retrieval efficiency.
- Implemented an environment variable check for `EVERHOUR_API_KEY` to ensure secure API access.
- Introduced a new method `_ensure_2024` to manage and cache timesheet data for each month of 2024, including logging for data fetching and caching status.
- Enhanced the overall structure and reliability of the `TimesheetDataset` class for better data handling.

These changes improve the application's capability to manage timesheet data effectively, ensuring that 2024 data is readily available and cached appropriately.
…resolution logic

- Introduced a new `allocation` query in the GraphQL schema to retrieve allocation data based on date range and filters.
- Implemented the `resolve_allocation` function to process and return allocation data categorized by type (consulting, internal, hands-on, squad).
- Enhanced the `schema.graphql` files to define the `Allocation` type and its related structures, improving the API's data model for allocation insights.

These changes enhance the application's capability to provide detailed allocation data, improving data retrieval and analysis for users.
…hanced filtering

- Updated the OneYearAllocation component to accept a new workerName prop, allowing for more specific allocation queries based on the worker's name.
- Modified the GraphQL query to utilize the workerName filter, improving the granularity of allocation data retrieval.

These changes enhance the application's ability to provide tailored allocation insights for individual workers.
…nd improved color contrast

- Added a new state for selected bin index to allow users to filter hours based on selected bins.
- Implemented adaptive binning logic that dynamically adjusts bin boundaries based on the distribution of hours, improving data visualization.
- Enhanced color contrast in histogram and grid elements for better visibility and user experience.
- Updated event handlers to reset selected bin index when changing allocation types.

These changes improve the usability and visual clarity of the OneYearAllocation component, facilitating better data analysis for users.
… tolerance handling

- Introduced a tolerance variable to enhance the accuracy of histogram binning, allowing for better grouping of hours.
- Added a helper function to check if hours fall within the selected bin, accommodating both discrete and continuous values.
- Updated the histogram calculation logic to dynamically create bins based on unique values and their distribution, improving data visualization.
- Removed redundant code related to bin checking, streamlining the component's functionality.

These changes enhance the usability and accuracy of the OneYearAllocation component, facilitating better data analysis for users.
…tering capabilities

- Added OneYearAllocation component to ClientPage, allowing for detailed allocation insights based on client data.
- Updated OneYearAllocation to accept a new clientName prop, enabling filtering of allocation data by client.
- Improved error handling in the OneYearAllocation component to provide clearer feedback during data loading and query errors.

These changes enhance the user experience by providing more contextual allocation data and improving the overall functionality of the application.
…or enhanced allocation insights

- Added OneYearAllocation component to both CasePage and SponsorPage, allowing for detailed allocation insights based on case and sponsor data.
- Updated OneYearAllocation to accept new props: caseTitle and sponsor, enabling more contextual filtering of allocation data.
- Improved styling for better visibility in the OneYearAllocation component.

These changes enhance the user experience by providing more relevant allocation data and improving the overall functionality of the application.
…ctionality

- Standardized code formatting for better consistency and readability, including consistent use of quotes and spacing.
- Enhanced the structure of the OneYearAllocation component by breaking down complex expressions and improving variable naming for clarity.
- Updated the rendering logic to ensure better handling of empty states and improved tooltip functionality.
- Added a SectionHeader component to provide a clearer context for the allocation data displayed.

These changes enhance the maintainability and user experience of the OneYearAllocation component, making it easier to understand and interact with allocation data.
…zero value

- Updated the state initialization for selectedKind to start with an empty string, ensuring the first non-zero value is selected dynamically.
- Added logic to set selectedKind to the first non-zero kind from totals, with a fallback to "consulting" if no non-zero values are found.

These changes improve the user experience by ensuring a relevant default selection in the allocation component.
- Updated the ByAccountManager, ByClient, BySponsor, ByWorker, and ByWorkingDay components to safely access nested properties using optional chaining and provide default values, enhancing robustness against undefined data.
- Modified the ByWorkingDay component to change the 'date' property to 'name' for better clarity and updated the mapping logic to format the date for display.

These changes improve the reliability and clarity of the analytics components, ensuring they handle data more gracefully and present it in a user-friendly manner.
…teractivity

- Introduced a new Stat component for displaying allocation metrics, improving the visual representation of data.
- Simplified click handling and styling logic for allocation types by implementing helper functions for class names and color retrieval.
- Enhanced user interaction by allowing users to select different allocation types with improved visual feedback based on selection state.

These changes improve the user experience by making the allocation data more visually appealing and interactive, while also streamlining the component's code structure.
…or assignment

- Introduced a new KindType type to standardize allocation kinds and enhance type safety.
- Implemented a getKindColor function to manage color assignments for different allocation types, improving code clarity and maintainability.
- Updated state initialization for selectedKind to ensure it starts as an empty string, dynamically selecting the first non-zero kind from totals.
- Enhanced rendering logic to utilize the new getKindColor function for consistent color application across the component.

These changes improve the overall structure and readability of the OneYearAllocation component, ensuring a more robust and visually coherent user experience.
@ElemarJR ElemarJR merged commit 2f675cc into eximiaco-labs:main Jan 3, 2025
1 check passed
@ElemarJR ElemarJR deleted the last_twelve_months_view branch January 3, 2025 01:21
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.

None yet

1 participant