Skip to content

Commit

Permalink
Merge branch 'master' into visualize_create_menu_test
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Mar 2, 2020
2 parents 1e1846e + 1eca341 commit 755b6a4
Show file tree
Hide file tree
Showing 1,069 changed files with 69,024 additions and 29,353 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -195,3 +195,7 @@
/x-pack/test/detection_engine_api_integration @elastic/siem
/x-pack/test/api_integration/apis/siem @elastic/siem
/x-pack/plugins/case @elastic/siem

# Security Intelligence And Analytics
/x-pack/legacy/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics
/x-pack/plugins/siem/server/lib/detection_engine/rules/prepackaged_rules @elastic/security-intelligence-analytics
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ export interface SavedObjectsServiceSetup

When plugins access the Saved Objects client, a new client is created using the factory provided to `setClientFactory` and wrapped by all wrappers registered through `addClientWrapper`<!-- -->.

All the setup APIs will throw if called after the service has started, and therefor cannot be used from legacy plugin code. Legacy plugins should use the legacy savedObject service until migrated.

## Example 1


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

[Home](./index.md) &gt; [kibana-plugin-server](./kibana-plugin-server.md) &gt; [SavedObjectsTypeMappingDefinition](./kibana-plugin-server.savedobjectstypemappingdefinition.md) &gt; [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md)

## SavedObjectsTypeMappingDefinition.dynamic property

The dynamic property of the mapping. either `false` or 'strict'. Defaults to strict

<b>Signature:</b>

