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

Polish admin posting pages #203

Merged
merged 15 commits into from
Mar 24, 2022
Merged

Polish admin posting pages #203

merged 15 commits into from
Mar 24, 2022

Conversation

sherryhli
Copy link
Member

@sherryhli sherryhli commented Mar 10, 2022

Ticket link

Closes fullcalendar/fullcalendar-react#138

Implementation description

In addition to completing requirements outlined in the ticket, this PR also...

  • Adds new DateTimeUtils functions
  • Fixes datetime bugs
  • Fixes UI bugs
  • Sets current week in shift calendar
  • Executes createShifts mutation in create posting review page

Please see commit messages for more details.

Steps to test

  1. Run the application locally (avoiding writes to staging DB for now to keep it clean)
docker-compose up --build
  1. Go to the create posting page and create a posting
    Create Posting Demo
  2. Verify data in the database
docker exec -it sistering_db/bin/bash -c "psql -U postgres -d sistering"
SELECT * FROM postings;
SELECT * FROM shifts WHERE posting_id = 'INSERT_POSTING_ID';

What should reviewers focus on?

  • Please review commit by commit
  • End-to-end functionality and correctness of behaviour
  • Code cleanliness
  • General adherence to hi-fi designs (note: another round of refinement is needed to be pixel-perfect, will require a design review)

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

@github-actions
Copy link

github-actions bot commented Mar 10, 2022

Visit the preview URL for this PR (updated for commit 51ecdcd):

https://sistering-dev--pr203-sherry-polish-admin-surs4jdg.web.app

(expires Thu, 31 Mar 2022 17:35:49 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

* TODO: implement better solution described here
* https://github.com/fullcalendar/fullcalendar/issues/4684#issuecomment-620787260
*/}
<div key={startDate}>
Copy link
Member Author

Choose a reason for hiding this comment

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

More context:
We need to set the initial date of the calendar to be in the week of the start date, which can be done via the intialDate prop passed to FullCalendar. The start date changes depending on user input on the create shifts page. However, FullCalendar does not re-render when the prop changes. This is a temp hack to force a re-render.

https://github.com/fullcalendar/fullcalendar-react/issues/57

Copy link
Member

Choose a reason for hiding this comment

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

Wait if posting start date is not on a sunday, is it supposed to rerender? Bc it does not for me.

Also, I realized if they make a posting that does not span the entire week, like wednesday to friday, the shift calendar will still allow you to create shifts for the entire week. It's kind of confusing bc when you input the dates, the format of the date doesn't say what day of the week it is.

image

Copy link
Member Author

Choose a reason for hiding this comment

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

Summary of what we discussed on Sunday:

Wait if posting start date is not on a sunday, is it supposed to rerender? Bc it does not for me.

The calendar always displays a 7-day week from Sun-Sat. A re-render is only triggered when the date of the Sunday before start date changes (e.g. the Sunday before March 22nd is March 20th, the Sunday before March 24th is also March 20th, so changing the start date from the 22nd to the 24th will not trigger a re-render)

Also, I realized if they make a posting that does not span the entire week, like wednesday to friday, the shift calendar will still allow you to create shifts for the entire week. It's kind of confusing bc when you input the dates, the format of the date doesn't say what day of the week it is.

Yep, agreed it's confusing, being addressed in #232 :)

@@ -42,7 +43,8 @@ const createStepLabel = (
const SideNavbar = (steps: SideNavbarStepsType): React.ReactElement => {
const { activeStep, labels } = steps;
return (
<Steps activeStep={activeStep} orientation="vertical">
// TODO: remove hardcoded width, investigate text wrapping behaviour
<Steps activeStep={activeStep} orientation="vertical" width="250px">
Copy link
Member Author

Choose a reason for hiding this comment

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

The circular number icon becomes distorted when the text spans multiple lines

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a temporary fix and does not work for smaller screens as it affects the centering of elements within the Container

@sherryhli sherryhli marked this pull request as ready for review March 15, 2022 04:35
Copy link
Member

@LenaNguyen LenaNguyen left a comment

Choose a reason for hiding this comment

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

Looks really good! Thanks for making these changes :) Just a some small deviations from designs and a couple questions.

</Text>
<SideNavBar
activeStep={0}
labels={["Basic Information", "Time Slots", "Review and Post"]}
Copy link
Member

Choose a reason for hiding this comment

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

The sidenav needs the grey background to match the designs. It's #F3F3F3 in the designs so we may need to ask if that also maps to background.dark

Copy link
Member

Choose a reason for hiding this comment

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

I asked the designers it's actually background.light

</Button>
<Button onClick={handleNext}>Next</Button>
</HStack>
</VStack>
Copy link
Member

Choose a reason for hiding this comment

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

The next/back footer should be stuck to the bottom of the screen:
image

If we're gonna refactor so that this creation flow is all in one page, then this change is probably better there instead of this pr though!

Copy link
Member

Choose a reason for hiding this comment

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

Made a ticket to refactor into one page #213

* TODO: implement better solution described here
* https://github.com/fullcalendar/fullcalendar/issues/4684#issuecomment-620787260
*/}
<div key={startDate}>
Copy link
Member

Choose a reason for hiding this comment

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

Wait if posting start date is not on a sunday, is it supposed to rerender? Bc it does not for me.

Also, I realized if they make a posting that does not span the entire week, like wednesday to friday, the shift calendar will still allow you to create shifts for the entire week. It's kind of confusing bc when you input the dates, the format of the date doesn't say what day of the week it is.

image

@sherryhli
Copy link
Member Author

Did a rebase but did not address the side navbar design deviation. It's not quite as straightforward as I thought, having trouble making the the enclosing VStack span the entire height of the container and I'll need to fiddle with the styling a bit more.

This issue, along with a couple others are documented in #233 for round 2 of refinement. @LenaNguyen if you don't mind could we go ahead and merge this PR as is?

Copy link
Member

@LenaNguyen LenaNguyen left a comment

Choose a reason for hiding this comment

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

👏👏

@sherryhli sherryhli merged commit beff7cf into main Mar 24, 2022
@sherryhli sherryhli deleted the sherry/polish-admin-posting branch March 24, 2022 22:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

index.js:1 Warning: NaN is an invalid value for the right css style property.
2 participants