Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Support v7.4 compatibility for kibana and sql-plugin #23

Merged
merged 3 commits into from
Jan 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ Please see our [documentation](https://opendistro.github.io/for-elasticsearch-do
See the [Kibana contributing guide](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment) for more instructions on setting up your development environment.

1. Change your node version to the version specified in `.node-version` inside the Kibana root directory.
1. Create a `kibana-extra` directory as a sibling directory to the Kibana source code directory.
1. Check out this package from version control into the `kibana-extra` directory.
1. Run `yarn kbn bootstrap` inside `kibana-extra/opendistro-elasticsearch-sql-kibana`.
1. cd into `plugins` directory in the Kibana source code directory.
1. Check out this package from version control into the `plugins` directory.
1. Run `yarn kbn bootstrap` inside `kibana/plugins/sql-kibana-plugin`.

Ultimately, your directory structure should look like this:

```md
.
├── kibana
├── kibana-extra
│ └── opendistro-elasticsearch-sql-kibana
│ └── sql-kibana-plugin
```


## Build

To build the plugin's distributable zip simply run `yarn build`.

Example output: `./build/opendistro-kibana-sql-1.0.0.0.zip`
Example output: `./build/opendistro_sql_kibana-1.0.0.0.zip`


## Run
Expand All @@ -44,7 +44,7 @@ Example output: `./build/opendistro-kibana-sql-1.0.0.0.zip`

Starts Kibana and includes this plugin. Kibana will be available on `localhost:5601`.

- `NODE_PATH=../../kibana/node_modules yarn test:jest`
- `NODE_PATH=../../node_modules yarn test:jest`

Runs the plugin tests.

Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import QueryService from './server/services/QueryService';
import TranslateService from './server/services/TranslateService';
import { createSqlCluster } from './server/clusters';

export const PLUGIN_NAME = 'opendistro-sql-kibana';
export const PLUGIN_NAME = 'sql-kibana';

export default function (kibana) {
return new kibana.Plugin({
Expand All @@ -45,7 +45,7 @@ export default function (kibana) {
// Create Clusters
createSqlCluster(server);
const client = server.plugins.elasticsearch;

// Add server routes and initialize the plugin here
query(server, new QueryService(client));
translate(server, new TranslateService(client));
Expand Down
30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"name": "opendistro-sql-kibana",
"name": "sql-kibana",
"version": "1.3.0.0",
"description": "SQL Console",
"main": "index.js",
"license": "Apache-2.0",
"homepage": "https://github.com/opendistro-for-elasticsearch/sql-kibana-plugin",
"kibana": {
"version": "7.3.2",
"version": "7.4.2",
"templateVersion": "6.3.3"
},
"repository": {
"type": "git",
"url": "https://github.com/opendistro-for-elasticsearch/sql-kibana-plugin"
},
"scripts": {
"preinstall": "node ../../kibana/preinstall_check",
"kbn": "node ../../kibana/scripts/kbn",
"preinstall": "node ../../preinstall_check",
"kbn": "node ../../scripts/kbn",
"lint": "tslint .",
"start": "plugin-helpers start",
"test:server": "plugin-helpers test:server",
"test:browser": "testcafe chrome public/__tests__",
"test:jest": "NODE_PATH=../../kibana/node_modules ./node_modules/.bin/jest --config ./test/jest.config.js",
"test:jest": "NODE_PATH=../../node_modules ../../node_modules/.bin/jest --config ./test/jest.config.js",
"build": "plugin-helpers build"
},
"dependencies": {
"@elastic/eui": "^14.4.0",
"@kbn/i18n": "link:../../kibana/packages/kbn-i18n",
"@kbn/ui-framework": "link:../../kibana/packages/kbn-ui-framework",
"@kbn/i18n": "link:../../packages/kbn-i18n",
"@kbn/ui-framework": "link:../../packages/kbn-ui-framework",
"react-dom": "^16.3.0",
"react-double-scrollbar": "^0.0.15"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react": "^7.0.0",
"@babel/plugin-proposal-class-properties": "^7.7.4",
"@babel/plugin-proposal-object-rest-spread": "^7.7.4",
"@babel/preset-env": "^7.7.6",
"@babel/preset-react": "^7.7.4",
"@babel/preset-typescript": "^7.3.3",
"@elastic/elasticsearch": "^7.2.0",
"@elastic/eslint-config-kibana": "link:../../kibana/packages/eslint-config-kibana",
"@elastic/eslint-import-resolver-kibana": "link:../../kibana/packages/kbn-eslint-import-resolver-kibana",
"@kbn/expect": "link:../../kibana/packages/kbn-expect",
"@kbn/plugin-helpers": "link:../../kibana/packages/kbn-plugin-helpers",
"@elastic/eslint-config-kibana": "link:../../packages/eslint-config-kibana",
"@elastic/eslint-import-resolver-kibana": "link:../../packages/kbn-eslint-import-resolver-kibana",
"@kbn/expect": "link:../../packages/kbn-expect",
"@kbn/plugin-helpers": "link:../../packages/kbn-plugin-helpers",
"@testing-library/jest-dom": "^4.0.0",
"@testing-library/react": "^8.0.5",
"@testing-library/user-event": "^4.1.0",
Expand Down
76 changes: 36 additions & 40 deletions public/components/Main/__snapshots__/main.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -64,8 +64,8 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -166,7 +166,7 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -188,8 +188,8 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -280,9 +280,7 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
</div>
</div>
</div>
<div
class="action-container"
>
<div>
<div
class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--directionRow euiFlexGroup--responsive action-container"
>
Expand Down Expand Up @@ -328,6 +326,7 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
<a
class="euiButtonEmpty euiButtonEmpty--primary euiHeaderLink sql-editor-link"
href="#"
rel="noreferrer"
>
<span
class="euiButtonEmpty__content"
Expand Down Expand Up @@ -413,7 +412,7 @@ exports[`<Main /> spec click run button, and response causes an error 1`] = `
</div>
<div
class=" error-message ace_editor ace-sql-console"
id="brace-editor"
id="some_html_id"
style="width: 100%; height: 500px; font-size: 14px;"
>
<textarea
Expand Down Expand Up @@ -552,7 +551,7 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -574,8 +573,8 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -676,7 +675,7 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -698,8 +697,8 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -790,9 +789,7 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
</div>
</div>
</div>
<div
class="action-container"
>
<div>
<div
class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--directionRow euiFlexGroup--responsive action-container"
>
Expand Down Expand Up @@ -838,6 +835,7 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
<a
class="euiButtonEmpty euiButtonEmpty--primary euiHeaderLink sql-editor-link"
href="#"
rel="noreferrer"
>
<span
class="euiButtonEmpty__content"
Expand Down Expand Up @@ -923,7 +921,7 @@ exports[`<Main /> spec click run button, and response is not ok 1`] = `
</div>
<div
class=" ace_editor ace-sql-console successful-message"
id="brace-editor"
id="some_html_id"
style="width: 100%; height: 500px; font-size: 14px;"
>
<textarea
Expand Down Expand Up @@ -1062,7 +1060,7 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -1084,8 +1082,8 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -1186,7 +1184,7 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -1208,8 +1206,8 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -1300,9 +1298,7 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
</div>
</div>
</div>
<div
class="action-container"
>
<div>
<div
class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--directionRow euiFlexGroup--responsive action-container"
>
Expand Down Expand Up @@ -1348,6 +1344,7 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
<a
class="euiButtonEmpty euiButtonEmpty--primary euiHeaderLink sql-editor-link"
href="#"
rel="noreferrer"
>
<span
class="euiButtonEmpty__content"
Expand Down Expand Up @@ -1433,7 +1430,7 @@ exports[`<Main /> spec click run button, and response is ok 1`] = `
</div>
<div
class=" ace_editor ace-sql-console successful-message"
id="brace-editor"
id="some_html_id"
style="width: 100%; height: 500px; font-size: 14px;"
>
<textarea
Expand Down Expand Up @@ -1572,7 +1569,7 @@ exports[`<Main /> spec renders the component 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -1594,8 +1591,8 @@ exports[`<Main /> spec renders the component 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -1696,7 +1693,7 @@ exports[`<Main /> spec renders the component 1`] = `
<div
class="euiCodeEditorWrapper"
data-test-subj="codeEditorContainer"
style="width: 100%; height: 20em;"
style="width: 100%; height: 18.5rem;"
>
<div
class="euiCodeEditorKeyboardHint"
Expand All @@ -1718,8 +1715,8 @@ exports[`<Main /> spec renders the component 1`] = `
</div>
<div
class=" ace_editor ace-sql-console"
id="brace-editor"
style="width: 100%; height: 20em; font-size: 12px;"
id="some_html_id"
style="width: 100%; height: 18.5rem; font-size: 12px;"
>
<textarea
aria-label="Code Editor"
Expand Down Expand Up @@ -1810,9 +1807,7 @@ exports[`<Main /> spec renders the component 1`] = `
</div>
</div>
</div>
<div
class="action-container"
>
<div>
<div
class="euiFlexGroup euiFlexGroup--gutterMedium euiFlexGroup--directionRow euiFlexGroup--responsive action-container"
>
Expand Down Expand Up @@ -1858,6 +1853,7 @@ exports[`<Main /> spec renders the component 1`] = `
<a
class="euiButtonEmpty euiButtonEmpty--primary euiHeaderLink sql-editor-link"
href="#"
rel="noreferrer"
>
<span
class="euiButtonEmpty__content"
Expand Down Expand Up @@ -1943,7 +1939,7 @@ exports[`<Main /> spec renders the component 1`] = `
</div>
<div
class=" ace_editor ace-sql-console successful-message"
id="brace-editor"
id="some_html_id"
style="width: 100%; height: 500px; font-size: 14px;"
>
<textarea
Expand Down
Loading