-
-
Notifications
You must be signed in to change notification settings - Fork 484
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
Case Contact Form Overhaul #6048
Case Contact Form Overhaul #6048
Conversation
cb2b324
to
d551efa
Compare
wait WOW @thejonroberts thank you so much for jamming on this. You have made my month 😂 |
@thejonroberts thank you for the feedback on the following:
I can create some sep tix for these. As fo this PR @elasticspoon do we need an issue to tie this PR to? |
@thejonroberts just chatted with Mallory (designer) and confirmed that we should be Requiring ContactType - are you able to do a "hot fix" here or would you like a new ticket? |
@bcastillo32 I can add the ContactType requirement here. |
Ok great. Thank you so much @thejonroberts ! |
123adc6
to
b2c47b1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Honestly, this is really good. I really liked the fallback to additional notes when an org has no contact topics set.
I haven't looked at the code too closely but mainly clicked around a bunch to do some higher level testing:
Blockers
- delete button for notes does not seem to work?
- I start a new case contact, add a topic answer, fill it in, reload the page, delete topic answer => is disappears from the page => reload page => its back
- I see a "you are not authorized' banner at the top of the page (I am admin creating a case contact)
- logs show
ActionController::RoutingError (No route matches [DELETE] "/"):
- should also probably skip
app/controllers/application_controller.rb:39:in set_active_banner'
for an api only request
- creating a contact topic answer:
- also tries to
set_active_banner
- have this in the logs
- also tries to
ActionController::UnknownFormat (SupervisorsController#index is missing a template for this request format and variant.
request.formats: ["application/json"]
request.variant: []):
- I think drafts are broken?
- logged in as a supervisor, picked a case, new case contact
- filled in some stuff, did not submit
- went back to page with all contacts for a case and contact was not there
- I seem to be getting the unauthorized message on random reloads of the contact form
Nice to have (not blocking)
- add some client side validation to the required fields
- mark the driving reimbursement fields are required
- autosave popup would be nice on other fields as well, just so I know when I am good
consolidate to details page 9 pending for notes, additional expenses, autosave move title to details page better spec helper, various fixes delete unused files additional expenses spec fixes put contact types partial back
better additional note behavior, comment out autosave, miscellaneous comments, lint contact topic answer spec and cleanup todo note for grouped contact types new spec empty group? inactive type spec
spec fo contact type required contact type active scope & includes many small template and spec changes
restore case contact scss remove form steps form controller cleanup remove create_with_answers form improvements
create/destroy records as needed via js fetch
Yea. I'm good with that as an initial approach and we can see in the future if we need to change that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of my stuff is just small comments but the drafts on the case details page (/casa_cases/:case_slug) don't appear, which is actually blocking.
volunteer.mp4
@elasticspoon, that cannot be done currently in the app! I tried it out on main branch to confirm. We don't set |
@MalloryPriceDesign thanks so much for the detailed feedback! I have reworked the form quite a bit and it is much better now! Notes:
I have made the date input blank on load. Note that there is some weird behavior in Safari browsers - The date input's value is null, but it is displayed as today's date. So user may think it is set, but value is null and will error if form is submitted as is. This could be confusing, so I added basic browser validation to require an input before submit... I think that feedback could probably be improved, depends on the browser implementation. I also could not get the CSS for input placeholder text color to work consistently for all inputs, I think due to our bootstrap setup. These issues would make good improvement tickets?
Yes, the entire Reimbursement section card is not rendered unless organization driving reimbursement is enabled.
Expenses are behind another feature flag (also in Organization Edit available to admin), so they are not shown unless Driving Reimbursement & Expense reimbursement are both enabled. Note that this means creator must request driving reimbursement to request Other Expenses... So you can have no reimbursement, driving reimbursement only, or driving & expense reimbursement. But not only Expense reimbursement.
Reworked classes and CSS to be much more consistent with design. Pretty close I think, the Figma files were extremely helpful, thank you.
EDIT:
The only way to do this (easily) means that it can only be a one line entry, as opposed to a more traditional address format, is that okay? Will wait to make the change until that is confirmed. |
@MalloryPriceDesign - ready for re-review, see above, edited some notes I made earlier. (may need to be deployed to the environment you were looking at, I'm not sure how that was setup) @elasticspoon - ready for re-review, with the caveat that I have not addressed the CasaCase show page draft issue, as I don't think that was a feature prior to this work, unless I'm missing something. |
Let's keep this as-is, I think the users will probably expect the traditional address format instead of a one-line format.
That's great! I used Codespaces to review previously. However, after running
I'll take a look again later. |
You are right. My flabbers are ghasted. I totally thought that was something that could be done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thejonroberts This is pretty tremendous work man. You are a saint to doing all this work and being so thorough about it. I don't see any blocking issues. I'm sure something will come up but I'm fine to send this as is.
I'll let @MalloryPriceDesign chime in if she has any further input.
Thank you, Mallory...
This is browser dependent -- Safari opens date picker on click for example. I think any changes to browser input behavior should be separate to make sure time can be spent ensuring cross-browser behaviors and accessibility considerations are maintained, a lot of gotchas can pop up! |
wow wow wow!! |
thank you everyone for the work on this! This is amazing and feedback on the codespace was very positive! |
What github issue is this PR for, if any?
Resolves #XXXX - Is there an issue for this yet?
Please review/merge these PRs first:
[ ] AdditionalExpenses and ContactTopicAnswer controllers & policies #6060They include some of the changes here, but can be merged with no changes to existing behavior. That will make review of this giant PR a little easier.
What changed, and why?
Total overhaul of CaseContact form. Reworked to be in one page. This was accomplished by reducing the wicked wizard steps to one - the details step.
Maintaining the autosave feature was complicated! Before, notes were the only thing that could change during an autosave, but now everything is in the form that gets sent during the autosave update. Therefore,
nested_attributes_for
contact_topic_answers
andadditional_expenses
required a stimulus NestedForm controller that could create and destroy records -- otherwise, autosave would make new records for every save, or try to delete records that had already been removed in the prior update. This also required creating controllers & routes for those json requests.How is this tested? (please write tests!) 💖💪
I had to rewrite request and system specs in the process. Request spec was made to be more typical, testing request responses for certain parameters, and not checking page content - I moved those into system specs. I got rid of the system/create spec and moved those tests to new or edit specs as applicable (I'm not sure how create was different from 'new' in a system spec). There were also specs asserting things about case show to that spec rather than the form specs, which I moved over to the case show specs.
Also added request and policy specs for the new controller routes, as mentioned.
Additional Notes
There are a few things from the design requirements that have not been met. I have pending specs for those (which may need to be removed?). I recommend creating issues and handling them separately. They are:
Screenshots please :)
Feelings gif (optional)
_What gif best describes your feeling working on this issue? https://giphy.com/