-
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
[ML] Transforms: Adds _schedule_now
action to transform list.
#153545
[ML] Transforms: Adds _schedule_now
action to transform list.
#153545
Conversation
Pinging @elastic/ml-ui (:ml) |
...app/sections/transform_management/components/action_schedule_now/use_schedule_now_action.tsx
Show resolved
Hide resolved
x-pack/plugins/transform/public/app/hooks/use_schedule_now_transform.tsx
Outdated
Show resolved
Hide resolved
I copied the pattern with the confirmation modal from the start transform action, but I wonder if it's necessary here since the transform is running anyway so a warning about cluster load seems unnecessary and the |
Tested latest changes with different Kibana users with and without On minor suggestion is to change how we are currently handling error message toasts. The toast content can be minimized/simplified, and the full error can be more explanatory. For example (and I know this permission issue has already been fixed), clicking |
I agree the error handling and toasts would be good to be improved. However, since this affects all actions on the page and not just |
/** | ||
* @apiGroup Transforms | ||
* | ||
* @api {post} /api/transform/schedule_now_transforms Schedules transforms now |
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.
Please can you add an API integration test for this new route.
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.
Added API integration tests in 3563f14.
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.
Tested and overall looks good. Just think that some of the text needs tweaking.
@szabosteve any thoughts on the text here?
@@ -286,6 +326,9 @@ export const TransformList: FC<TransformListProps> = ({ | |||
{bulkDeleteAction.isModalVisible && <DeleteActionModal {...bulkDeleteAction} />} | |||
{bulkResetAction.isModalVisible && <ResetActionModal {...bulkResetAction} />} | |||
{bulkStopAction.isModalVisible && <StopActionModal {...bulkStopAction} />} | |||
{bulkScheduleNowAction.isModalVisible && ( | |||
<ScheduleNowActionModal {...bulkScheduleNowAction} /> |
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 agree with you that this confirm modal isn't necessary here. It makes sense to show the warning when starting a transform, but since it is already started for this action, it seems unnecessary.
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.
Removed the modal in f4898da.
if (result.success === true) { | ||
toastNotifications.addSuccess( | ||
i18n.translate('xpack.transform.transformList.scheduleNowTransformSuccessMessage', { | ||
defaultMessage: 'Request to schedule transform {transformId} now acknowledged.', |
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 don't think the word now
is needed here. Request to schedule transform access_data_by_client acknowledged.
title: i18n.translate( | ||
'xpack.transform.transformList.scheduleNowTransformErrorMessage', | ||
{ | ||
defaultMessage: 'An error occurred scheduling the transform {transformId} now.', |
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.
Likewise, I don't think you need the word now
in here. It's ambiguous as it is anyway - did the error occur 'now' or did an error occur calling schedule_now
?
message = i18n.translate( | ||
'xpack.transform.capability.noPermission.scheduleNowTransformTooltip', | ||
{ | ||
defaultMessage: 'You do not have permission to schedule transforms now.', |
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 don't think you need the word now
here. You do not have permission to schedule transforms.
title: i18n.translate( | ||
'xpack.transform.stepCreateForm.scheduleNowTransformResponseSchemaErrorMessage', | ||
{ | ||
defaultMessage: 'An error occurred calling the schedule now transforms request.', |
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.
Maybe An error occurred calling the request to schedule the transform.
?
'xpack.transform.transformList.cannotScheduleNowCompleteBatchTransformBulkActionToolTip', | ||
{ | ||
defaultMessage: | ||
'One or more transforms are completed batch transforms and cannot be scheduled now.', |
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.
One or more transforms are completed batch transforms which cannot be scheduled.
perhaps?
completedBatchTransformMessage = i18n.translate( | ||
'xpack.transform.transformList.cannotScheduleNowCompleteBatchTransformToolTip', | ||
{ | ||
defaultMessage: '{transformId} is a completed batch transform and cannot be scheduled now.', |
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.
{transformId} is a completed batch transform and cannot be scheduled.
?
} from '../../../../lib/authorization'; | ||
import { TransformListRow, isCompletedBatchTransform } from '../../../../common'; | ||
|
||
export const scheduleNowActionNameText = i18n.translate( |
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 you add a tooltip to this button to provide clarification as to what this action does as @qn895 suggested?
Something like Instantly run the transform to process data without waiting for the configured interval between checks for changes in the source indices.
?
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.
Added a tooltip in a92b1ae.
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 would lean to explain what happens here instead of using the endpoint name. It's very hard to use the endpoint name unambiguously in the UI text (in fact, any text). It's a bit unwieldy. I left some suggestions. Please let me know what you think.
EDIT: After a discussion with Walter, I updated the suggestions to avoid using the verb run
because of the ambiguity with start
.
if (result.success === true) { | ||
toastNotifications.addSuccess( | ||
i18n.translate('xpack.transform.transformList.scheduleNowTransformSuccessMessage', { | ||
defaultMessage: 'Request to schedule transform {transformId} now acknowledged.', |
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.
defaultMessage: 'Request to schedule transform {transformId} now acknowledged.', | |
defaultMessage: 'Request to schedule transform {transformId} to process data instantly acknowledged.', |
title: i18n.translate( | ||
'xpack.transform.transformList.scheduleNowTransformErrorMessage', | ||
{ | ||
defaultMessage: 'An error occurred scheduling the transform {transformId} now.', |
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.
defaultMessage: 'An error occurred scheduling the transform {transformId} now.', | |
defaultMessage: 'An error occurred scheduling transform {transformId} to process data instantly.', |
title: i18n.translate( | ||
'xpack.transform.stepCreateForm.scheduleNowTransformResponseSchemaErrorMessage', | ||
{ | ||
defaultMessage: 'An error occurred calling the schedule now transforms request.', |
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.
defaultMessage: 'An error occurred calling the schedule now transforms request.', | |
defaultMessage: 'An error occurred calling the request to schedule the transform to process data instantly.', |
message = i18n.translate( | ||
'xpack.transform.capability.noPermission.scheduleNowTransformTooltip', | ||
{ | ||
defaultMessage: 'You do not have permission to schedule transforms now.', |
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.
defaultMessage: 'You do not have permission to schedule transforms now.', | |
defaultMessage: 'You do not have permission to schedule transforms to process data instantly.', |
message = i18n.translate( | ||
'xpack.transform.capability.noPermission.scheduleNowTransformTooltip', | ||
{ | ||
defaultMessage: 'You do not have permission to schedule transforms now.', |
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.
defaultMessage: 'You do not have permission to schedule transforms now.', | |
defaultMessage: 'You do not have permission to schedule transforms to process data instantly.', |
'xpack.transform.transformList.cannotScheduleNowCompleteBatchTransformBulkActionToolTip', | ||
{ | ||
defaultMessage: | ||
'One or more transforms are completed batch transforms and cannot be scheduled now.', |
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.
'One or more transforms are completed batch transforms and cannot be scheduled now.', | |
'One or more transforms are completed batch transforms and cannot be scheduled to process data instantly.', |
completedBatchTransformMessage = i18n.translate( | ||
'xpack.transform.transformList.cannotScheduleNowCompleteBatchTransformToolTip', | ||
{ | ||
defaultMessage: '{transformId} is a completed batch transform and cannot be scheduled now.', |
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.
defaultMessage: '{transformId} is a completed batch transform and cannot be scheduled now.', | |
defaultMessage: '{transformId} is a completed batch transform and cannot be scheduled to process data instantly.', |
@peteharverson @qn895 @szabosteve Addressed all comments, this is ready for another look! Thanks for your feedback esp. about the wording! |
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: cc @walterra |
Latest changes LGTM 🎉 |
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.
UI text LGTM!
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.
Latest text changes LGTM
Summary
Fixes #150350.
Fixes #153314.
_schedule_now
action to transform list.Checklist