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

Andrei/quick shift #25

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

Andrei/quick shift #25

wants to merge 8 commits into from

Conversation

andreisito
Copy link
Collaborator

What's new in this PR

Description

**

    1. Fill out the quick shift form like a shift form
    1. Formik uses validation schema + setField value to track form changes
    1. For any option, setFieldValue, TextField, and other formik components/funcs will update initialValues
    1. When submit is pressed, initialValues is sent to onSubmit function.
    1. onSubmit function accesses the field values from formik. Can manipulate as wanted
    1. OnSubmit formats the field info to match a scheduled shift. Sends it to firebase
      */

Reformatted a ShiftForm to match specs of a quickshift.

  • Categories removed from form
  • Autocomplete roster of all house members added as field
  • Calendar date picker used as QuickShift picks specific date.

Creates a scheduledShift that isn't linked to a Shift object in firebase, used for edge cases by managers.

Screenshots

image
beautiful.

How to review

//: # "Required -

  • Look at the /testing file.
  • Create a quick shift, hit submit, then review firebase scheduledShifts to see that specs match
  • Review QuickShiftForm file for debugging or more details

Caveats:

  • quick shift form relies on display names right now, but some user objects in firebase aren't formatted correctly. Need first + last. Works anyway right now
  • Formatting on date a little unclear. Right now, quickShiftForm uses Dayjs for dates, then stringifies on submission.
  • JSONcopy is a stringified Shift object, built to match scheduledShift functionality by the form.
  • Any dates or JSONcopy must be turned back into correct objects for future use, else stay as strings.

Next steps

  • Integrate with table.
  • Frontend cleanup

Relevant Links

Online sources

Related PRs

CC: @gregoriiaaa

@vercel
Copy link

vercel bot commented Apr 27, 2023

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

Name Status Preview Comments Updated (UTC)
bsc-web-app ❌ Failed (Inspect) Apr 30, 2023 9:01pm

Copy link
Contributor

@gregoriiaaa gregoriiaaa left a comment

Choose a reason for hiding this comment

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

Failed to deploy. Fix the following errors that Vercel caught:
image

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