Skip to content
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

Feature/translate ml - jobs(part 2) #25528

Merged
merged 27 commits into from
Dec 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c7ec189
Merge pull request #1 from elastic/master
Nox911 Sep 24, 2018
fa01b88
Merge pull request #2 from elastic/master
Nox911 Sep 27, 2018
70f6c7e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Sep 27, 2018
68587a0
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Sep 28, 2018
42aa7d3
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 2, 2018
efeaefe
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 2, 2018
8a054ed
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 8, 2018
b0d1660
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 16, 2018
62b6ad1
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 17, 2018
acbad4b
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 18, 2018
a850650
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 22, 2018
0a200ce
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 25, 2018
b2a8244
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 29, 2018
b4b979e
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 30, 2018
d349a4f
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Oct 31, 2018
ae285b9
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 2, 2018
3051641
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 5, 2018
6231971
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 8, 2018
f86a3d4
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 9, 2018
fa99548
Translate ml -> jobs - jobs-list(part_2)
Nox911 Nov 12, 2018
3fbeeb0
Fix issues
Nox911 Nov 13, 2018
cf813c7
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 13, 2018
9405e40
Merge branch 'master' into feature/translate-ml-jobs(part_2)
Nox911 Nov 13, 2018
1aba03f
Merge branch 'master' of https://github.com/elastic/kibana
Nox911 Nov 14, 2018
01080ef
Merge branch 'master' into feature/translate-ml-jobs(part_2)
Nox911 Nov 14, 2018
a228f72
Merge branch 'master' into feature/translate-ml-jobs(part_2)
pavel06081991 Dec 6, 2018
55038c3
fix review comments
pavel06081991 Dec 6, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"xpack.idxMgmt": "x-pack/plugins/index_management",
"xpack.infra": "x-pack/plugins/infra",
"xpack.licenseMgmt": "x-pack/plugins/license_management",
"xpack.ml": "x-pack/plugins/ml",
"xpack.logstash": "x-pack/plugins/logstash",
"xpack.monitoring": "x-pack/plugins/monitoring",
"xpack.reporting": "x-pack/plugins/reporting",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ import { toastNotifications } from 'ui/notify';
import { loadFullJob } from '../utils';
import { mlCreateWatchService } from '../../../../jobs/new_job/simple/components/watcher/create_watch_service';
import { CreateWatch } from '../../../../jobs/new_job/simple/components/watcher/create_watch_view';
import { FormattedMessage, injectI18n } from '@kbn/i18n/react';


