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

feat: allow html for announcement modal message #2063

Merged
merged 2 commits into from
Nov 2, 2022

Conversation

halfwhole
Copy link
Collaborator

Problem

The announcement modal currently does not allow HTML inside its message, preventing us from using clickable hyperlinks.

Solution

Allow HTML for the announcement modal message. Since we control the announcement message (through the ANNOUNCEMENT_MESSAGE env variable), this should be safe.

  • Sanitize message before setting it in inner HTML
  • Changed from display: flex to display: block to avoid new HTML elements from being added in new columns
  • Fixed small typo by renaming hmtlSanitizer to htmlSanitizer

Before & After Screenshots

AFTER:

ANNOUNCEMENT_MESSAGE here is set to You can now tag your links and manage your dashboards effectively. Learn more about this on <a href="https://guide.go.gov.sg/guide-1/link-tagging">our guide</a>.\nFurthermore, our team is constantly looking for new problems to solve for our users. If you would like us to build a solution for you, please provide your thoughts <a href="https://go.gov.sg/go-pain-point-survey">here</a>!

Screenshot 2022-11-01 at 6 59 01 PM

Copy link
Contributor

@thanhdatle thanhdatle left a comment

Choose a reason for hiding this comment

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

LGTM

@halfwhole halfwhole merged commit c7f6ec3 into develop Nov 2, 2022
@halfwhole halfwhole deleted the feat/allow-html-announcement-modal-message branch November 2, 2022 05:17
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