-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Security Solution][Fix]-Reset discarded timeline & Change timeline Save prompt Strategy #140399
Conversation
cdbc409
to
ddbc017
Compare
2ee7f30
to
d2456f3
Compare
import { createNewTimeline, populateTimeline, waitForTimelineChanges } from '../../tasks/timeline'; | ||
import { HOSTS_URL } from '../../urls/navigation'; | ||
|
||
describe('Save Timeline Prompts', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏾
|
||
import type { AppLeaveHandler } from '@kbn/core/public'; | ||
import { TimelineId, TimelineStatus, TimelineTabs } from '../../../../common/types/timeline'; | ||
import type { TimelineId } from '../../../../common/types/timeline'; | ||
import {} from '../../../../common/types/timeline'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shadow import 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔ Corrected now.
Files by Code Ownerelastic/security-solution
elastic/security-threat-hunting-explore
elastic/security-threat-hunting-investigations
|
@logeekal this issue was probably there prior to these changes, but the timeline isn't actually deleted once a user navigates away, most likely due to it's preservation in localstorage. It might be worth removing it from localstorage if the user confirms they want it to be removed. Alternatively we could change the message around? Screen.Recording.2022-09-27.at.10.34.12.AM.mov |
Thanks for pointing this error out. Will correct this. But I thought about removing data from local storage but I assumed that when user clicks on So at the time, I did not see the need to What do you think? |
100% agree. I think if there's anything it might be instead of showing the save modal on return to a timeline enabled page, we either show nothing or show some notification that their unsaved timeline was restored. 🤷🏾♂️ Not sure which the best route is |
Hmm that is a great idea. I have added the fix where I do not display anything i.e Timeline stays as it was. I am leaning towards displaying a toast/notification but wondering how easy it will be to determine that we have restored some changes. Let me get back to you on this. |
x-pack/plugins/security_solution/public/timelines/components/use_timeline_save_prompt/index.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@logeekal that looks great! Thanks for doing it. I've written some comments.
Also, about the location of the public/timelines/components/use_timeline_save_prompt/index.ts
, it is the only hook in this /components directory. Probably it would make more sense to move it to another place, alternatives:
public/common/utils/timeline/use_timeline_save_prompt.ts
public/common/hooks/timeline/use_timeline_save_prompt.ts
public/timelines/hooks/use_timeline_save_prompt.ts
(new /hooks dir)
x-pack/plugins/security_solution/public/timelines/components/use_timeline_save_prompt/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/use_timeline_save_prompt/index.ts
Outdated
Show resolved
Hide resolved
x-pack/plugins/security_solution/public/timelines/components/use_timeline_save_prompt/index.ts
Outdated
Show resolved
Hide resolved
01d1eff
to
85b6cb6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @logeekal for doing the changes and for taking the time to answer the questions.
LGTM! 🚀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the updates. Code looks good and works really well!
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
…ave prompt Strategy (elastic#140399) Please go through elastic#140614 to get the context of this PR. _tl,dr;_ Timeline bottom bar has been enabled on below pages. - Security / Dashboards - Security / Explore - Security / Cases / .... When user navigates to any other pages within security solution where `timeline bottom bar` is not visible, use will be reminded that they have an unsaved timeline. Justification for enabling `timeline bottom bar` on above pages is to prevent users from getting too many timeline save reminders if they navigate within `Security Solution` plugin.
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
…ave prompt Strategy (elastic#140399) Please go through elastic#140614 to get the context of this PR. _tl,dr;_ Timeline bottom bar has been enabled on below pages. - Security / Dashboards - Security / Explore - Security / Cases / .... When user navigates to any other pages within security solution where `timeline bottom bar` is not visible, use will be reminded that they have an unsaved timeline. Justification for enabling `timeline bottom bar` on above pages is to prevent users from getting too many timeline save reminders if they navigate within `Security Solution` plugin. (cherry picked from commit 803189f)
…ave prompt Strategy (#140399) (#143050) Please go through #140614 to get the context of this PR. _tl,dr;_ Timeline bottom bar has been enabled on below pages. - Security / Dashboards - Security / Explore - Security / Cases / .... When user navigates to any other pages within security solution where `timeline bottom bar` is not visible, use will be reminded that they have an unsaved timeline. Justification for enabling `timeline bottom bar` on above pages is to prevent users from getting too many timeline save reminders if they navigate within `Security Solution` plugin. (cherry picked from commit 803189f)
…ave prompt Strategy (elastic#140399) Please go through elastic#140614 to get the context of this PR. _tl,dr;_ Timeline bottom bar has been enabled on below pages. - Security / Dashboards - Security / Explore - Security / Cases / .... When user navigates to any other pages within security solution where `timeline bottom bar` is not visible, use will be reminded that they have an unsaved timeline. Justification for enabling `timeline bottom bar` on above pages is to prevent users from getting too many timeline save reminders if they navigate within `Security Solution` plugin.
Summary
Fixes #119593
Fixes #140614
Please go through #140614 to get the context of this PR.
tl,dr;
Timeline bottom bar has been enabled on below pages.
When user navigates to any other pages within security solution where
timeline bottom bar
is not visible, use will be reminded that they have an unsaved timeline.Justification for enabling
timeline bottom bar
on above pages is to prevent users from getting too many timeline save reminders if they navigate withinSecurity Solution
plugin.Detailed Workflow
Currently, when user navigates away from Security Solution plugin, system asks user to either Save/Discard the timeline.
draft
state. Indraft
state, it can either contain some changes by the user OR none at all.undefined
.updateDate
toundefined
if user decides to discard the timeline.There 2 workflow issues that are highlighted in the bug :
[ Fixed ] Issue 1
Steps to Reproduce*
This has been resolved as stated above.
[ Fixed ] Issue 2
Preconditions
Steps to Reproduce
Please go through #140614 for the detailed discussion on this workflow
Checklist
Delete any items that are not applicable to this PR.
For maintainers