Skip to content

Commit

Permalink
Merge branch 'master' into hide_severity_column
Browse files Browse the repository at this point in the history
  • Loading branch information
kibanamachine authored Aug 18, 2021
2 parents 7264126 + fc1a2bb commit 1de99aa
Show file tree
Hide file tree
Showing 213 changed files with 5,244 additions and 1,391 deletions.
Binary file modified dev_docs/assets/kibana_template_no_data_config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions dev_docs/tutorials/kibana_page_template.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ This is a built-in configuration that displays a very specific UI and requires v

The `noDataConfig` is of type [`NoDataPagProps`](https://github.com/elastic/kibana/blob/master/src/plugins/kibana_react/public/page_template/no_data_page/no_data_page.tsx):

1. `solution: string`: Single name for the current solution, used to auto-generate the title, logo, description, and button label *(required)*
1. `solution: string`: Single name for the current solution, used to auto-generate the title, logo, and description *(required)*
2. `docsLink: string`: Required to set the docs link for the whole solution *(required)*
3. `logo?: string`: Optionally replace the auto-generated logo
4. `pageTitle?: string`: Optionally replace the auto-generated page title (h1)
Expand All @@ -136,7 +136,7 @@ The `noDataConfig` is of type [`NoDataPagProps`](https://github.com/elastic/kiba

There are two main actions for adding data that we promote throughout Kibana, Elastic Agent and Beats. They are added to the cards that are displayed by using the keys `elasticAgent` and `beats` respectively. For consistent messaging, these two cards are pre-configured but require specific `href`s and/or `onClick` handlers for directing the user to the right location for that solution.

It also accepts a `recommended` prop as a boolean to promote one or more of the cards through visuals added to the UI. It will also place the `recommended` ones first in the list. By default, the configuration will recommend `elasticAgent`. Optionally you can also replace the `button` label by passing a string, or the whole component by passing a `ReactNode`.
It also accepts a `recommended` prop as a boolean to promote one or more of the cards through visuals added to the UI. It will also place the `recommended` ones first in the list. Optionally you can also replace the `button` label by passing a string, or the whole component by passing a `ReactNode`.


```tsx
Expand All @@ -145,18 +145,20 @@ const hasData = checkForData();

// No data configuration
const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = {
solution: 'Observability',
solution: 'Analytics',
logo: 'logoKibana',
docsLink: '#',
actions: {
elasticAgent: {
beats: {
href: '#',
},
beats: {
elasticAgent: {
href: '#',
},
},
};

// Conditionally apply the configuration if there is no data
<KibanaPageTemplate
solutionNav={/* Solution navigation still show if it exists and use the right template type */}
pageHeader={/* Page header will be ignored */}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface EmbeddableEditorState
| --- | --- | --- |
| [embeddableId](./kibana-plugin-plugins-embeddable-public.embeddableeditorstate.embeddableid.md) | <code>string</code> | |
| [originatingApp](./kibana-plugin-plugins-embeddable-public.embeddableeditorstate.originatingapp.md) | <code>string</code> | |
| [originatingPath](./kibana-plugin-plugins-embeddable-public.embeddableeditorstate.originatingpath.md) | <code>string</code> | |
| [searchSessionId](./kibana-plugin-plugins-embeddable-public.embeddableeditorstate.searchsessionid.md) | <code>string</code> | Pass current search session id when navigating to an editor, Editors could use it continue previous search session |
| [valueInput](./kibana-plugin-plugins-embeddable-public.embeddableeditorstate.valueinput.md) | <code>EmbeddableInput</code> | |

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [kibana-plugin-plugins-embeddable-public](./kibana-plugin-plugins-embeddable-public.md) &gt; [EmbeddableEditorState](./kibana-plugin-plugins-embeddable-public.embeddableeditorstate.md) &gt; [originatingPath](./kibana-plugin-plugins-embeddable-public.embeddableeditorstate.originatingpath.md)

## EmbeddableEditorState.originatingPath property

<b>Signature:</b>

```typescript
originatingPath?: string;
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"dependencies": {
"@elastic/apm-rum": "^5.8.0",
"@elastic/apm-rum-react": "^1.2.11",
"@elastic/charts": "33.2.2",
"@elastic/charts": "34.0.0",
"@elastic/datemath": "link:bazel-bin/packages/elastic-datemath",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch-canary@^8.0.0-canary.17",
"@elastic/ems-client": "7.15.0",
Expand Down Expand Up @@ -379,6 +379,7 @@
"redux-saga": "^1.1.3",
"redux-thunk": "^2.3.0",
"redux-thunks": "^1.0.0",
"remark-stringify": "^9.0.0",
"regenerator-runtime": "^0.13.3",
"request": "^2.88.0",
"require-in-the-middle": "^5.0.2",
Expand Down
1 change: 1 addition & 0 deletions src/plugins/embeddable/public/lib/state_transfer/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const EMBEDDABLE_EDITOR_STATE_KEY = 'embeddable_editor_state';
*/
export interface EmbeddableEditorState {
originatingApp: string;
originatingPath?: string;
embeddableId?: string;
valueInput?: EmbeddableInput;

Expand Down
2 changes: 2 additions & 0 deletions src/plugins/embeddable/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,8 @@ export interface EmbeddableEditorState {
embeddableId?: string;
// (undocumented)
originatingApp: string;
// (undocumented)
originatingPath?: string;
searchSessionId?: string;
// (undocumented)
valueInput?: EmbeddableInput;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ export const getSavedObjects = (): SavedObject[] => [
fieldFormatMap:
'{"hour_of_day":{"id":"number","params":{"pattern":"00"}},"AvgTicketPrice":{"id":"number","params":{"pattern":"$0,0.[00]"}}}',
runtimeFieldMap:
'{"hour_of_day":{"type":"long","script":{"source":"emit(doc[\'timestamp\'].value.hourOfDay);"}}}',
'{"hour_of_day":{"type":"long","script":{"source":"emit(doc[\'timestamp\'].value.getHour());"}}}',
},
references: [],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import { CoreStart } from 'kibana/public';
import { i18n } from '@kbn/i18n';
import {
RedirectAppLinks,
useKibana,
Expand Down Expand Up @@ -73,7 +74,9 @@ export const Overview: FC<Props> = ({ newsFetchResult, solutions, features }) =>
const manageDataFeatures = getFeaturesByCategory(FeatureCatalogueCategory.ADMIN);
const devTools = findFeatureById('console');
const noDataConfig: KibanaPageTemplateProps['noDataConfig'] = {
solution: 'Analytics',
solution: i18n.translate('kibanaOverview.noDataConfig.solutionName', {
defaultMessage: `Analytics`,
}),
logo: 'logoKibana',
actions: {
beats: {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
* Side Public License, v 1.
*/

/* eslint-disable @elastic/eui/href-or-on-click */

import React, { FunctionComponent } from 'react';
import { i18n } from '@kbn/i18n';
import { CoreStart } from 'kibana/public';
Expand All @@ -24,8 +22,9 @@ export type ElasticAgentCardProps = NoDataPageActions & {
*/
export const ElasticAgentCard: FunctionComponent<ElasticAgentCardProps> = ({
solution,
recommended = true,
href = 'app/integrations/browse',
recommended,
title,
href,
button,
...cardRest
}) => {
Expand All @@ -35,30 +34,26 @@ export const ElasticAgentCard: FunctionComponent<ElasticAgentCardProps> = ({
const addBasePath = http.basePath.prepend;
const basePathUrl = '/plugins/kibanaReact/assets/';

const defaultCTAtitle = i18n.translate('kibana-react.noDataPage.elasticAgentCard.title', {
defaultMessage: 'Add Elastic Agent',
});

const footer =
typeof button !== 'string' && typeof button !== 'undefined' ? (
button
) : (
<EuiButton href={href} onClick={cardRest?.onClick} target={cardRest?.target} fill>
{button ||
i18n.translate('kibana-react.noDataPage.elasticAgentCard.buttonLabel', {
defaultMessage: 'Find an integration for {solution}',
values: { solution },
})}
</EuiButton>
// The href and/or onClick are attached to the whole Card, so the button is just for show.
// Do not add the behavior here too or else it will propogate through
<EuiButton fill>{button || title || defaultCTAtitle}</EuiButton>
);

return (
<EuiCard
paddingSize="l"
href={href}
title={i18n.translate('kibana-react.noDataPage.elasticAgentCard.title', {
defaultMessage: 'Add a {solution} integration',
values: { solution },
})}
href={href ?? addBasePath('/app/integrations/browse')}
title={title || defaultCTAtitle}
description={i18n.translate('kibana-react.noDataPage.elasticAgentCard.description', {
defaultMessage: `The Elastic Agent provides a simple, unified way to
collect data from your machines.`,
defaultMessage: `Use Elastic Agent for a simple, unified way to collect data from your machines.`,
})}
image={addBasePath(`${basePathUrl}elastic_agent_card.svg`)}
betaBadgeLabel={recommended ? NO_DATA_RECOMMENDED : undefined}
Expand Down
Loading

0 comments on commit 1de99aa

Please sign in to comment.