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

David kenzy/scrollable calendar with functionality #39

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

ludavidca
Copy link
Collaborator

@ludavidca ludavidca commented Oct 30, 2024

Notion ticket link

Make Calendar Scrollable

Implementation description

  • Calendar

    • Implemented scrollable calendar with infinite scroll (3 years forward, 1 year back)
    • Connected the months when scrolling
    • Implemented the "today" button (auto scrolls to today)
    • Created UI to display each individual event with the correct location and class type
    • Implemented highlighting of today’s date
    • Implemented dynamic rendering of months based on displayed dates
  • Input form

    • Updated the input form component to reflect new design
    • Implemented input form appearance with today’s date when the "declare absence" button is clicked
    • Implemented input form appearance with the corresponding date when a date block is clicked
    • Implemented background darkening when the input form appears
    • Created the Google Drive upload component and connected API routes for the input form
    • Created a mini calendar form to select dates
    • Implemented successful message
    • Implemented validation and alerts when fields are not present

*NO ERROR HANDLING YET DUE TO DROPDOWN PR

  • API
    • Created API Route to get all absence data from the calendar with the correct class type and locations
    • Created API Routes for adding all data fields to absence table
    • Integrated prisma.ts file

Steps to test

  • Test Calendar:

    • Scroll through the calendar to verify that infinite scroll works both forwards and backward (2 years in each direction) and that months render/update properly
    • Verify that the months stay properly connected/aligned when scrolling
    • Click the "today" button and verify that it smoothly scrolls to the current date
    • Verify that today's date is visually highlighted
    • Verify that events display correctly with:
      • Proper location information
      • Correct class type
      • Accurate dates
  • Test Input Form:

    • Via the "declare absence" button:
      • Verify form opens with today's date pre-selected
    • Via a date block click:
      • Verify form opens with clicked date pre-selected
  • Test form validation:

    • Submit an empty form to verify validation alerts
    • Verify each required field individually

DO NOT TEST FOR INVALID Teacher ID error as this should not be an issue once dropdown is implemented

  • Test Google Drive upload:

    • Upload various file types to verify accepted formats
    • Test file size limits
    • Verify successful upload notification
  • Test mini calendar:

    • Verify date selection works
    • Verify navigation between months
    • Verify that the selected date is reflected in the main input form
  • Test form submission:

    • Submit valid data and verify the success message
    • Verify that submitted data appears correctly in the calendar
    • Verify all fields are properly saved to the database
  • Test form dismissal:

    • Click outside of the form to verify it closes
    • Verify background returns to normal
    • Verify unsaved data is handled appropriately
  • Test API:

    • Verify GET requests return correct absence data:
    • Verify all events are displayed
    • Verify class types are accurate
    • Verify locations are correct
    • Verify POST requests for absence submission:
    • Verify all data fields are properly saved
    • Verify error handling for invalid data
    • Verify successful database updates
    • Verify Google Drive link gets inputted into databases

What should reviewers focus on?

  • Proper input validation
  • Proper input updates/reflection in the calendar/database
  • Code readability and if sections/methods make sense
  • General code style/best practices

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

Copy link

vercel bot commented Oct 30, 2024

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

Name Status Preview Comments Updated (UTC)
sistema ❌ Failed (Inspect) Nov 20, 2024 2:52am

@VJagiasi
Copy link
Collaborator

  • Test Google Drive upload:

the file gets uploaded to the drive even if I don't submit the input form - fix it so that it get's uploaded only when we submit the absence

Copy link
Member

Choose a reason for hiding this comment

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

I think we should import the types from the prisma file just so we have one source of truth (otherwise when the schema changes we'll need to remember to modify all the relevant types files) prisma/prisma#12453

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.

5 participants