function getSuccessToast(id, url) {
function getSuccessToast(id, url, intl) {
return {
title: `Watch ${id} created successfully`,
title: intl.formatMessage({
id: 'xpack.ml.jobsList.createWatchFlyout.watchCreatedSuccessfullyNotificationMessage',
defaultMessage: 'Watch {id} created successfully' },
{ id }
),
text: (
<React.Fragment>
<EuiFlexGroup justifyContent="flexEnd" gutterSize="s">
Expand All @@ -41,7 +46,10 @@ function getSuccessToast(id, url) {
target="_blank"
iconType="link"
>
Edit watch
{intl.formatMessage({
id: 'xpack.ml.jobsList.createWatchFlyout.editWatchButtonLabel',
defaultMessage: 'Edit watch' }
)}
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -50,7 +58,7 @@ function getSuccessToast(id, url) {
};
}

export class CreateWatchFlyout extends Component {
class CreateWatchFlyoutUI extends Component {
constructor(props) {
super(props);

Expand Down Expand Up @@ -95,13 +103,17 @@ export class CreateWatchFlyout extends Component {
}

save = () => {
const { intl } = this.props;
mlCreateWatchService.createNewWatch(this.state.jobId)
.then((resp) => {
toastNotifications.addSuccess(getSuccessToast(resp.id, resp.url));
toastNotifications.addSuccess(getSuccessToast(resp.id, resp.url, intl));
this.closeFlyout();
})
.catch((error) => {
toastNotifications.addDanger(`Could not save watch`);
toastNotifications.addDanger(intl.formatMessage({
id: 'xpack.ml.jobsList.createWatchFlyout.watchNotSavedErrorNotificationMessage',
defaultMessage: 'Could not save watch'
}));
console.error(error);
});
}
Expand All @@ -125,7 +137,11 @@ export class CreateWatchFlyout extends Component {
<EuiFlyoutHeader>
<EuiTitle>
<h2>
Create watch for {jobId}
<FormattedMessage
id="xpack.ml.jobsList.createWatchFlyout.pageTitle"
defaultMessage="Create watch for {jobId}"
values={{ jobId }}
/>
</h2>
</EuiTitle>
</EuiFlyoutHeader>
Expand All @@ -145,15 +161,21 @@ export class CreateWatchFlyout extends Component {
onClick={this.closeFlyout}
flush="left"
>
Close
<FormattedMessage
id="xpack.ml.jobsList.createWatchFlyout.closeButtonLabel"
defaultMessage="Close"
/>
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton
onClick={this.save}
fill
>
Save
<FormattedMessage
id="xpack.ml.jobsList.createWatchFlyout.saveButtonLabel"
defaultMessage="Save"
/>
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
Expand All @@ -169,8 +191,9 @@ export class CreateWatchFlyout extends Component {

}
}
CreateWatchFlyout.propTypes = {
CreateWatchFlyoutUI.propTypes = {
setShowFunction: PropTypes.func.isRequired,
unsetShowFunction: PropTypes.func.isRequired,
};

export const CreateWatchFlyout = injectI18n(CreateWatchFlyoutUI);
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import { detectorToString } from 'plugins/ml/util/string_utils';
import { formatValues, filterObjects } from './format_values';
import { i18n } from '@kbn/i18n';

export function extractJobDetails(job) {

Expand All @@ -15,14 +16,18 @@ export function extractJobDetails(job) {
}

const general = {
title: 'General',
title: i18n.translate('xpack.ml.jobsList.jobDetails.generalTitle', {
defaultMessage: 'General'
}),
position: 'left',
items: filterObjects(job, true).map(formatValues)
};


const customUrl = {
title: 'Custom URLs',
title: i18n.translate('xpack.ml.jobsList.jobDetails.customUrlsTitle', {
defaultMessage: 'Custom URLs'
}),
position: 'right',
items: []
};
Expand All @@ -31,7 +36,9 @@ export function extractJobDetails(job) {
}

const node = {
title: 'Node',
title: i18n.translate('xpack.ml.jobsList.jobDetails.nodeTitle', {
defaultMessage: 'Node'
}),
position: 'right',
items: []
};
Expand All @@ -40,7 +47,9 @@ export function extractJobDetails(job) {
}

const detectors = {
title: 'Detectors',
title: i18n.translate('xpack.ml.jobsList.jobDetails.detectorsTitle', {
defaultMessage: 'Detectors'
}),
position: 'left',
items: []
};
Expand All @@ -55,31 +64,41 @@ export function extractJobDetails(job) {
}

const influencers = {
title: 'Influencers',
title: i18n.translate('xpack.ml.jobsList.jobDetails.influencersTitle', {
defaultMessage: 'Influencers'
}),
position: 'left',
items: job.analysis_config.influencers.map(i => ['', i])
};

const analysisConfig = {
title: 'Analysis config',
title: i18n.translate('xpack.ml.jobsList.jobDetails.analysisConfigTitle', {
defaultMessage: 'Analysis config'
}),
position: 'left',
items: filterObjects(job.analysis_config)
};

const analysisLimits = {
title: 'Analysis limits',
title: i18n.translate('xpack.ml.jobsList.jobDetails.analysisLimitsTitle', {
defaultMessage: 'Analysis limits'
}),
position: 'left',
items: filterObjects(job.analysis_limits)
};

const dataDescription = {
title: 'Data description',
title: i18n.translate('xpack.ml.jobsList.jobDetails.dataDescriptionTitle', {
defaultMessage: 'Data description'
}),
position: 'right',
items: filterObjects(job.data_description)
};

const datafeed = {
title: 'Datafeed',
title: i18n.translate('xpack.ml.jobsList.jobDetails.datafeedTitle', {
defaultMessage: 'Datafeed'
}),
position: 'left',
items: filterObjects(job.datafeed_config, true, true)
};
Expand All @@ -88,13 +107,17 @@ export function extractJobDetails(job) {
}

const counts = {
title: 'Counts',
title: i18n.translate('xpack.ml.jobsList.jobDetails.countsTitle', {
defaultMessage: 'Counts'
}),
position: 'left',
items: filterObjects(job.data_counts).map(formatValues)
};

const modelSizeStats = {
title: 'Model size stats',
title: i18n.translate('xpack.ml.jobsList.jobDetails.modelSizeStatsTitle', {
defaultMessage: 'Model size stats'
}),
position: 'right',
items: filterObjects(job.model_size_stats).map(formatValues)
};
Expand Down
Loading