Skip to content

Commit

Permalink
Merge pull request #1 from spalger/add-styled-components-debug-info
Browse files Browse the repository at this point in the history
Merged master into elastic#14036
  • Loading branch information
sorenlouv authored Sep 20, 2017
2 parents 4e2e144 + 94235d9 commit e6cf466
Show file tree
Hide file tree
Showing 131 changed files with 5,030 additions and 403 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('./src/optimize/babel/register');
require('./src/babel-register');

module.exports = function (grunt) {
// set the config once before calling load-grunt-config
Expand Down
10 changes: 0 additions & 10 deletions docs/index-shared2.asciidoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,2 @@

include::migration.asciidoc[]

include::getting-started.asciidoc[]

include::discover.asciidoc[]

include::visualize.asciidoc[]

include::dashboard.asciidoc[]

include::timelion.asciidoc[]
16 changes: 8 additions & 8 deletions docs/index-shared3.asciidoc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@

[[devtools-kibana]]
= Dev Tools

[partintro]
--
The *Dev Tools* page contains development tools that you can use to interact
with your data in Kibana.
--
include::getting-started.asciidoc[]

include::console.asciidoc[]
include::discover.asciidoc[]

include::visualize.asciidoc[]

include::dashboard.asciidoc[]

include::timelion.asciidoc[]
11 changes: 10 additions & 1 deletion docs/index-shared4.asciidoc
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@

include::management.asciidoc[]
[[devtools-kibana]]
= Dev Tools

[partintro]
--
The *Dev Tools* page contains development tools that you can use to interact
with your data in Kibana.
--

include::console.asciidoc[]
8 changes: 1 addition & 7 deletions docs/index-shared5.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@

include::plugins.asciidoc[]

include::development.asciidoc[]

include::limitations.asciidoc[]

include::release-notes.asciidoc[]
include::management.asciidoc[]
8 changes: 8 additions & 0 deletions docs/index-shared6.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

include::plugins.asciidoc[]

include::development.asciidoc[]

include::limitations.asciidoc[]

include::release-notes.asciidoc[]
1 change: 1 addition & 0 deletions docs/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ include::index-shared2.asciidoc[]
include::index-shared3.asciidoc[]
include::index-shared4.asciidoc[]
include::index-shared5.asciidoc[]
include::index-shared6.asciidoc[]
2 changes: 2 additions & 0 deletions docs/plugins/known-plugins.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ This list of plugins is not guaranteed to work on your version of Kibana. Instea
* https://github.com/mstoyano/kbn_c3js_vis[C3JS Visualizations] (mstoyano)
* https://github.com/elo7/cohort[Cohort analysis] (elo7)
* https://github.com/DeanF/health_metric_vis[Colored Metric Visualization] (deanf)
* https://github.com/JuanCarniglia/dendrogram_vis[Dendrogram] (JuanCarniglia)
* https://github.com/dlumbrer/kbn_dotplot[Dotplot] (dlumbrer)
* https://github.com/nreese/enhanced_tilemap[Enhanced Tilemap] (nreese)
* https://github.com/ommsolutions/kibana_ext_metrics_vis[Extended Metric] (ommsolutions)
Expand All @@ -48,6 +49,7 @@ This list of plugins is not guaranteed to work on your version of Kibana. Instea
[float]
=== Other
* https://github.com/nreese/kibana-time-plugin[Time picker as a dashboard panel] Widget to view and edit the time range from within dashboards.
* https://github.com/sw-jung/kibana_notification_center[Notification Center] - for better experience of notifier toasts.

* https://github.com/Webiks/kibana-API.git[Kibana-API] (webiks) Exposes an API with Kibana functionality.
Use it to create, edit and embed visualizations, and also to search inside an embedded dashboard.
Expand Down
4 changes: 4 additions & 0 deletions docs/release-notes.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This section summarizes the changes in each release.

* <<release-notes-6.0.0-alpha2>>
* <<release-notes-6.0.0-alpha1>>
ifdef::include-xpack[]
* <<release-notes-xpackkb>>
endif::include-xpack[]


--
include::release-notes/6.0.0-alpha2.asciidoc[]
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@
"ansicolors": "0.3.2",
"autoprefixer": "6.5.4",
"autoprefixer-loader": "2.0.0",
"babel-cli": "6.18.0",
"babel-core": "6.21.0",
"babel-jest": "21.0.0",
"babel-loader": "6.2.10",
"babel-plugin-add-module-exports": "0.2.1",
"babel-plugin-styled-components": "1.2.0",
"babel-plugin-transform-async-generator-functions": "6.24.1",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-define": "1.3.0",
"babel-plugin-transform-object-rest-spread": "6.23.0",
"babel-polyfill": "6.20.0",
"babel-preset-env": "1.4.0",
Expand Down Expand Up @@ -173,11 +173,12 @@
"react-color": "2.11.7",
"react-dom": "15.6.1",
"react-input-autosize": "1.1.0",
"react-input-range": "1.2.1",
"react-markdown": "2.4.2",
"react-redux": "4.4.5",
"react-router": "2.0.0",
"react-router-redux": "4.0.4",
"react-select": "1.0.0-rc.1",
"react-select": "1.0.0-rc.5",
"react-sortable": "1.1.0",
"react-test-renderer": "15.6.1",
"react-toggle": "3.0.1",
Expand Down Expand Up @@ -216,7 +217,7 @@
"chance": "1.0.6",
"cheerio": "0.22.0",
"chokidar": "1.6.0",
"chromedriver": "2.29.0",
"chromedriver": "2.32.3",
"classnames": "2.2.5",
"enzyme": "2.9.1",
"enzyme-to-json": "1.4.5",
Expand Down
2 changes: 1 addition & 1 deletion scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ node scripts/{{script name}} --help

This directory is excluded from the build and tools within it should help users discover their capabilities. Each script in this directory must:

- include the `../src/optimize/babel/register` module to bootstrap babel
- require `src/babel-register` to bootstrap babel
- call out to source code that is in the `src` directory
- react to the `--help` flag
- run everywhere OR check and fail fast when a required OS or toolchain is not available
2 changes: 1 addition & 1 deletion scripts/docs.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('../src/optimize/babel/register');
require('../src/babel-register');
require('../src/docs/cli');
2 changes: 1 addition & 1 deletion scripts/es_archiver.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('../src/optimize/babel/register');
require('../src/babel-register');
require('../src/es_archiver/cli');
2 changes: 1 addition & 1 deletion scripts/functional_test_runner.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('../src/optimize/babel/register');
require('../src/babel-register');
require('../src/functional_test_runner/cli');
3 changes: 1 addition & 2 deletions scripts/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,5 @@
//
// See all cli options in https://facebook.github.io/jest/docs/cli.html

require('../src/optimize/babel/register');
require('../src/babel-register');
require('../src/jest/cli');

2 changes: 1 addition & 1 deletion scripts/mocha.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('../src/optimize/babel/register');
require('../src/babel-register');
require('../test/scripts/run_mocha');
21 changes: 21 additions & 0 deletions src/babel-preset/common.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
presets: [
require.resolve('babel-preset-react'),
],
plugins: [
require.resolve('babel-plugin-styled-components'),
require.resolve('babel-plugin-add-module-exports'),

// stage 3
require.resolve('babel-plugin-transform-async-generator-functions'),
require.resolve('babel-plugin-transform-object-rest-spread'),

// the class properties proposal was merged with the private fields proposal
// into the "class fields" proposal. Babel doesn't support this combined
// proposal yet, which includes private field, so this transform is
// TECHNICALLY stage 2, but for all intents and purposes it's stage 3
//
// See https://github.com/babel/proposals/issues/12 for progress
require.resolve('babel-plugin-transform-class-properties'),
],
};
31 changes: 31 additions & 0 deletions src/babel-preset/node.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
presets: [
[
require.resolve('babel-preset-env'),
{
targets: {
// only applies the necessary transformations based on the
// current node.js processes version. For example: running
// `nvm install 8 && node ./src/cli` will run kibana in node
// version 8 and babel will stop transpiling async/await
// because they are supported in the "current" version of node
node: 'current',
},

// replaces `import "babel-polyfill"` with a list of require statements
// for just the polyfills that the target versions don't already supply
// on their own
useBuiltIns: true,
},
],
require('./common'),
],
plugins: [
[
require.resolve('babel-plugin-transform-define'),
{
'global.__BUILT_WITH_BABEL__': 'true'
}
]
]
};
18 changes: 18 additions & 0 deletions src/babel-preset/webpack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
presets: [
[
require.resolve('babel-preset-env'),
{
targets: {
browsers: [
'last 2 versions',
'> 5%',
'Safari 7', // for PhantomJS support
],
},
useBuiltIns: true,
},
],
require('./common'),
]
};
5 changes: 5 additions & 0 deletions src/babel-register/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// register and polyfill need to happen in this
// order and in separate files. Checkout each file
// for a much more detailed explaination
require('./register');
require('./polyfill');
10 changes: 10 additions & 0 deletions src/babel-register/polyfill.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// `babel-preset-env` looks for and rewrites the following import
// statement into a list of import statements based on the polyfills
// necessary for our target environment (the current version of node)
// but since it does that during compilation, `import 'babel-polyfill'`
// must be in a file that is loaded with `require()` AFTER `babel-register`
// is configured.
//
// This is why we have this single statement in it's own file and require
// it from ./index.js
import 'babel-polyfill';
34 changes: 34 additions & 0 deletions src/babel-register/register.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
const { resolve } = require('path');

