-
-
Notifications
You must be signed in to change notification settings - Fork 499
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
Convert partner profile to step-wise form #4504
Comments
Reserved for @danielabar -- who is fully briefed and interested! (let's say reserved until September 1) |
This is on my radar. Planning to complete partner request confirmation, then will turn my attention to this. |
Now that partner confirmation is done, I could start on this. |
Please do! |
…rtner step form should be rendered
Started. Looking into Accordion component to handle expand/collapsible sections. |
bringing @dorner into the loop for any early technical guidance. |
This might be simpler than a typical step-wise form in that the underlying model Each collapsible section could be a form that submits to the same A complexity could be that on any given "subset" update (i.e. where user clicked Save & Next), we wouldn't want to redirect them to the show view Possibly a different action button is needed for user to indicate something like "Save and I'm done with all this", or is that the "Submit for Approval" button? |
It would also be good to clarify how the sections from the current form should get split up? For example, is each existing "card" from the current form to become its own collapsible section? There is an existing partial for Agency Information, but it also includes Program Delivery Address, which is not shown in the mockups. Should Program Delivery Address be another collapsible section? |
Yes, each card should be a step. Program delivery address was moved to its current location after I made up the mockups. (Recall also that the presence of most of the cards is controlled at the bank organization level) Submit for Approval, in addition to saving, changes the status so that it appears on the banks list of partners to approve. We'll likely want to make more fields conditionally mandatory (definitely not for this issue) as we go on. |
Haven't had as much time to work on this but it's still on my todo list. Just wanted to post an update that it is possible to programmatically target the Bootstrap accordion sections whether they should render as expanded or collapsed. Expanded
<div class="accordion-item">
<button class="accordion-button"... aria-expanded="true">
<div class="accordion-collapse collapse show">
...
</div> Collapsed
<div class="accordion-item">
<button class="accordion-button collapsed"... aria-expanded="false">
<div class="accordion-collapse collapse">
...
</div> |
Tricky part may be on each given save of a section, determining which is the next section to render as expanded (and to ensure all the others are rendered as collapsed). It looks like there are 3 static (i.e. always shown) sections, with a number of dynamic sections in the middle (only to be shown if the partner has been configured as such). Something like this: n: loop over
|
…d on currently submitted partial
…rtner step form should be rendered
…d on currently submitted partial
…ed on currently submitted partial
…pen_section instance var
Okay, I definitely need input from the rest of the senior team now -- I don't currently have the technical chops to make some of these judgements. I've slacked them asking them to look at it, and am slotting it in for discussion in our Sunday planning meeting. |
…mic accordion logic - Introduce feature flag to control rendering of new partner step forms. - Add accordion UI for expand/collapse of sections in step forms. - Implement initial logic for handling dynamic next section based on submitted partial. - Build out partner step forms for different form sections. - Move next-step logic from controller to service object for cleaner separation of concerns. - Add logic to handle edge cases in form progression and server-side rendering of open sections. - Introduce tests for partner next step service.
…al logic - Add 'Submit for Approval' button logic with conditions based on partner statuses. - Handle server-side validation errors and ensure correct form section reopens on error. - Improve UI for population served, area served, and step form interactions. - Refactor form partials and helper methods to remove duplication. - Support custom accordion header titles and implement scroll to open section feature. - Refine final user experience with dynamic accordion behavior and error handling improvements.
@cielf My latest branch has the following changes:
It's not the same effect that would be from a pure SPA because it still does round trip to server to render the page, but let me know if it's "smooth enough"? |
Hey @danielabar -- If one is viewing it at a size where the collapsed form fits on one's screen, it's pretty good! I want to get some fresh eyes on it re whether the behaviour when you're working with a larger font and hence, have to scroll to get down to the lower bits of the screen is workable. (I don't see the scroll position being preserved in that case.) Let me show it to / talk with the rest of the senior team tomorrow. |
@cielf In the meantime, I'm continuing to investigate options. That scroll preservation meta tag mentioned in the Turbo docs: <meta name="turbo-refresh-scroll" content="preserve"> I was trying to dig through some of the turbo-rails code to understand why it wasn't working. I think it only works in co-ordination with turbo frames. So I attempted to wrap each form in a turbo-frame. In this case, it did preserve scroll position and had a very smooth effect, even on smaller screen sizes. However, it broke other things including:
There are a number of different options for turbo frames, I've been experimenting, some of them fix one thing but break something else, so this will require further research. It still might be worth confirming with some user interviews (if possible) - whether most users expect the form data to be saved on the caret icon clicks. If this is not the case, this feature could be simplified by only saving the form data on the "Save and Next" button click. |
@danielabar Ok.... We had a significant discussion in the planning meeting, and have decided to pull out of the automatic save / save and next paradigm as too cumbersome. I do apologize for taking you so far down the current road. I hope you learned some good stuff! I do appreciate your willingness to try to make it sing in the original way. So... here's the new preference, which we think will be much simpler:, and hopefully easier to implement. We tossed around ideas like showing the errors in the subforms, and/or putting a red X in the header of those, but I think, at least for the current iteration, let's just show them up top. (Note: I would keep the bit where we say "saving" when the save is happening, if it's not a lot of trouble) Does that sound workable? |
@cielf To clarify, we're going to remove the form submission behaviour from the bootstrap open/close caret icon clicks? i.e. the only way to save form data is to click the "Save Progress" button? Also re:
Given that only one form can be submitted at a time, I don't think it could ever happen that more than one section would be in an error state. |
@cielf Being able to open up multiple sections at once opens up a new scenario. Suppose user fills in a section, submits, and server sends back an error response, for example, Media Information: Now user can ignore this, open up any other section, for example, Organizational Capacity, fill it in and submit: Since each of these are separate forms, what would happen currently is the error state would be cleared from Media Information and it would save Organizational Capacity. Pretty much as if user had navigated away from the page and submitted any other form. Is this ok? Or if not, should all other submit buttons be disabled if any section is in an error state. This would mean user has to fix the error to move on. |
@danielabar we are suggesting that there should only be a single form encompassing all sections. |
(nods) It does mean that when someone saves, they are are going to have to provide media info. Luckily, that's among the easiest bits of information to lay one's hands on. |
@cielf @dorner Sorry for all the clarification questions, just want to be sure on the UI since we're no longer working from original mockups. re:
Since it's now just one big form, does this mean these buttons should appear outside of the collapsible sections at the top and bottom of the overall accordion? Or at the top and bottom of each accordion section? For now I've updated it with the buttons appearing at the top and bottom of the accordion, does this look ok? |
That looks good to me. |
- Introduce feature flag to control rendering of new partner step forms. - Add accordion UI for expand/collapse of sections in step forms. - Build out partner step forms for each section. - Add service to map profile field errors to sections they belong in. - Update accordion styles to render as open if they contain an error.
- Introduce feature flag to control rendering of new partner step forms. - Add accordion UI for expand/collapse of sections in step forms. - Build out partner step forms for each section. - Add service to map profile field errors to sections they belong in. - Update accordion styles to render as open if they contain an error. - replace bootstrap caret icons with saving indicator during form submission
Status update:
Notes:
TODO:
|
Thanks for the update! |
- Introduce feature flag to control rendering of new partner step forms. - Update controller edit and update actions to use feature flag. - Add accordion UI for expand/collapse of sections in step forms. - Build out partner step forms for each section. - Update partner profile validation to set errors at field level. - Add service to map profile field errors to sections they belong in. - Update accordion styles to render as open if they contain an error. - Replace bootstrap caret icons with saving indicator during form submission. - Add system tests for partner profile step-wise editing.
- Introduce feature flag to control rendering of new partner step forms. - Update controller edit and update actions to use feature flag. - Add accordion UI for expand/collapse of sections in step forms. - Build out partner step forms for each section. - Update partner profile validation to set errors at field level. - Add service to map profile field errors to sections they belong in. - Update accordion styles to render as open if they contain an error. - Replace bootstrap caret icons with saving indicator during form submission. - Add system tests for partner profile step-wise editing.
Hurrah! |
…t that expect errors at base level
[#4504] Add step-wise partner profile edit form
Summary
We want to rework the partner profile into a step-wise form, with error checking at each step.
Reasoning
The current form is very large and intimidating enough that it is a barrier to entry for the partners -- or the banks have to fill it in for them. Breaking it up into bite-size chunks will make it easier for the partners to deal with.
Details
This applies to both the partner and bank edits of the form (partner: partners/profile/edit bank: profiles/[partner #]/edit)
See concept below. Expand it for each of the 'cards' in the current partner profile edit forms. At each "save and next", we would want to be able to check the 'local' fields and display any relevant errors. The partners will also need to be able to "Submit for approval", which will check the whole thing, and, if ready, set the status to indicate that it is ready for approval.
Please note:
1/ Several of the cards can be enabled/disabled by the bank in their organization edit (sign in as org_admin1@example.com, "My Organization", click on "Edit" -- the field to look at is: "Partner Profile Sections"). If the card is not available, it should not appear in the "accordion".
2/ The user should be able to navigate to any of the available sections at will.
3/ Intermediate results (at save and next) will need to be saved, possibly over days
Criteria for completion
The text was updated successfully, but these errors were encountered: