Skip to content

Commit a2c04c1

Browse files
Merge branch 'master' of github.com:elastic/kibana into feature/component_templates_wizard
2 parents 2a4c47d + fd15268 commit a2c04c1

File tree

257 files changed

+7212
-1936
lines changed

Some content is hidden

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

257 files changed

+7212
-1936
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
"@babel/plugin-transform-modules-commonjs": "^7.10.1",
124124
"@babel/register": "^7.10.1",
125125
"@elastic/apm-rum": "^5.2.0",
126-
"@elastic/charts": "19.6.3",
126+
"@elastic/charts": "19.7.0",
127127
"@elastic/datemath": "5.0.3",
128128
"@elastic/ems-client": "7.9.3",
129129
"@elastic/eui": "24.1.0",

packages/kbn-ui-shared-deps/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"kbn:watch": "node scripts/build --dev --watch"
1010
},
1111
"dependencies": {
12-
"@elastic/charts": "19.6.3",
12+
"@elastic/charts": "19.7.0",
1313
"@elastic/eui": "24.1.0",
1414
"@elastic/numeral": "^2.5.0",
1515
"@kbn/i18n": "1.0.0",

src/plugins/es_ui_shared/public/forms/form_wizard/form_wizard_context.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { WithMultiContent, useMultiContentContext, HookProps } from '../multi_co
2323

2424
export interface Props<T extends object> {
2525
onSave: (data: T) => void | Promise<void>;
26-
children: JSX.Element | JSX.Element[];
26+
children: JSX.Element | Array<JSX.Element | null | false>;
2727
isEditing?: boolean;
2828
defaultActiveStep?: number;
2929
defaultValue?: HookProps<T>['defaultValue'];

src/plugins/es_ui_shared/public/forms/multi_content/multi_content_context.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export function useMultiContentContext<T extends object = { [key: string]: any }
5454
*
5555
* @param contentId The content id to be added to the "contents" map
5656
*/
57-
export function useContent<T extends object = { [key: string]: any }>(contentId: keyof T) {
57+
export function useContent<T extends object, K extends keyof T>(contentId: K) {
5858
const { updateContentAt, saveSnapshotAndRemoveContent, getData } = useMultiContentContext<T>();
5959

6060
const updateContent = useCallback(
@@ -71,8 +71,11 @@ export function useContent<T extends object = { [key: string]: any }>(contentId:
7171
};
7272
}, [contentId, saveSnapshotAndRemoveContent]);
7373

74+
const data = getData();
75+
const defaultValue = data[contentId];
76+
7477
return {
75-
defaultValue: getData()[contentId]!,
78+
defaultValue,
7679
updateContent,
7780
getData,
7881
};

src/plugins/es_ui_shared/public/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* In the future, each top level folder should be exported like that to avoid naming collision
2323
*/
2424
import * as Forms from './forms';
25+
import * as Monaco from './monaco';
2526

2627
export { JsonEditor, OnJsonEditorUpdateHandler } from './components/json_editor';
2728

@@ -53,10 +54,6 @@ export {
5354
expandLiteralStrings,
5455
} from './console_lang';
5556

56-
import * as Monaco from './monaco';
57-
58-
export { Monaco };
59-
6057
export {
6158
AuthorizationContext,
6259
AuthorizationProvider,
@@ -69,7 +66,7 @@ export {
6966
useAuthorizationContext,
7067
} from './authorization';
7168

72-
export { Forms };
69+
export { Monaco, Forms };
7370

7471
/** dummy plugin, we just want esUiShared to have its own bundle */
7572
export function plugin() {

src/plugins/es_ui_shared/static/forms/helpers/field_validators/is_json.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ import { ValidationFunc } from '../../hook_form_lib';
2121
import { isJSON } from '../../../validators/string';
2222
import { ERROR_CODE } from './types';
2323

24-
export const isJsonField = (message: string) => (
25-
...args: Parameters<ValidationFunc>
26-
): ReturnType<ValidationFunc<any, ERROR_CODE>> => {
24+
export const isJsonField = (
25+
message: string,
26+
{ allowEmptyString = false }: { allowEmptyString?: boolean } = {}
27+
) => (...args: Parameters<ValidationFunc>): ReturnType<ValidationFunc<any, ERROR_CODE>> => {
2728
const [{ value }] = args;
2829

29-
if (typeof value !== 'string') {
30+
if (typeof value !== 'string' || (allowEmptyString && value.trim() === '')) {
3031
return;
3132
}
3233

2.71 MB
Loading

src/plugins/home/server/services/tutorials/lib/tutorials_registry_types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export interface TutorialSchema {
8282
name: string;
8383
isBeta?: boolean;
8484
shortDescription: string;
85-
euiIconType?: IconType; // EUI icon type string, one of https://elastic.github.io/eui/#/icon;
85+
euiIconType?: IconType; // EUI icon type string, one of https://elastic.github.io/eui/#/display/icons;
8686
longDescription: string;
8787
completionTimeMinutes?: number;
8888
previewImagePath?: string;
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { i18n } from '@kbn/i18n';
21+
import { TutorialsCategory } from '../../services/tutorials';
22+
import {
23+
onPremInstructions,
24+
cloudInstructions,
25+
onPremCloudInstructions,
26+
} from '../instructions/metricbeat_instructions';
27+
import {
28+
TutorialContext,
29+
TutorialSchema,
30+
} from '../../services/tutorials/lib/tutorials_registry_types';
31+
32+
export function googlecloudMetricsSpecProvider(context: TutorialContext): TutorialSchema {
33+
const moduleName = 'googlecloud';
34+
return {
35+
id: 'googlecloudMetrics',
36+
name: i18n.translate('home.tutorials.googlecloudMetrics.nameTitle', {
37+
defaultMessage: 'Google Cloud metrics',
38+
}),
39+
category: TutorialsCategory.METRICS,
40+
shortDescription: i18n.translate('home.tutorials.googlecloudMetrics.shortDescription', {
41+
defaultMessage:
42+
'Fetch monitoring metrics from Google Cloud Platform using Stackdriver Monitoring API.',
43+
}),
44+
longDescription: i18n.translate('home.tutorials.googlecloudMetrics.longDescription', {
45+
defaultMessage:
46+
'The `googlecloud` Metricbeat module fetches monitoring metrics from Google Cloud Platform using Stackdriver Monitoring API. \
47+
[Learn more]({learnMoreLink}).',
48+
values: {
49+
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-googlecloud.html',
50+
},
51+
}),
52+
euiIconType: 'logoGCP',
53+
isBeta: false,
54+
artifacts: {
55+
dashboards: [
56+
{
57+
id: 'f40ee870-5e4a-11ea-a4f6-717338406083',
58+
linkLabel: i18n.translate(
59+
'home.tutorials.googlecloudMetrics.artifacts.dashboards.linkLabel',
60+
{
61+
defaultMessage: 'Google Cloud metrics dashboard',
62+
}
63+
),
64+
isOverview: true,
65+
},
66+
],
67+
exportedFields: {
68+
documentationUrl: '{config.docs.beats.metricbeat}/exported-fields-googlecloud.html',
69+
},
70+
},
71+
completionTimeMinutes: 10,
72+
previewImagePath: '/plugins/home/assets/googlecloud_metrics/screenshot.png',
73+
onPrem: onPremInstructions(moduleName, context),
74+
elasticCloud: cloudInstructions(moduleName),
75+
onPremElasticCloud: onPremCloudInstructions(moduleName),
76+
};
77+
}

src/plugins/home/server/tutorials/register.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import { openmetricsMetricsSpecProvider } from './openmetrics_metrics';
9191
import { oracleMetricsSpecProvider } from './oracle_metrics';
9292
import { iisMetricsSpecProvider } from './iis_metrics';
9393
import { azureLogsSpecProvider } from './azure_logs';
94+
import { googlecloudMetricsSpecProvider } from './googlecloud_metrics';
9495

9596
export const builtInTutorials = [
9697
systemLogsSpecProvider,
@@ -168,4 +169,5 @@ export const builtInTutorials = [
168169
oracleMetricsSpecProvider,
169170
iisMetricsSpecProvider,
170171
azureLogsSpecProvider,
172+
googlecloudMetricsSpecProvider,
171173
];

0 commit comments

Comments
 (0)