Repository navigation
[ML] DataFrame bulk actions - #43331
Conversation
|
Pinging @elastic/ml-ui |
💔 Build Failed |
💔 Build Failed |
💔 Build Failed |
💚 Build Succeeded |
…na into ml-df-bulk-actions
💚 Build Succeeded |
| return callWithRequest('ml.deleteDataFrameTransform', { transformId }); | ||
| } | ||
|
|
||
| async function stopTransform(options: { |
There was a problem hiding this comment.
stopTransform and startTransform take a very similar options parameter, could the types be combined in a shared interface?
There was a problem hiding this comment.
Since these are very small functions I found keeping them separate felt okay right now as we may change/add the options we pass to each and it feels much cleaner keeping them isolated than in the future having the potential of many if else's or ternary operators in a single function. 🤔
Having said that, I'm happy to update it now if everyone feels it's the best options. Otherwise, I'd like to wait and see what we end up adding to Data Frames and update it in the future if needed.
|
Tested this locally, works great overall! Some feedback on the availability of actions in the bulk dropdown menu:
|
💔 Build Failed |
|
Great update! I tested the bulk action menu again and the options are now disabled when they're not available for every item. The only missing bit I noticed: Start/Stop gets disabled for individual rows if items are bulk-selected, but the Delete-button on each row is still clickable. |
|
|
||
| import { i18n } from '@kbn/i18n'; | ||
| // @ts-ignore no declaration file for module | ||
| export { isRequestTimeout } from '../job_service/error_utils'; |
There was a problem hiding this comment.
nit, this function is so small and used quite a few times in this PR, IMO it would be worth adding a definition file for it.
There was a problem hiding this comment.
Addressing in a follow-up 👍
💚 Build Succeeded |
* wip: add selection and actions icon * add bulk delete functionality. use existing delete action component * add start bulk action * add stop bulk action * add label for number of transforms selected * Action components only accept items array. Update endpoint calls for array param * update tests * fix translation error * update start modal translation * transformDelete to server side for synchronous looping through ids * transformsStart to server side for synchronous looping through ids * transformsStop to server side for synchronous looping through ids * change request method for delete. * update deprecated functional component type * ensure bulk actions disabled when appropriate * handle timeouts for start,stop,delete actions * rename DataFrameTransformEndpointRequest type * disable all row actions when selected items * fix localization error
* wip: add selection and actions icon * add bulk delete functionality. use existing delete action component * add start bulk action * add stop bulk action * add label for number of transforms selected * Action components only accept items array. Update endpoint calls for array param * update tests * fix translation error * update start modal translation * transformDelete to server side for synchronous looping through ids * transformsStart to server side for synchronous looping through ids * transformsStop to server side for synchronous looping through ids * change request method for delete. * update deprecated functional component type * ensure bulk actions disabled when appropriate * handle timeouts for start,stop,delete actions * rename DataFrameTransformEndpointRequest type * disable all row actions when selected items * fix localization error
Summary
Adds
Start,Stop, andDeletebulk actions to data frames management.Creates endpoints on the server for listed actions.
If items are selected for bulk actions, the individual actions on every row should be disabled (the anomaly jobs list does this too)
If you select stopped jobs for bulk actions the stop action should not be available if one of the jobs is stopped.
If one of the jobs selected is already started the start option should not be available
If one of the jobs is running, the bulk delete option shouldn't be available.
Timeout errors handled by aborting subsequent actions if one times out. Implemented for all actions since they are all bulk actions as well.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Documentation was added for features that require explanation or tutorialsFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately