-
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] TS conversion of Index Management plugin extension #76308
Conversation
* eui to v28.0.0 * eui to 28.2.0 * euiselectableoptions type update * targeted nohoist * src snapshot updates * x-pack snapshot updates * strong -> mark * upgrade @elastic/charts to v21.0.1 * strong -> mark * fix charts version merge * maps -> add_field_tooltip_popover type update * snapshot update * Fix gridline visibility Co-authored-by: Justin Kambic <[email protected]> Co-authored-by: nickofthyme <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Justin Kambic <[email protected]>
Pinging @elastic/es-ui (Team:Elasticsearch UI) |
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: spalger <[email protected]>
…#76278) * fix URI decoding and editing of a policy which backs up all indices * fix type issue * fix general use of encoding and update decode algo * fix serialisation of snapshots and added a test * Fix test description name * Update attempt_to_uri_decode.ts * catch errors from decoding in the already throwing code Co-authored-by: Elastic Machine <[email protected]>
* Reconcile request helpers with eslint rules for React hooks. - Add clearer cleanup logic for unmounted components. - Align logic and comments in np_ready_request.ts and original request.ts. * Reorganize modules and convert tests to TS. - Split request.ts into send_request.ts and use_request.ts. - Convert test files into TS. - Relax SendRequestResponse type definition to type error as any instead of expecting an Error, since we weren't actually fulfilling this expectation. * Convert everything to hooks and add test coverage for request behavior. * Fix Watcher memoization bugs.
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! I tested locally and did not find any regressions.
I left a few code comments. Also, regarding the use of any
for indices
- could you utilize this interface in index_management: https://github.com/elastic/kibana/blob/master/x-pack/plugins/index_management/server/types.ts#L29?
selectedPolicyName: string; | ||
selectedAlias: string; | ||
policies: PolicyFromES[]; | ||
policyError?: string; |
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.
nit: might be more clear as policyErrorMessage
. I know this was pre-existing, so feel free to ignore 😄
</EuiDescriptionListDescription>, | ||
]; | ||
const cell = ( | ||
<Fragment> |
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.
nit: you can also use <></>
for fragments
} | ||
), | ||
}; | ||
}; | ||
|
||
export const removeLifecyclePolicyActionExtension = ({ indices, reloadIndices }) => { | ||
export const removeLifecyclePolicyActionExtension = ({ indices, reloadIndices }: any) => { |
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.
At the very least, I think this could be improved to:
export const removeLifecyclePolicyActionExtension = ({ indices, reloadIndices }: any) => { | |
export const removeLifecyclePolicyActionExtension = ({ indices, reloadIndices }: {indices: any; reloadIndices: () => void}) => { |
import { retryLifecycleForIndex } from '../application/services/api'; | ||
import { IndexLifecycleSummary } from './components/index_lifecycle_summary'; | ||
import { AddLifecyclePolicyConfirmModal } from './components/add_lifecycle_confirm_modal'; | ||
import { RemoveLifecyclePolicyConfirmModal } from './components/remove_lifecycle_confirm_modal'; | ||
|
||
// eslint-disable-next-line @kbn/eslint/no-restricted-paths | ||
import { ExtensionsSetup } from '../../../index_management/public/services'; |
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 if you export ExtensionsSetup
from x-pack/plugins/index_management/public/index.ts
you can remove the eslint-disable.
@@ -80,7 +98,7 @@ export class IndexLifecycleSummary extends Component { | |||
closePhaseExecutionPopover = () => { | |||
this.setState({ showPhaseExecutionPopover: false }); | |||
}; | |||
renderStackPopoverButton(ilm) { | |||
renderStackPopoverButton(ilm: any) { |
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.
can we avoid using any
here?
if (!ilm.phase_execution) { | ||
return null; | ||
} | ||
renderPhaseExecutionPopoverButton(ilm: any) { |
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.
can we avoid using any
here?
* [Maps] fix duplicate ID's * tslint cleanup * use layer id instead of layer name for popover id * tslint fixes Co-authored-by: Elastic Machine <[email protected]>
…ert with invalid document. (elastic#75929)
…edHosts' to 'xpack.actions.allowedHosts' (elastic#76325)
* Add telemetry around workpad variable usage * Fix typecheck Co-authored-by: Elastic Machine <[email protected]>
…option. (elastic#76061) * Exposed separate from ProxySettings rejectUnauthorized configuration option. * Fixed type checks * fixed tests
* delete src/legacy/ui/public folder * remove jest.mock('ui/XXX'); from tests * adapt stubbedLogstashIndexPatternService * remove delete keys from translation files * fix types import with Capabilities * remove legacy test utils * remove dead file referencing ui/newPlatform * move saved-object-finder styles to timelion plugin
* chore: group tests doing the same This will reduce the time it takes to execute the tests * chore: rephrase step * chore: extract common code to a function Co-authored-by: Elastic Machine <[email protected]>
…75537) * add intergration test for install prebuilt timelines * add integration tests * add functional test for export timeline * clean up * asserts the content of the exported timeline * update selector * update selector * reuses the timeline id from the expected exported file Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: Gloria Hornero <[email protected]>
@elasticmachine merge upstream |
* cleanup xpack_main legacy plugin, remove capabilities mixin * fix test env * delete injectXpackSignature and related tests
…ndex_management # Conflicts: # x-pack/plugins/snapshot_restore/public/application/lib/index.ts
@elasticmachine merge upstream |
💔 Build Failed
Failed CI StepsBuild metricsHistory
To update your PR or re-run it, just comment with: |
Summary
This PR converts Index Management plugin extension to TypeScript as an ongoing effort of converting the ILM plugin #74271. No UI/UX changes were made in this PR. To test for any regression, navigate to Index Management plugin and check following features in the Indices tab:
Todo
After this PR and policies table conversion PR #76006 are both merged, a follow-up PR will convert all the remaining js files, such as jest tests, services and helpers, also any remaining
any
types will be cleaned up to complete #74271