-
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
[Remote clusters] Convert service files to TypeScript #94138
Conversation
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
@yuliacech Could you please add the |
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.
Great work @yuliacech! It's exciting to see these files getting converted to TS 🎉 . Left one question regarding the use of !
but otherwise code LGTM. I did not run locally as it looks like no functionality has changed.
@@ -17,14 +17,14 @@ export function isAddressValid(seedNode) { | |||
// no need to wait for regEx if the part is empty | |||
return true; | |||
} | |||
const [match] = part.match(/[A-Za-z0-9\-]*/); | |||
const [match] = part.match(/[A-Za-z0-9\-]*/)!; |
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.
Are we confident that this will never return 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.
I think we should always get a match because of the *
operator (zero or more), but your comment made me consider that the ??
will be more readable, so I updated this line.
@@ -42,6 +42,6 @@ export function isPortValid(seedNode) { | |||
return false; | |||
} | |||
|
|||
const isPortNumeric = port.match(/[0-9]*/)[0] === port; | |||
const isPortNumeric = port.match(/[0-9]*/)![0] === port; |
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.
same here
@yuliacech I just noticed CI is failing after approving. I think you will need to remove the old jest snapshots for the validator functions that you migrated and rerun the tests and generate new ones before merging. |
…sh coalescing operator
Thank you for the review and thoughtful comments, @alisonelizabeth! I updated the snapshots and waiting for the CI to get green before merging. |
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
Summary
This PR converts some service files from JavaScript to TypeScript as preparation for more changes needed in Remote Clusters form for Cloud users. For discussion of Cloud work see PR#93953.
The goal is to be able to convert
remote_clusters/public/application/sections/components/remote_cluster_form/remote_cluster_form.js
to TypeScript while working on Cloud changes.