Skip to content

Commit

Permalink
Merge branch 'master' into renovate/@elasticcharts
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine authored Nov 6, 2019
2 parents d08b21a + 3d2b120 commit dd77bae
Show file tree
Hide file tree
Showing 172 changed files with 5,366 additions and 3,642 deletions.
4 changes: 3 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
/x-pack/test/functional/services/ml.ts @elastic/ml-ui
# ML team owns the transform plugin, ES team added here for visibility
# because the plugin lives in Kibana's Elasticsearch management section.
/x-pack/legacy/plugins/transform/ @elastic/ml-ui @elastic/es-ui
/x-pack/legacy/plugins/transform/ @elastic/ml-ui @elastic/es-ui

# Operations
/renovate.json5 @elastic/kibana-operations
Expand All @@ -68,7 +68,9 @@
# Security
/x-pack/legacy/plugins/security/ @elastic/kibana-security
/x-pack/legacy/plugins/spaces/ @elastic/kibana-security
/x-pack/plugins/spaces/ @elastic/kibana-security
/x-pack/legacy/plugins/encrypted_saved_objects/ @elastic/kibana-security
/x-pack/plugins/encrypted_saved_objects/ @elastic/kibana-security
/src/legacy/server/csp/ @elastic/kibana-security
/x-pack/plugins/security/ @elastic/kibana-security
/x-pack/test/api_integration/apis/security/ @elastic/kibana-security
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
"reselect": "^3.0.1",
"resize-observer-polyfill": "^1.5.0",
"rison-node": "1.0.2",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"script-loader": "0.7.2",
"semver": "^5.5.0",
"style-it": "^2.1.3",
Expand Down
30 changes: 25 additions & 5 deletions packages/kbn-babel-preset/node_preset.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@
*/

