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

91 styling for tabs in visit form #93

Merged
merged 8 commits into from
Jun 6, 2024

Conversation

dc2007git
Copy link
Contributor

Adds error localisation capabilities to tabs on form as described in #91

If opening a new visit, the tabs will be white. If an error is present on the categories in the form, it will be red. If the contents of the tab have been validated, the tab will be pink.

Also in this PR is a boldening of the tab fonts:

image

@dc2007git dc2007git linked an issue Jun 3, 2024 that may be closed by this pull request
@dc2007git
Copy link
Contributor Author

@eatyourpeas if you're happy with this then feel free to merge! Otherwise any other design changes lmk and I can implement them

@@ -29,7 +29,12 @@
{% endfor %}

<div role="tablist" class="tabs tabs-bordered">
<input type="radio" name="my_tabs_1" role="tab" class="tab" aria-label="Routine&nbsp;Measurements" checked/>
<input type="radio" name="my_tabs_1" role="tab" class="tab font-bold
{% for category in routine_measurements_categories %}
Copy link
Member

Choose a reason for hiding this comment

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

We could also consider passing an extra variable through context to avoid the iteration here? something like routine_measurements_category_has_errors? Same for annual review below.

If we stick with calculating it in the template please do tab the logic appropriately and use new lines as you would for anything else

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actioned! Thanks for the suggestion, is much tidier now. Before we merge I'd like to make some changes to the Routine Measurements form so that the errors there can be localised by the user a bit more easily.

@dc2007git
Copy link
Contributor Author

What do we think of this as error localisation on the form? The idea is to make it 'pop out':

image

I'm mindful that we want to keep theme consistent, and we use rcpch_red as our colour for red. As such, I've changed the background colour of 'Measurements' to be 'rcpch_vivid_green' instead of 'rcpch_red' so if an error pops up there, then it is more obvious.

Copy link
Member

@eatyourpeas eatyourpeas left a comment

Choose a reason for hiding this comment

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

This is better thank you @dc2007git. I think there are still too many colours and it is not yet clear I think to users that red means error, pink means complete and blue means unscored. I think possibly we need to think some more about the user journey.

A couple of other things.

  1. on save the visit date is being lost and therefore shows as None in the table
  2. you cannot save the form until all the errors are fixed. This is not intuitive if some of the errors are now hidden in fields in an inactive tab - if we are going to force all errors to be fixed before save, we are going to need to signpost to our users more that is what we expect. My feeling is we should allow save but with a warning that some fields still contain errors, maybe with an 'are you sure?' modal.
  3. I am getting an error with the 'fill with visit date' but that might be my local dev version clashing with the different versions of the model and migrations and so on.

Best probably is that I merge this and raise issues for those items. As @mbarton said earlier, it would be good to get this out early to trusted users to get feedback before it goes too much further.

@eatyourpeas eatyourpeas merged commit cb57c86 into development Jun 6, 2024
1 check passed
@eatyourpeas eatyourpeas deleted the 91-styling-for-tabs-in-visit-form branch June 6, 2024 14:11
@dc2007git
Copy link
Contributor Author

@eatyourpeas it also looks like when editing a User's details, such as their employing organisation, saving does not work either - possibly something wrong with the update logic in both forms then. Will create an issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Styling for Visit form
3 participants