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] [Timeline] delete notes #154834
[Security Solution] [Timeline] delete notes #154834
Conversation
Pinging @elastic/security-solution (Team: SecuritySolution) |
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.
Alerts area files lgtm
|
||
try { | ||
const frameworkRequest = await buildFrameworkRequest(context, security, request); | ||
const noteId = request.body?.noteId ?? ''; |
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.
Thought, if there is no noteId, could we just early return or just throw an error that the page has to be refreshed before the note can be deleted or something?
|
||
const { isFetching } = useDeleteNote(noteToDelete); | ||
const disableDelete = useMemo(() => { | ||
return isFetching || noteId == null; |
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.
So noteId should never be missing in the query then right?
[addError] | ||
); | ||
|
||
return useQuery( |
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.
I think you want to use useMutation
instead of useQuery
? Not sure if you'd get weird caching things using useQuery
instead of useMutation
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.
ya thank you, updated
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 changes, works great! LGTM 💪🏾
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
This pr is a part of work to harden the UX around investigation guides and user/outside of kibana generated content, currently in the form of markdown: #153377 This pr allows users to delete notes associated with a timeline, as invalid or incorrect content can currently be persisted in a timeline, with no way to remove it except to manually remove a hidden saved object that defines the note. An unused interface was removed as part of this, which seemed to indicate adding the ability to delete notes was planned at some point, but never implemented.
Checklist
Delete any items that are not applicable to this PR.