Skip to content

Commit 814b9d8

Browse files
committed
Merge branch 'main' into sharedux/cleanup-tomountpoint-deprecations-xii-observabilitysolution
2 parents 92a584c + 3ecd73c commit 814b9d8

File tree

71 files changed

+1866
-869
lines changed

Some content is hidden

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

71 files changed

+1866
-869
lines changed

dev_docs/key_concepts/embeddables.mdx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ date: 2024-05-09
77
tags: ['kibana', 'dev', 'contributor', 'api docs']
88
---
99

10-
Embeddable documentation and examples are bundled with Kibana and accessable by running `yarn start --run-examples`.
11-
Navigate to `http://localhost:5601/app/embeddablesApp`.
10+
Embeddable documentation available at [/src/plugins/embeddable/README.md](https://github.com/elastic/kibana/blob/main/src/plugins/embeddable/README.md)

docs/developer/plugin-list.asciidoc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ This API doesn't support angular, for registering angular dev tools, bootstrap a
9999
100100
101101
|{kib-repo}blob/{branch}/src/plugins/embeddable/README.md[embeddable]
102-
|Embeddable documentation and examples are bundled with Kibana and accessable by running yarn start --run-examples.
103-
Navigate to http://localhost:5601/app/embeddablesApp.
102+
|Embeddables are React components that manage their own state, can be serialized and deserialized, and return an API that can be used to interact with them imperatively.
104103
105104
106105
|{kib-repo}blob/{branch}/src/plugins/es_ui_shared/README.md[esUiShared]

examples/embeddable_examples/public/app/overview.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,19 @@
77
*/
88

99
import React from 'react';
10-
11-
import { EuiText } from '@elastic/eui';
10+
import { css } from '@emotion/react';
11+
import { EuiMarkdownFormat } from '@elastic/eui';
12+
// @ts-ignore
13+
import overviewMarkdown from '!!raw-loader!@kbn/embeddable-plugin/README.md';
1214

1315
export const Overview = () => {
1416
return (
15-
<EuiText>
16-
<p>
17-
Embeddables are React components that manage their own state, can be serialized and
18-
deserialized, and return an API that can be used to interact with them imperatively.
19-
</p>
20-
</EuiText>
17+
<EuiMarkdownFormat
18+
css={css`
19+
width: 75%;
20+
`}
21+
>
22+
{overviewMarkdown}
23+
</EuiMarkdownFormat>
2124
);
2225
};

examples/embeddable_examples/public/app/register_embeddable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const RegisterEmbeddable = () => {
2424
<h2>Register a new embeddable type</h2>
2525
<p>
2626
This plugin registers several embeddable types with{' '}
27-
<strong>registerReactEmbeddableFactory</strong> during plugin start. The code example
28-
below shows Search embeddable registration. Notice how the embeddable factory is imported
29-
asynchronously to limit initial page load size.
27+
<strong>registerReactEmbeddableFactory</strong>. The code example below shows Search
28+
embeddable registration. The embeddable factory is imported asynchronously to limit
29+
initial page load size.
3030
</p>
3131
</EuiText>
3232
<EuiSpacer size="s" />

examples/embeddable_examples/public/react_embeddables/search/search_embeddable_renderer.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,11 @@ export function SearchEmbeddableRenderer(props: Props) {
4141
}, [props.timeRange, parentApi.timeRange$]);
4242

4343
return (
44-
<div className="mapEmbeddableContainer">
45-
<ReactEmbeddableRenderer<SearchSerializedState, SearchApi>
46-
type={SEARCH_EMBEDDABLE_ID}
47-
state={initialState}
48-
parentApi={parentApi}
49-
hidePanelChrome={true}
50-
/>
51-
</div>
44+
<ReactEmbeddableRenderer<SearchSerializedState, SearchApi>
45+
type={SEARCH_EMBEDDABLE_ID}
46+
state={initialState}
47+
parentApi={parentApi}
48+
hidePanelChrome={true}
49+
/>
5250
);
5351
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@
10971097
"pretty-ms": "6.0.0",
10981098
"prop-types": "^15.8.1",
10991099
"proxy-from-env": "1.0.0",
1100-
"puppeteer": "22.3.0",
1100+
"puppeteer": "22.8.1",
11011101
"query-string": "^6.13.2",
11021102
"rbush": "^3.0.1",
11031103
"re-resizable": "^6.9.9",

packages/presentation/presentation_publishing/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export {
109109
export {
110110
apiPublishesPanelDescription,
111111
apiPublishesWritablePanelDescription,
112+
getPanelDescription,
112113
type PublishesPanelDescription,
113114
type PublishesWritablePanelDescription,
114115
} from './interfaces/titles/publishes_panel_description';
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the Elastic License
4+
* 2.0 and the Server Side Public License, v 1; you may not use this file except
5+
* in compliance with, at your election, the Elastic License 2.0 or the Server
6+
* Side Public License, v 1.
7+
*/
8+
9+
import { BehaviorSubject } from 'rxjs';
10+
import { getPanelDescription } from './publishes_panel_description';
11+
12+
describe('getPanelDescription', () => {
13+
test('should return default description when description is undefined', () => {
14+
const api = {
15+
panelDescription: new BehaviorSubject<string | undefined>(undefined),
16+
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'),
17+
};
18+
expect(getPanelDescription(api)).toBe('default description');
19+
});
20+
21+
test('should return empty description when description is empty string', () => {
22+
const api = {
23+
panelDescription: new BehaviorSubject<string | undefined>(''),
24+
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'),
25+
};
26+
expect(getPanelDescription(api)).toBe('');
27+
});
28+
29+
test('should return description when description is provided', () => {
30+
const api = {
31+
panelDescription: new BehaviorSubject<string | undefined>('custom description'),
32+
defaultPanelDescription: new BehaviorSubject<string | undefined>('default description'),
33+
};
34+
expect(getPanelDescription(api)).toBe('custom description');
35+
});
36+
});

packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_description.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export interface PublishesPanelDescription {
1313
defaultPanelDescription?: PublishingSubject<string | undefined>;
1414
}
1515

16+
export function getPanelDescription(api: Partial<PublishesPanelDescription>): string | undefined {
17+
return api.panelDescription?.value ?? api.defaultPanelDescription?.value;
18+
}
19+
1620
export type PublishesWritablePanelDescription = PublishesPanelDescription & {
1721
setPanelDescription: (newTitle: string | undefined) => void;
1822
};

packages/presentation/presentation_publishing/interfaces/titles/publishes_panel_title.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ describe('getPanelTitle', () => {
1818
expect(getPanelTitle(api)).toBe('default title');
1919
});
2020

21-
test('should return default title when title is empty string', () => {
21+
test('should return empty title when title is empty string', () => {
2222
const api = {
2323
panelTitle: new BehaviorSubject<string | undefined>(''),
2424
defaultPanelTitle: new BehaviorSubject<string | undefined>('default title'),
2525
};
26-
expect(getPanelTitle(api)).toBe('default title');
26+
expect(getPanelTitle(api)).toBe('');
2727
});
2828

2929
test('should return title when title is provided', () => {

0 commit comments

Comments
 (0)