-
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
[ILM] Convert node allocation component to TS and use hooks #72888
Conversation
@elasticmachine merge upstream |
b3d4979
to
4486489
Compare
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
@elasticmachine merge upstream |
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.
Nice work @yuliacech! This is a great improvement. I left a few comments in the code. I think some of the things I noticed were pre-existing, but would be nice to address as part of the refactor.
...lugins/index_lifecycle_management/public/application/sections/components/learn_more_link.tsx
Outdated
Show resolved
Hide resolved
...ement/public/application/sections/edit_policy/components/node_allocation/node_allocation.tsx
Outdated
Show resolved
Hide resolved
...ement/public/application/sections/edit_policy/components/node_allocation/node_allocation.tsx
Outdated
Show resolved
Hide resolved
...ement/public/application/sections/edit_policy/components/node_allocation/node_allocation.tsx
Outdated
Show resolved
Hide resolved
...ement/public/application/sections/edit_policy/components/node_allocation/node_allocation.tsx
Outdated
Show resolved
Hide resolved
x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.js
Show resolved
Hide resolved
x-pack/plugins/index_lifecycle_management/__jest__/components/edit_policy.test.js
Outdated
Show resolved
Hide resolved
...ement/public/application/sections/edit_policy/components/node_allocation/node_allocation.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
Hi @alisonelizabeth , |
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 @yuliacech for making the suggested changes! Overall LGTM.
I found a couple other minor things when I did a second round of testing. I think it would be nice if they could be addressed before merging, but I'm going to go ahead and approve to not block you.
- Invalid doc link (commented in code)
- I didn't check if this is a regression or not, but the "View a list of nodes..." link doesn't appear to be aligned correctly when I have node attributes configured.
- [nit] The error callout is a little hard for me to parse with the status code, error string, and error message in the same
<p>
tag. It may be worth reaching out to design - or maybe the docs team is more appropriate - for feedback.
...ement/public/application/sections/edit_policy/components/node_allocation/node_allocation.tsx
Outdated
Show resolved
Hide resolved
Great suggestions, @alisonelizabeth ! There was also a type check error, so I added a type for the api error: kibana/x-pack/plugins/index_lifecycle_management/public/application/services/http.ts Line 45 in 1ccf12f
|
Hello @esdocs team, I added a new callout instead of a toast notification when there is an error loading node attributes. I used the same wording for error information but it seems a bit hard to read. So I was hoping for some feedback to improve it. The text is build like this: |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
@yuliacech, thanks for the ping 👍 I’m curious whether we want to display Pinging @probakowski and @leehinman to provide any additional context that might be useful to the user in understanding these messages. Unable to load node attributes Unable to load node attributes Unable to load node attributes |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
Thanks a lot for your suggestion, @lockewritesdocs ! |
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.
Left a very minor suggestion, but 👍 otherwise!
title={ | ||
<FormattedMessage | ||
id="xpack.indexLifecycleMgmt.editPolicy.nodeAttributesLoadingFailedTitle" | ||
defaultMessage="Unable to load node attributes." |
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.
Suggest removing the period here, but that's totally minor. If having a period at the end matches other Kibana error message conventions, then please ignore.
💚 Build SucceededBuild metrics@kbn/optimizer bundle module count
async chunks size
page load bundle size
History
To update your PR or re-run it, just comment with: |
…72888) * [ILM] Convert node allocation component to TS and use hooks * [ILM] Fix jest tests * [ILM] Fix i18n check * [ILM] Implement code review suggestions * [ILM] Fix type check, docs link and button maxWidth in NodeAllocation component * Fix internaliation error * [ILM] Change error message when unable to load node attributes * [ILM] Delete a period in error callout Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…74556) * [ILM] Convert node allocation component to TS and use hooks * [ILM] Fix jest tests * [ILM] Fix i18n check * [ILM] Implement code review suggestions * [ILM] Fix type check, docs link and button maxWidth in NodeAllocation component * Fix internaliation error * [ILM] Change error message when unable to load node attributes * [ILM] Delete a period in error callout Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Summary
This PR is a part of an ongoing effort to convert ILM codebase from JavaScript to TypeScript. In this PR, NodeAllocation component of the ILM policy edit page (in warm and cold phases) has been refactored. As a result, the component will not use the redux store for loaded node attributes anymore, but it will use a hook for that. Also a callout was added for the case, when the request fails.
Error loading node attributes
Before
After
Checklist