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 description to sanctions #424

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Add description to sanctions #424

merged 1 commit into from
Nov 20, 2023

Conversation

felixclack
Copy link
Contributor

@felixclack felixclack commented Nov 14, 2023

We have expanded the sanctions list to also display a description
alongside the title.

This data isn't provided by the API so we opted to define it the same
way we do with the titles.

The descriptions contain links and we want them to be clickable so
using markdown made sense here.

The library is already being used elsewhere in the app, so there is no
extra dependency required. Also, we control the markdown text itself, so
there is no security risk by rendering this using the html_safe
method.

The use of CHOMP on the heredoc is to ensure we avoid the trailing
newline character that a heredoc automatically adds.

Link to Trello card

https://trello.com/c/XqT7t8dV/150-add-a-description-field-for-sanctions

capybara-202311141024554670423377

Checklist

  • Attach to Trello card
  • Rebased main
  • Cleaned commit history
  • Tested by running locally

Copy link
Contributor

@malcolmbaig malcolmbaig left a comment

Choose a reason for hiding this comment

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

There's date-related related code in the diff that doesn't appear to be related to the PR. Approach for sanction descriptions looks sound otherwise 👍🏼

We have expanded the sanctions list to also display a description
alongside the title.

This data isn't provided by the API so we opted to define it the same
way we do with the titles.

The descriptions contain links and we want them to be clickable so
using markdown made sense here.

The library is already being used elsewhere in the app, so there is no
extra dependency required. Also, we control the markdown text itself, so
there is no security risk by rendering this using the `html_safe`
method.

The use of `CHOMP` on the heredoc is to ensure we avoid the trailing
newline character that a heredoc automatically adds.
@felixclack felixclack merged commit 2f707fd into main Nov 20, 2023
12 checks passed
@felixclack felixclack deleted the descriptions branch November 20, 2023 10:26
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