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

CLDC-3740: Replace you didn't answer text with link to question #2836

Open
wants to merge 83 commits into
base: main
Choose a base branch
from

Conversation

Dinssa
Copy link
Contributor

@Dinssa Dinssa commented Nov 27, 2024

This PR aims to change how we show users that a question needs to be answered from a text and "Change" button like this...
Screenshot 2024-12-16 at 19 36 04

... to now present a link with an appropriate prompt to answer the question:
Screenshot 2024-12-16 at 19 37 06

Features

By default, it generates the link text for log questions based on their question type. Support users can customise this text by setting a value in the translation file for each question’s check_answer_prompt (it will have to be the full link text, not just the prefix). If no custom text is provided, it will add a prefix to the first available option in the following order: error_label, check_answer_label, header, or id. Note that question_text is intentionally excluded from this list. For questions with types checkbox, radio, or select, the default prefix is “Select”; for date types, it is “Set”; and for all other types, it is “Enter”.

Screenshot 2024-12-16 at 19 33 44

In this example we have a few custom set link text:

  • "Enter UPRN if known" - This page is divided into two sections. First, it asks if you know the UPRN value. If you answer “Yes,” you will be prompted to enter the UPRN on the same page. I changed the prompt from a first draft of “Answer if UPRN known” to “Enter UPRN if known” to better reflect this two-part process.
  • "Try find address" - As the check answer label here is not from a specific question but from a multi question page and without a custom check_answer_prompt would default to that of the first question "Address line 1"
  • "Enter address line 1 and 2" - Although this looks like it is just the check answer label plus a default prefix it would have also defaulted to the first question on the page "Address line 1" and just said "Enter address line 1".
  • "Answer if it's the first time being let as social-housing" - This would have by default been "Select first time being let as social-housing" as the question is a radio type. That didn't seem right so I've put in a draft custom check_answer_prompt as such. The same for "Answer if property is built or adapted to wheelchair-user standards".

Non log pages

Unlike for logs where we have many questions, which can be changed by support users, other pages are set by us and as such I have for the most part written the link texts per attribute, with a default "Enter" prefix should anything change in the future but is in most places unused.

Schemes example

Screenshot 2024-12-16 at 19 56 46

For some of these pages, it is not possible to create a resource without answering at least some of the questions. For example, when creating a scheme, you cannot complete the step and progress to the next page without answering the visible questions shown in the screenshot above. Therefore, I have not changed the behavior of those questions. The changes only apply to the questions you could skip in the initial stages.

No permission to change values

We only need to show the link to enter a value if the user has the necessary permissions to make those changes. Therefore, it is still necessary to display a message indicating that the value has not been entered. The example below shows the view of a data provider when viewing an incomplete scheme.

Screenshot 2024-12-16 at 20 02 16

Copy link

Comment on lines +34 to +35
<% else %>
<% row.with_action %>
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this need an else?

Copy link
Contributor Author

@Dinssa Dinssa Dec 19, 2024

Choose a reason for hiding this comment

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

Oh so, this is just to place something in place of no action. It's done elsewhere in similar tables with action rows, but not everywhere. It's not needed at all but I thought might be worth adding to keep the structure the same. Again, makes no difference, can also just be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Whatever makes sense, if we do it elsewhere it might be fine. Up to you!

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.

2 participants