Skip to content

Commit 1ec3487

Browse files
committed
Merge remote-tracking branch 'upstream/master' into action-index-not-able-to-clean
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
2 parents ec43002 + b7f2a01 commit 1ec3487

File tree

305 files changed

+2765
-2075
lines changed

Some content is hidden

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

305 files changed

+2765
-2075
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
1414
/src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
1515
/src/plugins/vis_type_xy/ @elastic/kibana-app
16+
/src/plugins/vis_type_table/ @elastic/kibana-app
1617
/src/plugins/kibana_legacy/ @elastic/kibana-app
1718
/src/plugins/vis_type_timelion/ @elastic/kibana-app
1819
/src/plugins/dashboard/ @elastic/kibana-app

.i18nrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"visDefaultEditor": "src/plugins/vis_default_editor",
4949
"visTypeMarkdown": "src/plugins/vis_type_markdown",
5050
"visTypeMetric": "src/plugins/vis_type_metric",
51-
"visTypeTable": "src/legacy/core_plugins/vis_type_table",
51+
"visTypeTable": "src/plugins/vis_type_table",
5252
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
5353
"visTypeTimeseries": ["src/legacy/core_plugins/vis_type_timeseries", "src/plugins/vis_type_timeseries"],
5454
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",

docs/images/clone_panel.gif

798 KB
Loading

docs/setup/production.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ server.port
133133
Settings that must be the same:
134134
--------
135135
xpack.security.encryptionKey //decrypting session cookies
136-
xpack.reporting.encryptionKey //decrypting reports stored in Elasticsearch
136+
xpack.reporting.encryptionKey //decrypting reports
137+
xpack.encryptedSavedObjects.encryptionKey // decrypting saved objects
137138
--------
138139

139140
Separate configuration files can be used from the command line by using the `-c` flag:

docs/user/dashboard.asciidoc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@ to the new dimensions.
9898
* To delete a panel, open the panel menu and select *Delete from dashboard.* Deleting a panel from a
9999
dashboard does *not* delete the saved visualization or search.
100100

101+
[float]
102+
[[cloning-a-panel]]
103+
=== Clone dashboard elements
104+
105+
In *Edit* mode, you can clone any panel on a dashboard.
106+
107+
To clone an existing panel, open the panel menu of the element you wish to clone, then select *Clone panel*.
108+
109+
* Cloned panels appear beside the original, and will move other panels down to make room if necessary.
110+
111+
* Clones support all of the original panel's functionality, including renaming, editing, and cloning.
112+
113+
* All cloned visualizations will appear in the visualization list.
114+
115+
[role="screenshot"]
116+
image:images/clone_panel.gif[clone panel]
117+
118+
101119
[float]
102120
[[viewing-detailed-information]]
103121
=== Inspect and edit elements

examples/state_containers_examples/public/todo/app.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import { AppMountParameters } from 'kibana/public';
2121
import ReactDOM from 'react-dom';
2222
import React from 'react';
23-
import { createHashHistory, createBrowserHistory } from 'history';
23+
import { createHashHistory } from 'history';
2424
import { TodoAppPage } from './todo';
2525

