rubyforgood / pantry_scheduler

MIT License
7 stars 13 forks source link

Usda cert alert #113

Closed rongxanh88 closed 6 years ago

rongxanh88 commented 7 years ago

Changes to client-form.js

  1. I added a section tag to enclose the form and a new component, the USDA alert. There is some flex box styling just to put it to the right side of the form like in the attached screenshot.

    screen shot 2017-09-19 at 11 13 46 am
  2. The UsdaAlert component only renders after checking if the USDA cert is true, and if the cert date is null or more than a year old.

pollygee commented 7 years ago

@rongxanh88 awesome thanks!

Can we update the the text to say "USDA certification date needs to be updated". It's slightly more accurate. There may be a paper signed and it just hasn't been added or several other categories. sorry should have though about the text for the box before, thanks!

Also, what would trigger the alert box to come up? I am not seeing it. When I click the check in box for a client who is USDA and has no date I'm not getting the box you're showing. I'm not sure what I'm missing?

pantryscheduler

rongxanh88 commented 7 years ago

@pollygee Yeah, I can change the message. I played around with the form a bit. If you change the USDA cert to Yes, then click save and close the dialog box, then click 'check in' again, the alert shows up. I am currently using this.props.client.usda_cert in my verification. My guess is that the clicking yes, and then saving does not alter this.state.client, but makes a Post request to the server? Thus the state does not alter until the app makes another GET request when you are on the dashboard.

rongxanh88 commented 7 years ago

@pollygee Yeah, I just had a look at the code. The app makes the put request to update the Rails backend. I'll have to add an event to change the state and make the alert appear dynamically. Not a big deal. I may have some time to knock that out tomorrow.

pollygee commented 7 years ago

@rongxanh88 ok great thanks! For a client who is already USDA cert with no date, I changed UDSA and I still can't get it to show up.

In any event, we def need it to come up if they're already USDA and don't have a date or that date has passed a year old. So checking it dynamically would be a must. Thanks for taking another stab at this!! Let me know when you push some more code. I'll check it out again.

pollygee commented 7 years ago

This is addressing issue #45

rongxanh88 commented 6 years ago

@pollygee Hey Polly, sorry I don't mean to ghost on you. I have been pretty busy with job interviews/ prep. I can get back to this issue on Thursday hopefully.

pollygee commented 6 years ago

@rongxanh88 no problem at all! Thanks for touching base and letting me know that helps a lot! We all understand how busy life can get :) Good luck with job interviews! I hope you have good news very soon!