Merge branch 'master' of https://github.com/elastic/kibana into bug/ingest-dev-480-484-485/host-details-update

This commit is contained in:
Michael Marcialis 2019-06-03 15:09:04 -04:00
commit fa1d6073c4
163 changed files with 4256 additions and 5657 deletions

View file

@ -44,7 +44,7 @@
# the username and password that the Kibana server uses to perform maintenance on the Kibana # the username and password that the Kibana server uses to perform maintenance on the Kibana
# index at startup. Your Kibana users still need to authenticate with Elasticsearch, which # index at startup. Your Kibana users still need to authenticate with Elasticsearch, which
# is proxied through the Kibana server. # is proxied through the Kibana server.
#elasticsearch.username: "user" #elasticsearch.username: "kibana"
#elasticsearch.password: "pass" #elasticsearch.password: "pass"
# Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively. # Enables SSL and paths to the PEM-format SSL certificate and SSL key files, respectively.

View file

@ -46,13 +46,12 @@ These wizards create {ml} jobs, dashboards, searches, and visualizations that
are customized to help you analyze your {auditbeat} and {filebeat} data. are customized to help you analyze your {auditbeat} and {filebeat} data.
If you are not certain which type of job to create, you can use the If you are not certain which type of job to create, you can use the
*Data Visualizer* to learn more about your data and to identify possible fields *Data Visualizer* to learn more about your data. If your index pattern contains
for {ml} analysis. a time field, it can identify possible fields for {ml} analysis.
[NOTE] [NOTE]
=============================== ===============================
* If your index pattern does not contain a time field, you cannot use the *Data Visualizer*. If your data is located outside of {es}, you cannot use {kib} to create
* If your data is located outside of {es}, you cannot use {kib} to create
your jobs and you cannot use {dfeeds} to retrieve your data in real time. your jobs and you cannot use {dfeeds} to retrieve your data in real time.
Machine learning analysis is still possible, however, by using APIs to Machine learning analysis is still possible, however, by using APIs to
create and manage jobs and post data to them. For more information, see create and manage jobs and post data to them. For more information, see

View file

@ -17,7 +17,8 @@ intuitive UI on the {kib} *Machine Learning* page for creating anomaly detection
jobs and understanding results. jobs and understanding results.
If you have a basic license, you can use the *Data Visualizer* to learn more If you have a basic license, you can use the *Data Visualizer* to learn more
about the data that you've stored in {es} and to identify possible fields for about your data. In particular, if your data is stored in {es} and contains a
time field, you can use the *Data Visualizer* to identify possible fields for
{ml} analysis: {ml} analysis:
[role="screenshot"] [role="screenshot"]

View file

@ -20,7 +20,7 @@ To assign {kib} privileges to the role, click **Add space privilege** in the Kib
[role="screenshot"] [role="screenshot"]
image::security/images/add-space-privileges.png[Add space privileges] image::security/images/add-space-privileges.png[Add space privileges]
Open the **Spaces** dropdown menu to specify whether to grant the role access to all spaces *** Global (all spaces)** or one or more individual spaces. If you select *** Global (all spaces)**, you cant select individual spaces until you clear your selection. Open the **Spaces** selection control to specify whether to grant the role access to all spaces *** Global (all spaces)** or one or more individual spaces. If you select *** Global (all spaces)**, you cant select individual spaces until you clear your selection.
Use the **Privilege** menu to grant access to features. The default is **Custom**, which you can use to grant access to individual features. Otherwise, you can grant read and write access to all current and future features by selecting **All**, or grant read access to all current and future features by selecting **Read**. Use the **Privilege** menu to grant access to features. The default is **Custom**, which you can use to grant access to individual features. Otherwise, you can grant read and write access to all current and future features by selecting **All**, or grant read access to all current and future features by selecting **Read**.
@ -39,7 +39,7 @@ image::security/images/create-space-privilege.png[Create space privilege]
==== Assigning different privileges to different spaces ==== Assigning different privileges to different spaces
Using the same role, its possible to assign different privileges to different spaces. After youve added space privileges, click **Add space privilege**. If youve already added privileges for either *** Global (all spaces)** or an individual space, you will not be able to select these in the **Spaces** control. Using the same role, its possible to assign different privileges to different spaces. After youve added space privileges, click **Add space privilege**. If youve already added privileges for either *** Global (all spaces)** or an individual space, you will not be able to select these in the **Spaces** selection control.
Additionally, if youve already assigned privileges at *** Global (all spaces)**, you are only able to assign additional privileges to individual spaces. Similar to the behavior of multiple roles granting the union of all privileges, space privileges are also a union. If youve already granted the user the **All** privilege at *** Global (all spaces)**, youre not able to restrict the role to only the **Read** privilege at an individual space. Additionally, if youve already assigned privileges at *** Global (all spaces)**, you are only able to assign additional privileges to individual spaces. Similar to the behavior of multiple roles granting the union of all privileges, space privileges are also a union. If youve already granted the user the **All** privilege at *** Global (all spaces)**, youre not able to restrict the role to only the **Read** privilege at an individual space.

View file