// this must happen before `require('babel-register')` and can't be changed
// once the module has been loaded
if (!process.env.BABEL_CACHE_PATH) {
process.env.BABEL_CACHE_PATH = resolve(__dirname, '../../optimize/.babelcache.json');
}

// paths that babel-register should ignore
const ignore = [
/[\\\/](node_modules|bower_components)[\\\/]/,
];

if (global.__BUILT_WITH_BABEL__) {
// when building the Kibana source we replace the statement
// `global.__BUILT_WITH_BABEL__` with the value `true` so that
// when babel-register is required for the first time by users
// it will exclude kibana's `src` directory.
//
// We still need babel-register for plugins though, we've been
// building their server code at require-time since version 4.2
// TODO: the plugin install process could transpile plugin server code...
ignore.push(resolve(__dirname, '../../src'));
}

// modifies all future calls to require() to automatically
// compile the required source with babel
require('babel-register')({
ignore,
babelrc: false,
presets: [
require.resolve('../babel-preset/node')
],
});
2 changes: 1 addition & 1 deletion src/cli/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('../optimize/babel/register');
require('../babel-register');
require('./cli');
2 changes: 1 addition & 1 deletion src/cli_plugin/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
require('../optimize/babel/register');
require('../babel-register');
require('./cli');
1 change: 0 additions & 1 deletion src/core_plugins/console/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<div id="editor_actions">
<kbn-tooltip text="click to send request">
<button
kbn-accessible-click
class="editor_action"
ng-click="sendSelected()"
data-test-subj="send-request-button">
Expand Down
15 changes: 13 additions & 2 deletions src/core_plugins/console/public/src/directives/history.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,26 @@
<div class="kuiLocalDropdownTitle">History</div>

