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

Fix/calendar fix #158

Merged
merged 20 commits into from
Aug 6, 2024
Merged

Fix/calendar fix #158

merged 20 commits into from
Aug 6, 2024

Conversation

JaneMoroz
Copy link
Collaborator

@JaneMoroz JaneMoroz commented Jul 6, 2024

Description

I probably overdid it 😅, but I needed to change a few things to understand where to use time conversion. I just enhanced things a little bit, renamed some functions/variables, and removed variables that seemed confusing and unnecessary.

  • Separated calendar logic from event logic.

    • Refactored Calendar.logic and removed some functions. For example, I moved the generateClassString and getCalendarElementColor logic to Cell.tsx because they are related to cell styles. I believe setIsHoveredDate triggered unnecessary re-renders, so using hover: and its combination with group (for icons) seemed reasonable. I also moved the icon-related logic to Cell.tsx as well.
    • All event time conversions to the current user's timezone now occur in Event.logic.
    • I created getEvents instead of showDotConditions (but the logic is pretty much the same) to simplify using EventItem in Calendar without all the conditionals.
    • Cell is now wrapped in a button, eliminating the need for onDotClick and some other click handlers.
  • Renamed the EventList type to MeetingEvent.

  • Removed time conversion from getDashboardData because all time conversions now occur in Events.logic.

Issue link

I checked the calendar using Sensors in Google Chrome.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@JaneMoroz JaneMoroz requested a review from Dan-Y-Ko as a code owner July 6, 2024 16:25
Copy link

vercel bot commented Jul 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
chingu-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 6, 2024 10:51pm

Copy link
Collaborator

@Dan-Y-Ko Dan-Y-Ko left a comment

Choose a reason for hiding this comment

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

The issue I mentioned before is still existing. If I change the data in getCurrentSprint file, the calendar will show the highlighted squares according to that date but the "today" date is the current date. There are 2 separate dates being used here. One in getcurrentsprint file and one in authprovider.

My suggestion would be to take the current date out of the function in the getcurrentsprint file and make it an export, and use that in the the authprovider.


Something like that. This way, not only do we have one source being used as the date but also if we need to manipulate the date, we don't need to go change it in multiple places (which is what we need to do currently)

There's also new instances of dates being used in other places too

@JaneMoroz
Copy link
Collaborator Author

@Dan-Y-Ko Done!

@Dan-Y-Ko Dan-Y-Ko merged commit c2c97a1 into dev Aug 6, 2024
3 checks passed
@Dan-Y-Ko Dan-Y-Ko deleted the fix/calendar-fix branch August 6, 2024 23:08
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