Skip to content

Commit 901a166

Browse files
committed
[ML] Edits to permissions check following review
1 parent bde38be commit 901a166

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

x-pack/legacy/plugins/ml/public/application/datavisualizer/index_based/page.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,11 @@ export const Page: FC = () => {
132132

133133
const defaults = getDefaultPageState();
134134

135-
const [showActionsPanel] = useState(
135+
const showActionsPanel =
136136
isFullLicense() &&
137-
checkPermission('canCreateJob') &&
138-
mlNodesAvailable() &&
139-
currentIndexPattern.timeFieldName !== undefined
140-
);
137+
checkPermission('canCreateJob') &&
138+
mlNodesAvailable() &&
139+
currentIndexPattern.timeFieldName !== undefined;
141140

142141
const [searchString, setSearchString] = useState(defaults.searchString);
143142
const [searchQuery, setSearchQuery] = useState(defaults.searchQuery);

x-pack/legacy/plugins/ml/public/application/explorer/explorer.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,11 @@ import {
2121
EuiFlexItem,
2222
EuiFormRow,
2323
EuiIconTip,
24+
EuiPage,
25+
EuiPageBody,
2426
EuiSelect,
2527
EuiSpacer,
28+
EuiTitle,
2629
} from '@elastic/eui';
2730

2831
import { AnnotationFlyout } from '../components/annotations/annotation_flyout';
@@ -87,8 +90,15 @@ function mapSwimlaneOptionsToEuiOptions(options) {
8790
const ExplorerPage = ({ children, jobSelectorProps, resizeRef }) => (
8891
<div ref={resizeRef} data-test-subj="mlPageAnomalyExplorer">
8992
<NavigationMenu tabId="explorer" />
93+
<EuiTitle style={{ paddingLeft: '10px', paddingTop: '10px' }}>
94+
<h1>
95+
<FormattedMessage id="xpack.ml.explorer.pageTitle" defaultMessage="Anomaly explorer" />
96+
</h1>
97+
</EuiTitle>
9098
<JobSelector {...jobSelectorProps} />
91-
{children}
99+
<EuiPage>
100+
<EuiPageBody>{children}</EuiPageBody>
101+
</EuiPage>
92102
</div>
93103
);
94104

x-pack/legacy/plugins/ml/public/application/jobs/jobs_list/jobs.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import React, { FC } from 'react';
88

9+
import { EuiPage, EuiPageBody } from '@elastic/eui';
910
import { NavigationMenu } from '../../components/navigation_menu';
1011

1112
// @ts-ignore
@@ -15,7 +16,11 @@ export const JobsPage: FC<{ props?: any }> = props => {
1516
return (
1617
<div data-test-subj="mlPageJobManagement">
1718
<NavigationMenu tabId="jobs" />
18-
<JobsListView {...props} />
19+
<EuiPage>
20+
<EuiPageBody>
21+
<JobsListView {...props} />
22+
</EuiPageBody>
23+
</EuiPage>
1924
</div>
2025
);
2126
};

0 commit comments

Comments
 (0)