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 SecurityWarningModal to the layout page #2044

Merged
merged 3 commits into from
Nov 8, 2024

Conversation

OKendigelyan
Copy link
Contributor

@OKendigelyan OKendigelyan commented Nov 8, 2024

Proposed changes

Task link

Types of changes

  • Bugfix
  • New feature
  • Refactor
  • Breaking change
  • UI fix

Steps to reproduce

Screenshots

image

Checklist

  • Tests that prove my fix is effective or that my feature works have been added
  • Documentation has been added (if appropriate)
  • Screenshots are added (if any UI changes have been made)
  • All TODOs have a corresponding task created (and the link is attached to it)

Copy link

vercel bot commented Nov 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
umami-embed-iframe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 5:32pm
umami-embed-iframe-ghostnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 5:32pm
umami-v2-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 5:32pm
umami-v2-web-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 8, 2024 5:32pm

Copy link
Contributor

@asiia-trilitech asiia-trilitech left a comment

Choose a reason for hiding this comment

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

Thanks for the quick implementation, Oleg

Looks great, just a couple of nits in the comments 🔥

const [openedAccordionItems, setOpenedAccordionItems] = useState<Set<number>>(new Set());

const handleInform = () => {
localStorage.setItem("user:isInformed", "true");
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe user:isExtensionsWarningShown?

it("renders all accordion items", async () => {
await renderInModal(<SecurityWarningModal />);

accordionItems.forEach(({ title }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we have an array of titles here instead?
If there is a fault with the accordionItems this test will still be green.

expect(gotItButton).toBeEnabled();
});

it("sets localStorage and closes modal when 'Got it' is clicked", async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: would be better to split into two separate tests, the more simple unit test is - the better

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