Skip to content

Commit

Permalink
Merge branch 'master' into 28159-x-button-accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Mar 4, 2019
2 parents 326409b + 27d91de commit a2a2a6a
Show file tree
Hide file tree
Showing 807 changed files with 20,660 additions and 18,962 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ bower_components
/plugins
/optimize
/built_assets
/html_docs
/src/fixtures/vislib/mock_data
/src/legacy/ui/public/angular-bootstrap
/src/legacy/ui/public/flot-charts
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ module.exports = {
*/
{
files: [
'test/functional/services/lib/leadfoot_element_wrapper/scroll_into_view_if_necessary.js',
'test/functional/services/lib/web_element_wrapper/scroll_into_view_if_necessary.js',
'**/browser_exec_scripts/**/*',
],
rules: {
Expand Down
8 changes: 2 additions & 6 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,14 @@
"xpack.rollupJobs": "x-pack/plugins/rollup",
"xpack.searchProfiler": "x-pack/plugins/searchprofiler",
"xpack.security": "x-pack/plugins/security",
"xpack.server": "x-pack/server",
"xpack.spaces": "x-pack/plugins/spaces",
"xpack.upgradeAssistant": "x-pack/plugins/upgrade_assistant",
"xpack.uptime": "x-pack/plugins/uptime",
"xpack.watcher": "x-pack/plugins/watcher"
},
"exclude": [
"src/legacy/ui/ui_render/bootstrap/app_bootstrap.js",
"src/legacy/ui/ui_render/ui_render_mixin.js",
"x-pack/plugins/infra/public/graphql/types.ts",
"x-pack/plugins/infra/public/utils/loading_state/loading_result.ts",
"x-pack/plugins/infra/server/graphql/types.ts",
"x-pack/plugins/infra/server/lib/domains/log_entries_domain/log_entries_domain.ts"
"src/legacy/ui/ui_render/ui_render_mixin.js"
],
"translations": [
"x-pack/plugins/translations/translations/zh-CN.json"
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.15.1
10.15.2
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.15.1
10.15.2
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ ReactDOM.render(
);
```

There is a number of tools was created to support internationalization in Kibana that would allow one to validate internationalized labels,
extract them to a `JSON` file or integrate translations back to Kibana. To know more, please read corresponding [readme](src/dev/i18n/README.md) file.

### Testing and Building

To ensure that your changes will not break other functionality, please run the test suite and build process before submitting your Pull Request.
Expand Down
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"url": "https://github.com/elastic/kibana.git"
},
"resolutions": {
"**/@types/node": "10.12.12"
"**/@types/node": "10.12.27"
},
"workspaces": {
"packages": [
Expand Down Expand Up @@ -246,8 +246,8 @@
"yauzl": "2.7.0"
},
"devDependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0",
"@babel/parser": "^7.3.4",
"@babel/types": "^7.3.4",
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/eslint-plugin-kibana-custom": "1.1.0",
"@elastic/makelogs": "^4.4.0",
Expand Down Expand Up @@ -281,7 +281,7 @@
"@types/has-ansi": "^3.0.0",
"@types/hoek": "^4.1.3",
"@types/humps": "^1.1.2",
"@types/jest": "^23.3.1",
"@types/jest": "^24.0.9",
"@types/joi": "^13.4.2",
"@types/jquery": "^3.3.6",
"@types/js-yaml": "^3.11.1",
Expand All @@ -292,7 +292,7 @@
"@types/mocha": "^5.2.6",
"@types/moment-timezone": "^0.5.8",
"@types/mustache": "^0.8.31",
"@types/node": "^10.12.12",
"@types/node": "^10.12.27",
"@types/opn": "^5.1.0",
"@types/podium": "^1.0.0",
"@types/prop-types": "^15.5.3",
Expand Down Expand Up @@ -359,8 +359,8 @@
"intl-messageformat-parser": "^1.4.0",
"is-path-inside": "^2.0.0",
"istanbul-instrumenter-loader": "3.0.1",
"jest": "^23.6.0",
"jest-cli": "^23.6.0",
"jest": "^24.1.0",
"jest-cli": "^24.1.0",
"jest-raw-loader": "^1.0.1",
"jimp": "0.2.28",
"json-stable-stringify": "^1.0.1",
Expand All @@ -373,7 +373,6 @@
"karma-junit-reporter": "1.2.0",
"karma-mocha": "1.3.0",
"karma-safari-launcher": "1.0.0",
"leadfoot": "1.7.5",
"license-checker": "^16.0.0",
"listr": "^0.14.1",
"load-grunt-config": "0.19.2",
Expand All @@ -392,6 +391,7 @@
"proxyquire": "1.7.11",
"regenerate": "^1.4.0",
"sass-lint": "^1.12.1",
"selenium-webdriver": "^4.0.0-alpha.1",
"simple-git": "1.37.0",
"sinon": "^5.0.7",
"strip-ansi": "^3.0.1",
Expand All @@ -401,19 +401,18 @@
"ts-jest": "^23.1.4",
"ts-loader": "^5.2.2",
"ts-node": "^7.0.1",
"tsconfig-paths": "^3.8.0",
"tslint": "^5.11.0",
"tslint-config-prettier": "^1.15.0",
"tslint-microsoft-contrib": "^6.0.0",
"tslint-plugin-prettier": "^2.0.0",
"typescript": "^3.0.3",
"typescript": "^3.3.3333",
"vinyl-fs": "^3.0.2",
"xml2js": "^0.4.19",
"xmlbuilder": "9.0.4",
"zlib": "^1.0.5"
},
"engines": {
"node": "10.15.1",
"node": "10.15.2",
"yarn": "^1.10.1"
}
}
3 changes: 2 additions & 1 deletion packages/eslint-config-kibana/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ module.exports = {
strict: [ 'error', 'never' ],
'valid-typeof': 'error',
'wrap-iife': [ 'error', 'outside' ],
'eol-last': ['error', 'always'],
yoda: 'off',

'object-curly-spacing': 'off', // overridden with babel/object-curly-spacing
Expand Down Expand Up @@ -150,7 +151,7 @@ module.exports = {
'jsx-a11y/role-supports-aria-props': 'error',
'jsx-a11y/scope': 'error',
'jsx-a11y/tabindex-no-positive': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'jsx-a11y/label-has-associated-control': 'error',
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-indent': ['error', 2],
'react/no-will-update-set-state': 'error',
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-babel-code-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
},
"dependencies": {
"@kbn/babel-preset": "1.0.0",
"@babel/parser": "^7.1.3",
"@babel/traverse": "^7.1.4",
"@babel/parser": "^7.3.4",
"@babel/traverse": "^7.3.4",
"lodash": "^4.17.11"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,23 @@
* under the License.
*/

// TODO: replace this when we use the method exposed by security https://github.com/elastic/kibana/pull/24616
export const isSecurityEnabled = server => {
const kibanaSecurity = server.plugins.security;
const esSecurity = server.plugins.xpack_main.info.feature('security');
module.exports = {
presets: [
require.resolve('@babel/preset-react'),
require.resolve('@babel/preset-typescript'),
],
plugins: [
require.resolve('babel7-plugin-add-module-exports'),
// stage 3
require.resolve('@babel/plugin-proposal-async-generator-functions'),
require.resolve('@babel/plugin-proposal-object-rest-spread'),

return kibanaSecurity && esSecurity.isAvailable() && esSecurity.isEnabled();
// the class properties proposal was merged with the private fields proposal
// into the "class fields" proposal. Babel doesn't support this combined
// proposal yet, which includes private field, so this transform is
// TECHNICALLY stage 2, but for all intents and purposes it's stage 3
//
// See https://github.com/babel/proposals/issues/12 for progress
require.resolve('@babel/plugin-proposal-class-properties'),
],
};
50 changes: 50 additions & 0 deletions packages/kbn-babel-preset/node_preset_7.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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.
*/

module.exports = () => ({
presets: [
[
require.resolve('@babel/preset-env'),
{
targets: {
// only applies the necessary transformations based on the
// current node.js processes version. For example: running
// `nvm install 8 && node ./src/cli` will run kibana in node
// version 8 and babel will stop transpiling async/await
// because they are supported in the "current" version of node
node: 'current',
},

// replaces `import "babel-polyfill"` with a list of require statements
// for just the polyfills that the target versions don't already supply
// on their own
useBuiltIns: 'entry',
},
],
require('./common_preset_7'),
],
plugins: [
[
require.resolve('babel-plugin-transform-define'),
{
'global.__BUILT_WITH_BABEL__': 'true'
}
]
]
});
12 changes: 10 additions & 2 deletions packages/kbn-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,20 @@
"version": "1.0.0",
"license": "Apache-2.0",
"dependencies": {
"@babel/core": "^7.3.4",
"@babel/plugin-proposal-async-generator-functions": "^7.2.0",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-proposal-object-rest-spread": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-async-generator-functions": "^6.24.1",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-define": "^1.3.0",
"babel-plugin-transform-define": "^1.3.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1"
"babel-preset-react": "^6.24.1",
"babel7-plugin-add-module-exports": "npm:babel-plugin-add-module-exports@^1.0.0"
}
}
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:bootstrap": "yarn build"
},
"devDependencies": {
"typescript": "^3.0.3"
"typescript": "^3.3.3333"
},
"peerDependencies": {
"joi": "^13.5.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-config-schema/src/duration/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function numberToDuration(numberMs: number) {
return momentDuration(numberMs);
}

export function ensureDuration(value?: Duration | string | number) {
export function ensureDuration(value: Duration | string | number) {
if (typeof value === 'string') {
return stringToDuration(value);
}
Expand Down
7 changes: 7 additions & 0 deletions packages/kbn-config-schema/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import {
TypeOf,
TypeOptions,
UnionType,
URIOptions,
URIType,
} from './types';

export { ObjectType, TypeOf, Type };
Expand All @@ -65,6 +67,10 @@ function string(options?: StringOptions): Type<string> {
return new StringType(options);
}

function uri(options?: URIOptions): Type<string> {
return new URIType(options);
}

function literal<T extends string | number | boolean>(value: T): Type<T> {
return new LiteralType(value);
}
Expand Down Expand Up @@ -188,6 +194,7 @@ export const schema = {
recordOf,
siblingRef,
string,
uri,
};

export type Schema = typeof schema;
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`#scheme returns error when shorter string 1`] = `"expected URI with scheme [http|https] but but got [ftp://elastic.co]."`;

exports[`#scheme returns error when shorter string 2`] = `"expected URI with scheme [http|https] but but got [file:///kibana.log]."`;

exports[`#validate throws when returns string 1`] = `"validator failure"`;

exports[`is required by default 1`] = `"expected value of type [string] but got [undefined]."`;

exports[`returns error when not string 1`] = `"expected value of type [string] but got [number]."`;

exports[`returns error when not string 2`] = `"expected value of type [string] but got [Array]."`;

exports[`returns error when not string 3`] = `"expected value of type [string] but got [RegExp]."`;

exports[`returns error when value is not a URI 1`] = `"value is [3domain.local] but it must be a valid URI (see RFC 3986)."`;

exports[`returns error when value is not a URI 2`] = `"value is [http://8010:0:0:0:9:500:300C:200A] but it must be a valid URI (see RFC 3986)."`;

exports[`returns error when value is not a URI 3`] = `"value is [-] but it must be a valid URI (see RFC 3986)."`;

exports[`returns error when value is not a URI 4`] = `"value is [https://example.com?baz[]=foo&baz[]=bar] but it must be a valid URI (see RFC 3986)."`;

exports[`returns error when value is not a URI 5`] = `"value is [http://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa] but it must be a valid URI (see RFC 3986)."`;
Loading

0 comments on commit a2a2a6a

Please sign in to comment.