-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Split budget creation in steps #4531
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cf87780
to
77cc0e9
Compare
4388ebc
to
9fed136
Compare
22dbe75
to
ade14c1
Compare
b3f2b58
to
d9d7a0c
Compare
cb5b255
to
527b1cf
Compare
f276a50
to
3f5a2f3
Compare
This way it will be easier to change it and reuse it.
We introduce the first step (creating the budget). Co-Authored-By: decabeza <[email protected]>
We usually prefer local variables over instance variables in partials. This way we'll be able to call the partial from views or components where the instance variable isn't available. And since we're using the `path` variable to configure the URL, we don't have to specify extra variables like `@budget` or the namespace `:admin` in `form_for`, since Rails only uses those variables to set the URL.
Using the placeholder selector, we weren't overwriting the rules in the mixin called with `@include` in some cases because in the generated CSS the placeholder selector appeared before the code generated by the calls to `@include`.
When we've got 6 actions and we use it in 3, IMHO the code is easier to follow if we write the actions where we do use it.
Note we're keeping this section's original design (which had one button to add a new group which after being pressed was replaced by a button to cancel) but we aren't using Foundation's `data-toggle` because there were a couple of usability and accessibility issues. First, using `data-toggle` multiple times and applying it to multiple elements led to the "cancel" button not being available after submitting a form with errors. Fixing it made the code more complicated. Second, the "Add new group" button always had the `aria-expanded` attribute set to "true", so my screen reader was announcing the button as expanded even when it wasn't. I didn't manage to fix it using `data-toggle`. Finally, after pressing either the "Add new group" and "Cancel" buttons, the keyboard focus was lost since the elements disappeared. So we're simplifying the HTML and adding some custom JavaScript to be able to handle the focus and manually setting the `aria-expanded` attribute. Co-Authored-By: Javi Martín <[email protected]> Co-Authored-By: Julian Herrero <[email protected]>
This way adding new steps will be easier.
With the word "headings" in it, it's a bit easier to know where we are. We're also using a translation since not every language in the world uses a "/" as a standard separator between two terms.
Co-Authored-By: decabeza <[email protected]>
This way it'll be easier to use it in the budgets wizard section as well.
So now there's no need to edit each phase individually to enable/disable them. We aren't doing the same thing in the form to edit a budget because we aren't sure about possible usability issues. On one hand, in some tables we automatically update records when we mark a checkbox, so users might expect that. On the other hand, having a checkbox in the middle of a form which updates the database automatically is counter-intuitive, particularly when right below that table there are other checkboxes which don't update the database until the form is submitted. So, either way, chances are users would think they've updated the phases (or kept them intact) while the opposite would be true. In the form within the wizard to create a budget that problem isn't that important because there aren't any other fields in the form and it's pretty intuitive that what users do will have no effect until they press the "Finish" button. Co-Authored-By: Julian Nicolas Herrero <[email protected]>
When users created a budget and made a typo, they could use the link to go back to edit a budget. However, after doing so, they were out of the budget creation process. So we're now letting users go back to edit the budget, fix any mistakes they might have made, and then continue to groups.
javierm
approved these changes
Jun 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
References
Objectives
Visual Changes
Budget step
![Captura de pantalla 2021-06-09 a las 11 57 08](https://user-images.githubusercontent.com/16189/121334868-59ed7900-c91a-11eb-99ec-2bba2a3813ff.png)
Groups step
![Captura de pantalla 2021-06-09 a las 11 58 13](https://user-images.githubusercontent.com/16189/121334917-6671d180-c91a-11eb-80ee-3bdb4620152e.png)
Headings step
![Captura de pantalla 2021-06-09 a las 11 59 02](https://user-images.githubusercontent.com/16189/121334951-6ffb3980-c91a-11eb-8cf6-2bb56e9db9d0.png)
Phases step
![Captura de pantalla 2021-06-09 a las 11 59 41](https://user-images.githubusercontent.com/16189/121335015-80abaf80-c91a-11eb-97d4-a2bcdaa6f0ba.png)