<div class="history-body">
<ul class="list-group history-reqs">
<ul
class="list-group history-reqs"
tabindex="0"
role="listbox"
aria-activedescendant="historyReq{{ history.selectedIndex }}"
scrollto-activedescendant
ng-keydown="history.onKeyDown($event)"
aria-label="History of sent requests"
>
<li
role="option"
ng-repeat="req in history.reqs"
id="historyReq{{$index}}"
ng-class="{ selected: history.viewingReq === req }"
ng-click="history.selectedReq = req; history.viewingReq = req"
ng-click="history.selectedReq = req; history.viewingReq = req; history.selectedIndex = $index"
ng-mouseenter="history.viewingReq = req"
ng-mouseleave="history.viewingReq = history.selectedReq"
ng-dblclick="history.restore(req)"
aria-label="{{:: 'Request: ' + history.describeReq(req) }}"
aria-selected="{{ history.selectedReq === req }}"
class="list-group-item history-req"
>
{{ history.describeReq(req) }}
Expand Down
24 changes: 23 additions & 1 deletion src/core_plugins/console/public/src/directives/sense_history.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { keyCodes } from 'ui_framework/services';

var { memoize } = require('lodash');
let moment = require('moment');

Expand All @@ -13,7 +15,8 @@ require('ui/modules')
controllerAs: 'history',
controller: function ($scope, $element) {
this.reqs = history.getHistory();
this.selectedReq = this.reqs[0];
this.selectedIndex = 0;
this.selectedReq = this.reqs[this.selectedIndex];
this.viewingReq = this.selectedReq;

// calculate the text description of a request
Expand All @@ -40,6 +43,25 @@ require('ui/modules')
history.restoreFromHistory(req);
$scope.kbnTopNav.close();
};

this.onKeyDown = (ev) => {
if (ev.keyCode === keyCodes.ENTER) {
this.restore();
return;
}

if (ev.keyCode === keyCodes.UP) {
ev.preventDefault();
this.selectedIndex--;
} else if (ev.keyCode === keyCodes.DOWN) {
ev.preventDefault();
this.selectedIndex++;
}

this.selectedIndex = Math.min(Math.max(0, this.selectedIndex), this.reqs.length - 1);
this.selectedReq = this.reqs[this.selectedIndex];
this.viewingReq = this.reqs[this.selectedIndex];
};
}
};
});
9 changes: 9 additions & 0 deletions src/core_plugins/input_control_vis/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
export default function (kibana) {
return new kibana.Plugin({
uiExports: {
visTypes: [
'plugins/input_control_vis/register_vis'
]
}
});
}
Loading

0 comments on commit e6cf466

Please sign in to comment.