Skip to content

Commit b9f327b

Browse files
Merge branch 'master' into elliptic
2 parents f3b0075 + 51e51ca commit b9f327b

261 files changed

Lines changed: 8603 additions & 1766 deletions

File tree

Some content is hidden

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

.eslintrc.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,6 @@ module.exports = {
8282
'react-hooks/exhaustive-deps': 'off',
8383
},
8484
},
85-
{
86-
files: ['src/legacy/core_plugins/vis_type_markdown/**/*.{js,ts,tsx}'],
87-
rules: {
88-
'react-hooks/exhaustive-deps': 'off',
89-
},
90-
},
9185
{
9286
files: ['src/legacy/core_plugins/vis_type_table/**/*.{js,ts,tsx}'],
9387
rules: {
@@ -347,9 +341,8 @@ module.exports = {
347341
'src/fixtures/**/*.js', // TODO: this directory needs to be more obviously "public" (or go away)
348342
],
349343
settings: {
350-
// instructs import/no-extraneous-dependencies to treat modules
351-
// in plugins/ or ui/ namespace as "core modules" so they don't
352-
// trigger failures for not being listed in package.json
344+
// instructs import/no-extraneous-dependencies to treat certain modules
345+
// as core modules, even if they aren't listed in package.json
353346
'import/core-modules': [
354347
'plugins',
355348
'legacy/ui',

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
/packages/kbn-es/ @elastic/kibana-operations
8787
/packages/kbn-pm/ @elastic/kibana-operations
8888
/packages/kbn-test/ @elastic/kibana-operations
89+
/packages/kbn-ui-shared-deps/ @elastic/kibana-operations
8990
/src/legacy/server/keystore/ @elastic/kibana-operations
9091
/src/legacy/server/pid/ @elastic/kibana-operations
9192
/src/legacy/server/sass/ @elastic/kibana-operations

docs/visualize/visualize_rollup_data.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ beta[]
66

77
You can visualize your rolled up data in a variety of charts, tables, maps, and
88
more. Most visualizations support rolled up data, with the exception of
9-
Timelion, TSVB, and Vega visualizations.
9+
Timelion and Vega visualizations.
1010

1111
To get started, go to *Management > Kibana > Index patterns.*
1212
If a rollup index is detected in the cluster, *Create index pattern*
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"id": "stateContainersExamples",
3+
"version": "0.0.1",
4+
"kibanaVersion": "kibana",
5+
"configPath": ["state_containers_examples"],
6+
"server": false,
7+
"ui": true,
8+
"requiredPlugins": [],
9+
"optionalPlugins": []
10+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "state_containers_examples",
3+
"version": "1.0.0",
4+
"main": "target/examples/state_containers_examples",
5+
"kibana": {
6+
"version": "kibana",
7+
"templateVersion": "1.0.0"
8+
},
9+
"license": "Apache-2.0",
10+
"scripts": {
11+
"kbn": "node ../../scripts/kbn.js",
12+
"build": "rm -rf './target' && tsc"
13+
},
14+
"devDependencies": {
15+
"typescript": "3.7.2"
16+
}
17+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { AppMountParameters } from 'kibana/public';
21+
import ReactDOM from 'react-dom';
22+
import React from 'react';
23+
import { createHashHistory, createBrowserHistory } from 'history';
24+
import { TodoAppPage } from './todo';
25+
26+
export interface AppOptions {
27+
appInstanceId: string;
28+
appTitle: string;
29+
historyType: History;
30+
}
31+
32+
export enum History {
33+
Browser,
34+
Hash,
35+
}
36+
37+
export const renderApp = (
38+
{ appBasePath, element }: AppMountParameters,
39+
{ appInstanceId, appTitle, historyType }: AppOptions
40+
) => {
41+
const history =
42+
historyType === History.Browser
43+
? createBrowserHistory({ basename: appBasePath })
44+
: createHashHistory();
45+
ReactDOM.render(
46+
<TodoAppPage
47+
history={history}
48+
appInstanceId={appInstanceId}
49+
appTitle={appTitle}
50+
appBasePath={appBasePath}
51+
isInitialRoute={() => {
52+
const stripTrailingSlash = (path: string) =>
53+
path.charAt(path.length - 1) === '/' ? path.substr(0, path.length - 1) : path;
54+
const currentAppUrl = stripTrailingSlash(history.createHref(history.location));
55+
if (historyType === History.Browser) {
56+
// browser history
57+
const basePath = stripTrailingSlash(appBasePath);
58+
return currentAppUrl === basePath && !history.location.search && !history.location.hash;
59+
} else {
60+
// hashed history
61+
return currentAppUrl === '#' && !history.location.search;
62+
}
63+
}}
64+
/>,
65+
element
66+
);
67+
68+
return () => ReactDOM.unmountComponentAtNode(element);
69+
};

webpackShims/angular.js renamed to examples/state_containers_examples/public/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
* under the License.
1818
*/
1919

20-
require('jquery');
21-
require('../node_modules/angular/angular');
22-
module.exports = window.angular;
20+
import { StateContainersExamplesPlugin } from './plugin';
21+
22+
export const plugin = () => new StateContainersExamplesPlugin();
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import { AppMountParameters, CoreSetup, Plugin } from 'kibana/public';
21+
22+
export class StateContainersExamplesPlugin implements Plugin {
23+
public setup(core: CoreSetup) {
24+
core.application.register({
25+
id: 'state-containers-example-browser-history',
26+
title: 'State containers example - browser history routing',
27+
async mount(params: AppMountParameters) {
28+
const { renderApp, History } = await import('./app');
29+
return renderApp(params, {
30+
appInstanceId: '1',
31+
appTitle: 'Routing with browser history',
32+
historyType: History.Browser,
33+
});
34+
},
35+
});
36+
core.application.register({
37+
id: 'state-containers-example-hash-history',
38+
title: 'State containers example - hash history routing',
39+
async mount(params: AppMountParameters) {
40+
const { renderApp, History } = await import('./app');
41+
return renderApp(params, {
42+
appInstanceId: '2',
43+
appTitle: 'Routing with hash history',
44+
historyType: History.Hash,
45+
});
46+
},
47+
});
48+
}
49+
50+
public start() {}
51+
public stop() {}
52+
}

0 commit comments

Comments
 (0)