Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@
*/

import React from 'react';
import { EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

export const PageTitle = () => {
return (
<EuiText>
<h1 data-test-subj="managementSettingsTitle">
<FormattedMessage id="advancedSettings.pageTitle" defaultMessage="Settings" />
</h1>
</EuiText>
<span data-test-subj="managementSettingsTitle">
<FormattedMessage id="advancedSettings.pageTitle" defaultMessage="Settings" />
</span>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ import {
UserProvidedValues,
UiSettingsType,
} from '../../../../core/public';
import { notificationServiceMock, docLinksServiceMock } from '../../../../core/public/mocks';
import { KibanaPageTemplate } from '../../../kibana_react/public';
import { FieldSetting } from './types';
import { AdvancedSettings } from './advanced_settings';
import { notificationServiceMock, docLinksServiceMock } from '../../../../core/public/mocks';
import { ComponentRegistry } from '../component_registry';
import { Search } from './components/search';

Expand Down Expand Up @@ -251,6 +252,7 @@ describe('AdvancedSettings', () => {
dockLinks={docLinksServiceMock.createStartContract().links}
uiSettings={mockConfig().core.uiSettings}
componentRegistry={new ComponentRegistry().start}
managementPageLayout={KibanaPageTemplate}
/>
);

Expand All @@ -273,6 +275,7 @@ describe('AdvancedSettings', () => {
dockLinks={docLinksServiceMock.createStartContract().links}
uiSettings={mockConfig().core.uiSettings}
componentRegistry={new ComponentRegistry().start}
managementPageLayout={KibanaPageTemplate}
/>
);

Expand All @@ -299,6 +302,7 @@ describe('AdvancedSettings', () => {
dockLinks={docLinksServiceMock.createStartContract().links}
uiSettings={mockConfig().core.uiSettings}
componentRegistry={new ComponentRegistry().start}
managementPageLayout={KibanaPageTemplate}
/>
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* Side Public License, v 1.
*/

import React, { Component } from 'react';
import React, { Component, ComponentType } from 'react';
import { Subscription } from 'rxjs';
import { UnregisterCallback } from 'history';
import { parse } from 'query-string';

import { UiCounterMetricType } from '@kbn/analytics';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, Query } from '@elastic/eui';
import { EuiSpacer, Query } from '@elastic/eui';

import {
IUiSettingsClient,
Expand All @@ -32,6 +32,7 @@ import { getAriaName, toEditableConfig, fieldSorter, DEFAULT_CATEGORY } from './

import { FieldSetting, SettingsChanges } from './types';
import { parseErrorMsg } from './components/search/search';
import { KibanaPageTemplateProps } from '../../../kibana_react/public';

export const QUERY = 'query';

Expand All @@ -43,6 +44,7 @@ interface AdvancedSettingsProps {
toasts: ToastsStart;
componentRegistry: ComponentRegistry['start'];
trackUiMetric?: (metricType: UiCounterMetricType, eventName: string | string[]) => void;
managementPageLayout: ComponentType<KibanaPageTemplateProps>;
}

interface AdvancedSettingsState {
Expand Down Expand Up @@ -239,17 +241,21 @@ export class AdvancedSettings extends Component<AdvancedSettingsProps, AdvancedS
componentRegistry.componentType.PAGE_SUBTITLE_COMPONENT
);
const PageFooter = componentRegistry.get(componentRegistry.componentType.PAGE_FOOTER_COMPONENT);
const ManagementPageLayout = this.props.managementPageLayout;

return (
<div>
<EuiFlexGroup gutterSize="none">
<EuiFlexItem>
<PageTitle />
</EuiFlexItem>
<EuiFlexItem>
<Search query={query} categories={this.categories} onQueryChange={this.onQueryChange} />
</EuiFlexItem>
</EuiFlexGroup>
<ManagementPageLayout
pageHeader={{
pageTitle: <PageTitle />,
rightSideItems: [
<Search
query={query}
categories={this.categories}
onQueryChange={this.onQueryChange}
/>,
],
}}
>
<PageSubtitle />
<EuiSpacer size="m" />
<CallOuts />
Expand All @@ -269,14 +275,15 @@ export class AdvancedSettings extends Component<AdvancedSettingsProps, AdvancedS
dockLinks={this.props.dockLinks}
toasts={this.props.toasts}
trackUiMetric={this.props.trackUiMetric}
queryText={query.text}
/>
<PageFooter
toasts={this.props.toasts}
query={query}
onQueryMatchChange={this.onFooterQueryMatchChange}
enableSaving={this.props.enableSaving}
/>
</div>
</ManagementPageLayout>
);
}
}
Loading