Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into newplatform/data-…
Browse files Browse the repository at this point in the history
…plugin/index-pattern/index-pattern-select
  • Loading branch information
Liza K committed Nov 26, 2019
2 parents f892860 + 0557a40 commit 4e049c9
Show file tree
Hide file tree
Showing 16 changed files with 761 additions and 104 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
/config/kibana.yml @elastic/kibana-platform
/x-pack/plugins/features/ @elastic/kibana-platform
/x-pack/plugins/licensing/ @elastic/kibana-platform
/packages/kbn-config-schema/ @elastic/kibana-platform

# Security
/x-pack/legacy/plugins/security/ @elastic/kibana-security
Expand Down
511 changes: 511 additions & 0 deletions packages/kbn-config-schema/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/core/MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ import { setup, start } from '../core_plugins/visualizations/public/legacy';
| Legacy Platform | New Platform | Notes |
| ------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `import 'ui/apply_filters'` | `import { ApplyFiltersPopover } from '../data/public'` | Directive is deprecated. |
| `import 'ui/apply_filters'` | `import { applyFiltersPopover } from '../data/public'` | Directive is deprecated. |
| `import 'ui/filter_bar'` | `import { FilterBar } from '../data/public'` | Directive is deprecated. |
| `import 'ui/query_bar'` | `import { QueryBarInput } from '../data/public'` | Directives are deprecated. |
| `import 'ui/search_bar'` | `import { SearchBar } from '../data/public'` | Directive is deprecated. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ import {
esFilters,
FilterManager,
TimefilterContract,
applyFiltersPopover,
changeTimeFilter,
extractTimeFilter,
} from '../../../../../../plugins/data/public';
import { applyFiltersPopover } from '../apply_filters/apply_filters_popover';
import { IndexPatternsStart } from '../../index_patterns';
export const GLOBAL_APPLY_FILTER_ACTION = 'GLOBAL_APPLY_FILTER_ACTION';

Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/legacy/core_plugins/data/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export function plugin() {
/** @public types */
export { DataSetup, DataStart };

export { ApplyFiltersPopover } from './filter';
export {
Field,
FieldType,
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* 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 { i18n } from '@kbn/i18n';
import { TUTORIAL_CATEGORY } from '../../../common/tutorials/tutorial_category';
import { onPremInstructions, cloudInstructions, onPremCloudInstructions } from '../../../common/tutorials/metricbeat_instructions';

export function activemqMetricsSpecProvider(context) {
const moduleName = 'activemq';
return {
id: 'activemqMetrics',
name: i18n.translate('kbn.server.tutorials.activemqMetrics.nameTitle', {
defaultMessage: 'ActiveMQ metrics',
}),
category: TUTORIAL_CATEGORY.METRICS,
shortDescription: i18n.translate('kbn.server.tutorials.activemqMetrics.shortDescription', {
defaultMessage: 'Fetch monitoring metrics from ActiveMQ instances.',
}),
longDescription: i18n.translate('kbn.server.tutorials.activemqMetrics.longDescription', {
defaultMessage: 'The `activemq` Metricbeat module fetches monitoring metrics from ActiveMQ instances \
[Learn more]({learnMoreLink}).',
values: {
learnMoreLink: '{config.docs.beats.metricbeat}/metricbeat-module-activemq.html',
},
}),
euiIconType: '/plugins/kibana/home/tutorial_resources/logos/activemq.svg',
isBeta: true,
artifacts: {
application: {
label: i18n.translate('kbn.server.tutorials.corednsMetrics.artifacts.application.label', {
defaultMessage: 'Discover',
}),
path: '/app/kibana#/discover'
},
dashboards: [],
exportedFields: {
documentationUrl: '{config.docs.beats.metricbeat}/exported-fields-activemq.html'
}
},
completionTimeMinutes: 10,
onPrem: onPremInstructions(moduleName, null, null, null, context),
elasticCloud: cloudInstructions(moduleName),
onPremElasticCloud: onPremCloudInstructions(moduleName)
};
}
2 changes: 2 additions & 0 deletions src/legacy/core_plugins/kibana/server/tutorials/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ import { consulMetricsSpecProvider } from './consul_metrics';
import { cockroachdbMetricsSpecProvider } from './cockroachdb_metrics';
import { traefikMetricsSpecProvider } from './traefik_metrics';
import { awsLogsSpecProvider } from './aws_logs';
import { activemqMetricsSpecProvider } from './activemq_metrics';

export function registerTutorials(server) {
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(systemLogsSpecProvider);
Expand Down Expand Up @@ -146,4 +147,5 @@ export function registerTutorials(server) {
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(cockroachdbMetricsSpecProvider);
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(traefikMetricsSpecProvider);
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(awsLogsSpecProvider);
server.newPlatform.setup.plugins.home.tutorials.registerTutorial(activemqMetricsSpecProvider);
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,12 @@ import {
} from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { Component } from 'react';
import { IndexPattern } from '../../index_patterns';
import {
mapAndFlattenFilters,
esFilters,
utils,
FilterLabel,
} from '../../../../../../plugins/data/public';
import { mapAndFlattenFilters, esFilters, utils, IIndexPattern } from '../..';
import { FilterLabel } from '../filter_bar';

interface Props {
filters: esFilters.Filter[];
indexPatterns: IndexPattern[];
indexPatterns: IIndexPattern[];
onCancel: () => void;
onSubmit: (filters: esFilters.Filter[]) => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,25 @@
* under the License.
*/

export { ApplyFiltersPopover } from './apply_filters';
import React from 'react';
import { ApplyFiltersPopoverContent } from './apply_filter_popover_content';
import { IIndexPattern, esFilters } from '../..';

type CancelFnType = () => void;
type SubmitFnType = (filters: esFilters.Filter[]) => void;

export const applyFiltersPopover = (
filters: esFilters.Filter[],
indexPatterns: IIndexPattern[],
onCancel: CancelFnType,
onSubmit: SubmitFnType
) => {
return (
<ApplyFiltersPopoverContent
indexPatterns={indexPatterns}
filters={filters}
onCancel={onCancel}
onSubmit={onSubmit}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
* under the License.
*/

export { ApplyFiltersPopover } from './apply_filters_popover';
export { applyFiltersPopover } from './apply_filters_popover';
3 changes: 2 additions & 1 deletion src/plugins/data/public/ui/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
* under the License.
*/

export * from './filter_bar';
export { IndexPatternSelect } from './index_pattern_select';
export { FilterBar } from './filter_bar';
export { applyFiltersPopover } from './apply_filters';
17 changes: 16 additions & 1 deletion x-pack/test/plugin_api_integration/plugins/task_manager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,20 @@
* you may not use this file except in compliance with the Elastic License.
*/

const { EventEmitter } = require('events');

import { initRoutes } from './init_routes';


const once = function (emitter, event) {
return new Promise(resolve => {
emitter.once(event, resolve);
});
};

export default function TaskTestingAPI(kibana) {
const taskTestingEvents = new EventEmitter();

return new kibana.Plugin({
name: 'sampleTask',
require: ['elasticsearch', 'task_manager'],
Expand Down Expand Up @@ -52,6 +63,10 @@ export default function TaskTestingAPI(kibana) {
refresh: true,
});

if (params.waitForEvent) {
await once(taskTestingEvents, params.waitForEvent);
}

return {
state: { count: (prevState.count || 0) + 1 },
runAt: millisecondsFromNow(params.nextRunMilliseconds),
Expand Down Expand Up @@ -88,7 +103,7 @@ export default function TaskTestingAPI(kibana) {
},
});

initRoutes(server);
initRoutes(server, taskTestingEvents);
},
});
}
Expand Down
Loading

0 comments on commit 4e049c9

Please sign in to comment.