[ML] Data Frames: Fix summary page. Rename job to transform. (#40237)

- Fixes the missing display of the transform description section from the wizard's details step.
- Renames job to transform in UI texts.
This commit is contained in:
Walter Rafelsberger 2019-07-03 13:40:09 +02:00 committed by GitHub
parent 7c79427991
commit 75092d5cfc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 60 additions and 41 deletions

View file

@ -40,7 +40,7 @@ export function getDataFrameCreateBreadcrumbs() {
DATA_FRAME_HOME,
{
text: i18n.translate('xpack.ml.dataFrameBreadcrumbs.dataFrameCreateLabel', {
defaultMessage: 'Create data frame',
defaultMessage: 'Create transform',
}),
href: '',
},

View file

@ -89,7 +89,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
await ml.dataFrame.createDataFrameTransformsJob(jobId, jobConfig);
toastNotifications.addSuccess(
i18n.translate('xpack.ml.dataframe.jobCreateForm.createJobSuccessMessage', {
defaultMessage: 'Data frame job {jobId} created successfully.',
defaultMessage: 'Data frame transform {jobId} created successfully.',
values: { jobId },
})
);
@ -97,7 +97,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
setCreated(false);
toastNotifications.addDanger(
i18n.translate('xpack.ml.dataframe.jobCreateForm.createJobErrorMessage', {
defaultMessage: 'An error occurred creating the data frame job {jobId}: {error}',
defaultMessage: 'An error occurred creating the data frame transform {jobId}: {error}',
values: { jobId, error: JSON.stringify(e) },
})
);
@ -118,7 +118,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
await ml.dataFrame.startDataFrameTransformsJob(jobId);
toastNotifications.addSuccess(
i18n.translate('xpack.ml.dataframe.jobCreateForm.startJobSuccessMessage', {
defaultMessage: 'Data frame job {jobId} started successfully.',
defaultMessage: 'Data frame transform {jobId} started successfully.',
values: { jobId },
})
);
@ -126,7 +126,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
setStarted(false);
toastNotifications.addDanger(
i18n.translate('xpack.ml.dataframe.jobCreateForm.startJobErrorMessage', {
defaultMessage: 'An error occurred starting the data frame job {jobId}: {error}',
defaultMessage: 'An error occurred starting the data frame transform {jobId}: {error}',
values: { jobId, error: JSON.stringify(e) },
})
);
@ -237,7 +237,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
'xpack.ml.dataframe.jobCreateForm.createAndStartDataFrameDescription',
{
defaultMessage:
'Creates and starts the data frame job. A data frame job will increase search and indexing load in your cluster. Please stop the job if excessive load is experienced. After the job is started, you will be offered options to continue exploring the data frame job.',
'Creates and starts the data frame transform. A data frame transform will increase search and indexing load in your cluster. Please stop the transform if excessive load is experienced. After the transform is started, you will be offered options to continue exploring the data frame transform.',
}
)}
</EuiText>
@ -257,7 +257,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
<EuiText color="subdued" size="s">
{i18n.translate('xpack.ml.dataframe.jobCreateForm.startDataFrameDescription', {
defaultMessage:
'Starts the data frame job. A data frame job will increase search and indexing load in your cluster. Please stop the job if excessive load is experienced. After the job is started, you will be offered options to continue exploring the data frame job.',
'Starts the data frame transform. A data frame transform will increase search and indexing load in your cluster. Please stop the transform if excessive load is experienced. After the transform is started, you will be offered options to continue exploring the data frame transform.',
})}
</EuiText>
</EuiFlexItem>
@ -275,7 +275,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
<EuiText color="subdued" size="s">
{i18n.translate('xpack.ml.dataframe.jobCreateForm.createDataFrameDescription', {
defaultMessage:
'Create the data frame job without starting it. You will be able to start the job later by returning to the data frame jobs list.',
'Create the data frame transform without starting it. You will be able to start the transform later by returning to the data frame transforms list.',
})}
</EuiText>
</EuiFlexItem>
@ -301,7 +301,7 @@ export const JobCreateForm: SFC<Props> = React.memo(
'xpack.ml.dataframe.jobCreateForm.copyJobConfigToClipBoardDescription',
{
defaultMessage:
'Copies to the clipboard the Kibana Dev Console command for creating the job.',
'Copies to the clipboard the Kibana Dev Console command for creating the transform.',
}
)}
</EuiText>
@ -335,12 +335,12 @@ export const JobCreateForm: SFC<Props> = React.memo(
<EuiCard
icon={<EuiIcon size="xxl" type="list" />}
title={i18n.translate('xpack.ml.dataframe.jobCreateForm.jobsListCardTitle', {
defaultMessage: 'Data frame jobs',
defaultMessage: 'Data frame transforms',
})}
description={i18n.translate(
'xpack.ml.dataframe.jobCreateForm.jobManagementCardDescription',
{
defaultMessage: 'Return to the data frame job management page.',
defaultMessage: 'Return to the data frame transform management page.',
}
)}
onClick={moveToDataFrameJobsList}

View file

@ -92,7 +92,8 @@ export const JobDetailsForm: SFC<Props> = React.memo(({ overrides = {}, onChange
} catch (e) {
toastNotifications.addDanger(
i18n.translate('xpack.ml.dataframe.jobDetailsForm.errorGettingDataFrameJobsList', {
defaultMessage: 'An error occurred getting the existing data frame job Ids: {error}',
defaultMessage:
'An error occurred getting the existing data frame transform Ids: {error}',
values: { error: JSON.stringify(e) },
})
);
@ -164,40 +165,40 @@ export const JobDetailsForm: SFC<Props> = React.memo(({ overrides = {}, onChange
<EuiForm>
<EuiFormRow
label={i18n.translate('xpack.ml.dataframe.jobDetailsForm.jobIdLabel', {
defaultMessage: 'Job id',
defaultMessage: 'Transform id',
})}
isInvalid={jobIdExists}
error={
jobIdExists && [
i18n.translate('xpack.ml.dataframe.jobDetailsForm.jobIdError', {
defaultMessage: 'A job with this id already exists.',
defaultMessage: 'A transform with this id already exists.',
}),
]
}
>
<EuiFieldText
placeholder="job id"
placeholder="transform id"
value={jobId}
onChange={e => setJobId(e.target.value)}
aria-label={i18n.translate('xpack.ml.dataframe.jobDetailsForm.jobIdInputAriaLabel', {
defaultMessage: 'Choose a unique job id.',
defaultMessage: 'Choose a unique transform id.',
})}
isInvalid={jobIdExists}
/>
</EuiFormRow>
<EuiFormRow
label={i18n.translate('xpack.ml.dataframe.jobDetailsForm.jobDescriptionLabel', {
defaultMessage: 'Job description',
defaultMessage: 'Transform description',
})}
>
<EuiFieldText
placeholder="job description"
placeholder="transform description"
value={jobDescription}
onChange={e => setJobDescription(e.target.value)}
aria-label={i18n.translate(
'xpack.ml.dataframe.jobDetailsForm.jobDescriptionInputAriaLabel',
{
defaultMessage: 'Choose an optional job description.',
defaultMessage: 'Choose an optional transform description.',
}
)}
/>

View file

@ -18,6 +18,7 @@ export const JobDetailsSummary: SFC<JobDetailsExposedState> = React.memo(
createIndexPattern,
isContinuousModeEnabled,
jobId,
jobDescription,
destinationIndex,
touched,
}) => {
@ -27,7 +28,7 @@ export const JobDetailsSummary: SFC<JobDetailsExposedState> = React.memo(
const destinationIndexHelpText = createIndexPattern
? i18n.translate('xpack.ml.dataframe.jobDetailsSummary.createIndexPatternMessage', {
defaultMessage: 'A Kibana index pattern will be created for this job.',
defaultMessage: 'A Kibana index pattern will be created for this transform.',
})
: '';
@ -35,11 +36,18 @@ export const JobDetailsSummary: SFC<JobDetailsExposedState> = React.memo(
<Fragment>
<EuiFormRow
label={i18n.translate('xpack.ml.dataframe.jobDetailsSummary.jobIdLabel', {
defaultMessage: 'Job id',
defaultMessage: 'Transform id',
})}
>
<EuiFieldText defaultValue={jobId} disabled={true} />
</EuiFormRow>
<EuiFormRow
label={i18n.translate('xpack.ml.dataframe.jobDetailsSummary.jobDescriptionLabel', {
defaultMessage: 'Transform description',
})}
>
<EuiFieldText defaultValue={jobDescription} disabled={true} />
</EuiFormRow>
<EuiFormRow
helpText={destinationIndexHelpText}
label={i18n.translate('xpack.ml.dataframe.jobDetailsSummary.destinationIndexLabel', {

View file

@ -146,7 +146,7 @@ export const Wizard: SFC = React.memo(() => {
},
{
title: i18n.translate('xpack.ml.dataframe.transformsWizard.jobDetailsStepTitle', {
defaultMessage: 'Job details',
defaultMessage: 'Transform details',
}),
children: (
<Fragment>

View file

@ -15,7 +15,7 @@ exports[`Data Frame: Job List <Page /> Minimal initialization 1`] = `
<EuiTitle>
<h1>
<FormattedMessage
defaultMessage="Data frame jobs"
defaultMessage="Data frame transforms"
id="xpack.ml.dataframe.jobsList.dataFrameTitle"
values={Object {}}
/>

View file

@ -18,7 +18,7 @@ exports[`Data Frame: Job List <CreateJobButton /> Minimal initialization 1`] = `
type="button"
>
<FormattedMessage
defaultMessage="Create data frame"
defaultMessage="Create transform"
id="xpack.ml.dataframe.jobsList.createDataFrameButton"
values={Object {}}
/>

View file

@ -34,7 +34,7 @@ export const CreateJobButton: SFC = () => {
>
<FormattedMessage
id="xpack.ml.dataframe.jobsList.createDataFrameButton"
defaultMessage="Create data frame"
defaultMessage="Create transform"
/>
</EuiButton>
);

View file

@ -95,7 +95,7 @@ exports[`Data Frame: Job List <ExpandedRow /> Minimal initialization 1`] = `
}
/>,
"id": "job-details",
"name": "Job details",
"name": "Transform details",
}
}
onTabClick={[Function]}
@ -192,7 +192,7 @@ exports[`Data Frame: Job List <ExpandedRow /> Minimal initialization 1`] = `
}
/>,
"id": "job-details",
"name": "Job details",
"name": "Transform details",
},
Object {
"content": <JobJsonPane

View file

@ -10,7 +10,7 @@ exports[`Data Frame: Job List <DataFrameJobList /> Minimal initialization 1`] =
onClick={[Function]}
type="button"
>
Create your first data frame job
Create your first data frame transform
</EuiButtonEmpty>,
]
}
@ -18,7 +18,7 @@ exports[`Data Frame: Job List <DataFrameJobList /> Minimal initialization 1`] =
iconColor="subdued"
title={
<h2>
No data frame jobs found
No data frame transforms found
</h2>
}
/>

View file

@ -64,7 +64,7 @@ export const DeleteAction: SFC<DeleteActionProps> = ({ deleteJob, item }) => {
content={
disabled
? i18n.translate('xpack.ml.dataframe.jobsList.deleteActionDisabledToolTipContent', {
defaultMessage: 'Stop the data frame job in order to delete it.',
defaultMessage: 'Stop the data frame transform in order to delete it.',
})
: createPermissionFailureMessage('canStartStopDataFrameJob')
}
@ -103,7 +103,7 @@ export const DeleteAction: SFC<DeleteActionProps> = ({ deleteJob, item }) => {
>
<p>
{i18n.translate('xpack.ml.dataframe.jobsList.deleteModalBody', {
defaultMessage: `Are you sure you want to delete this job? The job's destination index and optional Kibana index pattern will not be deleted.`,
defaultMessage: `Are you sure you want to delete this transform? The transform's destination index and optional Kibana index pattern will not be deleted.`,
})}
</p>
</EuiConfirmModal>

View file

@ -66,7 +66,7 @@ export const StartAction: SFC<StartActionProps> = ({ startJob, item }) => {
!canStartStopDataFrameJob
? createPermissionFailureMessage('canStartStopDataFrameJob')
: i18n.translate('xpack.ml.dataframe.jobsList.completeBatchJobToolTip', {
defaultMessage: '{jobId} is a completed batch job and cannot be restarted.',
defaultMessage: '{jobId} is a completed batch transform and cannot be restarted.',
values: { jobId: item.config.id },
})
}
@ -100,7 +100,7 @@ export const StartAction: SFC<StartActionProps> = ({ startJob, item }) => {
<p>
{i18n.translate('xpack.ml.dataframe.jobsList.startModalBody', {
defaultMessage:
'A data frame job will increase search and indexing load in your cluster. Please stop the job if excessive load is experienced. Are you sure you want to start this job?',
'A data frame transform will increase search and indexing load in your cluster. Please stop the transform if excessive load is experienced. Are you sure you want to start this transform?',
})}
</p>
</EuiConfirmModal>

View file

@ -57,7 +57,7 @@ export const ExpandedRow: SFC<Props> = ({ item }) => {
{
id: 'job-details',
name: i18n.translate('xpack.ml.dataframe.jobsList.jobDetails.tabs.jobSettingsLabel', {
defaultMessage: 'Job details',
defaultMessage: 'Transform details',
}),
content: <JobDetailsPane sections={[state, checkpointing, stats]} />,
},

View file

@ -6,6 +6,8 @@
import React, { SFC, useEffect, useState } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiButtonEmpty, EuiEmptyPrompt, SortDirection } from '@elastic/eui';
import { JobId, moveToDataFrameWizard, useRefreshTransformList } from '../../../../common';
@ -56,10 +58,18 @@ export const DataFrameJobList: SFC = () => {
if (dataFrameJobs.length === 0) {
return (
<EuiEmptyPrompt
title={<h2>No data frame jobs found</h2>}
title={
<h2>
{i18n.translate('xpack.ml.dataFrame.list.emptyPromptTitle', {
defaultMessage: 'No data frame transforms found',
})}
</h2>
}
actions={[
<EuiButtonEmpty onClick={moveToDataFrameWizard}>
Create your first data frame job
{i18n.translate('xpack.ml.dataFrame.list.emptyPromptButtonText', {
defaultMessage: 'Create your first data frame transform',
})}
</EuiButtonEmpty>,
]}
data-test-subj="mlNoDataFrameJobsFound"

View file

@ -18,14 +18,14 @@ export const deleteJobFactory = (getJobs: GetJobs) => async (d: DataFrameJobList
getJobs(true);
toastNotifications.addSuccess(
i18n.translate('xpack.ml.dataframe.jobsList.deleteJobSuccessMessage', {
defaultMessage: 'Data frame job {jobId} deleted successfully.',
defaultMessage: 'Data frame transform {jobId} deleted successfully.',
values: { jobId: d.config.id },
})
);
} catch (e) {
toastNotifications.addDanger(
i18n.translate('xpack.ml.dataframe.jobsList.deleteJobErrorMessage', {
defaultMessage: 'An error occurred deleting the data frame job {jobId}: {error}',
defaultMessage: 'An error occurred deleting the data frame transform {jobId}: {error}',
values: { jobId: d.config.id, error: JSON.stringify(e) },
})
);

View file

@ -17,7 +17,7 @@ export const startJobFactory = (getJobs: GetJobs) => async (d: DataFrameJobListR
await ml.dataFrame.startDataFrameTransformsJob(d.config.id);
toastNotifications.addSuccess(
i18n.translate('xpack.ml.dataframe.jobsList.startJobSuccessMessage', {
defaultMessage: 'Data frame job {jobId} started successfully.',
defaultMessage: 'Data frame transform {jobId} started successfully.',
values: { jobId: d.config.id },
})
);
@ -25,7 +25,7 @@ export const startJobFactory = (getJobs: GetJobs) => async (d: DataFrameJobListR
} catch (e) {
toastNotifications.addDanger(
i18n.translate('xpack.ml.dataframe.jobsList.startJobErrorMessage', {
defaultMessage: 'An error occurred starting the data frame job {jobId}: {error}',
defaultMessage: 'An error occurred starting the data frame transform {jobId}: {error}',
values: { jobId: d.config.id, error: JSON.stringify(e) },
})
);

View file

@ -40,7 +40,7 @@ export const Page: SFC = () => {
<h1>
<FormattedMessage
id="xpack.ml.dataframe.jobsList.dataFrameTitle"
defaultMessage="Data frame jobs"
defaultMessage="Data frame transforms"
/>
<span>&nbsp;</span>
<EuiBetaBadge