Skip to content

Commit

Permalink
[ML] Edits to permissions check following review
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson committed Jan 22, 2020
1 parent bde38be commit 901a166
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,11 @@ export const Page: FC = () => {

const defaults = getDefaultPageState();

const [showActionsPanel] = useState(
const showActionsPanel =
isFullLicense() &&
checkPermission('canCreateJob') &&
mlNodesAvailable() &&
currentIndexPattern.timeFieldName !== undefined
);
checkPermission('canCreateJob') &&
mlNodesAvailable() &&
currentIndexPattern.timeFieldName !== undefined;

const [searchString, setSearchString] = useState(defaults.searchString);
const [searchQuery, setSearchQuery] = useState(defaults.searchQuery);
Expand Down
12 changes: 11 additions & 1 deletion x-pack/legacy/plugins/ml/public/application/explorer/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@ import {
EuiFlexItem,
EuiFormRow,
EuiIconTip,
EuiPage,
EuiPageBody,
EuiSelect,
EuiSpacer,
EuiTitle,
} from '@elastic/eui';

import { AnnotationFlyout } from '../components/annotations/annotation_flyout';
Expand Down Expand Up @@ -87,8 +90,15 @@ function mapSwimlaneOptionsToEuiOptions(options) {
const ExplorerPage = ({ children, jobSelectorProps, resizeRef }) => (
<div ref={resizeRef} data-test-subj="mlPageAnomalyExplorer">
<NavigationMenu tabId="explorer" />
<EuiTitle style={{ paddingLeft: '10px', paddingTop: '10px' }}>
<h1>
<FormattedMessage id="xpack.ml.explorer.pageTitle" defaultMessage="Anomaly explorer" />
</h1>
</EuiTitle>
<JobSelector {...jobSelectorProps} />
{children}
<EuiPage>
<EuiPageBody>{children}</EuiPageBody>
</EuiPage>
</div>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import React, { FC } from 'react';

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

// @ts-ignore
Expand All @@ -15,7 +16,11 @@ export const JobsPage: FC<{ props?: any }> = props => {
return (
<div data-test-subj="mlPageJobManagement">
<NavigationMenu tabId="jobs" />
<JobsListView {...props} />
<EuiPage>
<EuiPageBody>
<JobsListView {...props} />
</EuiPageBody>
</EuiPage>
</div>
);
};

0 comments on commit 901a166

Please sign in to comment.