module.exports = (_, options = {}) => {
const overrides = [];
if (!process.env.ALLOW_PERFORMANCE_HOOKS_IN_TASK_MANAGER) {
overrides.push(
{
test: [/x-pack[\/\\]legacy[\/\\]plugins[\/\\]task_manager/],
plugins: [
[
'filter-imports',
{
imports: {
perf_hooks: ['performance'],
},
},
],
],
}
);
}

return {
presets: [
[
Expand All @@ -39,7 +58,7 @@ module.exports = (_, options = {}) => {
modules: 'cjs',
corejs: 3,

...(options['@babel/preset-env'] || {})
...(options['@babel/preset-env'] || {}),
},
],
require('./common_preset'),
Expand All @@ -48,9 +67,10 @@ module.exports = (_, options = {}) => {
[
require.resolve('babel-plugin-transform-define'),
{
'global.__BUILT_WITH_BABEL__': 'true'
}
]
]
'global.__BUILT_WITH_BABEL__': 'true',
},
],
],
overrides,
};
};
3 changes: 2 additions & 1 deletion packages/kbn-babel-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-modules-commonjs": "^7.5.0",
"@babel/preset-env": "^7.5.5",
"@babel/preset-react":"^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/preset-typescript": "^7.3.3",
"@kbn/elastic-idx": "1.0.0",
"babel-plugin-add-module-exports": "^1.0.2",
"babel-plugin-filter-imports": "^3.0.0",
"babel-plugin-transform-define": "^1.3.1",
"babel-plugin-typescript-strip-namespaces": "^1.1.1"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-dev-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"exit-hook": "^2.2.0",
"getopts": "^2.2.5",
"moment": "^2.24.0",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"tree-kill": "^1.2.1",
"tslib": "^1.9.3"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-dev-utils/src/proc_runner/proc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) {

const outcome$: Rx.Observable<number | null> = Rx.race(
// observe first exit event
Rx.fromEvent(childProcess, 'exit').pipe(
Rx.fromEvent<[number]>(childProcess, 'exit').pipe(
take(1),
map(([code]: [number]) => {
map(([code]) => {
if (stopCalled) {
return null;
}
Expand Down
4,730 changes: 2,410 additions & 2,320 deletions packages/kbn-pm/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/kbn-pm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"ora": "^1.4.0",
"prettier": "^1.18.2",
"read-pkg": "^5.2.0",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"spawn-sync": "^1.0.15",
"string-replace-loader": "^2.2.0",
"strip-ansi": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"glob": "^7.1.2",
"parse-link-header": "^1.0.1",
"strip-ansi": "^5.2.0",
"rxjs": "^6.2.1",
"rxjs": "^6.5.3",
"tar-fs": "^1.16.3",
"tmp": "^0.1.0",
"xml2js": "^0.4.22",
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ interface Props {
navLinks$: Rx.Observable<ChromeNavLink[]>;
recentlyAccessed$: Rx.Observable<ChromeRecentlyAccessedHistoryItem[]>;
forceAppSwitcherNavigation$: Rx.Observable<boolean>;
helpExtension$: Rx.Observable<ChromeHelpExtension>;
helpExtension$: Rx.Observable<ChromeHelpExtension | undefined>;
legacyMode: boolean;
navControlsLeft$: Rx.Observable<readonly ChromeNavControl[]>;
navControlsRight$: Rx.Observable<readonly ChromeNavControl[]>;
Expand Down
2 changes: 1 addition & 1 deletion src/core/public/chrome/ui/header/header_help_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import { HeaderExtension } from './header_extension';
import { ChromeHelpExtension } from '../../chrome_service';

interface Props {
helpExtension$: Rx.Observable<ChromeHelpExtension>;
helpExtension$: Rx.Observable<ChromeHelpExtension | undefined>;
intl: InjectedIntl;
kibanaVersion: string;
useDefaultContent?: boolean;
Expand Down
39 changes: 0 additions & 39 deletions src/core/server/http/http_server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,45 +577,6 @@ test('exposes route details of incoming request to a route handler', async () =>
});
});

describe('conditional compression', () => {
test('disables compression when there is a referer', async () => {
const { registerRouter, server: innerServer } = await server.setup(config);

const router = new Router('', logger, enhanceWithContext);
router.get({ path: '/', validate: false }, (context, req, res) =>
// we need the large body here so that compression would normally be used
res.ok({ body: 'hello'.repeat(500), headers: { 'Content-Type': 'text/html; charset=UTF-8' } })
);
registerRouter(router);

await server.start();
const response = await supertest(innerServer.listener)
.get('/')
.set('accept-encoding', 'gzip')
.set('referer', 'http://some-other-site/');

expect(response.header).not.toHaveProperty('content-encoding');
});

test(`enables compression when there isn't a referer`, async () => {
const { registerRouter, server: innerServer } = await server.setup(config);

const router = new Router('', logger, enhanceWithContext);
router.get({ path: '/', validate: false }, (context, req, res) =>
// we need the large body here so that compression will be used
res.ok({ body: 'hello'.repeat(500), headers: { 'Content-Type': 'text/html; charset=UTF-8' } })
);
registerRouter(router);

await server.start();
const response = await supertest(innerServer.listener)
.get('/')
.set('accept-encoding', 'gzip');

expect(response.header).toHaveProperty('content-encoding', 'gzip');
});
});

describe('setup contract', () => {
describe('#createSessionStorage', () => {
it('creates session storage factory', async () => {
Expand Down
18 changes: 0 additions & 18 deletions src/core/server/http/http_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export class HttpServer {

const basePathService = new BasePath(config.basePath);
this.setupBasePathRewrite(config, basePathService);
this.setupConditionalCompression();

return {
registerRouter: this.registerRouter.bind(this),
Expand Down Expand Up @@ -176,23 +175,6 @@ export class HttpServer {
});
}

private setupConditionalCompression() {
if (this.server === undefined) {
throw new Error('Server is not created yet');
}

this.server.ext('onRequest', (request, h) => {
// whenever there is a referrer, don't use compression even if the client supports it
if (request.info.referrer !== '') {
this.log.debug(
`Not using compression because there is a referer: ${request.info.referrer}`
);
request.info.acceptEncoding = '';
}
return h.continue;
});
}

private registerOnPostAuth(fn: OnPostAuthHandler) {
if (this.server === undefined) {
throw new Error('Server is not created yet');
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/legacy/plugins/find_legacy_plugin_specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export async function findLegacyPluginSpecs(settings: unknown, loggerFactory: Lo
invalidDirectoryError$: Observable<{ path: string }>;
invalidPackError$: Observable<{ path: string }>;
otherError$: Observable<unknown>;
deprecation$: Observable<unknown>;
deprecation$: Observable<{ spec: LegacyPluginSpec; message: string }>;
invalidVersionSpec$: Observable<LegacyPluginSpec>;
spec$: Observable<LegacyPluginSpec>;
disabledSpec$: Observable<LegacyPluginSpec>;
Expand Down
2 changes: 1 addition & 1 deletion src/core/server/plugins/discovery/plugins_discovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { PluginsConfig } from '../plugins_config';
import { PluginDiscoveryError } from './plugin_discovery_error';
import { parseManifest } from './plugin_manifest_parser';

const fsReadDir$ = bindNodeCallback(readdir);
const fsReadDir$ = bindNodeCallback<string, string[]>(readdir);
const fsStat$ = bindNodeCallback(stat);

/**
Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/lib/scan_delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { count, map, mergeAll, mergeMap } from 'rxjs/operators';
import { assertAbsolute } from './fs';

const getStat$ = Rx.bindNodeCallback(Fs.stat);
const getReadDir$ = Rx.bindNodeCallback(Fs.readdir);
const getReadDir$ = Rx.bindNodeCallback<string, string[]>(Fs.readdir);

interface Options {
directory: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
margin-top: $euiSizeXS;
}

.globalFilterBar__addButton {
min-height: $euiSizeL + $euiSizeXS; // same height as the badges
}

// sass-lint:disable quotes
.globalFilterGroup__branch {
padding: $euiSizeS $euiSizeM 0 0;
Expand Down Expand Up @@ -40,4 +44,3 @@
margin-top: $euiSize * -1;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@import '@elastic/eui/src/components/form/mixins';
@import '@elastic/eui/src/components/form/variables';
@import '@elastic/eui/src/components/form/mixins';

/**
* 1. Allow wrapping of long filter items
Expand All @@ -19,11 +19,17 @@

&:not(.globalFilterItem-isDisabled) {
@include euiFormControlDefaultShadow;
box-shadow: #{$euiFormControlBoxShadow}, inset 0 0 0 1px $kbnGlobalFilterItemBorderColor; // Make the actual border more visible
}

&:focus-within {
animation: none !important; // Remove focus ring animation otherwise it overrides simulated border via box-shadow
}
}

.globalFilterItem-isDisabled {
background-color: transparentize($euiColorLightShade, .4);
color: $euiColorDarkShade;
background-color: transparentize($euiColorLightShade, 0.5);
text-decoration: line-through;
font-weight: $euiFontWeightRegular;
font-style: italic;
Expand All @@ -39,12 +45,22 @@
bottom: 0;
left: 0;
width: $euiSizeXS;
background-color: $euiColorVis0;
background-color: $kbnGlobalFilterItemBorderColor;
border-top-left-radius: $euiBorderRadius / 2;
border-bottom-left-radius: $euiBorderRadius / 2;
}
}

.globalFilterItem-isExcluded {
&:not(.globalFilterItem-isDisabled) {
box-shadow: #{$euiFormControlBoxShadow}, inset 0 0 0 1px $kbnGlobalFilterItemBorderColorExcluded;

&::before {
background-color: $kbnGlobalFilterItemPinnedColorExcluded;
}
}
}

.globalFilterItem__editorForm {
padding: $euiSizeM;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
@import 'variables';
@import 'global_filter_group';
@import 'global_filter_item';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
$kbnGlobalFilterItemBorderColor: tintOrShade($euiColorMediumShade, 35%, 20%);
$kbnGlobalFilterItemBorderColorExcluded: tintOrShade($euiColorDanger, 70%, 50%);
$kbnGlobalFilterItemPinnedColorExcluded: tintOrShade($euiColorDanger, 30%, 20%);
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ function FilterBarUI(props: Props) {
size="xs"
onClick={() => setIsAddFilterPopoverOpen(true)}
data-test-subj="addFilter"
className="globalFilterBar__addButton"
>
+{' '}
<FormattedMessage
Expand Down
Loading

0 comments on commit dd77bae

Please sign in to comment.