```typescript
dynamic?: false | 'strict';
```
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,6 @@ const typeDefinition: SavedObjectsTypeMappingDefinition = {

| Property | Type | Description |
| --- | --- | --- |
| [properties](./kibana-plugin-server.savedobjectstypemappingdefinition.properties.md) | <code>SavedObjectsMappingProperties</code> | |
| [dynamic](./kibana-plugin-server.savedobjectstypemappingdefinition.dynamic.md) | <code>false &#124; 'strict'</code> | The dynamic property of the mapping. either <code>false</code> or 'strict'. Defaults to strict |
| [properties](./kibana-plugin-server.savedobjectstypemappingdefinition.properties.md) | <code>SavedObjectsMappingProperties</code> | The underlying properties of the type mapping |

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## SavedObjectsTypeMappingDefinition.properties property

The underlying properties of the type mapping

<b>Signature:</b>

```typescript
Expand Down
5 changes: 5 additions & 0 deletions docs/redirects.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ This page has moved. Please see <<reporting-getting-started>>.

This page has moved. Please see <<reporting-getting-started>>.

[role="exclude",id="add-sample-data"]
== Add sample data

This page has moved. Please see <<get-data-in>>.

[role="exclude",id="tilemap"]
== Coordinate map

Expand Down
70 changes: 40 additions & 30 deletions docs/user/getting-started.asciidoc
Original file line number Diff line number Diff line change
@@ -1,54 +1,65 @@
[[getting-started]]
= Getting Started
= Get started

[partintro]
--

You’re new to Kibana and want to give it a try. {kib} has sample data sets and
tutorials to help you get started.
Ready to try out {kib} and see what it can do? To quickest way to get started with {kib} is to set up on Cloud, then add a sample data set that helps you get a handle on the full range of {kib} features.

[float]
=== Sample data
[[cloud-set-up]]
== Set up on Cloud

You can use the <<add-sample-data, sample data
sets>> to take {kib} for a test ride without having
to go through the process of loading data yourself. With one click,
you can install a sample data set and start interacting with
{kib} visualizations in seconds. You can access the sample data
from the {kib} home page.
To access {kib} in a single click, run our hosted Elasticsearch Service on Elastic Cloud.

[float]
. Log into the link:https://cloud.elastic.co/[Elasticsearch Service Console].
If you need an account, register for a link:https://www.elastic.co/cloud/elasticsearch-service/signup[free 14-day trial].

. Click *Create deployment*, then give your deployment a name.

=== Add data tutorials
{kib} has built-in *Add Data* tutorials to help you set up
data flows in the Elastic Stack. These tutorials are available
from the Kibana home page. In *Add Data to Kibana*, find the data type
you’re interested in, and click its button to view a list of available tutorials.
. To use the default options, click *Create deployment*. You can modify the other deployment options, but the default options are great to get started.

Be sure to copy down the password for the `elastic` user and Cloud ID information. You'll need that later.

[float]
=== Hands-on experience
[[get-data-in]]
== Get data into {kib}

The easiest way to get data into {kib} is to add a sample data set.

{kib} has several sample data sets that you can use before loading your own data:

* *Sample eCommerce orders* includes visualizations for tracking product-related information,
such as cost, revenue, and price.

* *Sample flight data* includes visualizations for monitoring flight routes.

The following tutorials walk you through searching, analyzing,
and visualizing data.
* *Sample web logs* includes visualizations for monitoring website traffic.

* <<tutorial-sample-data, Explore Kibana using sample data>>. You'll
learn to filter and query data, edit visualizations, and interact with dashboards.
To use the sample data sets:

* <<tutorial-build-dashboard, Build your own dashboard>>. You'll manually load a data set and build
your own visualizations and dashboard.
. Go to the {kib} home page.

. Click *Load a data set and a {kib} dashboard*.

. Click *View data* and view the prepackaged dashboards, maps, and more.

[role="screenshot"]
image::images/add-sample-data.png[]

NOTE: The timestamps in the sample data sets are relative to when they are installed.
If you uninstall and reinstall a data set, the timestamps change to reflect the most recent installation.

[float]
=== Before you begin
[[getting-started-next-steps]]
== Next steps

Make sure you've <<install, installed Kibana>> and established
a <<connect-to-elasticsearch, connection to Elasticsearch>>.
* To get a hands-on experience creating visualizations, follow the <<tutorial-sample-data, add sample data>> tutorial.

If you are running our hosted Elasticsearch Service on Elastic Cloud, you access Kibana with a single click. (You can {ess-trial}[sign up for a free trial] and start exploring data in minutes.)
* If you're ready to load an actual data set and build a dashboard, follow the <<tutorial-build-dashboard, build your own dashboard>> tutorial.

--

include::{kib-repo-dir}/getting-started/add-sample-data.asciidoc[]

include::{kib-repo-dir}/getting-started/tutorial-sample-data.asciidoc[]

include::{kib-repo-dir}/getting-started/tutorial-full-experience.asciidoc[]
Expand All @@ -60,4 +71,3 @@ include::{kib-repo-dir}/getting-started/tutorial-discovering.asciidoc[]
include::{kib-repo-dir}/getting-started/tutorial-visualizing.asciidoc[]

include::{kib-repo-dir}/getting-started/tutorial-dashboard.asciidoc[]

4 changes: 2 additions & 2 deletions docs/user/index.asciidoc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
include::introduction.asciidoc[]

include::getting-started.asciidoc[]

include::setup.asciidoc[]

include::monitoring/configuring-monitoring.asciidoc[]

include::security/securing-kibana.asciidoc[]

include::getting-started.asciidoc[]

include::discover.asciidoc[]

include::visualize.asciidoc[]
Expand Down
9 changes: 7 additions & 2 deletions examples/ui_action_examples/public/hello_world_action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,16 @@ import { toMountPoint } from '../../../src/plugins/kibana_react/public';

export const HELLO_WORLD_ACTION_TYPE = 'HELLO_WORLD_ACTION_TYPE';

export const createHelloWorldAction = (openModal: OverlayStart['openModal']) =>
createAction<{}>({
interface StartServices {
openModal: OverlayStart['openModal'];
}

export const createHelloWorldAction = (getStartServices: () => Promise<StartServices>) =>
createAction({
type: HELLO_WORLD_ACTION_TYPE,
getDisplayName: () => 'Hello World!',
execute: async () => {
const { openModal } = await getStartServices();
const overlay = openModal(
toMountPoint(
<EuiModalBody>
Expand Down
28 changes: 16 additions & 12 deletions examples/ui_action_examples/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,34 @@
* under the License.
*/

import { Plugin, CoreSetup, CoreStart } from '../../../src/core/public';
import { UiActionsSetup, UiActionsStart } from '../../../src/plugins/ui_actions/public';
import { createHelloWorldAction, HELLO_WORLD_ACTION_TYPE } from './hello_world_action';
import { helloWorldTrigger } from './hello_world_trigger';
import { Plugin, CoreSetup } from '../../../src/core/public';
import { UiActionsSetup } from '../../../src/plugins/ui_actions/public';
import { createHelloWorldAction } from './hello_world_action';
import { helloWorldTrigger, HELLO_WORLD_TRIGGER_ID } from './hello_world_trigger';

interface UiActionExamplesSetupDependencies {
uiActions: UiActionsSetup;
}

interface UiActionExamplesStartDependencies {
uiActions: UiActionsStart;
declare module '../../../src/plugins/ui_actions/public' {
export interface TriggerContextMapping {
[HELLO_WORLD_TRIGGER_ID]: undefined;
}
}

export class UiActionExamplesPlugin
implements
Plugin<void, void, UiActionExamplesSetupDependencies, UiActionExamplesStartDependencies> {
implements Plugin<void, void, UiActionExamplesSetupDependencies> {
public setup(core: CoreSetup, { uiActions }: UiActionExamplesSetupDependencies) {
uiActions.registerTrigger(helloWorldTrigger);
uiActions.attachAction(helloWorldTrigger.id, HELLO_WORLD_ACTION_TYPE);
}

public start(coreStart: CoreStart, deps: UiActionExamplesStartDependencies) {
deps.uiActions.registerAction(createHelloWorldAction(coreStart.overlays.openModal));
const helloWorldAction = createHelloWorldAction(async () => ({
openModal: (await core.getStartServices())[0].overlays.openModal,
}));

uiActions.registerAction(helloWorldAction);
uiActions.attachAction(helloWorldTrigger.id, helloWorldAction.id);
}

public start() {}
public stop() {}
}
30 changes: 19 additions & 11 deletions examples/ui_actions_explorer/public/actions/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ export const EDIT_USER_ACTION = 'EDIT_USER_ACTION';
export const PHONE_USER_ACTION = 'PHONE_USER_ACTION';
export const SHOWCASE_PLUGGABILITY_ACTION = 'SHOWCASE_PLUGGABILITY_ACTION';

export const showcasePluggability = createAction<{}>({
export const showcasePluggability = createAction({
type: SHOWCASE_PLUGGABILITY_ACTION,
getDisplayName: () => 'This is pluggable! Any plugin can inject their actions here.',
execute: async ({}) => alert("Isn't that cool?!"),
execute: async () => alert("Isn't that cool?!"),
});

export const makePhoneCallAction = createAction<{ phone: string }>({
export type PhoneContext = string;

export const makePhoneCallAction = createAction<PhoneContext>({
type: CALL_PHONE_NUMBER_ACTION,
getDisplayName: () => 'Call phone number',
execute: async ({ phone }) => alert(`Pretend calling ${phone}...`),
execute: async phone => alert(`Pretend calling ${phone}...`),
});

export const lookUpWeatherAction = createAction<{ country: string }>({
Expand All @@ -55,11 +57,13 @@ export const lookUpWeatherAction = createAction<{ country: string }>({
},
});

export const viewInMapsAction = createAction<{ country: string }>({
export type CountryContext = string;

export const viewInMapsAction = createAction<CountryContext>({
type: VIEW_IN_MAPS_ACTION,
getIconType: () => 'popout',
getDisplayName: () => 'View in maps',
execute: async ({ country }) => {
execute: async country => {
window.open(`https://www.google.com/maps/place/${country}`, '_blank');
},
});
Expand Down Expand Up @@ -110,11 +114,13 @@ export const createEditUserAction = (getOpenModal: () => Promise<OverlayStart['o
},
});

