Merged
Conversation
18b219d to
a947f62
Compare
2 tasks
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.
Fixes bug from #240, which caused all-day events to lose their position during drags.
Also does minor follow-ups to #236 , which also cleans up surrounding code for readability
This pull request includes significant changes aimed at refactoring and simplifying the codebase, specifically around event positioning and width calculations in the calendar grid. The changes involve moving several utility functions to a new file and removing redundant code.
Refactoring and Simplification:
packages/web/src/common/utils/grid.util.ts: Removed multiple methods related to event positioning and width calculations, such asgetAllDayEventWidth,getEventCategory,getLeftPosition, andwidthMinusPadding. These methods were moved to a new file for better organization. [1] [2] [3] [4]packages/web/src/common/utils/position.util.ts: Added a new file that now contains the methods for calculating event positions and widths, such asgetAbsoluteLeftPosition,getAllDayEventWidth,getEventCategory, andgetLeftPosition. This helps in organizing the code better and making it more modular.File Renaming and Import Adjustments:
packages/web/src/__tests__/utils/grid.util/grid.util2.test.ts: Renamed topackages/web/src/common/utils/position.util.test.tsto reflect the new organization of utility functions.packages/web/src/views/Calendar/components/Event/Grid/GridEvent/GridEvent.tsxandpackages/web/src/views/Calendar/components/Grid/AllDayRow/AllDayEvent.tsx: Updated imports to use the newly createdposition.util.tsfile for event positioning functions. [1] [2]Removal of Redundant Files:
packages/web/src/views/Calendar/hooks/event/getPosition.tsandpackages/web/src/views/Calendar/hooks/event/useEventPosition.ts: Removed these files as their functionality has been moved to the newposition.util.tsfile. [1] [2]Layout Constants Adjustment:
packages/web/src/views/Calendar/layout.constants.ts: Removed the constantGRID_EVENT_OVERLAPPING_HORIZONTAL_MARGINas it has been moved to the newposition.util.tsfile.