Skip to content

Commit

Permalink
Merge branch 'master' of github.com:elastic/kibana into feature-fleet…
Browse files Browse the repository at this point in the history
…-global-component-template
  • Loading branch information
nchaulet committed Jun 22, 2021
2 parents 554a28e + 953a464 commit e627b28
Show file tree
Hide file tree
Showing 19 changed files with 209 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ readonly links: {
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly guide: string;
Expand Down

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ export class DocLinksService {
addData: `${KIBANA_DOCS}connect-to-elasticsearch.html`,
kibana: `${KIBANA_DOCS}index.html`,
upgradeAssistant: `${KIBANA_DOCS}upgrade-assistant.html`,
rollupJobs: `${KIBANA_DOCS}data-rollups.html`,
elasticsearch: {
docsBase: `${ELASTICSEARCH_DOCS}`,
asyncSearch: `${ELASTICSEARCH_DOCS}async-search-intro.html`,
Expand Down Expand Up @@ -532,6 +533,7 @@ export interface DocLinksStart {
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly guide: string;
Expand Down
1 change: 1 addition & 0 deletions src/core/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ export interface DocLinksStart {
readonly addData: string;
readonly kibana: string;
readonly upgradeAssistant: string;
readonly rollupJobs: string;
readonly elasticsearch: Record<string, string>;
readonly siem: {
readonly guide: string;
Expand Down
14 changes: 11 additions & 3 deletions x-pack/plugins/monitoring/public/alerts/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,18 @@ import { getAlertPanelsByCategory } from './lib/get_alert_panels_by_category';
import { getAlertPanelsByNode } from './lib/get_alert_panels_by_node';

export const numberOfAlertsLabel = (count: number) => `${count} alert${count > 1 ? 's' : ''}`;
export const numberOfRulesLabel = (count: number) => `${count} rule${count > 1 ? 's' : ''}`;

const MAX_TO_SHOW_BY_CATEGORY = 8;

const PANEL_TITLE = i18n.translate('xpack.monitoring.alerts.badge.panelTitle', {
const PANEL_TITLE_ALERTS = i18n.translate('xpack.monitoring.alerts.badge.panelTitle', {
defaultMessage: 'Alerts',
});

const PANEL_TITLE_RULES = i18n.translate('xpack.monitoring.rules.badge.panelTitle', {
defaultMessage: 'Rules',
});

const GROUP_BY_NODE = i18n.translate('xpack.monitoring.alerts.badge.groupByNode', {
defaultMessage: 'Group by node',
});
Expand Down Expand Up @@ -54,6 +59,7 @@ export const AlertsBadge: React.FC<Props> = (props: Props) => {
const [showByNode, setShowByNode] = React.useState(
!inSetupMode && alertCount > MAX_TO_SHOW_BY_CATEGORY
);
const PANEL_TITLE = inSetupMode ? PANEL_TITLE_RULES : PANEL_TITLE_ALERTS;

React.useEffect(() => {
if (inSetupMode && showByNode) {
Expand Down Expand Up @@ -93,10 +99,12 @@ export const AlertsBadge: React.FC<Props> = (props: Props) => {
<EuiBadge
iconType="bell"
color={inSetupMode ? 'default' : 'danger'}
onClickAriaLabel={numberOfAlertsLabel(alertCount)}
onClickAriaLabel={
inSetupMode ? numberOfRulesLabel(alertCount) : numberOfAlertsLabel(alertCount)
}
onClick={() => setShowPopover(true)}
>
{numberOfAlertsLabel(alertCount)}
{inSetupMode ? numberOfRulesLabel(alertCount) : numberOfAlertsLabel(alertCount)}
</EuiBadge>
);

Expand Down
8 changes: 0 additions & 8 deletions x-pack/plugins/rollup/public/crud_app/_crud_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,3 @@
.rollupJobWizardStepActions {
align-items: flex-end; /* 1 */
}

/**
* 1. Ensure panel fills width of parent when search input yields no matching rollup jobs.
*/
.rollupJobsListPanel {
// sass-lint:disable-block no-important
flex-grow: 1 !important; /* 1 */
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import React, { Component, Fragment } from 'react';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { cloneDeep, debounce, first, mapValues } from 'lodash';

Expand All @@ -18,11 +18,10 @@ import {
EuiCallOut,
EuiLoadingKibana,
EuiOverlayMask,
EuiPageContent,
EuiPageContentHeader,
EuiPageContentBody,
EuiPageHeader,
EuiSpacer,
EuiStepsHorizontal,
EuiTitle,
} from '@elastic/eui';

import {
Expand Down Expand Up @@ -522,44 +521,46 @@ export class JobCreateUi extends Component {
}

saveErrorFeedback = (
<Fragment>
<>
<EuiSpacer />

<EuiCallOut title={message} icon="cross" color="danger">
{errorBody}
</EuiCallOut>

<EuiSpacer />
</Fragment>
</>
);
}

return (
<Fragment>
<EuiPageContent>
<EuiPageContentHeader>
<EuiTitle size="l">
<h1>
<FormattedMessage
id="xpack.rollupJobs.createTitle"
defaultMessage="Create rollup job"
/>
</h1>
</EuiTitle>
</EuiPageContentHeader>

{saveErrorFeedback}

<EuiStepsHorizontal steps={this.getSteps()} />
<EuiPageContentBody restrictWidth style={{ width: '100%' }}>
<EuiPageHeader
bottomBorder
pageTitle={
<FormattedMessage
id="xpack.rollupJobs.createTitle"
defaultMessage="Create rollup job"
/>
}
/>

<EuiSpacer />
<EuiSpacer size="l" />

<EuiStepsHorizontal steps={this.getSteps()} />

{saveErrorFeedback}

<EuiSpacer />

{this.renderCurrentStep()}

{this.renderCurrentStep()}
<EuiSpacer size="l" />

<EuiSpacer size="l" />
{this.renderNavigation()}

{this.renderNavigation()}
</EuiPageContent>
{savingFeedback}
</Fragment>
</EuiPageContentBody>
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export class DetailPanel extends Component {
<EuiTextColor color="subdued">
<FormattedMessage
id="xpack.rollupJobs.detailPanel.loadingLabel"
defaultMessage="Loading rollup job..."
defaultMessage="Loading rollup job"
/>
</EuiTextColor>
</EuiText>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ describe('<DetailPanel />', () => {
({ component, find, exists } = initTestBed({ isLoading: true }));
const loading = find('rollupJobDetailLoading');
expect(loading.length).toBeTruthy();
expect(loading.text()).toEqual('Loading rollup job...');
expect(loading.text()).toEqual('Loading rollup job');

// Make sure the title and the tabs are visible
expect(exists('detailPanelTabSelected')).toBeTruthy();
Expand Down
Loading

0 comments on commit e627b28

Please sign in to comment.