Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/simulate_ingest_pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored May 26, 2020
2 parents e0b71da + 84993c6 commit 9cc5fd3
Show file tree
Hide file tree
Showing 7,369 changed files with 38,099 additions and 41,092 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 6 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ELASTIC_LICENSE_HEADER = `
`;

const allMochaRulesOff = {};
Object.keys(require('eslint-plugin-mocha').rules).forEach(k => {
Object.keys(require('eslint-plugin-mocha').rules).forEach((k) => {
allMochaRulesOff['mocha/' + k] = 'off';
});

Expand Down Expand Up @@ -197,6 +197,11 @@ module.exports = {
from: ['src/core/utils/**/*'],
errorMessage: `Plugins may only import from src/core/server and src/core/public.`,
},
{
target: ['(src|x-pack)/plugins/*/public/**/*'],
from: ['(src|x-pack)/plugins/*/server/**/*'],
errorMessage: `Public code can not import from server, use a common directory.`,
},
{
target: [
'(src|x-pack)/legacy/**/*',
Expand Down
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,14 @@ module.exports = {
};
```

APM [Real User Monitoring agent](https://www.elastic.co/guide/en/apm/agent/rum-js/current/index.html) is not available in the Kibana distributables,
however the agent can be enabled by setting `ELASTIC_APM_ACTIVE` to `true`.
flags
```
ELASTIC_APM_ACTIVE=true yarn start
// activates both Node.js and RUM agent
```

Once the agent is active, it will trace all incoming HTTP requests to Kibana, monitor for errors, and collect process-level metrics.
The collected data will be sent to the APM Server and is viewable in the APM UI in Kibana.

Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

require('./src/setup_node_env');

module.exports = function(grunt) {
module.exports = function (grunt) {
// set the config once before calling load-grunt-config
// and once during so that we have access to it via
// grunt.config.get() within the config files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

Returns an URL to a given app, including the global base path. By default, the URL is relative (/basePath/app/my-app). Use the `absolute` option to generate an absolute url (http://host:port/basePath/app/my-app)

Note that when generating absolute urls, the protocol, host and port are determined from the browser location.
Note that when generating absolute urls, the origin (protocol, host and port) are determined from the browser's location.

<b>Signature:</b>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ export interface ApplicationStart

| Method | Description |
| --- | --- |
| [getUrlForApp(appId, options)](./kibana-plugin-core-public.applicationstart.geturlforapp.md) | Returns an URL to a given app, including the global base path. By default, the URL is relative (/basePath/app/my-app). Use the <code>absolute</code> option to generate an absolute url (http://host:port/basePath/app/my-app)<!-- -->Note that when generating absolute urls, the protocol, host and port are determined from the browser location. |
| [getUrlForApp(appId, options)](./kibana-plugin-core-public.applicationstart.geturlforapp.md) | Returns an URL to a given app, including the global base path. By default, the URL is relative (/basePath/app/my-app). Use the <code>absolute</code> option to generate an absolute url (http://host:port/basePath/app/my-app)<!-- -->Note that when generating absolute urls, the origin (protocol, host and port) are determined from the browser's location. |
| [navigateToApp(appId, options)](./kibana-plugin-core-public.applicationstart.navigatetoapp.md) | Navigate to a given app |
| [navigateToUrl(url)](./kibana-plugin-core-public.applicationstart.navigatetourl.md) | Navigate to given url, which can either be an absolute url or a relative path, in a SPA friendly way when possible.<!-- -->If all these criteria are true for the given url: - (only for absolute URLs) The origin of the URL matches the origin of the browser's current location - The pathname of the URL starts with the current basePath (eg. /mybasepath/s/my-space) - The pathname segment after the basePath matches any known application route (eg. /app/<id>/ or any application's <code>appRoute</code> configuration)<!-- -->Then a SPA navigation will be performed using <code>navigateToApp</code> using the corresponding application and path. Otherwise, fallback to a full page reload to navigate to the url using <code>window.location.assign</code> |
| [registerMountContext(contextName, provider)](./kibana-plugin-core-public.applicationstart.registermountcontext.md) | Register a context provider for application mounting. Will only be available to applications that depend on the plugin that registered this context. Deprecated, use [CoreSetup.getStartServices](./kibana-plugin-core-public.coresetup.getstartservices.md)<!-- -->. |

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

[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [ApplicationStart](./kibana-plugin-core-public.applicationstart.md) &gt; [navigateToUrl](./kibana-plugin-core-public.applicationstart.navigatetourl.md)

## ApplicationStart.navigateToUrl() method

Navigate to given url, which can either be an absolute url or a relative path, in a SPA friendly way when possible.

If all these criteria are true for the given url: - (only for absolute URLs) The origin of the URL matches the origin of the browser's current location - The pathname of the URL starts with the current basePath (eg. /mybasepath/s/my-space) - The pathname segment after the basePath matches any known application route (eg. /app/<id>/ or any application's `appRoute` configuration)

Then a SPA navigation will be performed using `navigateToApp` using the corresponding application and path. Otherwise, fallback to a full page reload to navigate to the url using `window.location.assign`

<b>Signature:</b>

```typescript
navigateToUrl(url: string): Promise<void>;
```

## Parameters

| Parameter | Type | Description |
| --- | --- | --- |
| url | <code>string</code> | an absolute url, or a relative path, to navigate to. |

<b>Returns:</b>

`Promise<void>`

## Example


```ts
// current url: `https://kibana:8080/base-path/s/my-space/app/dashboard`

// will call `application.navigateToApp('discover', { path: '/some-path?foo=bar'})`
application.navigateToUrl('https://kibana:8080/base-path/s/my-space/app/discover/some-path?foo=bar')
application.navigateToUrl('/base-path/s/my-space/app/discover/some-path?foo=bar')

// will perform a full page reload using `window.location.assign`
application.navigateToUrl('https://elsewhere:8080/base-path/s/my-space/app/discover/some-path') // origin does not match
application.navigateToUrl('/app/discover/some-path') // does not include the current basePath
application.navigateToUrl('/base-path/s/my-space/app/unknown-app/some-path') // unknown application

```

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<b>Signature:</b>

```typescript
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "intl" | "indexPatterns" | "refreshInterval" | "customSubmitButton" | "screenTitle" | "dataTestSubj" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, "query" | "isLoading" | "filters" | "indexPatterns" | "refreshInterval" | "customSubmitButton" | "screenTitle" | "dataTestSubj" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "intl" | "indexPatterns" | "refreshInterval" | "customSubmitButton" | "screenTitle" | "dataTestSubj" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "onRefresh" | "timeHistory" | "onFiltersUpdated" | "onRefreshChange"> & ReactIntl.InjectedIntlProps>;
SearchBar: React.ComponentClass<Pick<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "intl" | "indexPatterns" | "customSubmitButton" | "screenTitle" | "dataTestSubj" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "timeHistory" | "onFiltersUpdated">, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "indexPatterns" | "customSubmitButton" | "screenTitle" | "dataTestSubj" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "timeHistory" | "onFiltersUpdated">, any> & {
WrappedComponent: React.ComponentType<Pick<SearchBarProps, "query" | "isLoading" | "filters" | "onRefresh" | "onRefreshChange" | "refreshInterval" | "intl" | "indexPatterns" | "customSubmitButton" | "screenTitle" | "dataTestSubj" | "showQueryBar" | "showQueryInput" | "showFilterBar" | "showDatePicker" | "showAutoRefreshOnly" | "isRefreshPaused" | "dateRangeFrom" | "dateRangeTo" | "showSaveQuery" | "savedQuery" | "onQueryChange" | "onQuerySubmit" | "onSaved" | "onSavedQueryUpdated" | "onClearSavedQuery" | "timeHistory" | "onFiltersUpdated"> & ReactIntl.InjectedIntlProps>;
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const AlwaysFiringExpression: React.FunctionComponent<AlwaysFiringParamsP
<EuiFieldNumber
name="instances"
value={instances}
onChange={event => {
onChange={(event) => {
setAlertParams('instances', event.target.valueAsNumber);
}}
/>
Expand Down
10 changes: 5 additions & 5 deletions examples/alerting_example/public/alert_types/astros.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ interface PeopleinSpaceParamsProps {
}

function isValueInEnum(enumeratin: Record<string, any>, value: any): boolean {
return !!Object.values(enumeratin).find(enumVal => enumVal === value);
return !!Object.values(enumeratin).find((enumVal) => enumVal === value);
}

export function getAlertType(): AlertTypeModel {
Expand Down Expand Up @@ -139,7 +139,7 @@ export const PeopleinSpaceExpression: React.FunctionComponent<PeopleinSpaceParam

const errorsCallout = flatten(
Object.entries(errors).map(([field, errs]: [string, string[]]) =>
errs.map(e => (
errs.map((e) => (
<p>
<EuiTextColor color="accent">{field}:</EuiTextColor>`: ${errs}`
</p>
Expand Down Expand Up @@ -189,7 +189,7 @@ export const PeopleinSpaceExpression: React.FunctionComponent<PeopleinSpaceParam
<EuiSelect
compressed
value={craftTrigger.craft}
onChange={event => {
onChange={(event) => {
setAlertParams('craft', event.target.value);
setCraftTrigger({
craft: event.target.value,
Expand Down Expand Up @@ -238,7 +238,7 @@ export const PeopleinSpaceExpression: React.FunctionComponent<PeopleinSpaceParam
<EuiSelect
compressed
value={outerSpaceCapacityTrigger.op}
onChange={event => {
onChange={(event) => {
setAlertParams('op', event.target.value);
setOuterSpaceCapacity({
...outerSpaceCapacityTrigger,
Expand All @@ -258,7 +258,7 @@ export const PeopleinSpaceExpression: React.FunctionComponent<PeopleinSpaceParam
<EuiFieldNumber
compressed
value={outerSpaceCapacityTrigger.outerSpaceCapacity}
onChange={event => {
onChange={(event) => {
setAlertParams('outerSpaceCapacity', event.target.valueAsNumber);
setOuterSpaceCapacity({
...outerSpaceCapacityTrigger,
Expand Down
5 changes: 1 addition & 4 deletions examples/alerting_example/server/alert_types/astros.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@ export const alertType: AlertType = {

if (getOperator(op)(peopleInCraft.length, outerSpaceCapacity)) {
peopleInCraft.forEach(({ craft, name }) => {
services
.alertInstanceFactory(name)
.replaceState({ craft })
.scheduleActions('default');
services.alertInstanceFactory(name).replaceState({ craft }).scheduleActions('default');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const CountUntil: React.FC<Props> = ({ fetchStreaming }) => {
<EuiFieldNumber
placeholder="Some integer"
value={data}
onChange={e => setData(Number(e.target.value))}
onChange={(e) => setData(Number(e.target.value))}
/>
</EuiFormRow>
<EuiButton type="submit" fill onClick={handleSubmit}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ export const DoubleIntegers: React.FC<Props> = ({ double }) => {
setShowingResults(true);
const nums = numbers
.split('\n')
.map(num => num.trim())
.map((num) => num.trim())
.filter(Boolean)
.map(Number);
counter.set(nums.length);
nums.forEach(num => {
nums.forEach((num) => {
double({ num }).then(
result => {
(result) => {
if (!isMounted()) return;
counter.dec();
pushResult({ num, result });
},
error => {
(error) => {
if (!isMounted()) return;
counter.dec();
pushResult({ num, error });
Expand Down Expand Up @@ -94,7 +94,7 @@ export const DoubleIntegers: React.FC<Props> = ({ double }) => {
fullWidth
placeholder="Enter numbers in milliseconds separated by new line"
value={numbers}
onChange={e => setNumbers(e.target.value)}
onChange={(e) => setNumbers(e.target.value)}
/>
</EuiFormRow>
<EuiButton type="submit" fill onClick={handleSubmit}>
Expand Down
2 changes: 1 addition & 1 deletion examples/bfetch_explorer/public/containers/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const App: React.FC = () => {
const routeElements: React.ReactElement[] = [];
for (const { items } of routes) {
for (const { id, component } of items) {
routeElements.push(<Route key={id} path={`/${id}`} render={props => component} />);
routeElements.push(<Route key={id} path={`/${id}`} render={(props) => component} />);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const Sidebar: React.FC<SidebarProps> = () => {
id,
name: title,
isSelected: true,
items: items.map(route => ({
items: items.map((route) => ({
id: route.id,
name: route.title,
onClick: () => history.push(`/${route.id}`),
Expand Down
2 changes: 1 addition & 1 deletion examples/bfetch_explorer/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class BfetchExplorerPlugin implements Plugin {
// Validate inputs.
if (num < 0) throw new Error('Invalid number');
// Wait number of specified milliseconds.
await new Promise(r => setTimeout(r, num));
await new Promise((r) => setTimeout(r, num));
// Double the number and send it back.
return { num: 2 * num };
},
Expand Down
4 changes: 2 additions & 2 deletions examples/demo_search/server/async_demo_search_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const totalMap = new Map<string, number>();

export const asyncDemoSearchStrategyProvider: TSearchStrategyProvider<typeof ASYNC_DEMO_SEARCH_STRATEGY> = () => {
return {
search: async request => {
search: async (request) => {
const id = request.id ?? generateId();

const loaded = (loadedMap.get(id) ?? 0) + 1;
Expand All @@ -52,7 +52,7 @@ export const asyncDemoSearchStrategyProvider: TSearchStrategyProvider<typeof ASY
const fibonacciSequence = getFibonacciSequence(loaded);
return { id, total, loaded, fibonacciSequence };
},
cancel: async id => {
cancel: async (id) => {
loadedMap.delete(id);
totalMap.delete(id);
},
Expand Down
2 changes: 1 addition & 1 deletion examples/demo_search/server/demo_search_strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DEMO_SEARCH_STRATEGY } from '../common';

export const demoSearchStrategyProvider: TSearchStrategyProvider<typeof DEMO_SEARCH_STRATEGY> = () => {
return {
search: request => {
search: (request) => {
return Promise.resolve({
greeting:
request.mood === 'happy'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function renderList(
embeddableServices: EmbeddableStart
) {
let number = 0;
const list = Object.values(panels).map(panel => {
const list = Object.values(panels).map((panel) => {
const child = embeddable.getChild(panel.explicitInput.id);
number++;
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function wrapSearchTerms(task: string, search?: string) {
}

function renderTasks(tasks: MultiTaskTodoInput['tasks'], search?: string) {
return tasks.map(task => (
return tasks.map((task) => (
<EuiListGroupItem
key={task}
data-test-subj="multiTaskTodoTask"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function getHasMatch(tasks: string[], title?: string, search?: string) {

if (title && title.match(search)) return true;

const match = tasks.find(task => task.match(search));
const match = tasks.find((task) => task.match(search));
if (match) return true;

return false;
Expand Down
Loading

0 comments on commit 9cc5fd3

Please sign in to comment.