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

Add site description to rtn. req. bookmark links #1358

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

Cruikshanks
Copy link
Member

https://eaflood.atlassian.net/browse/WATER-4685

Part of the work to migrate return versions from NALD to WRLS

During the UAT of the new view return version and requirements page, users let us know that, though useful, the bookmark links that currently display a return requirement's reference would be even better if they included the site description as well.

It's not so bad for return versions with 2 or 3 return requirements. But with more than that, it can be harder to find or recall which requirement you want to return to.

Well, our users' wish is our command!

https://eaflood.atlassian.net/browse/WATER-4685

> Part of the work to migrate return versions from NALD to WRLS

During UAT of the new view return version and requirements page users have let us know that though useful, the bookmark links that currently display a return requirement's reference would be even better if they included the site description as well.

It's not so bad for return versions with 2 or 3 return requirements. But any more than that it can be harder to find or recall which requirement you want to go back to.

Well, our users wish is our command!
@Cruikshanks Cruikshanks added the enhancement New feature or request label Sep 25, 2024
@Cruikshanks Cruikshanks self-assigned this Sep 25, 2024
@Cruikshanks Cruikshanks marked this pull request as ready for review September 25, 2024 15:47
@Cruikshanks Cruikshanks merged commit 151a17b into main Sep 25, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the add-site-description-to-rtn-req-bookmarks branch September 25, 2024 22:01
Cruikshanks added a commit that referenced this pull request Oct 3, 2024
https://eaflood.atlassian.net/browse/WATER-4685

We recently made a change to [Add the site description to bookmark links in the view return version page](#1358).

In testing our QA team have spotted that there are some return requirements we've imported from NALD that do not have a site description.

Site description will be a mandatory field when WRLS takes over management of returns. But we'll still have to support view those imported from NALD.

So, this change updates the view to handle return requirements with no site description.
Cruikshanks added a commit that referenced this pull request Oct 4, 2024
https://eaflood.atlassian.net/browse/WATER-4685

We recently [Added the site description to bookmark links in the view return version page](#1358).

In testing, our QA team has spotted that some return requirements we've imported from NALD do not have a site description.

When WRLS takes over return management, site description will be a mandatory field. However, we'll still have to support viewing returns imported from NALD.

So, this change updates the view to handle return requirements with no site description.
Cruikshanks added a commit that referenced this pull request Oct 9, 2024
https://eaflood.atlassian.net/browse/WATER-4685

> Part of the work to migrate managing return requirements from NALD to WRLS

In [Add site description to rtn. req. bookmark links](#1358) we added the return requirement site description to the bookmarks we display when viewing a return version with more than one requirement.

However, in that change we didn't cater for the fact users have added site descriptions that include special characters, for example `& " '`.

When these descriptions are included in the bookmark links, they appear like this.

- `Return reference 100234 - Quantities taken between points X, Y &Z`
- `Return reference 100432 - Opposite "Old cottage" entrance`
- `Return reference 100567 - Borehole in 'middle' field`

This changes updates the logic to escape these characters.
Cruikshanks added a commit that referenced this pull request Oct 10, 2024
https://eaflood.atlassian.net/browse/WATER-4685

> Part of the work to migrate managing return requirements from NALD to WRLS

In [Add site description to rtn. req. bookmark links](#1358) we added the return requirement site description to the bookmarks we display when viewing a return version with more than one requirement.

However, that change didn't account for users' adding site descriptions that include special characters, such as `" & '`.

When these descriptions are included in the bookmark links, they appear like this.

- `Return reference 100234 - Quantities taken between points X, Y &Z`
- `Return reference 100432 - Opposite "Old cottage" entrance`
- `Return reference 100567 - Borehole in 'middle' field`

This change updates the logic to escape these characters.

---

The problem is caused because the description is being added to a non-markup object `<a>`. This means Nunjucks is auto-escaping the content to protect us from an XSS attack.

To tell it not to auto-escape we have to use the [safe filter](https://mozilla.github.io/nunjucks/templating.html#autoescaping).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants