Skip to content

Commit

Permalink
Merge branch 'master' into visualization-list-eui
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza Katz committed Feb 21, 2019
2 parents a52fc12 + 6e31c1d commit cde4fa5
Show file tree
Hide file tree
Showing 126 changed files with 3,286 additions and 1,598 deletions.
17 changes: 17 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ A high level overview of our contributing guidelines.
- [Customizing `config/kibana.dev.yml`](#customizing-configkibanadevyml)
- [Setting Up SSL](#setting-up-ssl)
- [Linting](#linting)
- [Internationalization](#internationalization)
- [Testing and Building](#testing-and-building)
- [Debugging server code](#debugging-server-code)
- [Debugging Unit Tests](#debugging-unit-tests)
Expand Down Expand Up @@ -278,6 +279,22 @@ IntelliJ | Settings » Languages & Frameworks » JavaScript » Code Quality To

Another tool we use for enforcing consistent coding style is EditorConfig, which can be set up by installing a plugin in your editor that dynamically updates its configuration. Take a look at the [EditorConfig](http://editorconfig.org/#download) site to find a plugin for your editor, and browse our [`.editorconfig`](https://github.com/elastic/kibana/blob/master/.editorconfig) file to see what config rules we set up.

### Internationalization

All user-facing labels and info texts in Kibana should be internationalized. Please take a look at the [readme](packages/kbn-i18n/README.md) and the [guideline](packages/kbn-i18n/GUIDELINE.md) of the i18n package on how to do so.

In order to enable translations in the React parts of the application, the top most component of every `ReactDOM.render` call should be an `I18nContext`:
```jsx
import { I18nContext } from 'ui/i18n';

ReactDOM.render(
<I18nContext>
{myComponentTree}
</I18nContext>,
container
);
```

### Testing and Building

To ensure that your changes will not break other functionality, please run the test suite and build process before submitting your Pull Request.
Expand Down
17 changes: 15 additions & 2 deletions docs/reporting/getting-started.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
[[reporting-getting-started]]
== Getting Started

{reporting} is automatically enabled in {kib}.
[float]
=== System Setup

To manually generate a report:
{reporting} is automatically enabled in {kib}. The first time Kibana runs, it extracts a custom build for the Chromium web browser, which
runs on the server in headless mode to load Kibana and capture the rendered Kibana charts as images.

Chromium is an open-source project not related to Elastic, but the Chromium binary for Kibana has been custom-built by Elastic to ensure it
works with minimal setup. However, the Kibana server OS might still require additional dependencies for Chromium. See the
<<reporting-troubleshooting-system-dependencies, Reporting Troubleshooting>> section for more information about the system dependencies
for different operating systems.

[float]
=== Generating a Report Manually

. Open {kib} in your web browser and log in. If you are running {kib}
locally, go to `http://localhost:5601`. To access {kib} and generate
Expand Down Expand Up @@ -35,6 +45,9 @@ image:reporting/images/share-button.png["Reporting Button",link="share-button.pn

... Click the *Generate PDF* button.

[float]
=== Generating a Report Automatically

If you want to automatically generate reports from a script or with
{watcher}, use the displayed Generation URL. For more information, see
<<automating-report-generation, Automating Report Generation>>
4 changes: 0 additions & 4 deletions docs/reporting/index.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ visualizations, and saved searches. Dashboards and visualizations are
exported as PDF documents, while saved searches in Discover
are exported to CSV.

NOTE: On Linux, the `libfontconfig` and `libfreetype6` packages and system
fonts are required to generate PDF reports. If no system fonts are available,
labels are not rendered correctly in the reports.

Reporting is located in the share menu from the {kib} toolbar:

[role="screenshot"]
Expand Down
116 changes: 70 additions & 46 deletions docs/reporting/reporting-troubleshooting.asciidoc
Original file line number Diff line number Diff line change
@@ -1,78 +1,102 @@
[role="xpack"]
[[reporting-troubleshooting]]
== Reporting Troubleshooting
++++
<titleabbrev>Troubleshooting</titleabbrev>
++++

Having trouble? Here are solutions to common problems you might encounter while using Reporting.

[float]
=== Text is Not rendered correctly in generated reports
=== Verbose Logging
Kibana's server logs have a lot of useful information for troubleshooting and understanding how things work. If you're having any issues at
all, the full logs from Reporting will be the first place to look. In `kibana.yml`:

[source,yaml]
--------------------------------------------------------------------------------
logging.verbose: true
--------------------------------------------------------------------------------

For more information about logging, see <<logging-verbose,Kibana configuration settings>>.

[float]
[[reporting-troubleshooting-system-dependencies]]
=== System Dependencies
Reporting launches a "headless" web browser called Chromium on the Kibana server. It is a custom build made by Elastic of an open source
project, and it is intended to have minimal dependencies on OS libraries. However, the Kibana server OS might still require additional
dependencies for Chromium.

If a report label is rendered as an empty rectangle, no system fonts
are available. Install at least one font package on the system.
Make sure Kibana server OS has the appropriate packages installed for the distribution.

[float]
==== On CentOS/RHEL systems, the following packages should be installed:
* `ipa-gothic-fonts`
* `xorg-x11-fonts-100dpi`
* `xorg-x11-fonts-75dpi`
* `xorg-x11-utils`
* `xorg-x11-fonts-cyrillic`
* `xorg-x11-fonts-Type1`
* `xorg-x11-fonts-misc`
* `fontconfig`
* `freetype`

If the report is missing certain Chinese, Japanese or Korean characters, ensure that a system font with
those characters is installed.
[float]
==== On Ubuntu/Debian systems, the following packages should be installed:
* `fonts-liberation`
* `libfontconfig1`

[float]
=== Error generating your report
You might see "There was an error generating your report" or one of the following errors when you download your report. See below for
an explanation of why the failure occurred and what you can do to fix it.
=== Text is Not rendered correctly in generated reports

If a report label is rendered as an empty rectangle, no system fonts are available. Install at least one font package on the system.

If the report is missing certain Chinese, Japanese or Korean characters, ensure that a system font with those characters is installed.

[float]
=== Data Table Visualization does not show all data in PDF reports
There is currently a known limitation with the Data Table visualization that only the first page of data rows, which are the only data visible on the screen, are shown in PDF reports.
There is currently a known limitation with the Data Table visualization that only the first page of data rows, which are the only data
visible on the screen, are shown in PDF reports.

[float]
=== File Permissions
Ensure that the `headless_shell` binary located in your Kibana data directory is owned by the user who is running Kibana, that the
user has the execute permission, and if applicable, that the filesystem is mounted with the `exec` option.

[NOTE]
--
The Chromium binary is located in the Kibana installation directory as `data/headless_shell-OS_TYPE/headless_shell`. The full path is logged
the first time Kibana starts when verbose logging is enabled.
--

[float]
==== `You must install fontconfig and freetype for Reporting to work'`
Reporting uses a headless browser on the Kibana server, which relies on some
system packages. Install the appropriate fontconfig and freetype packages for
your distribution.
[[reporting-troubleshooting-error-messages]]
=== Error Messages
Whenever possible, a Reporting error message tries to be as self-explanatory as possible. Here are some error messages you might encounter,
along with the solution.

[float]
==== `Max attempts reached (3)`
==== "Max attempts reached"
There are two primary causes of this error:

. You're creating a PDF of a visualization or dashboard that spans a large amount of data and Kibana is hitting the `xpack.reporting.queue.timeout`

. Kibana is hosted behind a reverse-proxy, and the <<reporting-kibana-server-settings, Kibana server settings>> are not configured correctly

Create a Markdown visualization and then create a PDF report. If this succeeds, increase the `xpack.reporting.queue.timeout`
setting. If the PDF report fails with "Max attempts reached (3)," check your <<reporting-kibana-server-settings, Kibana server settings>>.

[float]
==== `You must install freetype and ttf-font for Reporting to work`
Reporting using the Chromium browser relies on system packages and at least one system font. Install the appropriate fontconfig and freetype
packages for your distribution and at least one system font.
Create a Markdown visualization and then create a PDF report. If this succeeds, increase the `xpack.reporting.queue.timeout` setting. If the
PDF report fails with "Max attempts reached," check your <<reporting-kibana-server-settings, Kibana server settings>>.

[float]
==== `You must install nss for Reporting to work`
Reporting using the Chromium browser relies on the Network Security Service libraries (NSS). Install the appropriate nss package for your distribution.
[[reporting-troubleshooting-nss-dependency]]
==== "You must install nss for Reporting to work"
Reporting using the Chromium browser relies on the Network Security Service libraries (NSS). Install the appropriate nss package for your
distribution.

[float]
==== `Unable to use Chromium sandbox. This can be disabled at your own risk with 'xpack.reporting.capture.browser.chromium.disableSandbox'`
[[reporting-troubleshooting-sandbox-dependency]]
==== "Unable to use Chromium sandbox"
Chromium uses sandboxing techniques that are built on top of operating system primitives. The Linux sandbox depends on user namespaces,
which were introduced with the 3.8 Linux kernel. However, many distributions don't have user namespaces enabled by default, or they require
the CAP_SYS_ADMIN capability.

Elastic recommends that you research the feasibility of enabling unprivileged user namespaces before disabling the sandbox. An exception
is if you are running Kibana in Docker because the container runs in a user namespace with the built-in seccomp/bpf filters.

[float]
==== `Caught error spawning Chromium`
Ensure that the `headless_shell` binary located in your Kibana data directory is owned by the user who is running Kibana, that the user has the execute permission,
and if applicable, that the filesystem is mounted with the `exec` option.

Another possible reason of such error might be the fact the `headless_shell` binary requires dependencies which are not installed at the operating system level.

.On CentOS/RHEL systems, the following packages should be installed:
* `ipa-gothic-fonts`
* `xorg-x11-fonts-100dpi`
* `xorg-x11-fonts-75dpi`
* `xorg-x11-utils`
* `xorg-x11-fonts-cyrillic`
* `xorg-x11-fonts-Type1`
* `xorg-x11-fonts-misc`
* `fontconfig`
* `freetype`

.On Ubuntu/Debian systems, the following packages should be installed:
* `fonts-liberation`
* `libfontconfig1`
17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"resolutions": {
"**/@types/node": "10.12.12",
"@types/react": "16.3.14"
"**/@types/node": "10.12.12"
},
"workspaces": {
"packages": [
Expand Down Expand Up @@ -192,11 +191,11 @@
"pug": "^2.0.3",
"querystring-browser": "1.0.4",
"raw-loader": "0.5.1",
"react": "^16.6.0",
"react": "^16.8.0",
"react-addons-shallow-compare": "15.6.2",
"react-anything-sortable": "^1.7.4",
"react-color": "^2.13.8",
"react-dom": "^16.6.0",
"react-dom": "^16.8.0",
"react-grid-layout": "^0.16.2",
"react-input-range": "^1.3.0",
"react-markdown": "^3.1.4",
Expand Down Expand Up @@ -274,7 +273,6 @@
"@types/eslint": "^4.16.2",
"@types/execa": "^0.9.0",
"@types/fetch-mock": "7.2.1",
"@types/json5": "^0.0.30",
"@types/getopts": "^2.0.0",
"@types/glob": "^5.0.35",
"@types/globby": "^8.0.0",
Expand All @@ -287,6 +285,7 @@
"@types/joi": "^13.4.2",
"@types/jquery": "^3.3.6",
"@types/js-yaml": "^3.11.1",
"@types/json5": "^0.0.30",
"@types/listr": "^0.13.0",
"@types/lodash": "^3.10.1",
"@types/minimatch": "^2.0.29",
Expand All @@ -297,8 +296,8 @@
"@types/podium": "^1.0.0",
"@types/prop-types": "^15.5.3",
"@types/puppeteer-core": "^1.9.0",
"@types/react": "16.3.14",
"@types/react-dom": "^16.0.5",
"@types/react": "^16.8.0",
"@types/react-dom": "^16.8.0",
"@types/react-redux": "^6.0.6",
"@types/react-router-dom": "^4.3.1",
"@types/react-virtualized": "^9.18.7",
Expand Down Expand Up @@ -327,8 +326,8 @@
"dedent": "^0.7.0",
"delete-empty": "^2.0.0",
"enzyme": "^3.7.0",
"enzyme-adapter-react-16": "^1.6.0",
"enzyme-adapter-utils": "^1.8.1",
"enzyme-adapter-react-16": "^1.9.0",
"enzyme-adapter-utils": "^1.10.0",
"enzyme-to-json": "^3.3.4",
"eslint": "^5.6.0",
"eslint-config-prettier": "^3.1.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-i18n/src/react/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function translateFormattedMessageUsingPseudoLocale(message: string) {
* with the pseudo localization function.
* @param child I18nProvider child component.
*/
function wrapIntlFormatMessage(child: React.ReactNode) {
function wrapIntlFormatMessage(child: React.ReactElement) {
return React.createElement(
injectI18n(({ intl }) => {
const formatMessage = intl.formatMessage;
Expand Down Expand Up @@ -81,7 +81,7 @@ export class I18nProvider extends React.PureComponent {
formats={i18n.getFormats()}
textComponent={React.Fragment}
>
{isPseudoLocale(i18n.getLocale())
{isPseudoLocale(i18n.getLocale()) && React.isValidElement(this.props.children)
? wrapIntlFormatMessage(this.props.children)
: this.props.children}
</IntlProvider>
Expand Down
66 changes: 0 additions & 66 deletions src/legacy/core_plugins/console/public/_ace_overrides.scss

This file was deleted.

1 change: 0 additions & 1 deletion src/legacy/core_plugins/console/public/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
// conChart__legend-isLoading

@import './app';
@import './ace_overrides';
@import './src/directives/index';
Loading

0 comments on commit cde4fa5

Please sign in to comment.