export interface UserContext {
user: User;
update: (user: User) => void;
}

export const createPhoneUserAction = (getUiActionsApi: () => Promise<UiActionsStart>) =>
createAction<{
user: User;
update: (user: User) => void;
}>({
createAction<UserContext>({
type: PHONE_USER_ACTION,
getDisplayName: () => 'Call phone number',
isCompatible: async ({ user }) => user.phone !== undefined,
Expand All @@ -126,6 +132,8 @@ export const createPhoneUserAction = (getUiActionsApi: () => Promise<UiActionsSt
// to the phone number trigger.
// TODO: we need to figure out the best way to handle these nested actions however, since
// we don't want multiple context menu's to pop up.
(await getUiActionsApi()).executeTriggerActions(PHONE_TRIGGER, { phone: user.phone });
if (user.phone !== undefined) {
(await getUiActionsApi()).executeTriggerActions(PHONE_TRIGGER, user.phone);
}
},
});
2 changes: 1 addition & 1 deletion examples/ui_actions_explorer/public/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const ActionsExplorer = ({ uiActionsApi, openModal }: Props) => {
</EuiText>
<EuiButton
data-test-subj="emitHelloWorldTrigger"
onClick={() => uiActionsApi.executeTriggerActions(HELLO_WORLD_TRIGGER_ID, {})}
onClick={() => uiActionsApi.executeTriggerActions(HELLO_WORLD_TRIGGER_ID, undefined)}
>
Say hello world!
</EuiButton>
Expand Down
11 changes: 11 additions & 0 deletions examples/ui_actions_explorer/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import {
makePhoneCallAction,
showcasePluggability,
SHOWCASE_PLUGGABILITY_ACTION,
UserContext,
CountryContext,
PhoneContext,
} from './actions/actions';

interface StartDeps {
Expand All @@ -45,6 +48,14 @@ interface SetupDeps {
uiActions: UiActionsSetup;
}

declare module '../../../src/plugins/ui_actions/public' {
export interface TriggerContextMapping {
[USER_TRIGGER]: UserContext;
[COUNTRY_TRIGGER]: CountryContext;
[PHONE_TRIGGER]: PhoneContext;
}
}

export class UiActionsExplorerPlugin implements Plugin<void, void, {}, StartDeps> {
public setup(core: CoreSetup<{ uiActions: UiActionsStart }>, deps: SetupDeps) {
deps.uiActions.registerTrigger({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ const createRowData = (
<Fragment>
<EuiButtonEmpty
onClick={() => {
uiActionsApi.executeTriggerActions(COUNTRY_TRIGGER, {
country: user.countryOfResidence,
});
uiActionsApi.executeTriggerActions(COUNTRY_TRIGGER, user.countryOfResidence);
}}
>
{user.countryOfResidence}
Expand All @@ -59,10 +57,9 @@ const createRowData = (
phone: (
<Fragment>
<EuiButtonEmpty
disabled={user.phone === undefined}
onClick={() => {
uiActionsApi.executeTriggerActions(PHONE_TRIGGER, {
phone: user.phone,
});
uiActionsApi.executeTriggerActions(PHONE_TRIGGER, user.phone!);
}}
>
{user.phone}
Expand Down
Loading

0 comments on commit 755b6a4

Please sign in to comment.