@ -104,7 +104,7 @@
"@babel/register": "7.4.4", "@babel/register": "7.4.4",
"@elastic/charts": "^4.2.6", "@elastic/charts": "^4.2.6",
"@elastic/datemath": "5.0.2", "@elastic/datemath": "5.0.2",
"@elastic/eui": "10.4.1", "@elastic/eui": "11.0.1",
"@elastic/filesaver": "1.1.2", "@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2", "@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.3", "@elastic/numeral": "2.3.3",
@ -145,17 +145,17 @@
"core-js": "2.6.9", "core-js": "2.6.9",
"css-loader": "1.0.0", "css-loader": "1.0.0",
"custom-event-polyfill": "^0.3.0", "custom-event-polyfill": "^0.3.0",
"d3": "3.5.6", "d3": "3.5.17",
"d3-cloud": "1.2.1", "d3-cloud": "1.2.5",
"del": "^4.0.0", "del": "^4.0.0",
"dragula": "3.7.2", "dragula": "3.7.2",
"elasticsearch": "^15.5.0", "elasticsearch": "^15.5.0",
"elasticsearch-browser": "^15.5.0", "elasticsearch-browser": "^15.5.0",
"encode-uri-query": "1.0.0", "encode-uri-query": "1.0.1",
"execa": "^1.0.0", "execa": "^1.0.0",
"expiry-js": "0.1.7", "expiry-js": "0.1.7",
"file-loader": "2.0.0", "file-loader": "2.0.0",
"font-awesome": "4.4.0", "font-awesome": "4.7.0",
"getos": "^3.1.0", "getos": "^3.1.0",
"glob": "^7.1.2", "glob": "^7.1.2",
"glob-all": "^3.1.0", "glob-all": "^3.1.0",
@ -165,37 +165,37 @@
"handlebars": "4.1.2", "handlebars": "4.1.2",
"hapi": "^17.5.3", "hapi": "^17.5.3",
"hapi-auth-cookie": "^9.0.0", "hapi-auth-cookie": "^9.0.0",
"hjson": "3.1.0", "hjson": "3.1.2",
"hoek": "^5.0.4", "hoek": "^5.0.4",
"http-proxy-agent": "^2.1.0", "http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^2.2.1", "https-proxy-agent": "^2.2.1",
"inert": "^5.1.0", "inert": "^5.1.0",
"joi": "^13.5.2", "joi": "^13.5.2",
"jquery": "^3.4.1", "jquery": "^3.4.1",
"js-yaml": "3.4.1", "js-yaml": "3.13.1",
"json-stable-stringify": "^1.0.1", "json-stable-stringify": "^1.0.1",
"json-stringify-pretty-compact": "1.0.4", "json-stringify-pretty-compact": "1.2.0",
"json-stringify-safe": "5.0.1", "json-stringify-safe": "5.0.1",
"leaflet": "1.0.3", "leaflet": "1.0.3",
"leaflet-draw": "0.4.10", "leaflet-draw": "0.4.14",
"leaflet-responsive-popup": "0.2.0", "leaflet-responsive-popup": "0.6.4",
"leaflet-vega": "^0.8.6", "leaflet-vega": "^0.8.6",
"leaflet.heat": "0.2.0", "leaflet.heat": "0.2.0",
"less": "^2.7.3", "less": "^2.7.3",
"less-loader": "4.1.0", "less-loader": "4.1.0",
"lodash": "npm:@elastic/lodash@3.10.1-kibana1", "lodash": "npm:@elastic/lodash@3.10.1-kibana1",
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"lru-cache": "4.1.1", "lru-cache": "4.1.5",
"markdown-it": "^8.4.1", "markdown-it": "^8.4.1",
"mini-css-extract-plugin": "0.4.4", "mini-css-extract-plugin": "0.4.4",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"mkdirp": "0.5.1", "mkdirp": "0.5.1",
"moment": "^2.20.1", "moment": "^2.20.1",
"moment-timezone": "^0.5.14", "moment-timezone": "^0.5.14",
"mustache": "2.3.0", "mustache": "2.3.2",
"ngreact": "0.5.1", "ngreact": "0.5.1",
"no-ui-slider": "1.2.0", "no-ui-slider": "1.2.0",
"node-fetch": "1.3.2", "node-fetch": "1.7.3",
"opn": "^5.4.0", "opn": "^5.4.0",
"oppsy": "^2.0.0", "oppsy": "^2.0.0",
"pegjs": "0.9.0", "pegjs": "0.9.0",
@ -258,6 +258,7 @@
}, },
"devDependencies": { "devDependencies": {
"@babel/parser": "7.4.5", "@babel/parser": "7.4.5",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/types": "7.4.4", "@babel/types": "7.4.4",
"@elastic/eslint-config-kibana": "0.15.0", "@elastic/eslint-config-kibana": "0.15.0",
"@elastic/github-checks-reporter": "0.0.15", "@elastic/github-checks-reporter": "0.0.15",
@ -268,7 +269,7 @@
"@kbn/expect": "1.0.0", "@kbn/expect": "1.0.0",
"@kbn/plugin-generator": "1.0.0", "@kbn/plugin-generator": "1.0.0",
"@kbn/test": "1.0.0", "@kbn/test": "1.0.0",
"@microsoft/api-documenter": "7.0.49", "@microsoft/api-documenter": "7.2.1",
"@microsoft/api-extractor": "7.1.1", "@microsoft/api-extractor": "7.1.1",
"@octokit/rest": "^15.10.0", "@octokit/rest": "^15.10.0",
"@types/angular": "1.6.50", "@types/angular": "1.6.50",
@ -287,7 +288,7 @@
"@types/enzyme": "^3.1.12", "@types/enzyme": "^3.1.12",
"@types/eslint": "^4.16.6", "@types/eslint": "^4.16.6",
"@types/execa": "^0.9.0", "@types/execa": "^0.9.0",
"@types/fetch-mock": "7.2.1", "@types/fetch-mock": "7.3.0",
"@types/getopts": "^2.0.1", "@types/getopts": "^2.0.1",
"@types/glob": "^7.1.1", "@types/glob": "^7.1.1",
"@types/globby": "^8.0.0", "@types/globby": "^8.0.0",
@ -302,7 +303,7 @@
"@types/jquery": "^3.3.6", "@types/jquery": "^3.3.6",
"@types/js-yaml": "^3.11.1", "@types/js-yaml": "^3.11.1",
"@types/json5": "^0.0.30", "@types/json5": "^0.0.30",
"@types/listr": "^0.13.0", "@types/listr": "^0.14.0",
"@types/lodash": "^3.10.1", "@types/lodash": "^3.10.1",
"@types/lru-cache": "^5.1.0", "@types/lru-cache": "^5.1.0",
"@types/minimatch": "^2.0.29", "@types/minimatch": "^2.0.29",
@ -338,6 +339,7 @@
"archiver": "^3.0.0", "archiver": "^3.0.0",
"babel-eslint": "10.0.1", "babel-eslint": "10.0.1",
"babel-jest": "^24.1.0", "babel-jest": "^24.1.0",
"babel-plugin-dynamic-import-node": "^2.2.0",
"backport": "4.5.5", "backport": "4.5.5",
"chai": "3.5.0", "chai": "3.5.0",
"chance": "1.0.18", "chance": "1.0.18",
@ -366,7 +368,7 @@
"eslint-plugin-react-hooks": "1.6.0", "eslint-plugin-react-hooks": "1.6.0",
"exit-hook": "^2.1.0", "exit-hook": "^2.1.0",
"faker": "1.1.0", "faker": "1.1.0",
"fetch-mock": "7.3.0", "fetch-mock": "7.3.3",
"geckodriver": "1.13.0", "geckodriver": "1.13.0",
"getopts": "^2.2.4", "getopts": "^2.2.4",
"grunt": "1.0.4", "grunt": "1.0.4",
@ -378,7 +380,7 @@
"gulp-babel": "8.0.0", "gulp-babel": "8.0.0",
"gulp-sourcemaps": "2.6.5", "gulp-sourcemaps": "2.6.5",
"has-ansi": "^3.0.0", "has-ansi": "^3.0.0",
"image-diff": "1.6.0", "image-diff": "1.6.3",
"intl-messageformat-parser": "^1.4.0", "intl-messageformat-parser": "^1.4.0",
"is-path-inside": "^2.0.0", "is-path-inside": "^2.0.0",
"istanbul-instrumenter-loader": "3.0.1", "istanbul-instrumenter-loader": "3.0.1",
@ -386,7 +388,7 @@
"jest-cli": "^24.1.0", "jest-cli": "^24.1.0",
"jest-dom": "^3.1.3", "jest-dom": "^3.1.3",
"jest-raw-loader": "^1.0.1", "jest-raw-loader": "^1.0.1",
"jimp": "0.6.0", "jimp": "0.6.4",
"json5": "^1.0.1", "json5": "^1.0.1",
"karma": "3.1.4", "karma": "3.1.4",
"karma-chrome-launcher": "2.2.0", "karma-chrome-launcher": "2.2.0",

View file

@ -7,11 +7,11 @@ module.exports = {
plugins: ['@kbn/eslint-plugin-eslint'], plugins: ['@kbn/eslint-plugin-eslint'],
parserOptions: { parserOptions: {
ecmaVersion: 6 ecmaVersion: 2018
}, },
env: { env: {
es6: true es6: true,
}, },
rules: { rules: {

View file

@ -44,8 +44,7 @@ module.exports = {
parserOptions: { parserOptions: {
sourceType: 'module', sourceType: 'module',
ecmaVersion: 6, ecmaVersion: 2018,
ecmaFeatures: { experimentalObjectRestSpread: true },
}, },
rules: { rules: {

View file

@ -42,9 +42,8 @@ module.exports = {
parserOptions: { parserOptions: {
sourceType: 'module', sourceType: 'module',
ecmaVersion: 6, ecmaVersion: 2018,
ecmaFeatures: { ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true jsx: true
}, },
// NOTE: That is to avoid a known performance issue related with the `ts.Program` used by // NOTE: That is to avoid a known performance issue related with the `ts.Program` used by

View file

@ -24,7 +24,7 @@ const dedent = require('dedent');
const ruleTester = new RuleTester({ const ruleTester = new RuleTester({
parser: 'babel-eslint', parser: 'babel-eslint',
parserOptions: { parserOptions: {
ecmaVersion: 2015, ecmaVersion: 2018,
}, },
}); });

View file

@ -35,7 +35,7 @@ const ruleTester = new RuleTester({
parser: 'babel-eslint', parser: 'babel-eslint',
parserOptions: { parserOptions: {
sourceType: 'module', sourceType: 'module',
ecmaVersion: 2015, ecmaVersion: 2018,
}, },
}); });

View file

@ -24,7 +24,7 @@ const dedent = require('dedent');
const ruleTester = new RuleTester({ const ruleTester = new RuleTester({
parser: 'babel-eslint', parser: 'babel-eslint',
parserOptions: { parserOptions: {
ecmaVersion: 2015, ecmaVersion: 2018,
}, },
}); });

View file

@ -19,7 +19,7 @@
"globby": "^8.0.1", "globby": "^8.0.1",
"gulp-babel": "^8.0.0", "gulp-babel": "^8.0.0",
"gulp-rename": "1.4.0", "gulp-rename": "1.4.0",
"gulp-zip": "4.1.0", "gulp-zip": "4.2.0",
"inquirer": "^1.2.2", "inquirer": "^1.2.2",
"minimatch": "^3.0.4", "minimatch": "^3.0.4",
"node-sass": "^4.9.4", "node-sass": "^4.9.4",

View file

@ -33,7 +33,7 @@
"@types/read-pkg": "^3.0.0", "@types/read-pkg": "^3.0.0",
"@types/strip-ansi": "^3.0.0", "@types/strip-ansi": "^3.0.0",
"@types/strong-log-transformer": "^1.0.0", "@types/strong-log-transformer": "^1.0.0",
"@types/tempy": "^0.1.0", "@types/tempy": "^0.2.0",
"@types/wrap-ansi": "^2.0.14", "@types/wrap-ansi": "^2.0.14",
"@types/write-pkg": "^3.1.0", "@types/write-pkg": "^3.1.0",
"babel-loader": "8.0.5", "babel-loader": "8.0.5",
@ -60,7 +60,7 @@
"string-replace-loader": "^2.1.1", "string-replace-loader": "^2.1.1",
"strip-ansi": "^4.0.0", "strip-ansi": "^4.0.0",
"strong-log-transformer": "^2.1.0", "strong-log-transformer": "^2.1.0",
"tempy": "^0.2.1", "tempy": "^0.3.0",
"typescript": "^3.3.3333", "typescript": "^3.3.3333",
"unlazy-loader": "^0.1.3", "unlazy-loader": "^0.1.3",
"webpack": "^4.23.1", "webpack": "^4.23.1",

View file

@ -106,6 +106,12 @@
groupName: 'grunt related packages', groupName: 'grunt related packages',
groupSlug: 'grunt', groupSlug: 'grunt',
}, },
{
packagePatterns: ['\\bangular\\b'],
groupName: 'angular related packages',
groupSlug: 'angular',
recreateClosed: false,
},
{ {
packagePatterns: ['\\bd3\\b'], packagePatterns: ['\\bd3\\b'],
groupName: 'd3 related packages', groupName: 'd3 related packages',

View file

@ -3,7 +3,7 @@
"strict": true, "strict": true,
"skipLibCheck": true, "skipLibCheck": true,
"lib": [ "lib": [
"esnext" "es2018"
] ]
}, },
"files": [ "files": [

View file

@ -23,4 +23,9 @@ module.exports = babelJest.createTransformer({
presets: [ presets: [
require.resolve('@kbn/babel-preset/node_preset') require.resolve('@kbn/babel-preset/node_preset')
], ],
plugins: [
// enables jest to parse and execute dynamic import() calls
'@babel/plugin-syntax-dynamic-import',
'dynamic-import-node'
]
}); });

View file

@ -88,7 +88,8 @@ export default {
'^.+\\.html?$': 'jest-raw-loader', '^.+\\.html?$': 'jest-raw-loader',
}, },
transformIgnorePatterns: [ transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.js$', // ignore all node_modules except @elastic/eui which requires babel transforms to handle dynamic import()
'[/\\\\]node_modules(?![\\/\\\\]@elastic[\\/\\\\]eui)[/\\\\].+\\.js$',
'packages/kbn-pm/dist/index.js' 'packages/kbn-pm/dist/index.js'
], ],
snapshotSerializers: [ snapshotSerializers: [

View file

@ -60,7 +60,7 @@ export const LICENSE_WHITELIST = [
'MIT*', 'MIT*',
'MIT/X11', 'MIT/X11',
'new BSD, and MIT', 'new BSD, and MIT',
'OFL-1.1 AND MIT', '(OFL-1.1 AND MIT)',
'Public Domain', 'Public Domain',
'Unlicense', 'Unlicense',
'WTFPL OR ISC', 'WTFPL OR ISC',

View file

@ -33,24 +33,13 @@ exports[`DashboardPanel matches snapshot 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M.164 10.329L1.87 8 .163 5.67c.18-.601.43-1.19.758-1.757a8.197 8.197 0 0 1 1.142-1.535l2.872.313L6.099.05a8.166 8.166 0 0 1 3.8-.003l1.166 2.644 2.872-.313a8.166 8.166 0 0 1 1.899 3.293L14.13 8l1.706 2.33c-.18.601-.43 1.19-.758 1.757a8.197 8.197 0 0 1-1.142 1.535l-2.872-.313-1.164 2.641a8.166 8.166 0 0 1-3.8.003l-1.166-2.644-2.872.313a8.166 8.166 0 0 1-1.899-3.293zm4.663 1.986a1 1 0 0 1 1.023.591l.957 2.17c.79.134 1.597.132 2.387-.001l.956-2.169a1 1 0 0 1 1.023-.59l2.358.256a7.23 7.23 0 0 0 1.194-2.068l-1.401-1.913a1 1 0 0 1 0-1.182l1.4-1.912a7.165 7.165 0 0 0-1.192-2.069l-2.359.257a1 1 0 0 1-1.023-.591L9.193.924a7.165 7.165 0 0 0-2.387.001L5.85 3.094a1 1 0 0 1-1.023.59l-2.358-.256a7.23 7.23 0 0 0-1.194 2.068l1.401 1.913a1 1 0 0 1 0 1.182l-1.4 1.912c.28.751.681 1.45 1.192 2.069l2.359-.257zM8 11a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-1a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"
id="gear-a"
/> />
</defs>
<use
xlink:href="#gear-a"
/>
</svg>
</button> </button>
</div> </div>
</div> </div>

View file

@ -20,25 +20,13 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiCallOutHeader__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiCallOutHeader__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M13.6 12.186l-1.357-1.358c-.025-.025-.058-.034-.084-.056.53-.794.84-1.746.84-2.773a4.977 4.977 0 0 0-.84-2.772c.026-.02.059-.03.084-.056L13.6 3.813a6.96 6.96 0 0 1 0 8.373zM8 15A6.956 6.956 0 0 1 3.814 13.6l1.358-1.358c.025-.025.034-.057.055-.084C6.02 12.688 6.974 13 8 13a4.978 4.978 0 0 0 2.773-.84c.02.026.03.058.056.083l1.357 1.358A6.956 6.956 0 0 1 8 15zm-5.601-2.813a6.963 6.963 0 0 1 0-8.373l1.359 1.358c.024.025.057.035.084.056A4.97 4.97 0 0 0 3 8c0 1.027.31 1.98.842 2.773-.027.022-.06.031-.084.056l-1.36 1.358zm5.6-.187A4 4 0 1 1 8 4a4 4 0 0 1 0 8zM8 1c1.573 0 3.019.525 4.187 1.4l-1.357 1.358c-.025.025-.035.057-.056.084A4.979 4.979 0 0 0 8 3a4.979 4.979 0 0 0-2.773.842c-.021-.027-.03-.059-.055-.084L3.814 2.4A6.957 6.957 0 0 1 8 1zm0-1a8.001 8.001 0 1 0 .003 16.002A8.001 8.001 0 0 0 8 0z"
id="help-a"
/> />
</defs>
<use
fill-rule="evenodd"
href="#help-a"
/>
</svg>
<span <span
class="euiCallOutHeader__title" class="euiCallOutHeader__title"
> >
@ -223,25 +211,13 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiCallOutHeader__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiCallOutHeader__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M13.6 12.186l-1.357-1.358c-.025-.025-.058-.034-.084-.056.53-.794.84-1.746.84-2.773a4.977 4.977 0 0 0-.84-2.772c.026-.02.059-.03.084-.056L13.6 3.813a6.96 6.96 0 0 1 0 8.373zM8 15A6.956 6.956 0 0 1 3.814 13.6l1.358-1.358c.025-.025.034-.057.055-.084C6.02 12.688 6.974 13 8 13a4.978 4.978 0 0 0 2.773-.84c.02.026.03.058.056.083l1.357 1.358A6.956 6.956 0 0 1 8 15zm-5.601-2.813a6.963 6.963 0 0 1 0-8.373l1.359 1.358c.024.025.057.035.084.056A4.97 4.97 0 0 0 3 8c0 1.027.31 1.98.842 2.773-.027.022-.06.031-.084.056l-1.36 1.358zm5.6-.187A4 4 0 1 1 8 4a4 4 0 0 1 0 8zM8 1c1.573 0 3.019.525 4.187 1.4l-1.357 1.358c-.025.025-.035.057-.056.084A4.979 4.979 0 0 0 8 3a4.979 4.979 0 0 0-2.773.842c-.021-.027-.03-.059-.055-.084L3.814 2.4A6.957 6.957 0 0 1 8 1zm0-1a8.001 8.001 0 1 0 .003 16.002A8.001 8.001 0 0 0 8 0z"
id="help-a"
/> />
</defs>
<use
fill-rule="evenodd"
href="#help-a"
/>
</svg>
<span <span
class="euiCallOutHeader__title" class="euiCallOutHeader__title"
> >
@ -274,25 +250,13 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiCallOutHeader__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiCallOutHeader__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M13.6 12.186l-1.357-1.358c-.025-.025-.058-.034-.084-.056.53-.794.84-1.746.84-2.773a4.977 4.977 0 0 0-.84-2.772c.026-.02.059-.03.084-.056L13.6 3.813a6.96 6.96 0 0 1 0 8.373zM8 15A6.956 6.956 0 0 1 3.814 13.6l1.358-1.358c.025-.025.034-.057.055-.084C6.02 12.688 6.974 13 8 13a4.978 4.978 0 0 0 2.773-.84c.02.026.03.058.056.083l1.357 1.358A6.956 6.956 0 0 1 8 15zm-5.601-2.813a6.963 6.963 0 0 1 0-8.373l1.359 1.358c.024.025.057.035.084.056A4.97 4.97 0 0 0 3 8c0 1.027.31 1.98.842 2.773-.027.022-.06.031-.084.056l-1.36 1.358zm5.6-.187A4 4 0 1 1 8 4a4 4 0 0 1 0 8zM8 1c1.573 0 3.019.525 4.187 1.4l-1.357 1.358c-.025.025-.035.057-.056.084A4.979 4.979 0 0 0 8 3a4.979 4.979 0 0 0-2.773.842c-.021-.027-.03-.059-.055-.084L3.814 2.4A6.957 6.957 0 0 1 8 1zm0-1a8.001 8.001 0 1 0 .003 16.002A8.001 8.001 0 0 0 8 0z"
id="help-a"
/> />
</defs>
<use
fill-rule="evenodd"
href="#help-a"
/>
</svg>
<span <span
class="euiCallOutHeader__title" class="euiCallOutHeader__title"
> >
@ -393,25 +357,13 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiCallOutHeader__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiCallOutHeader__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M13.6 12.186l-1.357-1.358c-.025-.025-.058-.034-.084-.056.53-.794.84-1.746.84-2.773a4.977 4.977 0 0 0-.84-2.772c.026-.02.059-.03.084-.056L13.6 3.813a6.96 6.96 0 0 1 0 8.373zM8 15A6.956 6.956 0 0 1 3.814 13.6l1.358-1.358c.025-.025.034-.057.055-.084C6.02 12.688 6.974 13 8 13a4.978 4.978 0 0 0 2.773-.84c.02.026.03.058.056.083l1.357 1.358A6.956 6.956 0 0 1 8 15zm-5.601-2.813a6.963 6.963 0 0 1 0-8.373l1.359 1.358c.024.025.057.035.084.056A4.97 4.97 0 0 0 3 8c0 1.027.31 1.98.842 2.773-.027.022-.06.031-.084.056l-1.36 1.358zm5.6-.187A4 4 0 1 1 8 4a4 4 0 0 1 0 8zM8 1c1.573 0 3.019.525 4.187 1.4l-1.357 1.358c-.025.025-.035.057-.056.084A4.979 4.979 0 0 0 8 3a4.979 4.979 0 0 0-2.773.842c-.021-.027-.03-.059-.055-.084L3.814 2.4A6.957 6.957 0 0 1 8 1zm0-1a8.001 8.001 0 1 0 .003 16.002A8.001 8.001 0 0 0 8 0z"
id="help-a"
/> />
</defs>
<use
fill-rule="evenodd"
href="#help-a"
/>
</svg>
<span <span
class="euiCallOutHeader__title" class="euiCallOutHeader__title"
> >

View file

@ -522,24 +522,20 @@ exports[`bulkCreate should display success message when bulkCreate is successful
title="complete" title="complete"
type="check" type="check"
> >
<check <EuiIconCheck
className="euiIcon euiIcon--medium euiStepNumber__icon" className="euiIcon euiIcon--medium euiIcon-isLoaded euiStepNumber__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
title="complete" title="complete"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
className="euiIcon euiIcon--medium euiStepNumber__icon" className="euiIcon euiIcon--medium euiIcon-isLoaded euiStepNumber__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
title="complete" title="complete"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
> >
<path <path
@ -547,7 +543,7 @@ exports[`bulkCreate should display success message when bulkCreate is successful
fillRule="evenodd" fillRule="evenodd"
/> />
</svg> </svg>
</check> </EuiIconCheck>
</EuiIcon> </EuiIcon>
</EuiI18n> </EuiI18n>
</div> </div>

View file

@ -135,16 +135,11 @@ exports[`Table should render normally 1`] = `
exports[`Table should render the boolean template (false) 1`] = `<span />`; exports[`Table should render the boolean template (false) 1`] = `<span />`;
exports[`Table should render the boolean template (true) 1`] = ` exports[`Table should render the boolean template (true) 1`] = `
<dot <EuiIconEmpty
aria-label="Is searchable" aria-label="Is searchable"
className="euiIcon euiIcon--medium euiIcon--secondary" className="euiIcon euiIcon--medium euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
/> />
`; `;

View file

@ -32,7 +32,6 @@ import { FeatureCatalogueRegistryProvider, FeatureCatalogueCategory } from 'ui/r
import { i18n } from '@kbn/i18n'; import { i18n } from '@kbn/i18n';
import { I18nContext } from 'ui/i18n'; import { I18nContext } from 'ui/i18n';
import { UICapabilitiesProvider } from 'ui/capabilities/react'; import { UICapabilitiesProvider } from 'ui/capabilities/react';
import { EuiBadge } from '@elastic/eui';
import { getListBreadcrumbs } from './breadcrumbs'; import { getListBreadcrumbs } from './breadcrumbs';
import React from 'react'; import React from 'react';
@ -124,35 +123,38 @@ uiModules.get('apps/management')
}); });
const renderList = () => { const renderList = () => {
$scope.indexPatternList = $route.current.locals.indexPatterns.map(pattern => { $scope.indexPatternList =
$route.current.locals.indexPatterns
.map(pattern => {
const id = pattern.id; const id = pattern.id;
const tags = indexPatternListProvider.getIndexPatternTags(pattern, $scope.defaultIndex === id); const title = pattern.get('title');
const isDefault = $scope.defaultIndex === id;
const tags = indexPatternListProvider.getIndexPatternTags(
pattern,
isDefault
);
return { return {
id: id, id,
title: title,
<span>
{pattern.get('title')}{$scope.defaultIndex === id && (<EuiBadge className="indexPatternList__badge">Default</EuiBadge>)}
</span>,
url: kbnUrl.eval('#/management/kibana/index_patterns/{{id}}', { id: id }), url: kbnUrl.eval('#/management/kibana/index_patterns/{{id}}', { id: id }),
active: $scope.editingId === id, active: $scope.editingId === id,
default: $scope.defaultIndex === id, default: isDefault,
tag: tags && tags.length ? tags[0] : null, tag: tags && tags.length ? tags[0] : null,
//the prepending of 0 at the default pattern takes care of prioritization
//so the sorting will but the default index on top
//or on bottom of a the table
sort: `${isDefault ? '0' : '1'}${title}`,
}; };
}).sort((a, b) => { })
if(a.default) { .sort((a, b) => {
if (a.sort < b.sort) {
return -1; return -1;
} } else if (a.sort > b.sort) {
if(b.default) {
return 1; return 1;
} } else {
if(a.title < b.title) {
return -1;
}
if(a.title > b.title) {
return 1;
}
return 0; return 0;
}
}) || []; }) || [];
updateIndexPatternList($scope.indexPatternList, kbnUrl, indexPatternCreationOptions); updateIndexPatternList($scope.indexPatternList, kbnUrl, indexPatternCreationOptions);

View file

@ -18,6 +18,7 @@
*/ */
import { import {
EuiBadge,
EuiButtonEmpty, EuiButtonEmpty,
EuiButtonIcon, EuiButtonIcon,
EuiFlexGroup, EuiFlexGroup,
@ -38,13 +39,14 @@ const columns = [
{ {
field: 'title', field: 'title',
name: 'Pattern', name: 'Pattern',
render: (name: string, { id }: { id: string }) => ( render: (name: string, index: { id: string; default: boolean }) => (
<EuiButtonEmpty size="xs" href={`#/management/kibana/index_patterns/${id}`}> <EuiButtonEmpty size="xs" href={`#/management/kibana/index_patterns/${index.id}`}>
{name} {name}
{index.default && <EuiBadge className="indexPatternList__badge">Default</EuiBadge>}
</EuiButtonEmpty> </EuiButtonEmpty>
), ),
dataType: 'string', dataType: 'string',
sortable: true, sortable: ({ sort }: { sort: string }) => sort,
}, },
]; ];
@ -56,7 +58,7 @@ const pagination = {
const sorting = { const sorting = {
sort: { sort: {
field: 'title', field: 'title',
direction: 'desc', direction: 'asc',
}, },
}; };
@ -90,9 +92,9 @@ export class IndexPatternTable extends React.Component<Props, State> {
<CreateIndexPatternPrompt onClose={() => this.setState({ showFlyout: false })} /> <CreateIndexPatternPrompt onClose={() => this.setState({ showFlyout: false })} />
)} )}
<EuiFlexGroup justifyContent="spaceBetween"> <EuiFlexGroup justifyContent="spaceBetween">
<EuiFlexItem grow={false}> <EuiFlexItem grow={false} className="euiIEFlexWrapFix">
<EuiFlexGroup alignItems="center" gutterSize="s"> <EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem> <EuiFlexItem grow={false}>
<EuiText> <EuiText>
<h2> <h2>
<FormattedMessage <FormattedMessage
@ -123,6 +125,7 @@ export class IndexPatternTable extends React.Component<Props, State> {
</EuiFlexGroup> </EuiFlexGroup>
<EuiSpacer /> <EuiSpacer />
<EuiInMemoryTable <EuiInMemoryTable
allowNeutralSort={false}
itemId="id" itemId="id"
isSelectable={false} isSelectable={false}
items={this.props.indexPatterns} items={this.props.indexPatterns}

View file

@ -25,9 +25,10 @@ export interface IndexPatternCreationOption {
export interface IndexPattern { export interface IndexPattern {
id: string; id: string;
title: HTMLElement; title: string;
url: string; url: string;
active: boolean; active: boolean;
default: boolean; default: boolean;
tag?: string[]; tag?: string[];
sort: string;
} }

View file

@ -174,17 +174,13 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
class="euiModal__flex" class="euiModal__flex"
@ -235,24 +231,13 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs>
<use
xlink:href="#search-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>
@ -288,7 +273,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -324,7 +309,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -457,17 +442,13 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
class="euiModal__flex" class="euiModal__flex"
@ -518,24 +499,13 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs>
<use
xlink:href="#search-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>
@ -571,7 +541,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -607,7 +577,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -679,17 +649,13 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
class="euiModal__flex" class="euiModal__flex"
@ -740,24 +706,13 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs>
<use
xlink:href="#search-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>
@ -793,7 +748,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -829,7 +784,7 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -914,31 +869,23 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
size="m" size="m"
type="cross" type="cross"
> >
<cross <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg> </EuiIconEmpty>
</cross>
</EuiIcon> </EuiIcon>
</button> </button>
</EuiButtonIcon> </EuiButtonIcon>
@ -1084,39 +1031,23 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
className="euiFormControlLayoutCustomIcon__icon" className="euiFormControlLayoutCustomIcon__icon"
type="search" type="search"
> >
<search <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs> </EuiIconEmpty>
<use
xlinkHref="#search-a"
/>
</svg>
</search>
</EuiIcon> </EuiIcon>
</span> </span>
</EuiFormControlLayoutCustomIcon> </EuiFormControlLayoutCustomIcon>
@ -1224,27 +1155,23 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
size="l" size="l"
type="empty" type="empty"
> >
<empty <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
/> />
</empty> </EuiIconEmpty>
</EuiIcon> </EuiIcon>
</VisTypeIcon> </VisTypeIcon>
</div> </div>
@ -1322,27 +1249,23 @@ exports[`NewVisModal filter for visualization types should render as expected 1`
size="l" size="l"
type="empty" type="empty"
> >
<empty <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
/> />
</empty> </EuiIconEmpty>
</EuiIcon> </EuiIcon>
</VisTypeIcon> </VisTypeIcon>
</div> </div>
@ -1618,17 +1541,13 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
class="euiModal__flex" class="euiModal__flex"
@ -1679,24 +1598,13 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs>
<use
xlink:href="#search-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>
@ -1730,7 +1638,7 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -1765,7 +1673,7 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -1898,17 +1806,13 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
class="euiModal__flex" class="euiModal__flex"
@ -1959,24 +1863,13 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs>
<use
xlink:href="#search-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>
@ -2010,7 +1903,7 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -2045,7 +1938,7 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -2117,17 +2010,13 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
class="euiModal__flex" class="euiModal__flex"
@ -2178,24 +2067,13 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs>
<use
xlink:href="#search-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>
@ -2229,7 +2107,7 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -2264,7 +2142,7 @@ exports[`NewVisModal should render as expected 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--large euiIcon--secondary" class="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
@ -2349,31 +2227,23 @@ exports[`NewVisModal should render as expected 1`] = `
size="m" size="m"
type="cross" type="cross"
> >
<cross <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg> </EuiIconEmpty>
</cross>
</EuiIcon> </EuiIcon>
</button> </button>
</EuiButtonIcon> </EuiButtonIcon>
@ -2519,39 +2389,23 @@ exports[`NewVisModal should render as expected 1`] = `
className="euiFormControlLayoutCustomIcon__icon" className="euiFormControlLayoutCustomIcon__icon"
type="search" type="search"
> >
<search <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11.271 11.978l3.872 3.873a.502.502 0 0 0 .708 0 .502.502 0 0 0 0-.708l-3.565-3.564c2.38-2.747 2.267-6.923-.342-9.532-2.73-2.73-7.17-2.73-9.898 0-2.728 2.729-2.728 7.17 0 9.9a6.955 6.955 0 0 0 4.949 2.05.5.5 0 0 0 0-1 5.96 5.96 0 0 1-4.242-1.757 6.01 6.01 0 0 1 0-8.486c2.337-2.34 6.143-2.34 8.484 0a6.01 6.01 0 0 1 0 8.486.5.5 0 0 0 .034.738z"
id="search-a"
/> />
</defs> </EuiIconEmpty>
<use
xlinkHref="#search-a"
/>
</svg>
</search>
</EuiIcon> </EuiIcon>
</span> </span>
</EuiFormControlLayoutCustomIcon> </EuiFormControlLayoutCustomIcon>
@ -2647,27 +2501,23 @@ exports[`NewVisModal should render as expected 1`] = `
size="l" size="l"
type="empty" type="empty"
> >
<empty <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
/> />
</empty> </EuiIconEmpty>
</EuiIcon> </EuiIcon>
</VisTypeIcon> </VisTypeIcon>
</div> </div>
@ -2745,27 +2595,23 @@ exports[`NewVisModal should render as expected 1`] = `
size="l" size="l"
type="empty" type="empty"
> >
<empty <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--large euiIcon--secondary" className="euiIcon euiIcon--large euiIcon--secondary euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
/> />
</empty> </EuiIconEmpty>
</EuiIcon> </EuiIcon>
</VisTypeIcon> </VisTypeIcon>
</div> </div>

View file

@ -0,0 +1,40 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { MappingProperties } from 'src/legacy/server/mappings';
import { SavedObjectsSchemaDefinition } from '../../schema';
/*
* This file contains logic to convert savedObjectSchemas into a dictonary of indexes and documents
*/
export function createIndexMap(
defaultIndex: string,
savedObjectSchemas: SavedObjectsSchemaDefinition,
indexMap: MappingProperties
) {
const map: { [index: string]: MappingProperties } = {};
Object.keys(indexMap).forEach(type => {
const indexPattern = (savedObjectSchemas[type] || {}).indexPattern || defaultIndex;
if (!map.hasOwnProperty(indexPattern as string)) {
map[indexPattern] = {};
}
map[indexPattern][type] = indexMap[type];
});
return map;
}

View file

@ -61,14 +61,12 @@ describe('KibanaMigrator', () => {
const { kbnServer } = mockKbnServer(); const { kbnServer } = mockKbnServer();
kbnServer.server.plugins.elasticsearch = undefined; kbnServer.server.plugins.elasticsearch = undefined;
const result = await new KibanaMigrator({ kbnServer }).awaitMigration(); const result = await new KibanaMigrator({ kbnServer }).awaitMigration();
expect(result).toEqual({ status: 'skipped' }); expect(result).toEqual([{ status: 'skipped' }, { status: 'skipped' }]);
}); });
it('waits for kbnServer.ready and elasticsearch.ready before attempting migrations', async () => { it('waits for kbnServer.ready and elasticsearch.ready before attempting migrations', async () => {
const { kbnServer } = mockKbnServer(); const { kbnServer } = mockKbnServer();
const clusterStub = jest.fn<any, any>(() => { const clusterStub = jest.fn<any, any>(() => ({ status: 404 }));
throw new Error('Doh!');
});
const waitUntilReady = jest.fn(async () => undefined); const waitUntilReady = jest.fn(async () => undefined);
kbnServer.server.plugins.elasticsearch = { kbnServer.server.plugins.elasticsearch = {
@ -83,7 +81,8 @@ describe('KibanaMigrator', () => {
}, },
}; };
await expect(new KibanaMigrator({ kbnServer }).awaitMigration()).rejects.toThrow(/Doh!/); const migrationResults = await new KibanaMigrator({ kbnServer }).awaitMigration();
expect(migrationResults.length).toEqual(2);
}); });
}); });
}); });
@ -94,11 +93,37 @@ function mockKbnServer({ configValues }: { configValues?: any } = {}) {
version: '8.2.3', version: '8.2.3',
ready: jest.fn(async () => undefined), ready: jest.fn(async () => undefined),
uiExports: { uiExports: {
savedObjectsManagement: {},
savedObjectValidations: {}, savedObjectValidations: {},
savedObjectMigrations: {}, savedObjectMigrations: {},
savedObjectMappings: [], savedObjectMappings: [
savedObjectSchemas: {}, {
savedObjectsManagement: {}, pluginId: 'testtype',
properties: {
testtype: {
properties: {
name: { type: 'keyword' },
},
},
},
},
{
pluginId: 'testtype2',
properties: {
testtype2: {
properties: {
name: { type: 'keyword' },
},
},
},
},
],
savedObjectSchemas: {
testtype2: {
isNamespaceAgnostic: false,
indexPattern: 'other-index',
},
},
}, },
server: { server: {
config: () => ({ config: () => ({

View file

@ -30,7 +30,7 @@ import { RawSavedObjectDoc, SavedObjectsSerializer } from '../../serialization';
import { docValidator } from '../../validation'; import { docValidator } from '../../validation';
import { buildActiveMappings, CallCluster, IndexMigrator, LogFn } from '../core'; import { buildActiveMappings, CallCluster, IndexMigrator, LogFn } from '../core';
import { DocumentMigrator, VersionedTransformer } from '../core/document_migrator'; import { DocumentMigrator, VersionedTransformer } from '../core/document_migrator';
import { createIndexMap } from '../core/build_index_map';
export interface KbnServer { export interface KbnServer {
server: Server; server: Server;
version: string; version: string;
@ -86,27 +86,39 @@ export class KibanaMigrator {
['warning', 'migration'], ['warning', 'migration'],
'The elasticsearch plugin is disabled. Skipping migrations.' 'The elasticsearch plugin is disabled. Skipping migrations.'
); );
return { status: 'skipped' }; return Object.keys(this.mappingProperties).map(() => ({ status: 'skipped' }));
} }
// Wait until elasticsearch is green... // Wait until elasticsearch is green...
await server.plugins.elasticsearch.waitUntilReady(); await server.plugins.elasticsearch.waitUntilReady();
const config = server.config(); const config = server.config();
const migrator = new IndexMigrator({ const indexMap = createIndexMap(
config.get('kibana.index'),
this.kbnServer.uiExports.savedObjectSchemas,
this.mappingProperties
);
const migrators = Object.keys(indexMap).map(index => {
return new IndexMigrator({
batchSize: config.get('migrations.batchSize'), batchSize: config.get('migrations.batchSize'),
callCluster: server.plugins.elasticsearch!.getCluster('admin').callWithInternalUser, callCluster: server.plugins.elasticsearch!.getCluster('admin').callWithInternalUser,
documentMigrator: this.documentMigrator, documentMigrator: this.documentMigrator,
index: config.get('kibana.index'), index,
log: this.log, log: this.log,
mappingProperties: this.mappingProperties, mappingProperties: indexMap[index],
pollInterval: config.get('migrations.pollInterval'), pollInterval: config.get('migrations.pollInterval'),
scrollDuration: config.get('migrations.scrollDuration'), scrollDuration: config.get('migrations.scrollDuration'),
serializer: this.serializer, serializer: this.serializer,
obsoleteIndexTemplatePattern: 'kibana_index_template*', obsoleteIndexTemplatePattern: 'kibana_index_template*',
}); });
});
return migrator.migrate(); if (migrators.length === 0) {
throw new Error(`Migrations failed to run, no mappings found or Kibana is not "ready".`);
}
return Promise.all(migrators.map(migrator => migrator.migrate()));
}); });
private kbnServer: KbnServer; private kbnServer: KbnServer;
@ -124,11 +136,15 @@ export class KibanaMigrator {
*/ */
constructor({ kbnServer }: { kbnServer: KbnServer }) { constructor({ kbnServer }: { kbnServer: KbnServer }) {
this.kbnServer = kbnServer; this.kbnServer = kbnServer;
this.serializer = new SavedObjectsSerializer( this.serializer = new SavedObjectsSerializer(
new SavedObjectsSchema(kbnServer.uiExports.savedObjectSchemas) new SavedObjectsSchema(kbnServer.uiExports.savedObjectSchemas)
); );
this.mappingProperties = mergeProperties(kbnServer.uiExports.savedObjectMappings || []); this.mappingProperties = mergeProperties(kbnServer.uiExports.savedObjectMappings || []);
this.log = (meta: string[], message: string) => kbnServer.server.log(meta, message); this.log = (meta: string[], message: string) => kbnServer.server.log(meta, message);
this.documentMigrator = new DocumentMigrator({ this.documentMigrator = new DocumentMigrator({
kibanaVersion: kbnServer.version, kibanaVersion: kbnServer.version,
migrations: kbnServer.uiExports.savedObjectMigrations || {}, migrations: kbnServer.uiExports.savedObjectMigrations || {},
@ -138,7 +154,7 @@ export class KibanaMigrator {
} }
/** /**
* Gets the index mappings defined by Kibana's enabled plugins. * Gets all the index mappings defined by Kibana's enabled plugins.
* *
* @returns * @returns
* @memberof KibanaMigrator * @memberof KibanaMigrator

View file

@ -17,6 +17,10 @@
* under the License. * under the License.
*/ */
jest.mock('../export', () => ({
getSortedObjectsForExport: jest.fn(),
}));
import Hapi from 'hapi'; import Hapi from 'hapi';
import * as exportMock from '../export'; import * as exportMock from '../export';
import { createMockServer } from './_mock_server'; import { createMockServer } from './_mock_server';
@ -24,10 +28,6 @@ import { createExportRoute } from './export';
const getSortedObjectsForExport = exportMock.getSortedObjectsForExport as jest.Mock; const getSortedObjectsForExport = exportMock.getSortedObjectsForExport as jest.Mock;
jest.mock('../export', () => ({
getSortedObjectsForExport: jest.fn(),
}));
describe('POST /api/saved_objects/_export', () => { describe('POST /api/saved_objects/_export', () => {
let server: Hapi.Server; let server: Hapi.Server;
const savedObjectsClient = { const savedObjectsClient = {

View file

@ -67,6 +67,9 @@ describe('Saved Objects Mixin', () => {
hiddentype: { hiddentype: {
hidden: true, hidden: true,
}, },
doc1: {
indexPattern: 'other-index',
},
}, },
savedObjectMappings: [ savedObjectMappings: [
{ {
@ -79,6 +82,21 @@ describe('Saved Objects Mixin', () => {
}, },
}, },
}, },
{
pluginId: 'testtype2',
properties: {
doc1: {
properties: {
name: { type: 'keyword' },
},
},
doc2: {
properties: {
name: { type: 'keyword' },
},
},
},
},
{ {
pluginId: 'secretPlugin', pluginId: 'secretPlugin',
properties: { properties: {
@ -198,7 +216,7 @@ describe('Saved Objects Mixin', () => {
it('should return all but hidden types', () => { it('should return all but hidden types', () => {
expect(service).toBeDefined(); expect(service).toBeDefined();
expect(service.types).toEqual(['config', 'testtype']); expect(service.types).toEqual(['config', 'testtype', 'doc1', 'doc2']);
}); });
const mockCallEs = jest.fn(); const mockCallEs = jest.fn();
@ -212,7 +230,7 @@ describe('Saved Objects Mixin', () => {
it('should create a repository without hidden types', () => { it('should create a repository without hidden types', () => {
const repository = service.getSavedObjectsRepository(mockCallEs); const repository = service.getSavedObjectsRepository(mockCallEs);
expect(repository).toBeDefined(); expect(repository).toBeDefined();
expect(repository._allowedTypes).toEqual(['config', 'testtype']); expect(repository._allowedTypes).toEqual(['config', 'testtype', 'doc1', 'doc2']);
}); });
it('should create a repository with a unique list of allowed types', () => { it('should create a repository with a unique list of allowed types', () => {
@ -221,7 +239,7 @@ describe('Saved Objects Mixin', () => {
'config', 'config',
'config', 'config',
]); ]);
expect(repository._allowedTypes).toEqual(['config', 'testtype']); expect(repository._allowedTypes).toEqual(['config', 'testtype', 'doc1', 'doc2']);
}); });
it('should create a repository with extraTypes minus duplicate', () => { it('should create a repository with extraTypes minus duplicate', () => {
@ -229,7 +247,13 @@ describe('Saved Objects Mixin', () => {
'hiddentype', 'hiddentype',
'hiddentype', 'hiddentype',
]); ]);
expect(repository._allowedTypes).toEqual(['config', 'testtype', 'hiddentype']); expect(repository._allowedTypes).toEqual([
'config',
'testtype',
'doc1',
'doc2',
'hiddentype',
]);
}); });
it('should not allow a repository without a callCluster function', () => { it('should not allow a repository without a callCluster function', () => {

View file

@ -20,6 +20,7 @@
interface SavedObjectsSchemaTypeDefinition { interface SavedObjectsSchemaTypeDefinition {
isNamespaceAgnostic: boolean; isNamespaceAgnostic: boolean;
hidden?: boolean; hidden?: boolean;
indexPattern?: string;
} }
export interface SavedObjectsSchemaDefinition { export interface SavedObjectsSchemaDefinition {

View file

@ -26,7 +26,22 @@ export interface SavedObjectsRepositoryOptions {
schema: unknown; schema: unknown;
serializer: unknown; serializer: unknown;
migrator: unknown; migrator: unknown;
onBeforeWrite: unknown; onBeforeWrite?: (
action: 'create' | 'index' | 'update' | 'bulk' | 'delete' | 'deleteByQuery',
params: {
index: string;
id?: string;
body: any;
}
) => void;
onBeforeRead?: (
action: 'get' | 'bulk',
params: {
index: string;
id?: string;
body: any;
}
) => void;
} }
export declare class SavedObjectsRepository { export declare class SavedObjectsRepository {

View file

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
import { omit } from 'lodash'; import { omit, flatten } from 'lodash';
import { getRootPropertiesObjects } from '../../../mappings'; import { getRootPropertiesObjects } from '../../../mappings';
import { getSearchDsl } from './search_dsl'; import { getSearchDsl } from './search_dsl';
import { includedFields } from './included_fields'; import { includedFields } from './included_fields';
@ -39,6 +39,7 @@ export class SavedObjectsRepository {
migrator, migrator,
allowedTypes = [], allowedTypes = [],
onBeforeWrite = () => {}, onBeforeWrite = () => {},
onBeforeRead = () => {},
} = options; } = options;
// It's important that we migrate documents / mark them as up-to-date // It's important that we migrate documents / mark them as up-to-date
@ -58,6 +59,8 @@ export class SavedObjectsRepository {
this._allowedTypes = allowedTypes; this._allowedTypes = allowedTypes;
this._onBeforeWrite = onBeforeWrite; this._onBeforeWrite = onBeforeWrite;
this._onBeforeRead = onBeforeRead;
this._unwrappedCallCluster = async (...args) => { this._unwrappedCallCluster = async (...args) => {
await migrator.awaitMigration(); await migrator.awaitMigration();
return callCluster(...args); return callCluster(...args);
@ -104,7 +107,7 @@ export class SavedObjectsRepository {
const response = await this._writeToCluster(method, { const response = await this._writeToCluster(method, {
id: raw._id, id: raw._id,
index: this._index, index: this._getIndexForType(type),
refresh: 'wait_for', refresh: 'wait_for',
body: raw._source, body: raw._source,
}); });
@ -170,6 +173,7 @@ export class SavedObjectsRepository {
{ {
[method]: { [method]: {
_id: expectedResult.rawMigratedDoc._id, _id: expectedResult.rawMigratedDoc._id,
_index: this._getIndexForType(object.type),
}, },
}, },
expectedResult.rawMigratedDoc._source expectedResult.rawMigratedDoc._source
@ -179,7 +183,6 @@ export class SavedObjectsRepository {
}); });
const esResponse = await this._writeToCluster('bulk', { const esResponse = await this._writeToCluster('bulk', {
index: this._index,
refresh: 'wait_for', refresh: 'wait_for',
body: bulkCreateParams, body: bulkCreateParams,
}); });
@ -251,7 +254,7 @@ export class SavedObjectsRepository {
const response = await this._writeToCluster('delete', { const response = await this._writeToCluster('delete', {
id: this._serializer.generateRawId(namespace, type, id), id: this._serializer.generateRawId(namespace, type, id),
index: this._index, index: this._getIndexForType(type),
refresh: 'wait_for', refresh: 'wait_for',
ignore: [404], ignore: [404],
}); });
@ -288,8 +291,16 @@ export class SavedObjectsRepository {
const typesToDelete = allTypes.filter(type => !this._schema.isNamespaceAgnostic(type)); const typesToDelete = allTypes.filter(type => !this._schema.isNamespaceAgnostic(type));
const indexes = flatten(
Object.values(this._schema).map(schema =>
Object.values(schema).map(props => props.indexPattern)
)
)
.filter(pattern => pattern !== undefined)
.concat([this._index]);
const esOptions = { const esOptions = {
index: this._index, index: indexes,
ignore: [404], ignore: [404],
refresh: 'wait_for', refresh: 'wait_for',
body: { body: {
@ -369,7 +380,7 @@ export class SavedObjectsRepository {
} }
const esOptions = { const esOptions = {
index: this._index, index: this._getIndexForType(type),
size: perPage, size: perPage,
from: perPage * (page - 1), from: perPage * (page - 1),
_source: includedFields(type, fields), _source: includedFields(type, fields),
@ -434,12 +445,12 @@ export class SavedObjectsRepository {
const unsupportedTypes = []; const unsupportedTypes = [];
const response = await this._callCluster('mget', { const response = await this._callCluster('mget', {
index: this._index,
body: { body: {
docs: objects.reduce((acc, { type, id, fields }) => { docs: objects.reduce((acc, { type, id, fields }) => {
if (this._isTypeAllowed(type)) { if (this._isTypeAllowed(type)) {
acc.push({ acc.push({
_id: this._serializer.generateRawId(namespace, type, id), _id: this._serializer.generateRawId(namespace, type, id),
_index: this._getIndexForType(type),
_source: includedFields(type, fields), _source: includedFields(type, fields),
}); });
} else { } else {
@ -500,7 +511,7 @@ export class SavedObjectsRepository {
const response = await this._callCluster('get', { const response = await this._callCluster('get', {
id: this._serializer.generateRawId(namespace, type, id), id: this._serializer.generateRawId(namespace, type, id),
index: this._index, index: this._getIndexForType(type),
ignore: [404], ignore: [404],
}); });
@ -545,7 +556,7 @@ export class SavedObjectsRepository {
const time = this._getCurrentTime(); const time = this._getCurrentTime();
const response = await this._writeToCluster('update', { const response = await this._writeToCluster('update', {
id: this._serializer.generateRawId(namespace, type, id), id: this._serializer.generateRawId(namespace, type, id),
index: this._index, index: this._getIndexForType(type),
...(version && decodeRequestVersion(version)), ...(version && decodeRequestVersion(version)),
refresh: 'wait_for', refresh: 'wait_for',
ignore: [404], ignore: [404],
@ -610,7 +621,7 @@ export class SavedObjectsRepository {
const response = await this._writeToCluster('update', { const response = await this._writeToCluster('update', {
id: this._serializer.generateRawId(namespace, type, id), id: this._serializer.generateRawId(namespace, type, id),
index: this._index, index: this._getIndexForType(type),
refresh: 'wait_for', refresh: 'wait_for',
_source: true, _source: true,
body: { body: {
@ -648,7 +659,16 @@ export class SavedObjectsRepository {
async _writeToCluster(method, params) { async _writeToCluster(method, params) {
try { try {
await this._onBeforeWrite(); await this._onBeforeWrite(method, params);
return await this._callCluster(method, params);
} catch (err) {
throw decorateEsError(err);
}
}
async _readFromCluster(method, params) {
try {
await this._onBeforeRead(method, params);
return await this._callCluster(method, params); return await this._callCluster(method, params);
} catch (err) { } catch (err) {
throw decorateEsError(err); throw decorateEsError(err);
@ -663,6 +683,15 @@ export class SavedObjectsRepository {
} }
} }
_getIndexForType(type) {
return (
(this._schema.definition &&
this._schema.definition[type] &&
this._schema.definition[type].indexPattern) ||
this._index
);
}
_getCurrentTime() { _getCurrentTime() {
return new Date().toISOString(); return new Date().toISOString();
} }

View file

@ -214,6 +214,11 @@ describe('SavedObjectsRepository', () => {
type: 'keyword', type: 'keyword',
}, },
}, },
baz: {
properties: {
type: 'keyword',
},
},
'index-pattern': { 'index-pattern': {
properties: { properties: {
someField: { someField: {
@ -249,6 +254,7 @@ describe('SavedObjectsRepository', () => {
globaltype: { isNamespaceAgnostic: true }, globaltype: { isNamespaceAgnostic: true },
foo: { isNamespaceAgnostic: true }, foo: { isNamespaceAgnostic: true },
bar: { isNamespaceAgnostic: true }, bar: { isNamespaceAgnostic: true },
baz: { indexPattern: 'beats' },
hiddenType: { isNamespaceAgnostic: true, hidden: true }, hiddenType: { isNamespaceAgnostic: true, hidden: true },
}); });
@ -358,6 +364,36 @@ describe('SavedObjectsRepository', () => {
expect(onBeforeWrite).toHaveBeenCalledTimes(1); expect(onBeforeWrite).toHaveBeenCalledTimes(1);
}); });
it('should use default index', async () => {
await savedObjectsRepository.create('index-pattern', {
id: 'logstash-*',
title: 'Logstash',
});
expect(onBeforeWrite).toHaveBeenCalledTimes(1);
expect(onBeforeWrite).toHaveBeenCalledWith(
'index',
expect.objectContaining({
index: '.kibana-test',
})
);
});
it('should use custom index', async () => {
await savedObjectsRepository.create('baz', {
id: 'logstash-*',
title: 'Logstash',
});
expect(onBeforeWrite).toHaveBeenCalledTimes(1);
expect(onBeforeWrite).toHaveBeenCalledWith(
'index',
expect.objectContaining({
index: 'beats',
})
);
});
it('migrates the doc', async () => { it('migrates the doc', async () => {
migrator.migrateDocument = doc => { migrator.migrateDocument = doc => {
doc.attributes.title = doc.attributes.title + '!!'; doc.attributes.title = doc.attributes.title + '!!';
@ -572,14 +608,14 @@ describe('SavedObjectsRepository', () => {
expect(bulkCalls.length).toEqual(1); expect(bulkCalls.length).toEqual(1);
expect(bulkCalls[0][1].body).toEqual([ expect(bulkCalls[0][1].body).toEqual([
{ create: { _id: 'config:one' } }, { create: { _index: '.kibana-test', _id: 'config:one' } },
{ {
type: 'config', type: 'config',
...mockTimestampFields, ...mockTimestampFields,
config: { title: 'Test One' }, config: { title: 'Test One' },
references: [{ name: 'ref_0', type: 'test', id: '1' }], references: [{ name: 'ref_0', type: 'test', id: '1' }],
}, },
{ create: { _id: 'index-pattern:two' } }, { create: { _index: '.kibana-test', _id: 'index-pattern:two' } },
{ {
type: 'index-pattern', type: 'index-pattern',
...mockTimestampFields, ...mockTimestampFields,
@ -629,7 +665,7 @@ describe('SavedObjectsRepository', () => {
'bulk', 'bulk',
expect.objectContaining({ expect.objectContaining({
body: [ body: [
{ create: { _id: 'config:one' } }, { create: { _index: '.kibana-test', _id: 'config:one' } },
{ {
type: 'config', type: 'config',
...mockTimestampFields, ...mockTimestampFields,
@ -637,7 +673,7 @@ describe('SavedObjectsRepository', () => {
migrationVersion: { foo: '2.3.4' }, migrationVersion: { foo: '2.3.4' },
references: [{ name: 'search_0', type: 'search', id: '123' }], references: [{ name: 'search_0', type: 'search', id: '123' }],
}, },
{ create: { _id: 'index-pattern:two' } }, { create: { _index: '.kibana-test', _id: 'index-pattern:two' } },
{ {
type: 'index-pattern', type: 'index-pattern',
...mockTimestampFields, ...mockTimestampFields,
@ -689,7 +725,7 @@ describe('SavedObjectsRepository', () => {
expect.objectContaining({ expect.objectContaining({
body: [ body: [
// uses create because overwriting is not allowed // uses create because overwriting is not allowed
{ create: { _id: 'foo:bar' } }, { create: { _index: '.kibana-test', _id: 'foo:bar' } },
{ type: 'foo', ...mockTimestampFields, foo: {}, references: [] }, { type: 'foo', ...mockTimestampFields, foo: {}, references: [] },
], ],
}) })
@ -713,7 +749,7 @@ describe('SavedObjectsRepository', () => {
expect.objectContaining({ expect.objectContaining({
body: [ body: [
// uses index because overwriting is allowed // uses index because overwriting is allowed
{ index: { _id: 'foo:bar' } }, { index: { _index: '.kibana-test', _id: 'foo:bar' } },
{ type: 'foo', ...mockTimestampFields, foo: {}, references: [] }, { type: 'foo', ...mockTimestampFields, foo: {}, references: [] },
], ],
}) })
@ -829,6 +865,7 @@ describe('SavedObjectsRepository', () => {
create: { create: {
_type: '_doc', _type: '_doc',
_id: 'foo-namespace:config:one', _id: 'foo-namespace:config:one',
_index: '.kibana-test',
_primary_term: 1, _primary_term: 1,
_seq_no: 2, _seq_no: 2,
}, },
@ -857,7 +894,7 @@ describe('SavedObjectsRepository', () => {
'bulk', 'bulk',
expect.objectContaining({ expect.objectContaining({
body: [ body: [
{ create: { _id: 'foo-namespace:config:one' } }, { create: { _index: '.kibana-test', _id: 'foo-namespace:config:one' } },
{ {
namespace: 'foo-namespace', namespace: 'foo-namespace',
type: 'config', type: 'config',
@ -865,7 +902,7 @@ describe('SavedObjectsRepository', () => {
config: { title: 'Test One' }, config: { title: 'Test One' },
references: [], references: [],
}, },
{ create: { _id: 'foo-namespace:index-pattern:two' } }, { create: { _index: '.kibana-test', _id: 'foo-namespace:index-pattern:two' } },
{ {
namespace: 'foo-namespace', namespace: 'foo-namespace',
type: 'index-pattern', type: 'index-pattern',
@ -908,14 +945,14 @@ describe('SavedObjectsRepository', () => {
'bulk', 'bulk',
expect.objectContaining({ expect.objectContaining({
body: [ body: [
{ create: { _id: 'config:one' } }, { create: { _id: 'config:one', _index: '.kibana-test' } },
{ {
type: 'config', type: 'config',
...mockTimestampFields, ...mockTimestampFields,
config: { title: 'Test One' }, config: { title: 'Test One' },
references: [], references: [],
}, },
{ create: { _id: 'index-pattern:two' } }, { create: { _id: 'index-pattern:two', _index: '.kibana-test' } },
{ {
type: 'index-pattern', type: 'index-pattern',
...mockTimestampFields, ...mockTimestampFields,
@ -943,7 +980,7 @@ describe('SavedObjectsRepository', () => {
'bulk', 'bulk',
expect.objectContaining({ expect.objectContaining({
body: [ body: [
{ create: { _id: 'globaltype:one' } }, { create: { _id: 'globaltype:one', _index: '.kibana-test' } },
{ {
type: 'globaltype', type: 'globaltype',
...mockTimestampFields, ...mockTimestampFields,
@ -1063,13 +1100,13 @@ describe('SavedObjectsRepository', () => {
expect(getSearchDslNS.getSearchDsl).toHaveBeenCalledWith(mappings, schema, { expect(getSearchDslNS.getSearchDsl).toHaveBeenCalledWith(mappings, schema, {
namespace: 'my-namespace', namespace: 'my-namespace',
type: ['config', 'index-pattern', 'dashboard'], type: ['config', 'baz', 'index-pattern', 'dashboard'],
}); });
expect(callAdminCluster).toHaveBeenCalledWith('deleteByQuery', { expect(callAdminCluster).toHaveBeenCalledWith('deleteByQuery', {
body: { conflicts: 'proceed' }, body: { conflicts: 'proceed' },
ignore: [404], ignore: [404],
index: '.kibana-test', index: ['beats', '.kibana-test'],
refresh: 'wait_for', refresh: 'wait_for',
}); });
}); });
@ -1401,9 +1438,9 @@ describe('SavedObjectsRepository', () => {
expect.objectContaining({ expect.objectContaining({
body: { body: {
docs: [ docs: [
{ _id: 'config:one' }, { _id: 'config:one', _index: '.kibana-test' },
{ _id: 'index-pattern:two' }, { _id: 'index-pattern:two', _index: '.kibana-test' },
{ _id: 'globaltype:three' }, { _id: 'globaltype:three', _index: '.kibana-test' },
], ],
}, },
}) })
@ -1432,9 +1469,9 @@ describe('SavedObjectsRepository', () => {
expect.objectContaining({ expect.objectContaining({
body: { body: {
docs: [ docs: [
{ _id: 'foo-namespace:config:one' }, { _id: 'foo-namespace:config:one', _index: '.kibana-test' },
{ _id: 'foo-namespace:index-pattern:two' }, { _id: 'foo-namespace:index-pattern:two', _index: '.kibana-test' },
{ _id: 'globaltype:three' }, { _id: 'globaltype:three', _index: '.kibana-test' },
], ],
}, },
}) })
@ -1966,6 +2003,14 @@ describe('SavedObjectsRepository', () => {
}); });
}); });
describe('types on custom index', () => {
it("should error when attempting to 'update' an unsupported type", async () => {
await expect(
savedObjectsRepository.update('hiddenType', 'bogus', { title: 'some title' })
).rejects.toEqual(new Error('Saved object [hiddenType/bogus] not found'));
});
});
describe('unsupported types', () => { describe('unsupported types', () => {
it("should error when attempting to 'update' an unsupported type", async () => { it("should error when attempting to 'update' an unsupported type", async () => {
await expect( await expect(

View file

@ -274,40 +274,23 @@ exports[`InspectorPanel should render as expected 1`] = `
size="m" size="m"
type="arrowDown" type="arrowDown"
> >
<arrowDown <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonEmpty__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonEmpty__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonEmpty__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonEmpty__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs> </EuiIconEmpty>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</arrowDown>
</EuiIcon> </EuiIcon>
<span <span
className="euiButtonEmpty__text" className="euiButtonEmpty__text"

View file

@ -26,25 +26,13 @@ exports[`<EditorOptionsGroup/> renders as expected 1`] = `
class="euiFlexItem euiFlexItem--flexGrowZero euiAccordion__iconWrapper" class="euiFlexItem euiFlexItem--flexGrowZero euiAccordion__iconWrapper"
> >
<svg <svg
class="euiIcon euiIcon--medium" class="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fill-rule="nonzero"
href="#arrow_down-a"
/>
</svg>
</div> </div>
<div <div
class="euiFlexItem euiAccordion__buttonContent" class="euiFlexItem euiAccordion__buttonContent"
@ -109,25 +97,13 @@ exports[`<EditorOptionsGroup/> renders as expected with actions 1`] = `
class="euiFlexItem euiFlexItem--flexGrowZero euiAccordion__iconWrapper" class="euiFlexItem euiFlexItem--flexGrowZero euiAccordion__iconWrapper"
> >
<svg <svg
class="euiIcon euiIcon--medium" class="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fill-rule="nonzero"
href="#arrow_down-a"
/>
</svg>
</div> </div>
<div <div
class="euiFlexItem euiAccordion__buttonContent" class="euiFlexItem euiAccordion__buttonContent"
@ -151,24 +127,13 @@ exports[`<EditorOptionsGroup/> renders as expected with actions 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonIcon__icon" class="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
href="#trash-a"
/>
</svg>
</button> </button>
</div> </div>
</div> </div>
@ -219,26 +184,13 @@ exports[`<EditorOptionsGroup/> renders as expected with initial collapsed 1`] =
class="euiFlexItem euiFlexItem--flexGrowZero euiAccordion__iconWrapper" class="euiFlexItem euiFlexItem--flexGrowZero euiAccordion__iconWrapper"
> >
<svg <svg
class="euiIcon euiIcon--medium" class="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fill-rule="nonzero"
href="#arrow_right-a"
transform="matrix(0 1 1 0 0 0)"
/>
</svg>
</div> </div>
<div <div
class="euiFlexItem euiAccordion__buttonContent" class="euiFlexItem euiAccordion__buttonContent"

View file

@ -23,7 +23,7 @@ import ngMock from 'ng_mock';
import series from 'fixtures/vislib/mock_data/date_histogram/_series'; import series from 'fixtures/vislib/mock_data/date_histogram/_series';
import terms from 'fixtures/vislib/mock_data/terms/_columns'; import terms from 'fixtures/vislib/mock_data/terms/_columns';
import $ from 'jquery'; import $ from 'jquery';
import { VislibVisualizationsTimeMarkerProvider } from '../../visualizations/time_marker'; import { TimeMarker } from '../../visualizations/time_marker';
describe('Vislib Time Marker Test Suite', function () { describe('Vislib Time Marker Test Suite', function () {
const height = 50; const height = 50;
@ -49,7 +49,6 @@ describe('Vislib Time Marker Test Suite', function () {
}); });
}; };
const times = []; const times = [];
let TimeMarker;
let defaultMarker; let defaultMarker;
let customMarker; let customMarker;
let selection; let selection;
@ -59,8 +58,7 @@ describe('Vislib Time Marker Test Suite', function () {
let domain; let domain;
beforeEach(ngMock.module('kibana')); beforeEach(ngMock.module('kibana'));
beforeEach(ngMock.inject(function (Private) { beforeEach(ngMock.inject(function () {
TimeMarker = Private(VislibVisualizationsTimeMarkerProvider);
minDomain = getExtent(series.series, d3.min); minDomain = getExtent(series.series, d3.min);
maxDomain = getExtent(series.series, d3.max); maxDomain = getExtent(series.series, d3.max);
domain = [minDomain, maxDomain]; domain = [minDomain, maxDomain];

View file

@ -22,7 +22,7 @@ import _ from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
import { VislibLibErrorHandlerProvider } from '../_error_handler'; import { VislibLibErrorHandlerProvider } from '../_error_handler';
import { VislibLibAxisTitleProvider } from './axis_title'; import { VislibLibAxisTitleProvider } from './axis_title';
import { VislibAxisLabelsProvider } from './axis_labels'; import { AxisLabels } from './axis_labels';
import { VislibAxisScaleProvider } from './axis_scale'; import { VislibAxisScaleProvider } from './axis_scale';
import { VislibLibAxisConfigProvider } from './axis_config'; import { VislibLibAxisConfigProvider } from './axis_config';
import { VislibError } from '../../../errors'; import { VislibError } from '../../../errors';
@ -30,7 +30,6 @@ import { VislibError } from '../../../errors';
export function VislibLibAxisProvider(Private) { export function VislibLibAxisProvider(Private) {
const ErrorHandler = Private(VislibLibErrorHandlerProvider); const ErrorHandler = Private(VislibLibErrorHandlerProvider);
const AxisTitle = Private(VislibLibAxisTitleProvider); const AxisTitle = Private(VislibLibAxisTitleProvider);
const AxisLabels = Private(VislibAxisLabelsProvider);
const AxisScale = Private(VislibAxisScaleProvider); const AxisScale = Private(VislibAxisScaleProvider);
const AxisConfig = Private(VislibLibAxisConfigProvider); const AxisConfig = Private(VislibLibAxisConfigProvider);

View file

@ -21,8 +21,7 @@ import d3 from 'd3';
import $ from 'jquery'; import $ from 'jquery';
import { truncateLabel } from '../../components/labels/truncate_labels'; import { truncateLabel } from '../../components/labels/truncate_labels';
export function VislibAxisLabelsProvider() { export class AxisLabels {
class AxisLabels {
constructor(axisConfig, scale) { constructor(axisConfig, scale) {
this.axisConfig = axisConfig; this.axisConfig = axisConfig;
this.axisScale = scale; this.axisScale = scale;
@ -139,7 +138,4 @@ export function VislibAxisLabelsProvider() {
}); });
}; };
} }
}
return AxisLabels;
} }

View file

@ -21,7 +21,7 @@ import d3 from 'd3';
import _ from 'lodash'; import _ from 'lodash';
import { dataLabel } from '../lib/_data_label'; import { dataLabel } from '../lib/_data_label';
import { VislibLibDispatchProvider } from '../lib/dispatch'; import { VislibLibDispatchProvider } from '../lib/dispatch';
import { TooltipProvider } from '../../vis/components/tooltip'; import { Tooltip } from '../../vis/components/tooltip';
import { getFormat } from '../../visualize/loader/pipeline_helpers/utilities'; import { getFormat } from '../../visualize/loader/pipeline_helpers/utilities';
import { HierarchicalTooltipFormatterProvider } from '../../agg_response/hierarchical/_hierarchical_tooltip_formatter'; import { HierarchicalTooltipFormatterProvider } from '../../agg_response/hierarchical/_hierarchical_tooltip_formatter';
import { PointSeriesTooltipFormatter } from '../../agg_response/point_series/_tooltip_formatter'; import { PointSeriesTooltipFormatter } from '../../agg_response/point_series/_tooltip_formatter';
@ -29,7 +29,6 @@ import { PointSeriesTooltipFormatter } from '../../agg_response/point_series/_to
export function VislibVisualizationsChartProvider(Private) { export function VislibVisualizationsChartProvider(Private) {
const Dispatch = Private(VislibLibDispatchProvider); const Dispatch = Private(VislibLibDispatchProvider);
const Tooltip = Private(TooltipProvider);
/** /**
* The Base Class for all visualizations. * The Base Class for all visualizations.
* *

View file

@ -19,11 +19,10 @@
import d3 from 'd3'; import d3 from 'd3';
import { VislibVisualizationsChartProvider } from './_chart'; import { VislibVisualizationsChartProvider } from './_chart';
import { GaugeTypesProvider } from './gauges/gauge_types'; import { gaugeTypes } from './gauges/gauge_types';
export function GaugeChartProvider(Private) { export function GaugeChartProvider(Private) {
const Chart = Private(VislibVisualizationsChartProvider); const Chart = Private(VislibVisualizationsChartProvider);
const gaugeTypes = Private(GaugeTypesProvider);
class GaugeChart extends Chart { class GaugeChart extends Chart {
constructor(handler, chartEl, chartData) { constructor(handler, chartEl, chartData) {

View file

@ -17,11 +17,8 @@
* under the License. * under the License.
*/ */
import { MeterGaugeProvider } from './meter'; import { MeterGauge } from './meter';
export function GaugeTypesProvider(Private) { export const gaugeTypes = {
meter: MeterGauge
return { };
meter: Private(MeterGaugeProvider)
};
}

View file

@ -21,10 +21,8 @@ import d3 from 'd3';
import _ from 'lodash'; import _ from 'lodash';
import { getHeatmapColors } from '../../components/color/heatmap_color'; import { getHeatmapColors } from '../../components/color/heatmap_color';
export function MeterGaugeProvider() {
const defaultConfig = {
const defaultConfig = {
showTooltip: true, showTooltip: true,
percentageMode: true, percentageMode: true,
maxAngle: 2 * Math.PI * 1.3, maxAngle: 2 * Math.PI * 1.3,
@ -46,9 +44,9 @@ export function MeterGaugeProvider() {
bgWidth: 0.5, bgWidth: 0.5,
width: 0.9 width: 0.9
} }
}; };
class MeterGauge { export class MeterGauge {
constructor(gaugeChart) { constructor(gaugeChart) {
this.gaugeChart = gaugeChart; this.gaugeChart = gaugeChart;
this.gaugeConfig = gaugeChart.gaugeConfig; this.gaugeConfig = gaugeChart.gaugeConfig;
@ -340,7 +338,4 @@ export function MeterGaugeProvider() {
return series; return series;
} }
}
return MeterGauge;
} }

View file

@ -20,17 +20,15 @@
import d3 from 'd3'; import d3 from 'd3';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
import { TooltipProvider } from '../../vis/components/tooltip'; import { Tooltip } from '../../vis/components/tooltip';
import { VislibVisualizationsChartProvider } from './_chart'; import { VislibVisualizationsChartProvider } from './_chart';
import { VislibVisualizationsTimeMarkerProvider } from './time_marker'; import { TimeMarker } from './time_marker';
import { VislibVisualizationsSeriesTypesProvider } from './point_series/series_types'; import { seriesTypes } from './point_series/series_types';
export function VislibVisualizationsPointSeriesProvider(Private) { export function VislibVisualizationsPointSeriesProvider(Private) {
const Chart = Private(VislibVisualizationsChartProvider); const Chart = Private(VislibVisualizationsChartProvider);
const Tooltip = Private(TooltipProvider); const seriTypes = seriesTypes;
const TimeMarker = Private(VislibVisualizationsTimeMarkerProvider);
const seriTypes = Private(VislibVisualizationsSeriesTypesProvider);
const touchdownTmpl = _.template(require('../partials/touchdown.tmpl.html')); const touchdownTmpl = _.template(require('../partials/touchdown.tmpl.html'));
/** /**
* Line Chart Visualization * Line Chart Visualization

View file

@ -19,9 +19,7 @@
import _ from 'lodash'; import _ from 'lodash';
export function VislibVisualizationsPointSeriesProvider() { export class PointSeries {
class PointSeries {
constructor(handler, seriesEl, seriesData, seriesConfig) { constructor(handler, seriesEl, seriesData, seriesConfig) {
this.handler = handler; this.handler = handler;
this.baseChart = handler.pointSeries; this.baseChart = handler.pointSeries;
@ -82,7 +80,4 @@ export function VislibVisualizationsPointSeriesProvider() {
const click = events.addClickEvent(); const click = events.addClickEvent();
return element.call(click); return element.call(click);
} }
}
return PointSeries;
} }

View file

@ -20,13 +20,10 @@
import d3 from 'd3'; import d3 from 'd3';
import _ from 'lodash'; import _ from 'lodash';
import $ from 'jquery'; import $ from 'jquery';
import { VislibVisualizationsPointSeriesProvider } from './_point_series'; import { PointSeries } from './_point_series';
export function VislibVisualizationsAreaChartProvider(Private) {
const PointSeries = Private(VislibVisualizationsPointSeriesProvider); const defaults = {
const defaults = {
mode: 'normal', mode: 'normal',
showCircles: true, showCircles: true,
radiusRatio: 9, radiusRatio: 9,
@ -34,8 +31,8 @@ export function VislibVisualizationsAreaChartProvider(Private) {
interpolate: 'linear', interpolate: 'linear',
color: undefined, color: undefined,
fillColor: undefined, fillColor: undefined,
}; };
/** /**
* Area chart visualization * Area chart visualization
* *
* @class AreaChart * @class AreaChart
@ -46,7 +43,7 @@ export function VislibVisualizationsAreaChartProvider(Private) {
* @param chartData {Object} Elasticsearch query results for this specific * @param chartData {Object} Elasticsearch query results for this specific
* chart * chart
*/ */
class AreaChart extends PointSeries { export class AreaChart extends PointSeries {
constructor(handler, chartEl, chartData, seriesConfigArgs) { constructor(handler, chartEl, chartData, seriesConfigArgs) {
super(handler, chartEl, chartData, seriesConfigArgs); super(handler, chartEl, chartData, seriesConfigArgs);
@ -263,7 +260,4 @@ export function VislibVisualizationsAreaChartProvider(Private) {
}); });
}; };
} }
}
return AreaChart;
} }

View file

@ -18,24 +18,21 @@
*/ */
import _ from 'lodash'; import _ from 'lodash';
import { VislibVisualizationsPointSeriesProvider } from './_point_series'; import { PointSeries } from './_point_series';
export function VislibVisualizationsColumnChartProvider(Private) {
const PointSeries = Private(VislibVisualizationsPointSeriesProvider); const defaults = {
const defaults = {
mode: 'normal', mode: 'normal',
showTooltip: true, showTooltip: true,
color: undefined, color: undefined,
fillColor: undefined, fillColor: undefined,
}; };
/** /**
* Histogram intervals are not always equal widths, e.g, monthly time intervals. * Histogram intervals are not always equal widths, e.g, monthly time intervals.
* It is more visually appealing to vary bar width so that gutter width is constant. * It is more visually appealing to vary bar width so that gutter width is constant.
*/ */
function datumWidth(defaultWidth, datum, nextDatum, scale, gutterWidth, groupCount = 1) { function datumWidth(defaultWidth, datum, nextDatum, scale, gutterWidth, groupCount = 1) {
let datumWidth = defaultWidth; let datumWidth = defaultWidth;
if (nextDatum) { if (nextDatum) {
datumWidth = ((scale(nextDatum.x) - scale(datum.x)) - gutterWidth) / groupCount; datumWidth = ((scale(nextDatum.x) - scale(datum.x)) - gutterWidth) / groupCount;
@ -45,9 +42,9 @@ export function VislibVisualizationsColumnChartProvider(Private) {
} }
} }
return datumWidth; return datumWidth;
} }
/** /**
* Vertical Bar Chart Visualization: renders vertical and/or stacked bars * Vertical Bar Chart Visualization: renders vertical and/or stacked bars
* *
* @class ColumnChart * @class ColumnChart
@ -57,7 +54,7 @@ export function VislibVisualizationsColumnChartProvider(Private) {
* @param el {HTMLElement} HTML element to which the chart will be appended * @param el {HTMLElement} HTML element to which the chart will be appended
* @param chartData {Object} Elasticsearch query results for this specific chart * @param chartData {Object} Elasticsearch query results for this specific chart
*/ */
class ColumnChart extends PointSeries { export class ColumnChart extends PointSeries {
constructor(handler, chartEl, chartData, seriesConfigArgs) { constructor(handler, chartEl, chartData, seriesConfigArgs) {
super(handler, chartEl, chartData, seriesConfigArgs); super(handler, chartEl, chartData, seriesConfigArgs);
this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults); this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults);
@ -274,7 +271,4 @@ export function VislibVisualizationsColumnChartProvider(Private) {
}); });
}; };
} }
}
return ColumnChart;
} }

View file

@ -19,21 +19,18 @@
import _ from 'lodash'; import _ from 'lodash';
import moment from 'moment'; import moment from 'moment';
import { VislibVisualizationsPointSeriesProvider } from './_point_series'; import { PointSeries } from './_point_series';
import { getHeatmapColors } from '../../components/color/heatmap_color'; import { getHeatmapColors } from '../../components/color/heatmap_color';
import { import {
isColorDark isColorDark
} from '@elastic/eui'; } from '@elastic/eui';
export function VislibVisualizationsHeatmapChartProvider(Private) {
const PointSeries = Private(VislibVisualizationsPointSeriesProvider); const defaults = {
const defaults = {
color: undefined, // todo color: undefined, // todo
fillColor: undefined // todo fillColor: undefined // todo
}; };
/** /**
* Line Chart Visualization * Line Chart Visualization
* *
* @class HeatmapChart * @class HeatmapChart
@ -43,7 +40,7 @@ export function VislibVisualizationsHeatmapChartProvider(Private) {
* @param el {HTMLElement} HTML element to which the chart will be appended * @param el {HTMLElement} HTML element to which the chart will be appended
* @param chartData {Object} Elasticsearch query results for this specific chart * @param chartData {Object} Elasticsearch query results for this specific chart
*/ */
class HeatmapChart extends PointSeries { export class HeatmapChart extends PointSeries {
constructor(handler, chartEl, chartData, seriesConfigArgs) { constructor(handler, chartEl, chartData, seriesConfigArgs) {
super(handler, chartEl, chartData, seriesConfigArgs); super(handler, chartEl, chartData, seriesConfigArgs);
this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults); this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults);
@ -326,7 +323,4 @@ export function VislibVisualizationsHeatmapChartProvider(Private) {
}); });
}; };
} }
}
return HeatmapChart;
} }

View file

@ -19,13 +19,9 @@
import d3 from 'd3'; import d3 from 'd3';
import _ from 'lodash'; import _ from 'lodash';
import { VislibVisualizationsPointSeriesProvider } from './_point_series'; import { PointSeries } from './_point_series';
export function VislibVisualizationsLineChartProvider(Private) { const defaults = {
const PointSeries = Private(VislibVisualizationsPointSeriesProvider);
const defaults = {
mode: 'normal', mode: 'normal',
showCircles: true, showCircles: true,
radiusRatio: 9, radiusRatio: 9,
@ -34,8 +30,8 @@ export function VislibVisualizationsLineChartProvider(Private) {
lineWidth: 2, lineWidth: 2,
color: undefined, color: undefined,
fillColor: undefined fillColor: undefined
}; };
/** /**
* Line Chart Visualization * Line Chart Visualization
* *
* @class LineChart * @class LineChart
@ -45,7 +41,7 @@ export function VislibVisualizationsLineChartProvider(Private) {
* @param el {HTMLElement} HTML element to which the chart will be appended * @param el {HTMLElement} HTML element to which the chart will be appended
* @param chartData {Object} Elasticsearch query results for this specific chart * @param chartData {Object} Elasticsearch query results for this specific chart
*/ */
class LineChart extends PointSeries { export class LineChart extends PointSeries {
constructor(handler, chartEl, chartData, seriesConfigArgs) { constructor(handler, chartEl, chartData, seriesConfigArgs) {
super(handler, chartEl, chartData, seriesConfigArgs); super(handler, chartEl, chartData, seriesConfigArgs);
this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults); this.seriesConfig = _.defaults(seriesConfigArgs || {}, defaults);
@ -236,7 +232,4 @@ export function VislibVisualizationsLineChartProvider(Private) {
}); });
}; };
} }
}
return LineChart;
} }

View file

@ -17,17 +17,14 @@
* under the License. * under the License.
*/ */
import { VislibVisualizationsColumnChartProvider } from './column_chart'; import { ColumnChart } from './column_chart';
import { VislibVisualizationsLineChartProvider } from './line_chart'; import { LineChart } from './line_chart';
import { VislibVisualizationsAreaChartProvider } from './area_chart'; import { AreaChart } from './area_chart';
import { VislibVisualizationsHeatmapChartProvider } from './heatmap_chart'; import { HeatmapChart } from './heatmap_chart';
export function VislibVisualizationsSeriesTypesProvider(Private) { export const seriesTypes = {
histogram: ColumnChart,
return { line: LineChart,
histogram: Private(VislibVisualizationsColumnChartProvider), area: AreaChart,
line: Private(VislibVisualizationsLineChartProvider), heatmap: HeatmapChart
area: Private(VislibVisualizationsAreaChartProvider), };
heatmap: Private(VislibVisualizationsHeatmapChartProvider)
};
}

View file

@ -20,9 +20,7 @@
import d3 from 'd3'; import d3 from 'd3';
import dateMath from '@elastic/datemath'; import dateMath from '@elastic/datemath';
export function VislibVisualizationsTimeMarkerProvider() { export class TimeMarker {
class TimeMarker {
constructor(times, xScale, height) { constructor(times, xScale, height) {
const currentTimeArr = [{ const currentTimeArr = [{
'time': new Date().getTime(), 'time': new Date().getTime(),
@ -85,7 +83,4 @@ export function VislibVisualizationsTimeMarkerProvider() {
.attr('y2', self.xScale.range()[0]); .attr('y2', self.xScale.range()[0]);
}); });
} }
}
return TimeMarker;
} }

View file

@ -18,24 +18,13 @@ exports[`VisualizationNoResults should render according to snapshot 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--subdued euiIcon--app" class="euiIcon euiIcon--medium euiIcon--subdued euiIcon--app euiIcon-isLoading"
focusable="false" focusable="false"
height="32" height="16"
viewBox="0 0 32 32" viewBox="0 0 16 16"
width="32" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
class="euiIcon__fillSecondary"
d="M32 32H4a4 4 0 0 1-4-4V0h2v28a2 2 0 0 0 2 2h28v2z"
/> />
<path
d="M6 20h2v7H6zM16 12h2v15h-2zM26 17h2v10h-2z"
/>
<path
d="M27 6a3 3 0 0 0-2.08.84L20 4.36A2.2 2.2 0 0 0 20 4a3 3 0 0 0-6 0c.001.341.062.68.18 1l-5.6 4.46A3 3 0 0 0 7 9a3 3 0 1 0 3 3 2.93 2.93 0 0 0-.18-1l5.6-4.48A3 3 0 0 0 17 7a3 3 0 0 0 2.08-.84l5 2.48A2.2 2.2 0 0 0 24 9a3 3 0 1 0 3-3zM7 13a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm10-8a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm10 5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"
/>
</svg>
<div <div
class="euiSpacer euiSpacer--s" class="euiSpacer euiSpacer--s"
/> />

View file

@ -12,18 +12,13 @@ exports[`VisualizationRequestError should render according to snapshot 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--danger" class="euiIcon euiIcon--medium euiIcon--danger euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.59 10.059L7.35 5.18h1.3L8.4 10.06h-.81zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184zM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2zm0-1h12L8 2 2 13z"
fill-rule="evenodd"
/> />
</svg>
<div <div
class="euiSpacer euiSpacer--s" class="euiSpacer euiSpacer--s"
/> />

View file

@ -7,7 +7,7 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@elastic/eui": "10.4.1", "@elastic/eui": "11.0.1",
"react": "^16.8.0", "react": "^16.8.0",
"react-dom": "^16.8.0" "react-dom": "^16.8.0"
} }

View file

@ -7,7 +7,7 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@elastic/eui": "10.4.1", "@elastic/eui": "11.0.1",
"react": "^16.8.0" "react": "^16.8.0"
} }
} }

View file

@ -8,7 +8,7 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@elastic/eui": "10.4.1", "@elastic/eui": "11.0.1",
"react": "^16.8.0" "react": "^16.8.0"
}, },
"scripts": { "scripts": {

View file

@ -7,7 +7,7 @@
}, },
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@elastic/eui": "10.4.1", "@elastic/eui": "11.0.1",
"react": "^16.8.0", "react": "^16.8.0",
"react-dom": "^16.8.0" "react-dom": "^16.8.0"
} }

View file

@ -20,8 +20,9 @@
"strict": true, "strict": true,
// enables "core language features" // enables "core language features"
"lib": [ "lib": [
// ESNext auto includes previous versions all the way back to es5 // ES2018 includes previous versions all the way back to es5
"esnext", // We are not using esnext because @babel/polyfill is on core-js 2, not 3
"es2018",
// includes support for browser APIs // includes support for browser APIs
"dom" "dom"
], ],

View file

@ -41,7 +41,8 @@ export function createJestConfig({
'^.+\\.(js|tsx?)$': `${kibanaDirectory}/src/dev/jest/babel_transform.js`, '^.+\\.(js|tsx?)$': `${kibanaDirectory}/src/dev/jest/babel_transform.js`,
}, },
transformIgnorePatterns: [ transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.js$' // ignore all node_modules except @elastic/eui which requires babel transforms to handle dynamic import()
'[/\\\\]node_modules(?![\\/\\\\]@elastic[\\/\\\\]eui)[/\\\\].+\\.js$'
], ],
snapshotSerializers: [ snapshotSerializers: [
`${kibanaDirectory}/node_modules/enzyme-to-json/serializer` `${kibanaDirectory}/node_modules/enzyme-to-json/serializer`

View file

@ -84,7 +84,7 @@
"@types/react-sticky": "^6.0.3", "@types/react-sticky": "^6.0.3",
"@types/react-test-renderer": "^16.8.0", "@types/react-test-renderer": "^16.8.0",
"@types/recompose": "^0.30.2", "@types/recompose": "^0.30.2",
"@types/reduce-reducers": "^0.1.3", "@types/reduce-reducers": "^0.3.0",
"@types/redux-actions": "^2.2.1", "@types/redux-actions": "^2.2.1",
"@types/rimraf": "^2.0.2", "@types/rimraf": "^2.0.2",
"@types/sinon": "^7.0.0", "@types/sinon": "^7.0.0",
@ -120,7 +120,7 @@
"enzyme-to-json": "^3.3.4", "enzyme-to-json": "^3.3.4",
"execa": "^1.0.0", "execa": "^1.0.0",
"fancy-log": "^1.3.2", "fancy-log": "^1.3.2",
"fetch-mock": "7.3.0", "fetch-mock": "7.3.3",
"graphql-code-generator": "^0.13.0", "graphql-code-generator": "^0.13.0",
"graphql-codegen-introspection-template": "^0.13.0", "graphql-codegen-introspection-template": "^0.13.0",
"graphql-codegen-typescript-resolvers-template": "^0.13.0", "graphql-codegen-typescript-resolvers-template": "^0.13.0",
@ -168,7 +168,7 @@
"@babel/register": "7.4.4", "@babel/register": "7.4.4",
"@babel/runtime": "7.4.5", "@babel/runtime": "7.4.5",
"@elastic/datemath": "5.0.2", "@elastic/datemath": "5.0.2",
"@elastic/eui": "10.4.1", "@elastic/eui": "11.0.1",
"@elastic/javascript-typescript-langserver": "^0.1.27", "@elastic/javascript-typescript-langserver": "^0.1.27",
"@elastic/lsp-extension": "^0.1.1", "@elastic/lsp-extension": "^0.1.1",
"@elastic/node-crypto": "^1.0.0", "@elastic/node-crypto": "^1.0.0",
@ -212,16 +212,16 @@
"copy-to-clipboard": "^3.0.8", "copy-to-clipboard": "^3.0.8",
"core-js": "2.6.9", "core-js": "2.6.9",
"cronstrue": "^1.51.0", "cronstrue": "^1.51.0",
"d3": "3.5.6", "d3": "3.5.17",
"d3-scale": "1.0.6", "d3-scale": "1.0.7",
"dataloader": "^1.4.0", "dataloader": "^1.4.0",
"dedent": "^0.7.0", "dedent": "^0.7.0",
"dragselect": "1.8.1", "dragselect": "1.12.2",
"elasticsearch": "^15.5.0", "elasticsearch": "^15.5.0",
"extract-zip": "1.5.0", "extract-zip": "1.6.7",
"file-saver": "^1.3.8", "file-saver": "^1.3.8",
"file-type": "^10.9.0", "file-type": "^10.9.0",
"font-awesome": "4.4.0", "font-awesome": "4.7.0",
"formsy-react": "^1.1.5", "formsy-react": "^1.1.5",
"get-port": "4.2.0", "get-port": "4.2.0",
"getos": "^3.1.0", "getos": "^3.1.0",
@ -246,7 +246,7 @@
"io-ts": "^1.4.2", "io-ts": "^1.4.2",
"joi": "^13.5.2", "joi": "^13.5.2",
"jquery": "^3.4.1", "jquery": "^3.4.1",
"js-yaml": "3.4.1", "js-yaml": "3.13.1",
"json-stable-stringify": "^1.0.1", "json-stable-stringify": "^1.0.1",
"jsonwebtoken": "^8.3.0", "jsonwebtoken": "^8.3.0",
"lodash": "npm:@elastic/lodash@3.10.1-kibana1", "lodash": "npm:@elastic/lodash@3.10.1-kibana1",
@ -268,7 +268,7 @@
"moment-duration-format": "^1.3.0", "moment-duration-format": "^1.3.0",
"moment-timezone": "^0.5.14", "moment-timezone": "^0.5.14",
"memoize-one": "^5.0.0", "memoize-one": "^5.0.0",
"monaco-editor": "^0.14.3", "monaco-editor": "^0.17.0",
"ngreact": "^0.5.1", "ngreact": "^0.5.1",
"nock": "10.0.4", "nock": "10.0.4",
"node-fetch": "^2.1.2", "node-fetch": "^2.1.2",

View file

@ -42,26 +42,14 @@ exports[`ErrorGroupOverview -> List should render empty state 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonEmpty__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonEmpty__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
<span <span
className="euiButtonEmpty__text" className="euiButtonEmpty__text"
> >
@ -190,18 +178,14 @@ exports[`ErrorGroupOverview -> List should render empty state 1`] = `
</span> </span>
<svg <svg
aria-label="Sorted in descending order" aria-label="Sorted in descending order"
className="euiIcon euiIcon--medium euiTableSortIcon" className="euiIcon euiIcon--medium euiIcon-isLoading euiTableSortIcon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7 11.692V3.556C7 3.249 7.224 3 7.5 3s.5.249.5.556v8.136l4.096-4.096a.5.5 0 0 1 .707.707l-4.242 4.243a1.494 1.494 0 0 1-.925.433.454.454 0 0 1-.272 0 1.494 1.494 0 0 1-.925-.433L2.197 8.303a.5.5 0 1 1 .707-.707L7 11.692z"
/> />
</svg>
<span <span
className="euiScreenReaderOnly" className="euiScreenReaderOnly"
> >
@ -266,26 +250,14 @@ exports[`ErrorGroupOverview -> List should render empty state 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonEmpty__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonEmpty__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
<span <span
className="euiButtonEmpty__text" className="euiButtonEmpty__text"
> >
@ -374,26 +346,14 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonEmpty__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonEmpty__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
<span <span
className="euiButtonEmpty__text" className="euiButtonEmpty__text"
> >
@ -522,18 +482,14 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = `
</span> </span>
<svg <svg
aria-label="Sorted in descending order" aria-label="Sorted in descending order"
className="euiIcon euiIcon--medium euiTableSortIcon" className="euiIcon euiIcon--medium euiIcon-isLoading euiTableSortIcon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7 11.692V3.556C7 3.249 7.224 3 7.5 3s.5.249.5.556v8.136l4.096-4.096a.5.5 0 0 1 .707.707l-4.242 4.243a1.494 1.494 0 0 1-.925.433.454.454 0 0 1-.272 0 1.494 1.494 0 0 1-.925-.433L2.197 8.303a.5.5 0 1 1 .707-.707L7 11.692z"
/> />
</svg>
<span <span
className="euiScreenReaderOnly" className="euiScreenReaderOnly"
> >
@ -1008,26 +964,14 @@ exports[`ErrorGroupOverview -> List should render with data 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonEmpty__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonEmpty__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
<span <span
className="euiButtonEmpty__text" className="euiButtonEmpty__text"
> >

View file

@ -16,13 +16,16 @@ import {
asDecimal asDecimal
} from '../../../utils/formatters'; } from '../../../utils/formatters';
import { Coordinate } from '../../../../typings/timeseries'; import { Coordinate } from '../../../../typings/timeseries';
import { getEmptySeries } from '../../shared/charts/CustomPlot/getEmptySeries';
interface Props { interface Props {
start: number | string | undefined;
end: number | string | undefined;
chart: GenericMetricsChart; chart: GenericMetricsChart;
hoverXHandlers: HoverXHandlers; hoverXHandlers: HoverXHandlers;
} }
export function MetricsChart({ chart, hoverXHandlers }: Props) { export function MetricsChart({ start, end, chart, hoverXHandlers }: Props) {
const formatYValue = getYTickFormatter(chart); const formatYValue = getYTickFormatter(chart);
const formatTooltip = getTooltipFormatter(chart); const formatTooltip = getTooltipFormatter(chart);
@ -31,6 +34,8 @@ export function MetricsChart({ chart, hoverXHandlers }: Props) {
legendValue: formatYValue(series.overallValue) legendValue: formatYValue(series.overallValue)
})); }));
const noHits = chart.totalHits === 0;
return ( return (
<React.Fragment> <React.Fragment>
<EuiTitle size="xs"> <EuiTitle size="xs">
@ -38,8 +43,8 @@ export function MetricsChart({ chart, hoverXHandlers }: Props) {
</EuiTitle> </EuiTitle>
<CustomPlot <CustomPlot
{...hoverXHandlers} {...hoverXHandlers}
noHits={chart.totalHits === 0} noHits={noHits}
series={transformedSeries} series={noHits ? getEmptySeries(start, end) : transformedSeries}
tickFormatY={formatYValue} tickFormatY={formatYValue}
formatTooltipValue={formatTooltip} formatTooltipValue={formatTooltip}
yMax={chart.yUnit === 'percent' ? 1 : 'max'} yMax={chart.yUnit === 'percent' ? 1 : 'max'}
@ -52,8 +57,8 @@ function getYTickFormatter(chart: GenericMetricsChart) {
switch (chart.yUnit) { switch (chart.yUnit) {
case 'bytes': { case 'bytes': {
const max = Math.max( const max = Math.max(
...chart.series.flatMap(series => ...chart.series.map(({ data }) =>
series.data.map(coord => coord.y || 0) Math.max(...data.map(({ y }) => y || 0))
) )
); );
return getFixedByteFormatter(max); return getFixedByteFormatter(max);

View file

@ -18,6 +18,7 @@ interface ServiceMetricsProps {
export function ServiceMetrics({ urlParams, agentName }: ServiceMetricsProps) { export function ServiceMetrics({ urlParams, agentName }: ServiceMetricsProps) {
const { data } = useServiceMetricCharts(urlParams, agentName); const { data } = useServiceMetricCharts(urlParams, agentName);
const { start, end } = urlParams;
return ( return (
<React.Fragment> <React.Fragment>
<SyncChartGroup <SyncChartGroup
@ -26,7 +27,12 @@ export function ServiceMetrics({ urlParams, agentName }: ServiceMetricsProps) {
{data.charts.map(chart => ( {data.charts.map(chart => (
<EuiFlexItem key={chart.key}> <EuiFlexItem key={chart.key}>
<EuiPanel> <EuiPanel>
<MetricsChart chart={chart} hoverXHandlers={hoverXHandlers} /> <MetricsChart
start={start}
end={end}
chart={chart}
hoverXHandlers={hoverXHandlers}
/>
</EuiPanel> </EuiPanel>
</EuiFlexItem> </EuiFlexItem>
))} ))}

View file

@ -106,13 +106,12 @@ NodeList [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButton__icon" class="euiIcon euiIcon--medium euiIcon-isLoaded euiButton__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
> >
<defs> <defs>
<path <path

View file

@ -18,13 +18,12 @@ exports[`TransactionActionMenu component should match the snapshot 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
class="euiIcon euiIcon--medium euiButtonEmpty__icon" class="euiIcon euiIcon--medium euiIcon-isLoaded euiButtonEmpty__icon"
focusable="false" focusable="false"
height="16" height="16"
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width="16"
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
> >
<defs> <defs>
<path <path

View file

@ -0,0 +1,30 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
import { memoize } from 'lodash';
import d3 from 'd3';
export const getEmptySeries = memoize(
(
start: number | string = Date.now() - 3600000,
end: number | string = Date.now()
) => {
const dates = d3.time
.scale()
.domain([new Date(start), new Date(end)])
.ticks();
return [
{
data: dates.map(x => ({
x: x.getTime(),
y: 1
}))
}
];
},
(start: string, end: string) => [start, end].join('_')
);

View file

@ -13,10 +13,8 @@ import { InnerCustomPlot } from '../index';
import responseWithData from './responseWithData.json'; import responseWithData from './responseWithData.json';
import VoronoiPlot from '../VoronoiPlot'; import VoronoiPlot from '../VoronoiPlot';
import InteractivePlot from '../InteractivePlot'; import InteractivePlot from '../InteractivePlot';
import { import { getResponseTimeSeries } from '../../../../../selectors/chartSelectors';
getResponseTimeSeries, import { getEmptySeries } from '../getEmptySeries';
getEmptySerie
} from '../../../../../selectors/chartSelectors';
function getXValueByIndex(index) { function getXValueByIndex(index) {
return responseWithData.responseTimes.avg[index].x; return responseWithData.responseTimes.avg[index].x;
@ -289,7 +287,7 @@ describe('when response has no data', () => {
const onSelectionEnd = jest.fn(); const onSelectionEnd = jest.fn();
let wrapper; let wrapper;
beforeEach(() => { beforeEach(() => {
const series = getEmptySerie(1451606400000, 1451610000000); const series = getEmptySeries(1451606400000, 1451610000000);
wrapper = mount( wrapper = mount(
<InnerCustomPlot <InnerCustomPlot

View file

@ -27,6 +27,7 @@ import { MLJobLink } from '../../Links/MachineLearningLinks/MLJobLink';
import CustomPlot from '../CustomPlot'; import CustomPlot from '../CustomPlot';
import { SyncChartGroup } from '../SyncChartGroup'; import { SyncChartGroup } from '../SyncChartGroup';
import { LicenseContext } from '../../../../context/LicenseContext'; import { LicenseContext } from '../../../../context/LicenseContext';
import { getEmptySeries } from '../CustomPlot/getEmptySeries';
interface TransactionChartProps { interface TransactionChartProps {
hasMLJob: boolean; hasMLJob: boolean;
@ -134,7 +135,7 @@ export class TransactionCharts extends Component<TransactionChartProps> {
public render() { public render() {
const { charts, urlParams } = this.props; const { charts, urlParams } = this.props;
const { noHits, responseTimeSeries, tpmSeries } = charts; const { noHits, responseTimeSeries, tpmSeries } = charts;
const { transactionType } = urlParams; const { transactionType, start, end } = urlParams;
return ( return (
<SyncChartGroup <SyncChartGroup
@ -157,7 +158,9 @@ export class TransactionCharts extends Component<TransactionChartProps> {
</EuiFlexGroup> </EuiFlexGroup>
<CustomPlot <CustomPlot
noHits={noHits} noHits={noHits}
series={responseTimeSeries} series={
noHits ? getEmptySeries(start, end) : responseTimeSeries
}
{...hoverXHandlers} {...hoverXHandlers}
tickFormatY={this.getResponseTimeTickFormatter} tickFormatY={this.getResponseTimeTickFormatter}
formatTooltipValue={this.getResponseTimeTooltipFormatter} formatTooltipValue={this.getResponseTimeTooltipFormatter}
@ -174,7 +177,7 @@ export class TransactionCharts extends Component<TransactionChartProps> {
</EuiTitle> </EuiTitle>
<CustomPlot <CustomPlot
noHits={noHits} noHits={noHits}
series={tpmSeries} series={noHits ? getEmptySeries(start, end) : tpmSeries}
{...hoverXHandlers} {...hoverXHandlers}
tickFormatY={this.getTPMFormatter} tickFormatY={this.getTPMFormatter}
formatTooltipValue={this.getTPMTooltipFormatter} formatTooltipValue={this.getTPMTooltipFormatter}

View file

@ -6,8 +6,7 @@
import theme from '@elastic/eui/dist/eui_theme_light.json'; import theme from '@elastic/eui/dist/eui_theme_light.json';
import { i18n } from '@kbn/i18n'; import { i18n } from '@kbn/i18n';
import d3 from 'd3'; import { difference, zipObject } from 'lodash';
import { difference, memoize, zipObject } from 'lodash';
import mean from 'lodash.mean'; import mean from 'lodash.mean';
import { rgba } from 'polished'; import { rgba } from 'polished';
import { TimeSeriesAPIResponse } from '../../server/lib/transactions/charts'; import { TimeSeriesAPIResponse } from '../../server/lib/transactions/charts';
@ -17,32 +16,6 @@ import { Coordinate, RectCoordinate } from '../../typings/timeseries';
import { asDecimal, asMillis, tpmUnit } from '../utils/formatters'; import { asDecimal, asMillis, tpmUnit } from '../utils/formatters';
import { IUrlParams } from '../context/UrlParamsContext/types'; import { IUrlParams } from '../context/UrlParamsContext/types';
export const getEmptySerie = memoize(
(
start: string | number = Date.now() - 3600000,
end: string | number = Date.now()
) => {
const dates = d3.time
.scale()
.domain([new Date(start), new Date(end)])
.ticks();
return [
{
data: dates.map(x => ({
x: x.getTime(),
y: 1
}))
}
];
},
(start: string, end: string) => [start, end].join('_')
);
interface IEmptySeries {
data: Coordinate[];
}
export interface ITpmBucket { export interface ITpmBucket {
title: string; title: string;
data: Coordinate[]; data: Coordinate[];
@ -53,8 +26,8 @@ export interface ITpmBucket {
export interface ITransactionChartData { export interface ITransactionChartData {
noHits: boolean; noHits: boolean;
tpmSeries: ITpmBucket[] | IEmptySeries[]; tpmSeries: ITpmBucket[];
responseTimeSeries: TimeSerie[] | IEmptySeries[]; responseTimeSeries: TimeSerie[];
} }
const INITIAL_DATA = { const INITIAL_DATA = {
@ -72,17 +45,16 @@ const INITIAL_DATA = {
}; };
export function getTransactionCharts( export function getTransactionCharts(
{ start, end, transactionType }: IUrlParams, { transactionType }: IUrlParams,
{ apmTimeseries, anomalyTimeseries }: TimeSeriesAPIResponse = INITIAL_DATA { apmTimeseries, anomalyTimeseries }: TimeSeriesAPIResponse = INITIAL_DATA
): ITransactionChartData { ): ITransactionChartData {
const noHits = apmTimeseries.totalHits === 0; const noHits = apmTimeseries.totalHits === 0;
const tpmSeries = noHits const tpmSeries = getTpmSeries(apmTimeseries, transactionType);
? getEmptySerie(start, end)
: getTpmSeries(apmTimeseries, transactionType);
const responseTimeSeries = noHits const responseTimeSeries = getResponseTimeSeries({
? getEmptySerie(start, end) apmTimeseries,
: getResponseTimeSeries({ apmTimeseries, anomalyTimeseries }); anomalyTimeseries
});
return { return {
noHits, noHits,

View file

@ -1,41 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/
declare module 'ui/autocomplete_providers' {
import { StaticIndexPattern } from 'ui/index_patterns';
export type AutocompleteProvider = (
args: {
config: {
get(configKey: string): any;
};
indexPatterns: StaticIndexPattern[];
boolFilter: any;
}
) => GetSuggestions;
export type GetSuggestions = (
args: {
query: string;
selectionStart: number;
selectionEnd: number;
}
) => Promise<AutocompleteSuggestion[]>;
export type AutocompleteSuggestionType = 'field' | 'value' | 'operator' | 'conjunction';
export interface AutocompleteSuggestion {
description: string;
end: number;
start: number;
text: string;
type: AutocompleteSuggestionType;
}
export function addAutocompleteProvider(language: string, provider: AutocompleteProvider): void;
export function getAutocompleteProvider(language: string): AutocompleteProvider | undefined;
}

View file

@ -16,26 +16,14 @@ exports[`Storyshots renderers/DropdownFilter default 1`] = `
</option> </option>
</select> </select>
<svg <svg
className="euiIcon euiIcon--medium canvasDropdownFilter__icon" className="euiIcon euiIcon--medium euiIcon-isLoading canvasDropdownFilter__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</div> </div>
`; `;
@ -73,26 +61,14 @@ exports[`Storyshots renderers/DropdownFilter with choices 1`] = `
</option> </option>
</select> </select>
<svg <svg
className="euiIcon euiIcon--medium canvasDropdownFilter__icon" className="euiIcon euiIcon--medium euiIcon-isLoading canvasDropdownFilter__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</div> </div>
`; `;
@ -131,26 +107,14 @@ exports[`Storyshots renderers/DropdownFilter with choices and new value 1`] = `
</option> </option>
</select> </select>
<svg <svg
className="euiIcon euiIcon--medium canvasDropdownFilter__icon" className="euiIcon euiIcon--medium euiIcon-isLoading canvasDropdownFilter__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</div> </div>
`; `;
@ -189,26 +153,14 @@ exports[`Storyshots renderers/DropdownFilter with choices and value 1`] = `
</option> </option>
</select> </select>
<svg <svg
className="euiIcon euiIcon--medium canvasDropdownFilter__icon" className="euiIcon euiIcon--medium euiIcon-isLoading canvasDropdownFilter__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</div> </div>
`; `;
@ -229,25 +181,13 @@ exports[`Storyshots renderers/DropdownFilter with new value 1`] = `
</option> </option>
</select> </select>
<svg <svg
className="euiIcon euiIcon--medium canvasDropdownFilter__icon" className="euiIcon euiIcon--medium euiIcon-isLoading canvasDropdownFilter__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</div> </div>
`; `;

View file

@ -81,18 +81,14 @@ exports[`Storyshots components/Asset airplane 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12.5 11V5H11V3.5H5V5H3.5v6H5v1.5h6V11h1.5zm1 0H15v4h-4v-1.5H5V15H1v-4h1.5V5H1V1h4v1.5h6V1h4v4h-1.5v6zM4 4V2H2v2h2zm8 0h2V2h-2v2zM2 14h2v-2H2v2zm10 0h2v-2h-2v2z"
/> />
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -118,18 +114,14 @@ exports[`Storyshots components/Asset airplane 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7 11.692V3.556C7 3.249 7.224 3 7.5 3s.5.249.5.556v8.136l4.096-4.096a.5.5 0 0 1 .707.707l-4.242 4.243a1.494 1.494 0 0 1-.925.433.454.454 0 0 1-.272 0 1.494 1.494 0 0 1-.925-.433L2.197 8.303a.5.5 0 1 1 .707-.707L7 11.692z"
/> />
</svg>
</button> </button>
</div> </div>
</span> </span>
@ -156,21 +148,14 @@ exports[`Storyshots components/Asset airplane 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 2.729V2a1 1 0 0 1 1-1h2v1H1v12h4v1H1a1 1 0 0 1-1-1V2.729zM12 5V2a1 1 0 0 0-1-1H9v1h2v3h1zm-1 1h2v9H6V6h5V5H6a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2v1z"
/> />
<path
d="M7 10h5V9H7zM7 8h5V7H7zM7 12h5v-1H7zM7 14h5v-1H7zM9 2V1a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v1h1V1h4v1h1zM3 3h6V2H3z"
/>
</svg>
</button> </button>
</div> </div>
</span> </span>
@ -194,25 +179,14 @@ exports[`Storyshots components/Asset airplane 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
xlinkHref="#trash-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -303,18 +277,14 @@ exports[`Storyshots components/Asset marker 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12.5 11V5H11V3.5H5V5H3.5v6H5v1.5h6V11h1.5zm1 0H15v4h-4v-1.5H5V15H1v-4h1.5V5H1V1h4v1.5h6V1h4v4h-1.5v6zM4 4V2H2v2h2zm8 0h2V2h-2v2zM2 14h2v-2H2v2zm10 0h2v-2h-2v2z"
/> />
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -340,18 +310,14 @@ exports[`Storyshots components/Asset marker 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7 11.692V3.556C7 3.249 7.224 3 7.5 3s.5.249.5.556v8.136l4.096-4.096a.5.5 0 0 1 .707.707l-4.242 4.243a1.494 1.494 0 0 1-.925.433.454.454 0 0 1-.272 0 1.494 1.494 0 0 1-.925-.433L2.197 8.303a.5.5 0 1 1 .707-.707L7 11.692z"
/> />
</svg>
</button> </button>
</div> </div>
</span> </span>
@ -378,21 +344,14 @@ exports[`Storyshots components/Asset marker 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M0 2.729V2a1 1 0 0 1 1-1h2v1H1v12h4v1H1a1 1 0 0 1-1-1V2.729zM12 5V2a1 1 0 0 0-1-1H9v1h2v3h1zm-1 1h2v9H6V6h5V5H6a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h7a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2v1z"
/> />
<path
d="M7 10h5V9H7zM7 8h5V7H7zM7 12h5v-1H7zM7 14h5v-1H7zM9 2V1a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v1h1V1h4v1h1zM3 3h6V2H3z"
/>
</svg>
</button> </button>
</div> </div>
</span> </span>
@ -416,25 +375,14 @@ exports[`Storyshots components/Asset marker 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
xlinkHref="#trash-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>

View file

@ -82,23 +82,18 @@ Array [
} }
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#000", "fill": "#000",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div>, </div>,
<div <div
@ -116,23 +111,18 @@ Array [
} }
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#fff", "fill": "#fff",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div>, </div>,
<div <div
@ -150,23 +140,18 @@ Array [
} }
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#fff", "fill": "#fff",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.59 10.059L7.35 5.18h1.3L8.4 10.06h-.81zm.394 1.901a.61.61 0 0 1-.448-.186.606.606 0 0 1-.186-.444c0-.174.062-.323.186-.446a.614.614 0 0 1 .448-.184c.169 0 .315.06.44.182.124.122.186.27.186.448a.6.6 0 0 1-.189.446.607.607 0 0 1-.437.184zM2 14a1 1 0 0 1-.878-1.479l6-11a1 1 0 0 1 1.756 0l6 11A1 1 0 0 1 14 14H2zm0-1h12L8 2 2 13z"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div>, </div>,
<div <div
@ -184,23 +169,18 @@ Array [
} }
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#fff", "fill": "#fff",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div>, </div>,
] ]

View file

@ -202,19 +202,14 @@ exports[`Storyshots components/ColorManager interactive 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -225,19 +220,14 @@ exports[`Storyshots components/ColorManager interactive 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div> </div>
@ -415,19 +405,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -438,19 +423,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div>, </div>,
@ -512,19 +492,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -535,19 +510,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div>, </div>,
@ -609,19 +579,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -632,19 +597,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div>, </div>,

View file

@ -364,23 +364,18 @@ Array [
} }
> >
<svg <svg
className="euiIcon euiIcon--medium selected-color" className="euiIcon euiIcon--medium euiIcon-isLoading selected-color"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#333", "fill": "#333",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
</button> </button>
@ -718,23 +713,18 @@ exports[`Storyshots components/ColorPalette six colors, wrap at 4 1`] = `
} }
> >
<svg <svg
className="euiIcon euiIcon--medium selected-color" className="euiIcon euiIcon--medium euiIcon-isLoading selected-color"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#333", "fill": "#333",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
</button> </button>
@ -995,23 +985,18 @@ Array [
} }
> >
<svg <svg
className="euiIcon euiIcon--medium selected-color" className="euiIcon euiIcon--medium euiIcon-isLoading selected-color"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#333", "fill": "#333",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
</button> </button>

View file

@ -221,19 +221,14 @@ exports[`Storyshots components/ColorPicker interactive 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -244,19 +239,14 @@ exports[`Storyshots components/ColorPicker interactive 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div> </div>
@ -317,23 +307,18 @@ exports[`Storyshots components/ColorPicker six colors 1`] = `
} }
> >
<svg <svg
className="euiIcon euiIcon--medium selected-color" className="euiIcon euiIcon--medium euiIcon-isLoading selected-color"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#333", "fill": "#333",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
</button> </button>
@ -527,19 +512,14 @@ exports[`Storyshots components/ColorPicker six colors 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -550,19 +530,14 @@ exports[`Storyshots components/ColorPicker six colors 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div> </div>
@ -793,19 +768,14 @@ exports[`Storyshots components/ColorPicker six colors, value missing 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -816,19 +786,14 @@ exports[`Storyshots components/ColorPicker six colors, value missing 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div> </div>
@ -868,23 +833,18 @@ exports[`Storyshots components/ColorPicker three colors 1`] = `
} }
> >
<svg <svg
className="euiIcon euiIcon--medium selected-color" className="euiIcon euiIcon--medium euiIcon-isLoading selected-color"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#333", "fill": "#333",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
</button> </button>
@ -1000,19 +960,14 @@ exports[`Storyshots components/ColorPicker three colors 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
<button <button
aria-label="Remove Color" aria-label="Remove Color"
@ -1023,19 +978,14 @@ exports[`Storyshots components/ColorPicker three colors 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</button> </button>
</div> </div>
</div> </div>

View file

@ -56,18 +56,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
className="euiModal__flex" className="euiModal__flex"
@ -197,18 +193,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFilePicker__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFilePicker__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 10.114l1.85-1.943a.52.52 0 0 1 .77 0c.214.228.214.6 0 .829l-1.95 2.05a1.552 1.552 0 0 1-2.31 0L5.41 9a.617.617 0 0 1 0-.829.52.52 0 0 1 .77 0L8 10.082V1.556C8 1.249 8.224 1 8.5 1s.5.249.5.556v8.558zM4.18 6a.993.993 0 0 0-.972.804l-1.189 6A.995.995 0 0 0 2.991 14h11.018a1 1 0 0 0 .972-1.196l-1.19-6a.993.993 0 0 0-.97-.804H4.18zM6 5v1h5V5h1.825c.946 0 1.76.673 1.946 1.608l1.19 6A2 2 0 0 1 14.016 15H2.984a1.992 1.992 0 0 1-1.945-2.392l1.19-6C2.414 5.673 3.229 5 4.174 5H6z"
/> />
</svg>
<div <div
className="euiFilePicker__promptText" className="euiFilePicker__promptText"
> >
@ -244,22 +236,14 @@ Array [
className="euiCard__top" className="euiCard__top"
> >
<svg <svg
className="euiIcon euiIcon--xxLarge euiIcon--app euiCard__icon" className="euiIcon euiIcon--xxLarge euiIcon--app euiIcon-isLoading euiCard__icon"
focusable="false" focusable="false"
height="32" height={16}
style={null} style={null}
viewBox="0 0 32 32" viewBox="0 0 16 16"
width="32" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
className="euiIcon__fillSecondary"
d="M7 17h2v7H7zM12 14h2v10h-2zM17 16h2v8h-2zM22 14h3v2h-3zM22 18h3v2h-3zM22 22h3v2h-3z"
/> />
<path
d="M30.73 24a6.47 6.47 0 0 1 .45-2.19c.337-.9.52-1.85.54-2.81a8.55 8.55 0 0 0-.54-2.81 6.47 6.47 0 0 1-.45-2.19 9.2 9.2 0 0 1 .62-2.49c.53-1.57 1.08-3.19.08-4.2-1-1.01-2.41-.44-3.52.05a5.59 5.59 0 0 1-2.09.64 5.3 5.3 0 0 1-.59 0L16 .28 6.77 8a5.3 5.3 0 0 1-.59 0 5.59 5.59 0 0 1-2.09-.65C3 6.87 1.6 6.25.57 7.31c-1.03 1.06-.45 2.63.08 4.2A9.2 9.2 0 0 1 1.27 14a6.47 6.47 0 0 1-.45 2.19A8.55 8.55 0 0 0 .28 19c.02.96.203 1.91.54 2.81A6.47 6.47 0 0 1 1.27 24a9.2 9.2 0 0 1-.62 2.49c-.53 1.57-1.08 3.19-.08 4.2.353.38.852.59 1.37.58a5.67 5.67 0 0 0 2.15-.63A5.59 5.59 0 0 1 6.18 30a7.13 7.13 0 0 1 2.29.47 8 8 0 0 0 2.62.53 7.37 7.37 0 0 0 2.47-.51A7.14 7.14 0 0 1 16 30a6.24 6.24 0 0 1 2.14.45 8 8 0 0 0 2.77.55 8.08 8.08 0 0 0 2.77-.55 6.24 6.24 0 0 1 2.14-.45 5.59 5.59 0 0 1 2.09.65c1.11.49 2.49 1.11 3.52.05 1.03-1.06.45-2.63-.08-4.2a9.2 9.2 0 0 1-.62-2.5zM21.17 7h-.26a8 8 0 0 0-2.77.55A6.24 6.24 0 0 1 16 8a6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 11.09 7h-.26L16 2.72 21.17 7zm8.89 22.27a4.42 4.42 0 0 1-1.34-.46 7.08 7.08 0 0 0-2.9-.82 8.14 8.14 0 0 0-2.78.55 6.13 6.13 0 0 1-2.13.45 6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 16 28a9 9 0 0 0-3.08.6 5.74 5.74 0 0 1-1.83.4 6.36 6.36 0 0 1-2-.43A8.72 8.72 0 0 0 6.18 28a7.08 7.08 0 0 0-2.9.82 9.65 9.65 0 0 1-1.28.52 6.08 6.08 0 0 1 .52-2.21c.403-1 .65-2.055.73-3.13a8.55 8.55 0 0 0-.54-2.81A6.47 6.47 0 0 1 2.27 19a6.47 6.47 0 0 1 .44-2.19c.337-.9.52-1.85.54-2.81a10.48 10.48 0 0 0-.72-3.13 9 9 0 0 1-.59-2.16H2c.447.1.88.255 1.29.46a7.08 7.08 0 0 0 2.9.82A8.14 8.14 0 0 0 9 9.44 6.13 6.13 0 0 1 11.09 9a6.13 6.13 0 0 1 2.13.45A8.14 8.14 0 0 0 16 10a8.14 8.14 0 0 0 2.78-.55A6.13 6.13 0 0 1 20.91 9a6.13 6.13 0 0 1 2.09.44 8.14 8.14 0 0 0 2.78.55 7.08 7.08 0 0 0 2.9-.82A9.65 9.65 0 0 1 30 8.66a6.08 6.08 0 0 1-.52 2.21c-.403 1-.65 2.055-.73 3.13.02.96.203 1.91.54 2.81a6.47 6.47 0 0 1 .44 2.19 6.47 6.47 0 0 1-.44 2.19 8.55 8.55 0 0 0-.54 2.81c.078 1.074.32 2.13.72 3.13a9 9 0 0 1 .59 2.16v-.02z"
/>
</svg>
</span> </span>
<span <span
className="euiCard__content" className="euiCard__content"
@ -410,18 +394,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
className="euiModal__flex" className="euiModal__flex"
@ -551,18 +531,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFilePicker__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFilePicker__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 10.114l1.85-1.943a.52.52 0 0 1 .77 0c.214.228.214.6 0 .829l-1.95 2.05a1.552 1.552 0 0 1-2.31 0L5.41 9a.617.617 0 0 1 0-.829.52.52 0 0 1 .77 0L8 10.082V1.556C8 1.249 8.224 1 8.5 1s.5.249.5.556v8.558zM4.18 6a.993.993 0 0 0-.972.804l-1.189 6A.995.995 0 0 0 2.991 14h11.018a1 1 0 0 0 .972-1.196l-1.19-6a.993.993 0 0 0-.97-.804H4.18zM6 5v1h5V5h1.825c.946 0 1.76.673 1.946 1.608l1.19 6A2 2 0 0 1 14.016 15H2.984a1.992 1.992 0 0 1-1.945-2.392l1.19-6C2.414 5.673 3.229 5 4.174 5H6z"
/> />
</svg>
<div <div
className="euiFilePicker__promptText" className="euiFilePicker__promptText"
> >
@ -753,18 +729,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
className="euiModal__flex" className="euiModal__flex"
@ -894,18 +866,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFilePicker__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFilePicker__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 10.114l1.85-1.943a.52.52 0 0 1 .77 0c.214.228.214.6 0 .829l-1.95 2.05a1.552 1.552 0 0 1-2.31 0L5.41 9a.617.617 0 0 1 0-.829.52.52 0 0 1 .77 0L8 10.082V1.556C8 1.249 8.224 1 8.5 1s.5.249.5.556v8.558zM4.18 6a.993.993 0 0 0-.972.804l-1.189 6A.995.995 0 0 0 2.991 14h11.018a1 1 0 0 0 .972-1.196l-1.19-6a.993.993 0 0 0-.97-.804H4.18zM6 5v1h5V5h1.825c.946 0 1.76.673 1.946 1.608l1.19 6A2 2 0 0 1 14.016 15H2.984a1.992 1.992 0 0 1-1.945-2.392l1.19-6C2.414 5.673 3.229 5 4.174 5H6z"
/> />
</svg>
<div <div
className="euiFilePicker__promptText" className="euiFilePicker__promptText"
> >
@ -941,22 +909,14 @@ Array [
className="euiCard__top" className="euiCard__top"
> >
<svg <svg
className="euiIcon euiIcon--xxLarge euiIcon--app euiCard__icon" className="euiIcon euiIcon--xxLarge euiIcon--app euiIcon-isLoading euiCard__icon"
focusable="false" focusable="false"
height="32" height={16}
style={null} style={null}
viewBox="0 0 32 32" viewBox="0 0 16 16"
width="32" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
className="euiIcon__fillSecondary"
d="M7 17h2v7H7zM12 14h2v10h-2zM17 16h2v8h-2zM22 14h3v2h-3zM22 18h3v2h-3zM22 22h3v2h-3z"
/> />
<path
d="M30.73 24a6.47 6.47 0 0 1 .45-2.19c.337-.9.52-1.85.54-2.81a8.55 8.55 0 0 0-.54-2.81 6.47 6.47 0 0 1-.45-2.19 9.2 9.2 0 0 1 .62-2.49c.53-1.57 1.08-3.19.08-4.2-1-1.01-2.41-.44-3.52.05a5.59 5.59 0 0 1-2.09.64 5.3 5.3 0 0 1-.59 0L16 .28 6.77 8a5.3 5.3 0 0 1-.59 0 5.59 5.59 0 0 1-2.09-.65C3 6.87 1.6 6.25.57 7.31c-1.03 1.06-.45 2.63.08 4.2A9.2 9.2 0 0 1 1.27 14a6.47 6.47 0 0 1-.45 2.19A8.55 8.55 0 0 0 .28 19c.02.96.203 1.91.54 2.81A6.47 6.47 0 0 1 1.27 24a9.2 9.2 0 0 1-.62 2.49c-.53 1.57-1.08 3.19-.08 4.2.353.38.852.59 1.37.58a5.67 5.67 0 0 0 2.15-.63A5.59 5.59 0 0 1 6.18 30a7.13 7.13 0 0 1 2.29.47 8 8 0 0 0 2.62.53 7.37 7.37 0 0 0 2.47-.51A7.14 7.14 0 0 1 16 30a6.24 6.24 0 0 1 2.14.45 8 8 0 0 0 2.77.55 8.08 8.08 0 0 0 2.77-.55 6.24 6.24 0 0 1 2.14-.45 5.59 5.59 0 0 1 2.09.65c1.11.49 2.49 1.11 3.52.05 1.03-1.06.45-2.63-.08-4.2a9.2 9.2 0 0 1-.62-2.5zM21.17 7h-.26a8 8 0 0 0-2.77.55A6.24 6.24 0 0 1 16 8a6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 11.09 7h-.26L16 2.72 21.17 7zm8.89 22.27a4.42 4.42 0 0 1-1.34-.46 7.08 7.08 0 0 0-2.9-.82 8.14 8.14 0 0 0-2.78.55 6.13 6.13 0 0 1-2.13.45 6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 16 28a9 9 0 0 0-3.08.6 5.74 5.74 0 0 1-1.83.4 6.36 6.36 0 0 1-2-.43A8.72 8.72 0 0 0 6.18 28a7.08 7.08 0 0 0-2.9.82 9.65 9.65 0 0 1-1.28.52 6.08 6.08 0 0 1 .52-2.21c.403-1 .65-2.055.73-3.13a8.55 8.55 0 0 0-.54-2.81A6.47 6.47 0 0 1 2.27 19a6.47 6.47 0 0 1 .44-2.19c.337-.9.52-1.85.54-2.81a10.48 10.48 0 0 0-.72-3.13 9 9 0 0 1-.59-2.16H2c.447.1.88.255 1.29.46a7.08 7.08 0 0 0 2.9.82A8.14 8.14 0 0 0 9 9.44 6.13 6.13 0 0 1 11.09 9a6.13 6.13 0 0 1 2.13.45A8.14 8.14 0 0 0 16 10a8.14 8.14 0 0 0 2.78-.55A6.13 6.13 0 0 1 20.91 9a6.13 6.13 0 0 1 2.09.44 8.14 8.14 0 0 0 2.78.55 7.08 7.08 0 0 0 2.9-.82A9.65 9.65 0 0 1 30 8.66a6.08 6.08 0 0 1-.52 2.21c-.403 1-.65 2.055-.73 3.13.02.96.203 1.91.54 2.81a6.47 6.47 0 0 1 .44 2.19 6.47 6.47 0 0 1-.44 2.19 8.55 8.55 0 0 0-.54 2.81c.078 1.074.32 2.13.72 3.13a9 9 0 0 1 .59 2.16v-.02z"
/>
</svg>
</span> </span>
<span <span
className="euiCard__content" className="euiCard__content"
@ -1106,18 +1066,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
className="euiModal__flex" className="euiModal__flex"
@ -1247,18 +1203,14 @@ Array [
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFilePicker__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFilePicker__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 10.114l1.85-1.943a.52.52 0 0 1 .77 0c.214.228.214.6 0 .829l-1.95 2.05a1.552 1.552 0 0 1-2.31 0L5.41 9a.617.617 0 0 1 0-.829.52.52 0 0 1 .77 0L8 10.082V1.556C8 1.249 8.224 1 8.5 1s.5.249.5.556v8.558zM4.18 6a.993.993 0 0 0-.972.804l-1.189 6A.995.995 0 0 0 2.991 14h11.018a1 1 0 0 0 .972-1.196l-1.19-6a.993.993 0 0 0-.97-.804H4.18zM6 5v1h5V5h1.825c.946 0 1.76.673 1.946 1.608l1.19 6A2 2 0 0 1 14.016 15H2.984a1.992 1.992 0 0 1-1.945-2.392l1.19-6C2.414 5.673 3.229 5 4.174 5H6z"
/> />
</svg>
<div <div
className="euiFilePicker__promptText" className="euiFilePicker__promptText"
> >
@ -1294,22 +1246,14 @@ Array [
className="euiCard__top" className="euiCard__top"
> >
<svg <svg
className="euiIcon euiIcon--xxLarge euiIcon--app euiCard__icon" className="euiIcon euiIcon--xxLarge euiIcon--app euiIcon-isLoading euiCard__icon"
focusable="false" focusable="false"
height="32" height={16}
style={null} style={null}
viewBox="0 0 32 32" viewBox="0 0 16 16"
width="32" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
className="euiIcon__fillSecondary"
d="M7 17h2v7H7zM12 14h2v10h-2zM17 16h2v8h-2zM22 14h3v2h-3zM22 18h3v2h-3zM22 22h3v2h-3z"
/> />
<path
d="M30.73 24a6.47 6.47 0 0 1 .45-2.19c.337-.9.52-1.85.54-2.81a8.55 8.55 0 0 0-.54-2.81 6.47 6.47 0 0 1-.45-2.19 9.2 9.2 0 0 1 .62-2.49c.53-1.57 1.08-3.19.08-4.2-1-1.01-2.41-.44-3.52.05a5.59 5.59 0 0 1-2.09.64 5.3 5.3 0 0 1-.59 0L16 .28 6.77 8a5.3 5.3 0 0 1-.59 0 5.59 5.59 0 0 1-2.09-.65C3 6.87 1.6 6.25.57 7.31c-1.03 1.06-.45 2.63.08 4.2A9.2 9.2 0 0 1 1.27 14a6.47 6.47 0 0 1-.45 2.19A8.55 8.55 0 0 0 .28 19c.02.96.203 1.91.54 2.81A6.47 6.47 0 0 1 1.27 24a9.2 9.2 0 0 1-.62 2.49c-.53 1.57-1.08 3.19-.08 4.2.353.38.852.59 1.37.58a5.67 5.67 0 0 0 2.15-.63A5.59 5.59 0 0 1 6.18 30a7.13 7.13 0 0 1 2.29.47 8 8 0 0 0 2.62.53 7.37 7.37 0 0 0 2.47-.51A7.14 7.14 0 0 1 16 30a6.24 6.24 0 0 1 2.14.45 8 8 0 0 0 2.77.55 8.08 8.08 0 0 0 2.77-.55 6.24 6.24 0 0 1 2.14-.45 5.59 5.59 0 0 1 2.09.65c1.11.49 2.49 1.11 3.52.05 1.03-1.06.45-2.63-.08-4.2a9.2 9.2 0 0 1-.62-2.5zM21.17 7h-.26a8 8 0 0 0-2.77.55A6.24 6.24 0 0 1 16 8a6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 11.09 7h-.26L16 2.72 21.17 7zm8.89 22.27a4.42 4.42 0 0 1-1.34-.46 7.08 7.08 0 0 0-2.9-.82 8.14 8.14 0 0 0-2.78.55 6.13 6.13 0 0 1-2.13.45 6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 16 28a9 9 0 0 0-3.08.6 5.74 5.74 0 0 1-1.83.4 6.36 6.36 0 0 1-2-.43A8.72 8.72 0 0 0 6.18 28a7.08 7.08 0 0 0-2.9.82 9.65 9.65 0 0 1-1.28.52 6.08 6.08 0 0 1 .52-2.21c.403-1 .65-2.055.73-3.13a8.55 8.55 0 0 0-.54-2.81A6.47 6.47 0 0 1 2.27 19a6.47 6.47 0 0 1 .44-2.19c.337-.9.52-1.85.54-2.81a10.48 10.48 0 0 0-.72-3.13 9 9 0 0 1-.59-2.16H2c.447.1.88.255 1.29.46a7.08 7.08 0 0 0 2.9.82A8.14 8.14 0 0 0 9 9.44 6.13 6.13 0 0 1 11.09 9a6.13 6.13 0 0 1 2.13.45A8.14 8.14 0 0 0 16 10a8.14 8.14 0 0 0 2.78-.55A6.13 6.13 0 0 1 20.91 9a6.13 6.13 0 0 1 2.09.44 8.14 8.14 0 0 0 2.78.55 7.08 7.08 0 0 0 2.9-.82A9.65 9.65 0 0 1 30 8.66a6.08 6.08 0 0 1-.52 2.21c-.403 1-.65 2.055-.73 3.13.02.96.203 1.91.54 2.81a6.47 6.47 0 0 1 .44 2.19 6.47 6.47 0 0 1-.44 2.19 8.55 8.55 0 0 0-.54 2.81c.078 1.074.32 2.13.72 3.13a9 9 0 0 1 .59 2.16v-.02z"
/>
</svg>
</span> </span>
<span <span
className="euiCard__content" className="euiCard__content"

View file

@ -16,22 +16,14 @@ exports[`Storyshots components/ElementCard with click handler 1`] = `
className="euiCard__top" className="euiCard__top"
> >
<svg <svg
className="euiIcon euiIcon--xxLarge euiIcon--app euiCard__icon" className="euiIcon euiIcon--xxLarge euiIcon--app euiIcon-isLoading euiCard__icon"
focusable="false" focusable="false"
height="32" height={16}
style={null} style={null}
viewBox="0 0 32 32" viewBox="0 0 16 16"
width="32" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
className="euiIcon__fillSecondary"
d="M7 17h2v7H7zM12 14h2v10h-2zM17 16h2v8h-2zM22 14h3v2h-3zM22 18h3v2h-3zM22 22h3v2h-3z"
/> />
<path
d="M30.73 24a6.47 6.47 0 0 1 .45-2.19c.337-.9.52-1.85.54-2.81a8.55 8.55 0 0 0-.54-2.81 6.47 6.47 0 0 1-.45-2.19 9.2 9.2 0 0 1 .62-2.49c.53-1.57 1.08-3.19.08-4.2-1-1.01-2.41-.44-3.52.05a5.59 5.59 0 0 1-2.09.64 5.3 5.3 0 0 1-.59 0L16 .28 6.77 8a5.3 5.3 0 0 1-.59 0 5.59 5.59 0 0 1-2.09-.65C3 6.87 1.6 6.25.57 7.31c-1.03 1.06-.45 2.63.08 4.2A9.2 9.2 0 0 1 1.27 14a6.47 6.47 0 0 1-.45 2.19A8.55 8.55 0 0 0 .28 19c.02.96.203 1.91.54 2.81A6.47 6.47 0 0 1 1.27 24a9.2 9.2 0 0 1-.62 2.49c-.53 1.57-1.08 3.19-.08 4.2.353.38.852.59 1.37.58a5.67 5.67 0 0 0 2.15-.63A5.59 5.59 0 0 1 6.18 30a7.13 7.13 0 0 1 2.29.47 8 8 0 0 0 2.62.53 7.37 7.37 0 0 0 2.47-.51A7.14 7.14 0 0 1 16 30a6.24 6.24 0 0 1 2.14.45 8 8 0 0 0 2.77.55 8.08 8.08 0 0 0 2.77-.55 6.24 6.24 0 0 1 2.14-.45 5.59 5.59 0 0 1 2.09.65c1.11.49 2.49 1.11 3.52.05 1.03-1.06.45-2.63-.08-4.2a9.2 9.2 0 0 1-.62-2.5zM21.17 7h-.26a8 8 0 0 0-2.77.55A6.24 6.24 0 0 1 16 8a6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 11.09 7h-.26L16 2.72 21.17 7zm8.89 22.27a4.42 4.42 0 0 1-1.34-.46 7.08 7.08 0 0 0-2.9-.82 8.14 8.14 0 0 0-2.78.55 6.13 6.13 0 0 1-2.13.45 6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 16 28a9 9 0 0 0-3.08.6 5.74 5.74 0 0 1-1.83.4 6.36 6.36 0 0 1-2-.43A8.72 8.72 0 0 0 6.18 28a7.08 7.08 0 0 0-2.9.82 9.65 9.65 0 0 1-1.28.52 6.08 6.08 0 0 1 .52-2.21c.403-1 .65-2.055.73-3.13a8.55 8.55 0 0 0-.54-2.81A6.47 6.47 0 0 1 2.27 19a6.47 6.47 0 0 1 .44-2.19c.337-.9.52-1.85.54-2.81a10.48 10.48 0 0 0-.72-3.13 9 9 0 0 1-.59-2.16H2c.447.1.88.255 1.29.46a7.08 7.08 0 0 0 2.9.82A8.14 8.14 0 0 0 9 9.44 6.13 6.13 0 0 1 11.09 9a6.13 6.13 0 0 1 2.13.45A8.14 8.14 0 0 0 16 10a8.14 8.14 0 0 0 2.78-.55A6.13 6.13 0 0 1 20.91 9a6.13 6.13 0 0 1 2.09.44 8.14 8.14 0 0 0 2.78.55 7.08 7.08 0 0 0 2.9-.82A9.65 9.65 0 0 1 30 8.66a6.08 6.08 0 0 1-.52 2.21c-.403 1-.65 2.055-.73 3.13.02.96.203 1.91.54 2.81a6.47 6.47 0 0 1 .44 2.19 6.47 6.47 0 0 1-.44 2.19 8.55 8.55 0 0 0-.54 2.81c.078 1.074.32 2.13.72 3.13a9 9 0 0 1 .59 2.16v-.02z"
/>
</svg>
</span> </span>
<span <span
className="euiCard__content" className="euiCard__content"
@ -119,22 +111,14 @@ exports[`Storyshots components/ElementCard with tags 1`] = `
className="euiCard__top" className="euiCard__top"
> >
<svg <svg
className="euiIcon euiIcon--xxLarge euiIcon--app euiCard__icon" className="euiIcon euiIcon--xxLarge euiIcon--app euiIcon-isLoading euiCard__icon"
focusable="false" focusable="false"
height="32" height={16}
style={null} style={null}
viewBox="0 0 32 32" viewBox="0 0 16 16"
width="32" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
className="euiIcon__fillSecondary"
d="M7 17h2v7H7zM12 14h2v10h-2zM17 16h2v8h-2zM22 14h3v2h-3zM22 18h3v2h-3zM22 22h3v2h-3z"
/> />
<path
d="M30.73 24a6.47 6.47 0 0 1 .45-2.19c.337-.9.52-1.85.54-2.81a8.55 8.55 0 0 0-.54-2.81 6.47 6.47 0 0 1-.45-2.19 9.2 9.2 0 0 1 .62-2.49c.53-1.57 1.08-3.19.08-4.2-1-1.01-2.41-.44-3.52.05a5.59 5.59 0 0 1-2.09.64 5.3 5.3 0 0 1-.59 0L16 .28 6.77 8a5.3 5.3 0 0 1-.59 0 5.59 5.59 0 0 1-2.09-.65C3 6.87 1.6 6.25.57 7.31c-1.03 1.06-.45 2.63.08 4.2A9.2 9.2 0 0 1 1.27 14a6.47 6.47 0 0 1-.45 2.19A8.55 8.55 0 0 0 .28 19c.02.96.203 1.91.54 2.81A6.47 6.47 0 0 1 1.27 24a9.2 9.2 0 0 1-.62 2.49c-.53 1.57-1.08 3.19-.08 4.2.353.38.852.59 1.37.58a5.67 5.67 0 0 0 2.15-.63A5.59 5.59 0 0 1 6.18 30a7.13 7.13 0 0 1 2.29.47 8 8 0 0 0 2.62.53 7.37 7.37 0 0 0 2.47-.51A7.14 7.14 0 0 1 16 30a6.24 6.24 0 0 1 2.14.45 8 8 0 0 0 2.77.55 8.08 8.08 0 0 0 2.77-.55 6.24 6.24 0 0 1 2.14-.45 5.59 5.59 0 0 1 2.09.65c1.11.49 2.49 1.11 3.52.05 1.03-1.06.45-2.63-.08-4.2a9.2 9.2 0 0 1-.62-2.5zM21.17 7h-.26a8 8 0 0 0-2.77.55A6.24 6.24 0 0 1 16 8a6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 11.09 7h-.26L16 2.72 21.17 7zm8.89 22.27a4.42 4.42 0 0 1-1.34-.46 7.08 7.08 0 0 0-2.9-.82 8.14 8.14 0 0 0-2.78.55 6.13 6.13 0 0 1-2.13.45 6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 16 28a9 9 0 0 0-3.08.6 5.74 5.74 0 0 1-1.83.4 6.36 6.36 0 0 1-2-.43A8.72 8.72 0 0 0 6.18 28a7.08 7.08 0 0 0-2.9.82 9.65 9.65 0 0 1-1.28.52 6.08 6.08 0 0 1 .52-2.21c.403-1 .65-2.055.73-3.13a8.55 8.55 0 0 0-.54-2.81A6.47 6.47 0 0 1 2.27 19a6.47 6.47 0 0 1 .44-2.19c.337-.9.52-1.85.54-2.81a10.48 10.48 0 0 0-.72-3.13 9 9 0 0 1-.59-2.16H2c.447.1.88.255 1.29.46a7.08 7.08 0 0 0 2.9.82A8.14 8.14 0 0 0 9 9.44 6.13 6.13 0 0 1 11.09 9a6.13 6.13 0 0 1 2.13.45A8.14 8.14 0 0 0 16 10a8.14 8.14 0 0 0 2.78-.55A6.13 6.13 0 0 1 20.91 9a6.13 6.13 0 0 1 2.09.44 8.14 8.14 0 0 0 2.78.55 7.08 7.08 0 0 0 2.9-.82A9.65 9.65 0 0 1 30 8.66a6.08 6.08 0 0 1-.52 2.21c-.403 1-.65 2.055-.73 3.13.02.96.203 1.91.54 2.81a6.47 6.47 0 0 1 .44 2.19 6.47 6.47 0 0 1-.44 2.19 8.55 8.55 0 0 0-.54 2.81c.078 1.074.32 2.13.72 3.13a9 9 0 0 1 .59 2.16v-.02z"
/>
</svg>
</span> </span>
<span <span
className="euiCard__content" className="euiCard__content"
@ -291,22 +275,14 @@ exports[`Storyshots components/ElementCard with title and description 1`] = `
className="euiCard__top" className="euiCard__top"
> >
<svg <svg
className="euiIcon euiIcon--xxLarge euiIcon--app euiCard__icon" className="euiIcon euiIcon--xxLarge euiIcon--app euiIcon-isLoading euiCard__icon"
focusable="false" focusable="false"
height="32" height={16}
style={null} style={null}
viewBox="0 0 32 32" viewBox="0 0 16 16"
width="32" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
className="euiIcon__fillSecondary"
d="M7 17h2v7H7zM12 14h2v10h-2zM17 16h2v8h-2zM22 14h3v2h-3zM22 18h3v2h-3zM22 22h3v2h-3z"
/> />
<path
d="M30.73 24a6.47 6.47 0 0 1 .45-2.19c.337-.9.52-1.85.54-2.81a8.55 8.55 0 0 0-.54-2.81 6.47 6.47 0 0 1-.45-2.19 9.2 9.2 0 0 1 .62-2.49c.53-1.57 1.08-3.19.08-4.2-1-1.01-2.41-.44-3.52.05a5.59 5.59 0 0 1-2.09.64 5.3 5.3 0 0 1-.59 0L16 .28 6.77 8a5.3 5.3 0 0 1-.59 0 5.59 5.59 0 0 1-2.09-.65C3 6.87 1.6 6.25.57 7.31c-1.03 1.06-.45 2.63.08 4.2A9.2 9.2 0 0 1 1.27 14a6.47 6.47 0 0 1-.45 2.19A8.55 8.55 0 0 0 .28 19c.02.96.203 1.91.54 2.81A6.47 6.47 0 0 1 1.27 24a9.2 9.2 0 0 1-.62 2.49c-.53 1.57-1.08 3.19-.08 4.2.353.38.852.59 1.37.58a5.67 5.67 0 0 0 2.15-.63A5.59 5.59 0 0 1 6.18 30a7.13 7.13 0 0 1 2.29.47 8 8 0 0 0 2.62.53 7.37 7.37 0 0 0 2.47-.51A7.14 7.14 0 0 1 16 30a6.24 6.24 0 0 1 2.14.45 8 8 0 0 0 2.77.55 8.08 8.08 0 0 0 2.77-.55 6.24 6.24 0 0 1 2.14-.45 5.59 5.59 0 0 1 2.09.65c1.11.49 2.49 1.11 3.52.05 1.03-1.06.45-2.63-.08-4.2a9.2 9.2 0 0 1-.62-2.5zM21.17 7h-.26a8 8 0 0 0-2.77.55A6.24 6.24 0 0 1 16 8a6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 11.09 7h-.26L16 2.72 21.17 7zm8.89 22.27a4.42 4.42 0 0 1-1.34-.46 7.08 7.08 0 0 0-2.9-.82 8.14 8.14 0 0 0-2.78.55 6.13 6.13 0 0 1-2.13.45 6.24 6.24 0 0 1-2.14-.45A8 8 0 0 0 16 28a9 9 0 0 0-3.08.6 5.74 5.74 0 0 1-1.83.4 6.36 6.36 0 0 1-2-.43A8.72 8.72 0 0 0 6.18 28a7.08 7.08 0 0 0-2.9.82 9.65 9.65 0 0 1-1.28.52 6.08 6.08 0 0 1 .52-2.21c.403-1 .65-2.055.73-3.13a8.55 8.55 0 0 0-.54-2.81A6.47 6.47 0 0 1 2.27 19a6.47 6.47 0 0 1 .44-2.19c.337-.9.52-1.85.54-2.81a10.48 10.48 0 0 0-.72-3.13 9 9 0 0 1-.59-2.16H2c.447.1.88.255 1.29.46a7.08 7.08 0 0 0 2.9.82A8.14 8.14 0 0 0 9 9.44 6.13 6.13 0 0 1 11.09 9a6.13 6.13 0 0 1 2.13.45A8.14 8.14 0 0 0 16 10a8.14 8.14 0 0 0 2.78-.55A6.13 6.13 0 0 1 20.91 9a6.13 6.13 0 0 1 2.09.44 8.14 8.14 0 0 0 2.78.55 7.08 7.08 0 0 0 2.9-.82A9.65 9.65 0 0 1 30 8.66a6.08 6.08 0 0 1-.52 2.21c-.403 1-.65 2.055-.73 3.13.02.96.203 1.91.54 2.81a6.47 6.47 0 0 1 .44 2.19 6.47 6.47 0 0 1-.44 2.19 8.55 8.55 0 0 0-.54 2.81c.078 1.074.32 2.13.72 3.13a9 9 0 0 1 .59 2.16v-.02z"
/>
</svg>
</span> </span>
<span <span
className="euiCard__content" className="euiCard__content"

View file

@ -30,25 +30,14 @@ exports[`Storyshots components/ElementTypes/ElementControls has two buttons 1`]
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M12.148 3.148L11 2l-9 9v3h3l9-9-1.144-1.144-8.002 7.998a.502.502 0 0 1-.708 0 .502.502 0 0 1 0-.708l8.002-7.998zM11 1c.256 0 .512.098.707.293l3 3a.999.999 0 0 1 0 1.414l-9 9A.997.997 0 0 1 5 15H2a1 1 0 0 1-1-1v-3c0-.265.105-.52.293-.707l9-9A.997.997 0 0 1 11 1zM5 14H2v-3l3 3z"
id="pencil-a"
/> />
</defs>
<use
xlinkHref="#pencil-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -71,25 +60,14 @@ exports[`Storyshots components/ElementTypes/ElementControls has two buttons 1`]
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
xlinkHref="#trash-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>

View file

@ -71,25 +71,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M12.148 3.148L11 2l-9 9v3h3l9-9-1.144-1.144-8.002 7.998a.502.502 0 0 1-.708 0 .502.502 0 0 1 0-.708l8.002-7.998zM11 1c.256 0 .512.098.707.293l3 3a.999.999 0 0 1 0 1.414l-9 9A.997.997 0 0 1 5 15H2a1 1 0 0 1-1-1v-3c0-.265.105-.52.293-.707l9-9A.997.997 0 0 1 11 1zM5 14H2v-3l3 3z"
id="pencil-a"
/> />
</defs>
<use
xlinkHref="#pencil-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -112,25 +101,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
xlinkHref="#trash-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -196,25 +174,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M12.148 3.148L11 2l-9 9v3h3l9-9-1.144-1.144-8.002 7.998a.502.502 0 0 1-.708 0 .502.502 0 0 1 0-.708l8.002-7.998zM11 1c.256 0 .512.098.707.293l3 3a.999.999 0 0 1 0 1.414l-9 9A.997.997 0 0 1 5 15H2a1 1 0 0 1-1-1v-3c0-.265.105-.52.293-.707l9-9A.997.997 0 0 1 11 1zM5 14H2v-3l3 3z"
id="pencil-a"
/> />
</defs>
<use
xlinkHref="#pencil-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -237,25 +204,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
xlinkHref="#trash-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -321,25 +277,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M12.148 3.148L11 2l-9 9v3h3l9-9-1.144-1.144-8.002 7.998a.502.502 0 0 1-.708 0 .502.502 0 0 1 0-.708l8.002-7.998zM11 1c.256 0 .512.098.707.293l3 3a.999.999 0 0 1 0 1.414l-9 9A.997.997 0 0 1 5 15H2a1 1 0 0 1-1-1v-3c0-.265.105-.52.293-.707l9-9A.997.997 0 0 1 11 1zM5 14H2v-3l3 3z"
id="pencil-a"
/> />
</defs>
<use
xlinkHref="#pencil-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -362,25 +307,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
xlinkHref="#trash-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -461,25 +395,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls and filter
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M12.148 3.148L11 2l-9 9v3h3l9-9-1.144-1.144-8.002 7.998a.502.502 0 0 1-.708 0 .502.502 0 0 1 0-.708l8.002-7.998zM11 1c.256 0 .512.098.707.293l3 3a.999.999 0 0 1 0 1.414l-9 9A.997.997 0 0 1 5 15H2a1 1 0 0 1-1-1v-3c0-.265.105-.52.293-.707l9-9A.997.997 0 0 1 11 1zM5 14H2v-3l3 3z"
id="pencil-a"
/> />
</defs>
<use
xlinkHref="#pencil-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -502,25 +425,14 @@ exports[`Storyshots components/ElementTypes/ElementGrid with controls and filter
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M11 3h5v1H0V3h5V1a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2zm-7.056 8H7v1H4.1l.392 2.519c.042.269.254.458.493.458h6.03c.239 0 .451-.189.493-.458l1.498-9.576H14l-1.504 9.73c-.116.747-.74 1.304-1.481 1.304h-6.03c-.741 0-1.365-.557-1.481-1.304l-1.511-9.73H9V5.95H3.157L3.476 8H8v1H3.632l.312 2zM6 3h4V1H6v2z"
id="trash-a"
/> />
</defs>
<use
xlinkHref="#trash-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>

View file

@ -21,18 +21,14 @@ exports[`Storyshots components/FileUpload default 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFilePicker__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFilePicker__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 10.114l1.85-1.943a.52.52 0 0 1 .77 0c.214.228.214.6 0 .829l-1.95 2.05a1.552 1.552 0 0 1-2.31 0L5.41 9a.617.617 0 0 1 0-.829.52.52 0 0 1 .77 0L8 10.082V1.556C8 1.249 8.224 1 8.5 1s.5.249.5.556v8.558zM4.18 6a.993.993 0 0 0-.972.804l-1.189 6A.995.995 0 0 0 2.991 14h11.018a1 1 0 0 0 .972-1.196l-1.19-6a.993.993 0 0 0-.97-.804H4.18zM6 5v1h5V5h1.825c.946 0 1.76.673 1.946 1.608l1.19 6A2 2 0 0 1 14.016 15H2.984a1.992 1.992 0 0 1-1.945-2.392l1.19-6C2.414 5.673 3.229 5 4.174 5H6z"
/> />
</svg>
<div <div
className="euiFilePicker__promptText" className="euiFilePicker__promptText"
> >

View file

@ -48,26 +48,14 @@ exports[`Storyshots components/FontPicker default 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>
@ -142,26 +130,14 @@ exports[`Storyshots components/FontPicker with value 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</span> </span>
</div> </div>
</div> </div>

View file

@ -71,23 +71,18 @@ exports[`Storyshots components/ItemGrid complex grid 1`] = `
} }
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#333", "fill": "#333",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
<div <div
@ -105,23 +100,18 @@ exports[`Storyshots components/ItemGrid complex grid 1`] = `
} }
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#FFF", "fill": "#FFF",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
<div <div
@ -139,23 +129,18 @@ exports[`Storyshots components/ItemGrid complex grid 1`] = `
} }
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#FFF", "fill": "#FFF",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
</div> </div>
</div> </div>
@ -166,47 +151,32 @@ exports[`Storyshots components/ItemGrid icon grid 1`] = `
className="item-grid-row" className="item-grid-row"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 7h3.5a.5.5 0 1 1 0 1H8v3.5a.5.5 0 1 1-1 0V8H3.5a.5.5 0 0 1 0-1H7V3.5a.5.5 0 0 1 1 0V7zm-.5-7C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882z"
fillRule="evenodd"
/> />
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.5 0C11.636 0 15 3.364 15 7.5S11.636 15 7.5 15 0 11.636 0 7.5 3.364 0 7.5 0zm0 .882a6.618 6.618 0 1 0 0 13.236A6.618 6.618 0 0 0 7.5.882zM3.5 7h8a.5.5 0 1 1 0 1h-8a.5.5 0 0 1 0-1z"
fillRule="evenodd"
/> />
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6.5 12a.502.502 0 0 1-.354-.146l-4-4a.502.502 0 0 1 .708-.708L6.5 10.793l6.646-6.647a.502.502 0 0 1 .708.708l-7 7A.502.502 0 0 1 6.5 12"
fillRule="evenodd"
/> />
</svg>
</div> </div>
`; `;

View file

@ -16,8 +16,8 @@ storiesOf('components/ItemGrid', module)
)) ))
.add('icon grid', () => ( .add('icon grid', () => (
<ItemGrid <ItemGrid
items={['plusInCircle', 'minusInCircle', 'check'] as IconType[]} items={['plusInCircle', 'minusInCircle', 'check']}
children={(item: IconType) => <EuiIcon key={item} type={item} />} children={item => <EuiIcon key={item} type={item} />}
/> />
)) ))
.add('color dot grid', () => ( .add('color dot grid', () => (

View file

@ -57,18 +57,14 @@ exports[`Storyshots components/KeyboardShortcutsDoc default 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z"
/> />
</svg>
</button> </button>
<div <div
className="euiFlyoutHeader euiFlyoutHeader--hasBorder" className="euiFlyoutHeader euiFlyoutHeader--hasBorder"

View file

@ -45,18 +45,14 @@ exports[`Storyshots components/SidebarHeader/ default 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 2H2v11h6v1H1V1h12v6h-1V2zM5 5h5.999V4H5v1zM3 5V4h1v1H3zm2 3V7h3v1H5zM3 8V7h1v1H3zm2 3v-1h2v1H5zm5-1H8v1h2v2h1v-2h2v-1h-2V8h-1v2zm-7 1v-1h1v1H3zm7.5-5a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9z"
/> />
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -92,25 +88,14 @@ exports[`Storyshots components/SidebarHeader/ default 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M7 1v2h2V1H7zM6 0h4v4H6V0zm0 6h4v4H6V6zm1 1v2h2V7H7zm-1 5h4v4H6v-4zm1 1v2h2v-2H7z"
id="boxes_vertical-a"
/> />
</defs>
<use
xlinkHref="#boxes_vertical-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -167,18 +152,14 @@ exports[`Storyshots components/SidebarHeader/ without layer controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M12 2H2v11h6v1H1V1h12v6h-1V2zM5 5h5.999V4H5v1zM3 5V4h1v1H3zm2 3V7h3v1H5zM3 8V7h1v1H3zm2 3v-1h2v1H5zm5-1H8v1h2v2h1v-2h2v-1h-2V8h-1v2zm-7 1v-1h1v1H3zm7.5-5a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9z"
/> />
</svg>
</button> </button>
</span> </span>
</div> </div>
@ -214,25 +195,14 @@ exports[`Storyshots components/SidebarHeader/ without layer controls 1`] = `
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiButtonIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiButtonIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M7 1v2h2V1H7zM6 0h4v4H6V0zm0 6h4v4H6V6zm1 1v2h2V7H7zm-1 5h4v4H6v-4zm1 1v2h2v-2H7z"
id="boxes_vertical-a"
/> />
</defs>
<use
xlinkHref="#boxes_vertical-a"
/>
</svg>
</button> </button>
</span> </span>
</div> </div>

View file

@ -55,31 +55,18 @@ exports[`Storyshots components/Tag as health 1`] = `
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#666666", "fill": "#666666",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<circle
cx="8"
cy="8"
id="dot-a"
r="4"
/> />
</defs>
<use
xlinkHref="#dot-a"
/>
</svg>
</div> </div>
<div <div
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
@ -101,31 +88,18 @@ exports[`Storyshots components/Tag as health with color 1`] = `
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#9b3067", "fill": "#9b3067",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<circle
cx="8"
cy="8"
id="dot-a"
r="4"
/> />
</defs>
<use
xlinkHref="#dot-a"
/>
</svg>
</div> </div>
<div <div
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"

View file

@ -76,31 +76,18 @@ Array [
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#cc3b54", "fill": "#cc3b54",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<circle
cx="8"
cy="8"
id="dot-a"
r="4"
/> />
</defs>
<use
xlinkHref="#dot-a"
/>
</svg>
</div> </div>
<div <div
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
@ -119,31 +106,18 @@ Array [
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#9b3067", "fill": "#9b3067",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<circle
cx="8"
cy="8"
id="dot-a"
r="4"
/> />
</defs>
<use
xlinkHref="#dot-a"
/>
</svg>
</div> </div>
<div <div
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
@ -162,31 +136,18 @@ Array [
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={ style={
Object { Object {
"fill": "#d41e93", "fill": "#d41e93",
} }
} }
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<circle
cx="8"
cy="8"
id="dot-a"
r="4"
/> />
</defs>
<use
xlinkHref="#dot-a"
/>
</svg>
</div> </div>
<div <div
className="euiFlexItem euiFlexItem--flexGrowZero" className="euiFlexItem euiFlexItem--flexGrowZero"

View file

@ -2,7 +2,7 @@
"extends": "../../../../../tsconfig", "extends": "../../../../../tsconfig",
"compilerOptions": { "compilerOptions": {
"module": "commonjs", "module": "commonjs",
"lib": ["esnext", "dom"], "lib": ["es2018", "dom"],
"noImplicitAny": true, "noImplicitAny": true,
"strictNullChecks": true, "strictNullChecks": true,
"strictFunctionTypes": false, "strictFunctionTypes": false,

View file

@ -72,6 +72,7 @@ export enum FileTreeItemType {
export interface WorkerResult { export interface WorkerResult {
uri: string; uri: string;
cancelled?: boolean;
} }
// TODO(mengwei): create a AbstractGitWorkerResult since we now have an // TODO(mengwei): create a AbstractGitWorkerResult since we now have an

View file

@ -60,10 +60,11 @@ export class CodeBlock extends React.PureComponent<Props> {
(e.target.type === monaco.editor.MouseTargetType.GUTTER_LINE_NUMBERS || (e.target.type === monaco.editor.MouseTargetType.GUTTER_LINE_NUMBERS ||
e.target.type === monaco.editor.MouseTargetType.CONTENT_TEXT) e.target.type === monaco.editor.MouseTargetType.CONTENT_TEXT)
) { ) {
const lineNumber = (this.props.startLine || 0) + e.target.position.lineNumber; const position = e.target.position || { lineNumber: 0, column: 0 };
const lineNumber = (this.props.startLine || 0) + position.lineNumber;
this.props.onClick({ this.props.onClick({
lineNumber, lineNumber,
column: e.target.position.column, column: position.column,
}); });
} }
}); });
@ -94,7 +95,9 @@ export class CodeBlock extends React.PureComponent<Props> {
prevProps.highlightRanges !== this.props.highlightRanges prevProps.highlightRanges !== this.props.highlightRanges
) { ) {
if (this.ed) { if (this.ed) {
this.ed.getModel().setValue(this.props.code); const model = this.ed.getModel();
if (model) {
model.setValue(this.props.code);
if (this.props.highlightRanges) { if (this.props.highlightRanges) {
const decorations = this.props.highlightRanges!.map((range: IRange) => { const decorations = this.props.highlightRanges!.map((range: IRange) => {
@ -113,6 +116,7 @@ export class CodeBlock extends React.PureComponent<Props> {
} }
} }
} }
}
public componentWillUnmount(): void { public componentWillUnmount(): void {
if (this.ed) { if (this.ed) {

View file

@ -181,7 +181,8 @@ export class EditorComponent extends React.Component<IProps> {
this.editor.onMouseDown((e: editorInterfaces.IEditorMouseEvent) => { this.editor.onMouseDown((e: editorInterfaces.IEditorMouseEvent) => {
if (e.target.type === monaco.editor.MouseTargetType.GUTTER_LINE_NUMBERS) { if (e.target.type === monaco.editor.MouseTargetType.GUTTER_LINE_NUMBERS) {
const uri = `${repo}/blob/${encodeRevisionString(revision)}/${file}`; const uri = `${repo}/blob/${encodeRevisionString(revision)}/${file}`;
history.push(`/${uri}!L${e.target.position.lineNumber}:0${qs}`); const position = e.target.position || { lineNumber: 0, column: 0 };
history.push(`/${uri}!L${position.lineNumber}:0${qs}`);
} }
this.monaco!.container.focus(); this.monaco!.container.focus();
}); });

View file

@ -16,25 +16,14 @@ exports[`render correctly 1`] = `
/> />
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiSideNav__mobileIcon" className="euiIcon euiIcon--medium euiIcon-isLoading euiSideNav__mobileIcon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M2 4V2h2v2H2zm5 0V2h2v2H7zm5 0V2h2v2h-2zM2 9V7h2v2H2zm5 0V7h2v2H7zm5 0V7h2v2h-2zM2 14v-2h2v2H2zm5 0v-2h2v2H7zm5 0v-2h2v2h-2z"
id="apps-a"
/> />
</defs>
<use
xlinkHref="#apps-a"
/>
</svg>
</span> </span>
</button> </button>
<div <div
@ -86,41 +75,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-android-closed" data-test-subj="codeFileTreeNode-Directory-Icon-android-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -148,41 +120,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-futures-closed" data-test-subj="codeFileTreeNode-Directory-Icon-futures-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -210,40 +165,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava-open" data-test-subj="codeFileTreeNode-Directory-Icon-guava-open"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1 9.5l.826-3.717A1 1 0 0 1 2.802 5H13V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2H1v7.5zm.247 3.5h11.95l1.556-7H2.803l-1.556 7zM13 14H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H13a1 1 0 0 1 1 1V5h.753a1 1 0 0 1 .977 1.217l-1.556 7a1 1 0 0 1-.976.783H13z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -273,41 +212,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava/javadoc-link-closed" data-test-subj="codeFileTreeNode-Directory-Icon-guava/javadoc-link-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -335,25 +257,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -385,40 +296,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava/src/com/google-open" data-test-subj="codeFileTreeNode-Directory-Icon-guava/src/com/google-open"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M1 9.5l.826-3.717A1 1 0 0 1 2.802 5H13V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2H1v7.5zm.247 3.5h11.95l1.556-7H2.803l-1.556 7zM13 14H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H13a1 1 0 0 1 1 1V5h.753a1 1 0 0 1 .977 1.217l-1.556 7a1 1 0 0 1-.976.783H13z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -451,41 +346,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava/src/com/google/common-closed" data-test-subj="codeFileTreeNode-Directory-Icon-guava/src/com/google/common-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -513,41 +391,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava/src/com/google/thirdparty/publicsuffix-closed" data-test-subj="codeFileTreeNode-Directory-Icon-guava/src/com/google/thirdparty/publicsuffix-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -579,41 +440,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava-bom-closed" data-test-subj="codeFileTreeNode-Directory-Icon-guava-bom-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -641,41 +485,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava-gwt-closed" data-test-subj="codeFileTreeNode-Directory-Icon-guava-gwt-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -703,41 +530,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava-testlib-closed" data-test-subj="codeFileTreeNode-Directory-Icon-guava-testlib-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -765,41 +575,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-guava-tests-closed" data-test-subj="codeFileTreeNode-Directory-Icon-guava-tests-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -827,41 +620,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-refactorings-closed" data-test-subj="codeFileTreeNode-Directory-Icon-refactorings-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -889,41 +665,24 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--small codeFileTree__icon" className="euiIcon euiIcon--small euiIcon-isLoading codeFileTree__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_right-a"
/> />
</defs>
<use
fillRule="nonzero"
transform="matrix(0 1 1 0 0 0)"
xlinkHref="#arrow_right-a"
/>
</svg>
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
data-test-subj="codeFileTreeNode-Directory-Icon-util-closed" data-test-subj="codeFileTreeNode-Directory-Icon-util-closed"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M6 2H1v11h14V3.5H7.125A1.125 1.125 0 0 1 6 2.375V2zm.25-1a.75.75 0 0 1 .75.75v.625c0 .069.056.125.125.125H15a1 1 0 0 1 1 1V13a1 1 0 0 1-1 1H1a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.25z"
/> />
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -951,25 +710,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1001,25 +749,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1051,25 +788,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1101,25 +827,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1151,25 +866,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1201,25 +905,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1251,25 +944,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1301,25 +983,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1351,25 +1022,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >
@ -1401,25 +1061,14 @@ exports[`render correctly 1`] = `
tabIndex={0} tabIndex={0}
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M10.8 0H2a1 1 0 0 0-1 1v14a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4.429c0-.256-.098-.503-.274-.689l-3.2-3.428A1.002 1.002 0 0 0 10.8 0M14 5v10H2V1h8v3.5a.5.5 0 0 0 .5.5H14z"
id="document-a"
/> />
</defs>
<use
xlinkHref="#document-a"
/>
</svg>
<span <span
className="codeFileTree__directory" className="codeFileTree__directory"
> >

View file

@ -44,7 +44,6 @@ test('render correctly', () => {
location={location} location={location}
closeTreePath={mockFunction} closeTreePath={mockFunction}
openTreePath={mockFunction} openTreePath={mockFunction}
fetchRepoTree={mockFunction}
/> />
) )
.toJSON(); .toJSON();

View file

@ -11,7 +11,7 @@ import classes from 'classnames';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { RouteComponentProps, withRouter } from 'react-router-dom'; import { RouteComponentProps, withRouter } from 'react-router-dom';
import { FileTree as Tree, FileTreeItemType } from '../../../model'; import { FileTree as Tree, FileTreeItemType } from '../../../model';
import { closeTreePath, fetchRepoTree, FetchRepoTreePayload, openTreePath } from '../../actions'; import { closeTreePath, openTreePath } from '../../actions';
import { EuiSideNavItem, MainRouteParams, PathTypes } from '../../common/types'; import { EuiSideNavItem, MainRouteParams, PathTypes } from '../../common/types';
import { RootState } from '../../reducers'; import { RootState } from '../../reducers';
import { encodeRevisionString } from '../../utils/url'; import { encodeRevisionString } from '../../utils/url';
@ -20,9 +20,7 @@ interface Props extends RouteComponentProps<MainRouteParams> {
node?: Tree; node?: Tree;
closeTreePath: (paths: string) => void; closeTreePath: (paths: string) => void;
openTreePath: (paths: string) => void; openTreePath: (paths: string) => void;
fetchRepoTree: (p: FetchRepoTreePayload) => void;
openedPaths: string[]; openedPaths: string[];
treeLoading?: boolean;
} }
export class CodeFileTree extends React.Component<Props> { export class CodeFileTree extends React.Component<Props> {
@ -33,16 +31,6 @@ export class CodeFileTree extends React.Component<Props> {
} }
} }
public fetchTree(path = '', isDir: boolean) {
const { resource, org, repo, revision } = this.props.match.params;
this.props.fetchRepoTree({
uri: `${resource}/${org}/${repo}`,
revision,
path: path || '',
isDir,
});
}
public onClick = (node: Tree) => { public onClick = (node: Tree) => {
const { resource, org, repo, revision, path } = this.props.match.params; const { resource, org, repo, revision, path } = this.props.match.params;
if (!(path === node.path)) { if (!(path === node.path)) {
@ -257,11 +245,9 @@ export class CodeFileTree extends React.Component<Props> {
const mapStateToProps = (state: RootState) => ({ const mapStateToProps = (state: RootState) => ({
node: state.file.tree, node: state.file.tree,
openedPaths: state.file.openedPaths, openedPaths: state.file.openedPaths,
treeLoading: state.file.rootFileTreeLoading,
}); });
const mapDispatchToProps = { const mapDispatchToProps = {
fetchRepoTree,
closeTreePath, closeTreePath,
openTreePath, openTreePath,
}; };

View file

@ -53,8 +53,8 @@ interface Props extends RouteComponentProps<MainRouteParams> {
onSearchScopeChanged: (s: SearchScope) => void; onSearchScopeChanged: (s: SearchScope) => void;
repoScope: string[]; repoScope: string[];
notFoundDirs: string[]; notFoundDirs: string[];
fileTreeLoadingPaths: string[];
searchOptions: SearchOptions; searchOptions: SearchOptions;
fileTreeLoading: boolean;
query: string; query: string;
} }
const LANG_MD = 'markdown'; const LANG_MD = 'markdown';
@ -266,7 +266,7 @@ class CodeContent extends React.PureComponent<Props> {
} }
public renderContent() { public renderContent() {
const { file, match, tree, fileTreeLoading, isNotFound, notFoundDirs } = this.props; const { file, match, tree, fileTreeLoadingPaths, isNotFound, notFoundDirs } = this.props;
const { path, pathType, resource, org, repo, revision } = match.params; const { path, pathType, resource, org, repo, revision } = match.params;
if (isNotFound || notFoundDirs.includes(path || '')) { if (isNotFound || notFoundDirs.includes(path || '')) {
return <NotFound />; return <NotFound />;
@ -281,7 +281,7 @@ class CodeContent extends React.PureComponent<Props> {
const node = this.findNode(path ? path.split('/') : [], tree); const node = this.findNode(path ? path.split('/') : [], tree);
return ( return (
<div className="codeContainer__directoryView"> <div className="codeContainer__directoryView">
<Directory node={node} loading={fileTreeLoading} /> <Directory node={node} loading={fileTreeLoadingPaths.includes(path)} />
<CommitHistory <CommitHistory
repoUri={repoUri} repoUri={repoUri}
header={ header={
@ -390,7 +390,7 @@ const mapStateToProps = (state: RootState) => ({
notFoundDirs: state.file.notFoundDirs, notFoundDirs: state.file.notFoundDirs,
file: state.file.file, file: state.file.file,
tree: state.file.tree, tree: state.file.tree,
fileTreeLoading: state.file.fileTreeLoading, fileTreeLoadingPaths: state.file.fileTreeLoadingPaths,
currentTree: currentTreeSelector(state), currentTree: currentTreeSelector(state),
branches: state.file.branches, branches: state.file.branches,
hasMoreCommits: hasMoreCommitsSelector(state), hasMoreCommits: hasMoreCommitsSelector(state),

View file

@ -74,7 +74,7 @@ class CodeMain extends React.Component<Props> {
} }
const mapStateToProps = (state: RootState) => ({ const mapStateToProps = (state: RootState) => ({
loadingFileTree: state.file.rootFileTreeLoading, loadingFileTree: state.file.fileTreeLoadingPaths.includes(''),
loadingStructureTree: state.symbol.loading, loadingStructureTree: state.symbol.loading,
hasStructure: structureSelector(state).length > 0 && !state.symbol.error, hasStructure: structureSelector(state).length > 0 && !state.symbol.error,
languageServerInitializing: state.symbol.languageServerInitializing, languageServerInitializing: state.symbol.languageServerInitializing,

View file

@ -71,7 +71,7 @@ class CodeSideTabs extends React.PureComponent<Props> {
id: Tabs.file, id: Tabs.file,
name: 'File', name: 'File',
content: fileTabContent, content: fileTabContent,
'data-test-subj': 'codeFileTreeTab', 'data-test-subj': `codeFileTreeTab${this.sideTab === Tabs.file ? 'Active' : ''}`,
}, },
{ {
id: Tabs.structure, id: Tabs.structure,

View file

@ -349,29 +349,21 @@ exports[`render correctly with empty query string 1`] = `
<EuiIcon <EuiIcon
type="bullseye" type="bullseye"
> >
<bullseye <EuiIconEmpty
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12zm0 1A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0-3a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"
/> />
</svg> </EuiIconEmpty>
</bullseye>
</EuiIcon> </EuiIcon>
Search Everything Search Everything
@ -408,29 +400,21 @@ exports[`render correctly with empty query string 1`] = `
<EuiIcon <EuiIcon
type="bullseye" type="bullseye"
> >
<bullseye <EuiIconEmpty
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12zm0 1A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0-3a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"
/> />
</svg> </EuiIconEmpty>
</bullseye>
</EuiIcon> </EuiIcon>
Search Everything Search Everything
@ -461,40 +445,23 @@ exports[`render correctly with empty query string 1`] = `
className="euiFormControlLayoutCustomIcon__icon" className="euiFormControlLayoutCustomIcon__icon"
type="arrowDown" type="arrowDown"
> >
<arrowDown <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs> </EuiIconEmpty>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</arrowDown>
</EuiIcon> </EuiIcon>
</span> </span>
</EuiFormControlLayoutCustomIcon> </EuiFormControlLayoutCustomIcon>
@ -1093,29 +1060,21 @@ exports[`render correctly with input query string changed 1`] = `
<EuiIcon <EuiIcon
type="bullseye" type="bullseye"
> >
<bullseye <EuiIconEmpty
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12zm0 1A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0-3a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"
/> />
</svg> </EuiIconEmpty>
</bullseye>
</EuiIcon> </EuiIcon>
Search Everything Search Everything
@ -1152,29 +1111,21 @@ exports[`render correctly with input query string changed 1`] = `
<EuiIcon <EuiIcon
type="bullseye" type="bullseye"
> >
<bullseye <EuiIconEmpty
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
> >
<svg <svg
className="euiIcon euiIcon--medium" className="euiIcon euiIcon--medium euiIcon-isLoading"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
>
<path
d="M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12zm0 1A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0-3a4 4 0 1 0 0-8 4 4 0 0 0 0 8zm0-1a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-2a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"
/> />
</svg> </EuiIconEmpty>
</bullseye>
</EuiIcon> </EuiIcon>
Search Everything Search Everything
@ -1205,40 +1156,23 @@ exports[`render correctly with input query string changed 1`] = `
className="euiFormControlLayoutCustomIcon__icon" className="euiFormControlLayoutCustomIcon__icon"
type="arrowDown" type="arrowDown"
> >
<arrowDown <EuiIconEmpty
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16"
style={null} style={null}
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
> >
<svg <svg
aria-hidden="true" aria-hidden="true"
className="euiIcon euiIcon--medium euiFormControlLayoutCustomIcon__icon" className="euiIcon euiIcon--medium euiIcon-isLoading euiFormControlLayoutCustomIcon__icon"
focusable="false" focusable="false"
height="16" height={16}
style={null} style={null}
viewBox="0 0 16 16" viewBox="0 0 16 16"
width="16" width={16}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
xmlnsXlink="http://www.w3.org/1999/xlink"
>
<defs>
<path
d="M13.069 5.157L8.384 9.768a.546.546 0 0 1-.768 0L2.93 5.158a.552.552 0 0 0-.771 0 .53.53 0 0 0 0 .759l4.684 4.61c.641.631 1.672.63 2.312 0l4.684-4.61a.53.53 0 0 0 0-.76.552.552 0 0 0-.771 0z"
id="arrow_down-a"
/> />
</defs> </EuiIconEmpty>
<use
fillRule="nonzero"
xlinkHref="#arrow_down-a"
/>
</svg>
</arrowDown>
</EuiIcon> </EuiIcon>
</span> </span>
</EuiFormControlLayoutCustomIcon> </EuiFormControlLayoutCustomIcon>

Some files were not shown because too many files have changed in this diff Show more