2626
export interface AppOptions {
@@ -35,13 +35,10 @@ export enum History {
3535
}
3636

3737
export const renderApp = (
38-
{ appBasePath, element }: AppMountParameters,
38+
{ appBasePath, element, history: platformHistory }: AppMountParameters,
3939
{ appInstanceId, appTitle, historyType }: AppOptions
4040
) => {
41-
const history =
42-
historyType === History.Browser
43-
? createBrowserHistory({ basename: appBasePath })
44-
: createHashHistory();
41+
const history = historyType === History.Browser ? platformHistory : createHashHistory();
4542
ReactDOM.render(
4643
<TodoAppPage
4744
history={history}
@@ -54,8 +51,7 @@ export const renderApp = (
5451
const currentAppUrl = stripTrailingSlash(history.createHref(history.location));
5552
if (historyType === History.Browser) {
5653
// browser history
57-
const basePath = stripTrailingSlash(appBasePath);
58-
return currentAppUrl === basePath && !history.location.search && !history.location.hash;
54+
return currentAppUrl === '' && !history.location.search && !history.location.hash;
5955
} else {
6056
// hashed history
6157
return currentAppUrl === '#' && !history.location.search;

examples/state_containers_examples/public/todo/todo.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,20 @@ const TodoApp: React.FC<TodoAppProps> = ({ filter }) => {
9191
return (
9292
<>
9393
<div>
94-
<Link to={{ ...location, pathname: '/' }}>
94+
<Link to={{ ...location, pathname: '/' }} data-test-subj={'filterLinkAll'}>
9595
<EuiButton size={'s'} color={!filter ? 'primary' : 'secondary'}>
9696
All
9797
</EuiButton>
9898
</Link>
99-
<Link to={{ ...location, pathname: '/completed' }}>
99+
<Link to={{ ...location, pathname: '/completed' }} data-test-subj={'filterLinkCompleted'}>
100100
<EuiButton size={'s'} color={filter === 'completed' ? 'primary' : 'secondary'}>
101101
Completed
102102
</EuiButton>
103103
</Link>
104-
<Link to={{ ...location, pathname: '/not-completed' }}>
104+
<Link
105+
to={{ ...location, pathname: '/not-completed' }}
106+
data-test-subj={'filterLinkNotCompleted'}
107+
>
105108
<EuiButton size={'s'} color={filter === 'not-completed' ? 'primary' : 'secondary'}>
106109
Not Completed
107110
</EuiButton>
@@ -121,6 +124,7 @@ const TodoApp: React.FC<TodoAppProps> = ({ filter }) => {
121124
});
122125
}}
123126
label={todo.text}
127+
data-test-subj={`todoCheckbox-${todo.id}`}
124128
/>
125129
<EuiButton
126130
style={{ marginLeft: '8px' }}

examples/state_containers_examples/public/with_data_services/application.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
import React from 'react';
2121
import ReactDOM from 'react-dom';
22-
import { createBrowserHistory } from 'history';
2322
import { AppMountParameters, CoreStart } from '../../../../src/core/public';
2423
import { AppPluginDependencies } from './types';
2524
import { StateDemoApp } from './components/app';
@@ -28,9 +27,8 @@ import { createKbnUrlStateStorage } from '../../../../src/plugins/kibana_utils/p
2827
export const renderApp = (
2928
{ notifications, http }: CoreStart,
3029
{ navigation, data }: AppPluginDependencies,
31-
{ appBasePath, element }: AppMountParameters
30+
{ appBasePath, element, history }: AppMountParameters
3231
) => {
33-
const history = createBrowserHistory({ basename: appBasePath });
3432
const kbnUrlStateStorage = createKbnUrlStateStorage({ useHash: false, history });
3533

3634
ReactDOM.render(

packages/kbn-config-schema/src/types/object_type.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919

2020
import { schema } from '..';
21+
import { TypeOf } from './object_type';
2122

2223
test('returns value by default', () => {
2324
const type = schema.object({
@@ -350,3 +351,26 @@ test('unknowns = `ignore` affects only own keys', () => {
350351
})
351352
).toThrowErrorMatchingInlineSnapshot(`"[foo.baz]: definition for this key is missing"`);
352353
});
354+
355+
test('handles optional properties', () => {
356+
const type = schema.object({
357+
required: schema.string(),
358+
optional: schema.maybe(schema.string()),
359+
});
360+
361+
type SchemaType = TypeOf<typeof type>;
362+
363+
let foo: SchemaType = {
364+
required: 'foo',
365+
};
366+
foo = {
367+
required: 'hello',
368+
optional: undefined,
369+
};
370+
foo = {
371+
required: 'hello',
372+
optional: 'bar',
373+
};
374+
375+
expect(foo).toBeDefined();
376+
});

packages/kbn-config-schema/src/types/object_type.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,26 @@ export type Props = Record<string, Type<any>>;
2626

2727
export type TypeOf<RT extends Type<any>> = RT['type'];
2828

29+
type OptionalProperties<Base extends Props> = Pick<
30+
Base,
31+
{
32+
[Key in keyof Base]: undefined extends TypeOf<Base[Key]> ? Key : never;
33+
}[keyof Base]
34+
>;
35+
36+
type RequiredProperties<Base extends Props> = Pick<
37+
Base,
38+
{
39+
[Key in keyof Base]: undefined extends TypeOf<Base[Key]> ? never : Key;
40+
}[keyof Base]
41+
>;
42+
2943
// Because of https://github.com/Microsoft/TypeScript/issues/14041
3044
// this might not have perfect _rendering_ output, but it will be typed.
31-
export type ObjectResultType<P extends Props> = Readonly<{ [K in keyof P]: TypeOf<P[K]> }>;
45+
export type ObjectResultType<P extends Props> = Readonly<
46+
{ [K in keyof OptionalProperties<P>]?: TypeOf<P[K]> } &
47+
{ [K in keyof RequiredProperties<P>]: TypeOf<P[K]> }
48+
>;
3249

3350
interface UnknownOptions {
3451
/**
@@ -40,9 +57,7 @@ interface UnknownOptions {
4057
unknowns?: 'allow' | 'ignore' | 'forbid';
4158
}
4259

43-
export type ObjectTypeOptions<P extends Props = any> = TypeOptions<
44-
{ [K in keyof P]: TypeOf<P[K]> }
45-
> &
60+
export type ObjectTypeOptions<P extends Props = any> = TypeOptions<ObjectResultType<P>> &
4661
UnknownOptions;
4762

4863
export class ObjectType<P extends Props = any> extends Type<ObjectResultType<P>> {

0 commit comments

Comments
 (0)