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

Fix Notifications Overlay that opens automatically #6133

Merged

Conversation

marcelo-earth
Copy link
Contributor

@marcelo-earth marcelo-earth commented Jan 18, 2023

Closes #6130.

Describe your changes:

Problem

TL;DR The close button does not close properly because of the parent component

We have this current user flow:

  1. User receives information notification ✅ Alert is displayed
  2. User opens notification list ✅ Notification list is displayed
  3. User closes notification list ⚠️

⚠️ At this point two things can happen: if the user closes the notification list before 3000 milliseconds (since the alert is sent) everything works correctly. The variable in charge of displaying the NotificationList component will switch from true to false.

But after that time, if the user tries to close it, the error occurs.

The emitting event to close of the NotificationsList component is not sent to the NotificationIndicator once it is hidden (not rendered).

Since the variable in charge of displaying the NotificationList component is still true, the next time Open MCT tries to send any kind of alert, it will open the alert with the notification list. Here's the bug.

Solution

Adding showNotificationsOverlay to this condition continue to display the NotificationIndicator element even if there are no notifications. This allows the notification list closing flow to continue on its way without interruption.

// If there are no notifications, is the notification list displayed? If so, keep the parent component rendered so the user can close it properly, otherwise just if there are notifications.
notifications.length === 0 ? showNotificationsOverlay : notifications.length > 0

This has minimal impact on the user experience, because the modal still hides all page content including the indicator itself.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

@codecov
Copy link

codecov bot commented Jan 18, 2023

Codecov Report

Merging #6133 (4ccfd46) into master (d5adaf6) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Current head 4ccfd46 differs from pull request most recent head 4de8d54. Consider uploading reports for the commit 4de8d54 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6133      +/-   ##
==========================================
- Coverage   54.65%   54.64%   -0.01%     
==========================================
  Files         600      600              
  Lines       23950    23950              
  Branches     2117     2117              
==========================================
- Hits        13089    13087       -2     
- Misses      10261    10264       +3     
+ Partials      600      599       -1     
Flag Coverage Δ *Carryforward flag
e2e-ci 39.49% <ø> (ø) Carriedforward from a02ae5b
e2e-full 51.23% <ø> (ø) Carriedforward from a02ae5b
e2e-stable 50.09% <ø> (ø)
unit 50.25% <ø> (-0.01%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Impacted Files Coverage Δ
...tionIndicator/components/NotificationIndicator.vue 81.81% <ø> (ø)
src/plugins/tabs/components/tabs.vue 34.40% <0.00%> (-1.61%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5adaf6...4de8d54. Read the comment docs.

@marcelo-earth marcelo-earth changed the title Show NotificationIndicator also if NotificationsList is shown Fix Notifications Overlay that opens automatically Jan 18, 2023
@ozyx ozyx added this to the Target:2.1.6 milestone Jan 18, 2023
@ozyx ozyx added the source:community Community contribution or request label Jan 18, 2023
@ozyx ozyx self-requested a review January 18, 2023 17:06
@unlikelyzero
Copy link
Contributor

This looks amazing! Would you mind adding a regression test for this area?

@marcelo-earth
Copy link
Contributor Author

This looks amazing! Would you mind adding a regression test for this area?

Sure! I will push the test for your review.

Copy link
Contributor

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

Test looks great! I just had a single question about accessible locators.

Would you mind moving the test into the existing notification.e2e.spec.js file?

@marcelo-earth marcelo-earth requested review from ozyx and unlikelyzero and removed request for ozyx and unlikelyzero January 18, 2023 21:46
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Looks great! Just have one minor request and this is good to merge.

Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Awesome work. Really appreciate the quick turnaround on this! Thank you again.

@ozyx ozyx enabled auto-merge (squash) January 18, 2023 22:19
@ozyx ozyx merged commit 70074c5 into nasa:master Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source:community Community contribution or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notifications Overlay Opens Automatically
3 participants