Skip to content

Commit e20a9bf

Browse files
committed
Merge branch 'master' of github.com:elastic/kibana into fixup-team-assignment
2 parents 05cb7a3 + b9413cf commit e20a9bf

File tree

200 files changed

+1607
-875
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+1607
-875
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"@elastic/apm-rum": "^5.2.0",
126126
"@elastic/charts": "19.8.1",
127127
"@elastic/datemath": "5.0.3",
128-
"@elastic/elasticsearch": "7.9.0-rc.1",
128+
"@elastic/elasticsearch": "7.9.0-rc.2",
129129
"@elastic/ems-client": "7.9.3",
130130
"@elastic/eui": "26.3.1",
131131
"@elastic/filesaver": "1.1.2",

test/functional/apps/dashboard/dashboard_error_handling.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
2828
/**
2929
* Common test suite for testing exception scenarious within dashboard
3030
*/
31-
// Flaky: https://github.com/elastic/kibana/issues/72146
32-
describe.skip('dashboard error handling', () => {
31+
describe('dashboard error handling', () => {
3332
before(async () => {
3433
await esArchiver.loadIfNeeded('dashboard/current/kibana');
3534
await PageObjects.common.navigateToApp('dashboard');

test/functional/apps/dashboard/embeddable_rendering.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ export default function ({ getService, getPageObjects }) {
9898
await dashboardExpect.vegaTextsDoNotExist(['5,000']);
9999
};
100100

101-
// FLAKY: https://github.com/elastic/kibana/issues/46305
102-
describe.skip('dashboard embeddable rendering', function describeIndexTests() {
101+
describe('dashboard embeddable rendering', function describeIndexTests() {
103102
before(async () => {
104103
await esArchiver.load('dashboard/current/kibana');
105104
await kibanaServer.uiSettings.replace({

x-pack/plugins/index_lifecycle_management/__jest__/client_integration/helpers/setup_environment.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export const setupEnvironment = () => {
2929
);
3030

3131
mockHttpClient.interceptors.response.use(({ data }) => data);
32+
// This expects HttpSetup but we're giving it AxiosInstance.
33+
// @ts-ignore
3234
initHttp(mockHttpClient);
3335
const { server, httpRequestsMockHelpers } = initHttpRequests();
3436

x-pack/plugins/index_lifecycle_management/public/application/services/api.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
*/
66

77
import { METRIC_TYPE } from '@kbn/analytics';
8-
import { trackUiMetric } from './ui_metric';
98

109
import {
1110
UIM_POLICY_DELETE,
@@ -15,8 +14,13 @@ import {
1514
UIM_INDEX_RETRY_STEP,
1615
} from '../constants';
1716

17+
import { trackUiMetric } from './ui_metric';
1818
import { sendGet, sendPost, sendDelete, useRequest } from './http';
1919

20+
interface GenericObject {
21+
[key: string]: any;
22+
}
23+
2024
export async function loadNodes() {
2125
return await sendGet(`nodes/list`);
2226
}
@@ -33,7 +37,7 @@ export async function loadPolicies(withIndices: boolean) {
3337
return await sendGet('policies', { withIndices });
3438
}
3539

36-
export async function savePolicy(policy: any) {
40+
export async function savePolicy(policy: GenericObject) {
3741
return await sendPost(`policies`, policy);
3842
}
3943

@@ -58,14 +62,14 @@ export const removeLifecycleForIndex = async (indexNames: string[]) => {
5862
return response;
5963
};
6064

61-
export const addLifecyclePolicyToIndex = async (body: any) => {
65+
export const addLifecyclePolicyToIndex = async (body: GenericObject) => {
6266
const response = await sendPost(`index/add`, body);
6367
// Only track successful actions.
6468
trackUiMetric(METRIC_TYPE.COUNT, UIM_POLICY_ATTACH_INDEX);
6569
return response;
6670
};
6771

68-
export const addLifecyclePolicyToTemplate = async (body: any) => {
72+
export const addLifecyclePolicyToTemplate = async (body: GenericObject) => {
6973
const response = await sendPost(`template`, body);
7074
// Only track successful actions.
7175
trackUiMetric(METRIC_TYPE.COUNT, UIM_POLICY_ATTACH_INDEX_TEMPLATE);

x-pack/plugins/index_lifecycle_management/public/application/services/api_errors.js renamed to x-pack/plugins/index_lifecycle_management/public/application/services/api_errors.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import { IHttpFetchError } from 'src/core/public';
78
import { fatalErrors, toasts } from './notification';
89

9-
function createToastConfig(error, errorTitle) {
10+
function createToastConfig(error: IHttpFetchError, errorTitle: string) {
1011
if (error && error.body) {
12+
// Error body shape is defined by the API.
1113
const { error: errorString, statusCode, message } = error.body;
1214

1315
return {
@@ -17,7 +19,7 @@ function createToastConfig(error, errorTitle) {
1719
}
1820
}
1921

20-
export function showApiWarning(error, errorTitle) {
22+
export function showApiWarning(error: IHttpFetchError, errorTitle: string) {
2123
const toastConfig = createToastConfig(error, errorTitle);
2224

2325
if (toastConfig) {
@@ -26,10 +28,10 @@ export function showApiWarning(error, errorTitle) {
2628

2729
// This error isn't an HTTP error, so let the fatal error screen tell the user something
2830
// unexpected happened.
29-
return fatalErrors(error, errorTitle);
31+
return fatalErrors.add(error, errorTitle);
3032
}
3133

32-
export function showApiError(error, errorTitle) {
34+
export function showApiError(error: IHttpFetchError, errorTitle: string) {
3335
const toastConfig = createToastConfig(error, errorTitle);
3436

3537
if (toastConfig) {

x-pack/plugins/index_lifecycle_management/public/application/services/http.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7+
import { HttpSetup } from 'src/core/public';
78
import {
89
UseRequestConfig,
910
useRequest as _useRequest,
1011
Error,
1112
} from '../../../../../../src/plugins/es_ui_shared/public';
1213

13-
let _httpClient: any;
14+
interface GenericObject {
15+
[key: string]: any;
16+
}
17+
18+
let _httpClient: HttpSetup;
1419

15-
export function init(httpClient: any): void {
20+
export function init(httpClient: HttpSetup): void {
1621
_httpClient = httpClient;
1722
}
1823

@@ -26,15 +31,15 @@ function getFullPath(path: string): string {
2631
return apiPrefix;
2732
}
2833

29-
export function sendPost(path: string, payload: any): any {
34+
export function sendPost(path: string, payload: GenericObject) {
3035
return _httpClient.post(getFullPath(path), { body: JSON.stringify(payload) });
3136
}
3237

33-
export function sendGet(path: string, query?: any): any {
38+
export function sendGet(path: string, query?: GenericObject): any {
3439
return _httpClient.get(getFullPath(path), { query });
3540
}
3641

37-
export function sendDelete(path: string): any {
42+
export function sendDelete(path: string) {
3843
return _httpClient.delete(getFullPath(path));
3944
}
4045

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@ import { removeLifecycleForIndex } from '../../application/services/api';
1313
import { showApiError } from '../../application/services/api_errors';
1414
import { toasts } from '../../application/services/notification';
1515

16-
export class RemoveLifecyclePolicyConfirmModal extends Component {
17-
constructor(props) {
18-
super(props);
19-
this.state = {
20-
policies: [],
21-
selectedPolicyName: null,
22-
selectedAlias: null,
23-
};
24-
}
16+
interface Props {
17+
indexNames: string[];
18+
closeModal: () => void;
19+
reloadIndices: () => void;
20+
}
2521

22+
export class RemoveLifecyclePolicyConfirmModal extends Component<Props> {
2623
removePolicy = async () => {
2724
const { indexNames, closeModal, reloadIndices } = this.props;
2825

x-pack/plugins/infra/public/alerting/common/components/alert_preview.tsx

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ import {
1414
EuiFlexGroup,
1515
EuiFlexItem,
1616
EuiCallOut,
17-
EuiOverlayMask,
18-
EuiModal,
19-
EuiModalHeader,
20-
EuiModalHeaderTitle,
21-
EuiModalBody,
17+
EuiAccordion,
2218
EuiCodeBlock,
23-
EuiLink,
19+
EuiText,
2420
} from '@elastic/eui';
2521
import { FormattedMessage } from '@kbn/i18n/react';
2622
import { i18n } from '@kbn/i18n';
@@ -61,9 +57,6 @@ export const AlertPreview: React.FC<Props> = (props) => {
6157
const [previewResult, setPreviewResult] = useState<
6258
(AlertPreviewSuccessResponsePayload & Record<string, any>) | null
6359
>(null);
64-
const [isErrorModalVisible, setIsErrorModalVisible] = useState<boolean>(false);
65-
const onOpenModal = useCallback(() => setIsErrorModalVisible(true), [setIsErrorModalVisible]);
66-
const onCloseModal = useCallback(() => setIsErrorModalVisible(false), [setIsErrorModalVisible]);
6760

6861
const onSelectPreviewLookbackInterval = useCallback((e) => {
6962
setPreviewLookbackInterval(e.target.value);
@@ -271,33 +264,32 @@ export const AlertPreview: React.FC<Props> = (props) => {
271264
iconType="alert"
272265
>
273266
{previewError.body && (
274-
<FormattedMessage
275-
id="xpack.infra.metrics.alertFlyout.alertPreviewErrorDesc"
276-
defaultMessage="Try again later, or {viewTheError}."
277-
values={{
278-
viewTheError: <EuiLink onClick={onOpenModal}>view the error</EuiLink>,
279-
}}
280-
/>
267+
<>
268+
<FormattedMessage
269+
id="xpack.infra.metrics.alertFlyout.alertPreviewErrorDesc"
270+
defaultMessage="Please try again later or see details for more information."
271+
/>
272+
<EuiSpacer size={'s'} />
273+
<EuiAccordion
274+
id="alertErrorDetailsAccordion"
275+
buttonContent={
276+
<>
277+
<EuiText size="s">
278+
<FormattedMessage
279+
id="xpack.infra.metrics.alertFlyout.errorDetails"
280+
defaultMessage="Details"
281+
/>
282+
</EuiText>
283+
</>
284+
}
285+
>
286+
<EuiSpacer size={'s'} />
287+
<EuiCodeBlock>{previewError.body.message}</EuiCodeBlock>
288+
</EuiAccordion>
289+
</>
281290
)}
282291
</EuiCallOut>
283292
)}
284-
{isErrorModalVisible && (
285-
<EuiOverlayMask>
286-
<EuiModal onClose={onCloseModal}>
287-
<EuiModalHeader>
288-
<EuiModalHeaderTitle>
289-
<FormattedMessage
290-
id="xpack.infra.metrics.alertFlyout.alertPreviewErrorModalTitle"
291-
defaultMessage="Alert preview error"
292-
/>
293-
</EuiModalHeaderTitle>
294-
</EuiModalHeader>
295-
<EuiModalBody>
296-
<EuiCodeBlock>{previewError.body.message}</EuiCodeBlock>
297-
</EuiModalBody>
298-
</EuiModal>
299-
</EuiOverlayMask>
300-
)}
301293
</>
302294
)}
303295
</>

x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/epm/components/assets_facet_group.tsx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6-
6+
import React, { Fragment } from 'react';
77
import {
88
EuiFacetButton,
99
EuiFacetGroup,
@@ -14,8 +14,8 @@ import {
1414
EuiTextColor,
1515
EuiTitle,
1616
} from '@elastic/eui';
17-
import React, { Fragment } from 'react';
1817
import styled from 'styled-components';
18+
import { FormattedMessage } from '@kbn/i18n/react';
1919
import {
2020
AssetsGroupedByServiceByType,
2121
AssetTypeToParts,
@@ -43,8 +43,15 @@ const FacetGroup = styled(EuiFacetGroup)`
4343
`;
4444

4545
const FacetButton = styled(EuiFacetButton)`
46-
padding: '${(props) => props.theme.eui.paddingSizes.xs} 0';
47-
height: 'unset';
46+
&&& {
47+
.euiFacetButton__icon,
48+
.euiFacetButton__quantity {
49+
opacity: 1;
50+
}
51+
.euiFacetButton__text {
52+
color: ${(props) => props.theme.eui.euiTextColor};
53+
}
54+
}
4855
`;
4956

5057
export function AssetsFacetGroup({ assets }: { assets: AssetsGroupedByServiceByType }) {
@@ -70,7 +77,15 @@ export function AssetsFacetGroup({ assets }: { assets: AssetsGroupedByServiceByT
7077
<EuiFlexItem>
7178
<EuiTitle key={service} size="xs">
7279
<EuiText>
73-
<h4>{ServiceTitleMap[service]} Assets</h4>
80+
<h4>
81+
<FormattedMessage
82+
id="xpack.ingestManager.epm.assetGroupTitle"
83+
defaultMessage="{assetType} assets"
84+
values={{
85+
assetType: ServiceTitleMap[service],
86+
}}
87+
/>
88+
</h4>
7489
</EuiText>
7590
</EuiTitle>
7691
</EuiFlexItem>
@@ -83,13 +98,7 @@ export function AssetsFacetGroup({ assets }: { assets: AssetsGroupedByServiceByT
8398
const iconType = type in AssetIcons && AssetIcons[type];
8499
const iconNode = iconType ? <EuiIcon type={iconType} size="s" /> : '';
85100
return (
86-
<FacetButton
87-
key={type}
88-
quantity={parts.length}
89-
icon={iconNode}
90-
// https://github.com/elastic/eui/issues/2216
91-
buttonRef={() => {}}
92-
>
101+
<FacetButton key={type} quantity={parts.length} icon={iconNode} isDisabled={true}>
93102
<EuiTextColor color="subdued">{AssetTitleMap[type]}</EuiTextColor>
94103
</FacetButton>
95104
);

0 commit comments

Comments
 (0)