Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newplatform/timefilter/ts #5

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b7bba21
De-angularize DocViewer table layout (#43240)
kertal Aug 27, 2019
0772e19
[ML] Data frames: Fixes table sorting. (#43859)
walterra Aug 27, 2019
dce041c
[ML] Adding error reporting to new job wizard charts (#43857)
jgowdyelastic Aug 27, 2019
1d0c1c2
Security - allow for custom cluster privileges (#43817)
legrego Aug 27, 2019
5917cd3
Telemetry/opt in welcome screen (#42110)
Bamieh Aug 27, 2019
8cdd469
Timefilter - replace SimpleEmitter with observables (#43748)
Aug 27, 2019
77e95ea
[APM] Instantly display local UI filter names (#44063)
dgieselaar Aug 27, 2019
e3499ed
Typescriptifying
Aug 22, 2019
8b9d86a
More TS
Aug 22, 2019
a7ecf49
define InputTimeRange type
Aug 22, 2019
f9739ea
fix import path
Aug 22, 2019
0f2324e
Add invalidateAPIKey support to security plugin (#43707)
mikecote Aug 27, 2019
f188b29
Modify I18nProvider so that it does not generate new React components…
chrisdavies Aug 27, 2019
b680912
Disable alerting and actions plugin by default (#44083)
mikecote Aug 27, 2019
243a095
Add commonly used ranges to apm date-picker (#44082)
noctifer20 Aug 27, 2019
3cc4653
[ML] Data Frames Summary Stats Bar (#43986)
alvarezmelissa87 Aug 27, 2019
17106e8
Introduce PKI authentication provider. (#42606)
azasypkin Aug 27, 2019
37fa099
Update console autocomplete for ML put data_frame analytics (#44101)
sebelga Aug 27, 2019
2e279aa
Feature/default enable csv dashboard (#44048)
Aug 27, 2019
b98954a
Fixes alert mustache templating with arrays (#44094)
pmuellr Aug 27, 2019
a5c6353
chore(NA): fix babel plugin discover for thread-loader-warmup (#44106)
mistic Aug 27, 2019
3489274
[Monitoring] Only do a single date_histogram agg for get_nodes calls …
chrisronline Aug 27, 2019
eeff5ef
[APM] Sets up APM with new shared Kibana core context (#43920)
jasonrhodes Aug 27, 2019
43df3a7
Reset dirty saved query on reload (#43927)
TinaHeiligers Aug 27, 2019
61087ba
update apm index pattern (#44107)
jalvz Aug 27, 2019
084433f
Upgrade EUI to 13.6.0 (#43916)
thompsongl Aug 27, 2019
8b55ff6
Chore/bump chromium webgl+kerberos (#42751)
Aug 27, 2019
4d1671b
List grunt tasks from terminal (#43798)
wayneseymour Aug 27, 2019
9d8f808
skip flaky test (#44132)
Aug 27, 2019
fed58df
skip flaky suite (#44086)
Aug 27, 2019
9a99e71
Update dependency xml-crypto to v1 (#43227)
renovate[bot] Aug 27, 2019
fea743e
Update dependency abortcontroller-polyfill to ^1.3.0 (#44027)
renovate[bot] Aug 27, 2019
075c68b
Update dependency babel-eslint to ^10.0.3 (#44029)
renovate[bot] Aug 27, 2019
6e5f6ff
Update dependency base64-js to ^1.3.1 (#44031)
renovate[bot] Aug 27, 2019
697033f
Update dependency chroma-js to ^1.4.1 (#44033)
renovate[bot] Aug 27, 2019
48c6109
esArchiver: retry kibana config update (#43987)
dmlemeshko Aug 27, 2019
f706eda
Update dependency @elastic/makelogs to ^4.5.0 (#43912)
renovate[bot] Aug 27, 2019
6f402b7
[SR] SLM create and edit policies (#43390)
jen-huang Aug 27, 2019
5201136
skip flaky suite (#43960)
Aug 27, 2019
cb17672
Update run_i18n_extract.ts (#44092)
Bamieh Aug 27, 2019
670f1ae
Fix truncation of long filter bar items (#43874)
cchaos Aug 27, 2019
fbca664
eui to 13.6.1 (#44149)
thompsongl Aug 27, 2019
871abf5
Refactor doc table to only accept hits (#43634)
lukasolson Aug 27, 2019
e492cce
Task manager fix flaky assertValidInterval test (#44163)
mikecote Aug 28, 2019
df4260c
[Maps] Refactor draw filter UI to be similar to create filter from fe…
nreese Aug 28, 2019
7a27c7a
[Logs UI] Fix redirect to logs stream (#43806)
Zacqary Aug 28, 2019
cd418a1
Revert "disable flaky tests (#43017)"
Aug 28, 2019
1595abe
[babel-preset/webpack] use corejs 3 (#44154)
Aug 28, 2019
eee0032
[Canvas] Embedding Workpads in other Websites (#42545)
clintandrewhall Aug 28, 2019
833d662
[SIEM] Fixes duplicate columns in timeline and fixes errors on multip…
XavierM Aug 28, 2019
4be35ba
[code] Remove the useless deps download control option (#43940)
Aug 28, 2019
282bc5a
Update nodemailer related packages (#43949)
renovate[bot] Aug 28, 2019
28da43a
Update dependency backport to v4.6.5 (#44030)
renovate[bot] Aug 28, 2019
dfddf3d
Update dependency chalk to ^2.4.2 (#44032)
renovate[bot] Aug 28, 2019
f162ff0
Update dependency constate-latest to ^1.2.0 (#44035)
renovate[bot] Aug 28, 2019
1efe813
[Reporting] improve deprecation logging, of PDF creation params (#44130)
tsullivan Aug 28, 2019
a6335fd
[IM] prevent users from editing and deleting cloud-managed templates …
alisonelizabeth Aug 28, 2019
1a0dc65
[Reporting] Fix TypeError with pending job info (#43924)
tsullivan Aug 28, 2019
7fda81f
[Stack Monitoring] Update APM metric titles (#44091)
cachedout Aug 28, 2019
b20c7fc
[ML] Data frame analytics: Advanced editor. (#43989)
walterra Aug 28, 2019
15377f3
Restructure files in kbn_vislib_vis_types folder (#43866)
sulemanof Aug 28, 2019
9bc0ec0
upgrade elastic charts library - v11.1.1 (#44222)
nickofthyme Aug 28, 2019
22e781a
[Logs UI] Clarify labels of log rate section (#44108)
weltenwort Aug 28, 2019
ef6276d
Move angel values into vis rendering code (#43968)
sulemanof Aug 28, 2019
3e4455b
Fix 'Color not provided' error in case of more than 1 color and input…
rpbouw Aug 28, 2019
3deb07f
Replaced last import of chrome with core dep (#44007)
Aug 28, 2019
98dce92
Merge remote-tracking branch 'upstream/master' into newplatform/timef…
Aug 28, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"tsvb": "src/legacy/core_plugins/metrics",
"kbnESQuery": "packages/kbn-es-query",
"inspector": "src/plugins/inspector",
"kibana-react": "src/plugins/kibana_react"
"kibana-react": "src/plugins/kibana_react",
"esUi": "src/plugins/es_ui_shared"
},
"exclude": ["src/legacy/ui/ui_render/ui_render_mixin.js"],
"translations": []
Expand Down
29 changes: 11 additions & 18 deletions .sass-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,29 @@ files:
- 'x-pack/legacy/plugins/rollup/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/security/**/*.s+(a|c)ss'
- 'x-pack/legacy/plugins/canvas/**/*.s+(a|c)ss'
ignore:
- 'x-pack/legacy/plugins/canvas/external_runtime/**/*.s+(a|c)ss'
rules:
quotes:
- 2
-
style: 'single'
- style: 'single'
# } else { style on one line, like our JS
brace-style:
- 2
-
style: '1tbs'
- style: '1tbs'
variable-name-format:
- 2
-
convention: 'camelcase'
- convention: 'camelcase'
# Needs regex, right now we ignore
class-name-format: 0
# Order how you please
property-sort-order: 0
hex-notation:
- 2
-
style: 'uppercase'
- style: 'uppercase'
mixin-name-format:
- 2
-
allow-leading-underscore: false
- allow-leading-underscore: false
convention: 'camelcase'
# Use none instead of 0 for no border
border-zero:
Expand All @@ -47,8 +44,7 @@ rules:
indentation: 2
function-name-format:
- 2
-
allow-leading-underscore: false
- allow-leading-underscore: false
convention: 'camelcase'
# This removes the need for ::hover
pseudo-element: 0
Expand All @@ -62,23 +58,20 @@ rules:
force-attribute-nesting: 0
no-qualifying-elements:
- 2
-
# Allows input[type=search]
- # Allows input[type=search]
allow-element-with-attribute: 1
# Files can end without a newline
final-newline: 0
# We use some rare duplicate property values for browser variance
no-duplicate-properties:
- 2
-
exclude:
- exclude:
- 'font-size'
- 'word-break'
# Put a line-break between sections of CSS, but allow quicky one-liners for legibility
empty-line-between-blocks:
- 2
-
allow-single-line-rulesets: 1
- allow-single-line-rulesets: 1
# Warns are nice for deprecations and development
no-warn: 0
# Transition all is useful in certain situations and there's no recent info to suggest slowdown
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@
"dependencies": {
"@babel/core": "^7.5.5",
"@babel/register": "^7.5.5",
"@elastic/charts": "^10.2.0",
"@elastic/charts": "^11.1.1",
"@elastic/datemath": "5.0.2",
"@elastic/eui": "13.3.0",
"@elastic/eui": "13.6.1",
"@elastic/filesaver": "1.1.2",
"@elastic/good": "8.1.1-kibana2",
"@elastic/numeral": "2.3.3",
Expand All @@ -124,7 +124,7 @@
"@types/react-grid-layout": "^0.16.7",
"@types/recompose": "^0.30.5",
"JSONStream": "1.3.5",
"abortcontroller-polyfill": "^1.1.9",
"abortcontroller-polyfill": "^1.3.0",
"angular": "1.6.9",
"angular-aria": "1.6.6",
"angular-elastic": "2.5.1",
Expand All @@ -138,7 +138,7 @@
"boom": "^7.2.0",
"brace": "0.11.1",
"cache-loader": "^4.1.0",
"chalk": "^2.4.1",
"chalk": "^2.4.2",
"check-disk-space": "^2.1.0",
"color": "1.0.3",
"commander": "3.0.0",
Expand Down Expand Up @@ -266,7 +266,7 @@
"@elastic/eslint-config-kibana": "0.15.0",
"@elastic/eslint-plugin-eui": "0.0.1",
"@elastic/github-checks-reporter": "0.0.20b3",
"@elastic/makelogs": "^4.4.0",
"@elastic/makelogs": "^4.5.0",
"@kbn/dev-utils": "1.0.0",
"@kbn/es": "1.0.0",
"@kbn/eslint-import-resolver-kibana": "2.0.0",
Expand Down Expand Up @@ -345,10 +345,10 @@
"@typescript-eslint/parser": "1.13.0",
"angular-mocks": "1.4.7",
"archiver": "^3.0.0",
"babel-eslint": "^10.0.2",
"babel-eslint": "^10.0.3",
"babel-jest": "^24.9.0",
"babel-plugin-dynamic-import-node": "^2.3.0",
"backport": "4.6.4",
"backport": "4.6.5",
"chai": "3.5.0",
"chance": "1.0.18",
"cheerio": "0.22.0",
Expand Down Expand Up @@ -381,6 +381,7 @@
"geckodriver": "1.16.2",
"getopts": "^2.2.4",
"grunt": "1.0.4",
"grunt-available-tasks": "^0.6.3",
"grunt-cli": "^1.2.0",
"grunt-contrib-watch": "^1.1.0",
"grunt-karma": "2.0.0",
Expand Down Expand Up @@ -417,6 +418,7 @@
"nock": "10.0.6",
"node-sass": "^4.9.4",
"normalize-path": "^3.0.0",
"null-loader": "^3.0.0",
"nyc": "^14.1.1",
"pixelmatch": "4.0.2",
"pkg-up": "^2.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config-kibana/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"peerDependencies": {
"@typescript-eslint/eslint-plugin": "1.13.0",
"@typescript-eslint/parser": "1.13.0",
"babel-eslint": "^10.0.2",
"babel-eslint": "^10.0.3",
"eslint": "5.16.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-ban": "1.2.0",
Expand Down
6 changes: 2 additions & 4 deletions packages/kbn-babel-preset/webpack_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ module.exports = () => {
{
useBuiltIns: 'entry',
modules: 'cjs',
corejs: 2,
corejs: 3,
},
],
require('./common_preset'),
],
plugins: [
'@babel/plugin-syntax-dynamic-import'
]
plugins: [require.resolve('@babel/plugin-syntax-dynamic-import')],
};
};
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"kbn:watch": "yarn build --watch"
},
"dependencies": {
"chalk": "^2.4.1",
"chalk": "^2.4.2",
"dedent": "^0.7.0",
"execa": "^1.0.0",
"exit-hook": "^2.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-es/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@elastic/elasticsearch": "^7.3.0",
"@kbn/dev-utils": "1.0.0",
"abort-controller": "^2.0.3",
"chalk": "^2.4.1",
"chalk": "^2.4.2",
"dedent": "^0.7.0",
"del": "^4.0.0",
"execa": "^1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-eslint-plugin-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "Apache-2.0",
"peerDependencies": {
"eslint": "5.16.0",
"babel-eslint": "^10.0.2"
"babel-eslint": "^10.0.3"
},
"dependencies": {
"micromatch": "3.1.10",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions packages/kbn-i18n/src/react/provider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import { mount, shallow } from 'enzyme';
import * as React from 'react';
import { intlShape } from 'react-intl';
import { injectI18n } from './inject';
import { I18nProvider } from './provider';

Expand All @@ -46,7 +45,7 @@ describe('I18nProvider', () => {
</I18nProvider>,
{
childContextTypes: {
intl: intlShape,
intl: { formatMessage: jest.fn() },
},
}
);
Expand Down
46 changes: 2 additions & 44 deletions packages/kbn-i18n/src/react/provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,7 @@ import * as React from 'react';
import { IntlProvider } from 'react-intl';

import * as i18n from '../core';
import { isPseudoLocale, translateUsingPseudoLocale } from '../core/pseudo_locale';
import { injectI18n } from './inject';

/**
* To translate label that includes nested `FormattedMessage` instances React Intl
* replaces them with special placeholders (@__uid__@ELEMENT-uid-counter@__uid__@)
* and maps them back with nested translations after `formatMessage` processes
* original string, so we shouldn't modify these special placeholders with pseudo
* translations otherwise React Intl won't be able to properly replace placeholders.
* It's implementation detail of the React Intl, but since pseudo localization is dev
* only feature we should be fine here.
* @param message
*/
function translateFormattedMessageUsingPseudoLocale(message: string) {
const formattedMessageDelimiter = message.match(/@__.{10}__@/);
if (formattedMessageDelimiter !== null) {
return message
.split(formattedMessageDelimiter[0])
.map(part => (part.startsWith('ELEMENT-') ? part : translateUsingPseudoLocale(part)))
.join(formattedMessageDelimiter[0]);
}

return translateUsingPseudoLocale(message);
}

/**
* If pseudo locale is detected, default intl.formatMessage should be decorated
* with the pseudo localization function.
* @param child I18nProvider child component.
*/
function wrapIntlFormatMessage(child: React.ReactElement) {
return React.createElement(
injectI18n(({ intl }) => {
const formatMessage = intl.formatMessage;
intl.formatMessage = (...args) =>
translateFormattedMessageUsingPseudoLocale(formatMessage(...args));

return React.Children.only(child);
})
);
}
import { PseudoLocaleWrapper } from './pseudo_locale_wrapper';

/**
* The library uses the provider pattern to scope an i18n context to a tree
Expand All @@ -81,9 +41,7 @@ export class I18nProvider extends React.PureComponent {
formats={i18n.getFormats()}
textComponent={React.Fragment}
>
{isPseudoLocale(i18n.getLocale()) && React.isValidElement(this.props.children)
? wrapIntlFormatMessage(this.props.children)
: this.props.children}
<PseudoLocaleWrapper>{this.props.children}</PseudoLocaleWrapper>
</IntlProvider>
);
}
Expand Down
75 changes: 75 additions & 0 deletions packages/kbn-i18n/src/react/pseudo_locale_wrapper.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/*
* 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 * as PropTypes from 'prop-types';
import * as React from 'react';
import * as i18n from '../core';
import { isPseudoLocale, translateUsingPseudoLocale } from '../core/pseudo_locale';

/**
* To translate label that includes nested `FormattedMessage` instances React Intl
* replaces them with special placeholders (@__uid__@ELEMENT-uid-counter@__uid__@)
* and maps them back with nested translations after `formatMessage` processes
* original string, so we shouldn't modify these special placeholders with pseudo
* translations otherwise React Intl won't be able to properly replace placeholders.
* It's implementation detail of the React Intl, but since pseudo localization is dev
* only feature we should be fine here.
* @param message
*/
function translateFormattedMessageUsingPseudoLocale(message: string) {
const formattedMessageDelimiter = message.match(/@__.{10}__@/);
if (formattedMessageDelimiter !== null) {
return message
.split(formattedMessageDelimiter[0])
.map(part => (part.startsWith('ELEMENT-') ? part : translateUsingPseudoLocale(part)))
.join(formattedMessageDelimiter[0]);
}

return translateUsingPseudoLocale(message);
}

/**
* If the locale is our pseudo locale (e.g. en-xa), we override the
* intl.formatMessage function to display scrambled characters. We are
* overriding the context rather than using injectI18n, because the
* latter creates a new React component, which causes React diffs to
* be inefficient in some cases, and can cause React hooks to lose
* their state.
*/
export class PseudoLocaleWrapper extends React.PureComponent {
public static propTypes = { children: PropTypes.element.isRequired };

public static contextTypes = {
intl: PropTypes.object.isRequired,
};

constructor(props: { children: React.ReactNode }, context: any) {
super(props, context);

if (isPseudoLocale(i18n.getLocale())) {
const formatMessage = context.intl.formatMessage;
context.intl.formatMessage = (...args: any[]) =>
translateFormattedMessageUsingPseudoLocale(formatMessage(...args));
}
}

public render() {
return this.props.children;
}
}
2 changes: 1 addition & 1 deletion packages/kbn-plugin-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"private": true,
"version": "1.0.0",
"dependencies": {
"chalk": "^2.4.1",
"chalk": "^2.4.2",
"dedent": "^0.7.0",
"execa": "^1.0.0",
"getopts": "^2.2.4",
Expand Down
Loading