Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into kbn-50511-migrate…
Browse files Browse the repository at this point in the history
…-csp-usage-collector
  • Loading branch information
pgayvallet committed Aug 20, 2020
2 parents 0eaae43 + 77a434b commit a803061
Show file tree
Hide file tree
Showing 87 changed files with 1,176 additions and 1,520 deletions.
8 changes: 3 additions & 5 deletions docs/visualize/vega.asciidoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[[vega-graph]]
== Vega

experimental[]

Build custom visualizations using Vega and Vega-Lite, backed by one or more
data sources including {es}, Elastic Map Service, URL,
or static data. Use the {kib} extensions to Vega to embed Vega into
Expand Down Expand Up @@ -1259,7 +1257,7 @@ Override it by providing a different `stroke`, `fill`, or `color` (Vega-Lite) va
[[vega-queries]]
==== Writing {es} queries in Vega

experimental[] {kib} extends the Vega https://vega.github.io/vega/docs/data/[data] elements
{kib} extends the Vega https://vega.github.io/vega/docs/data/[data] elements
with support for direct {es} queries specified as a `url`.

Because of this, {kib} is **unable to support dynamically loaded data**,
Expand Down Expand Up @@ -1414,7 +1412,7 @@ try to get about 10-15 data points (buckets).
[[vega-esmfiles]]
=== Access Elastic Map Service files

experimental[] Access the Elastic Map Service files via the same mechanism:
Access the Elastic Map Service files via the same mechanism:

[source,yaml]
----
Expand Down Expand Up @@ -1619,7 +1617,7 @@ kibanaSetTimeFilter(start, end)
[[vega-useful-links]]
=== Resources and examples

experimental[] To learn more about Vega and Vega-Lite, refer to the resources and examples.
To learn more about Vega and Vega-Lite, refer to the resources and examples.

==== Vega editor
The https://vega.github.io/editor/[Vega Editor] includes examples for Vega & Vega-Lite, but does not support any
Expand Down
1 change: 0 additions & 1 deletion src/plugins/vis_type_vega/public/vega_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const createVegaTypeDefinition = (dependencies: VegaVisualizationDependen
getSupportedTriggers: () => {
return [VIS_EVENT_TO_TRIGGER.applyFilter];
},
stage: 'experimental',
inspectorAdapters: createInspectorAdapters,
};
};
26 changes: 0 additions & 26 deletions src/plugins/visualize/config.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/plugins/visualize/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"savedObjects",
"visualizations",
"embeddable",
"dashboard",
"uiActions"
],
"optionalPlugins": ["home", "share"],
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/visualize/public/application/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import { SharePluginStart } from 'src/plugins/share/public';
import { SavedObjectsStart, SavedObject } from 'src/plugins/saved_objects/public';
import { EmbeddableStart } from 'src/plugins/embeddable/public';
import { KibanaLegacyStart } from 'src/plugins/kibana_legacy/public';
import { ConfigSchema } from '../../config';
import { DashboardStart } from '../../../dashboard/public';

export type PureVisState = SavedVisState;

Expand Down Expand Up @@ -111,7 +111,7 @@ export interface VisualizeServices extends CoreStart {
createVisEmbeddableFromObject: VisualizationsStart['__LEGACY']['createVisEmbeddableFromObject'];
restorePreviousUrl: () => void;
scopedHistory: ScopedHistory;
featureFlagConfig: ConfigSchema;
dashboard: DashboardStart;
}

export interface SavedVisInstance {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const getTopNavConfig = (
toastNotifications,
visualizeCapabilities,
i18n: { Context: I18nContext },
featureFlagConfig,
dashboard,
}: VisualizeServices
) => {
const { vis, embeddableHandler } = visInstance;
Expand Down Expand Up @@ -212,7 +212,7 @@ export const getTopNavConfig = (
};
if (
originatingApp === 'dashboards' &&
featureFlagConfig.showNewVisualizeFlow &&
dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
!savedVis
) {
return createVisReference();
Expand Down Expand Up @@ -292,7 +292,7 @@ export const getTopNavConfig = (
const isSaveAsButton = anchorElement.classList.contains('saveAsButton');
if (
originatingApp === 'dashboards' &&
featureFlagConfig.showNewVisualizeFlow &&
dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
!isSaveAsButton
) {
createVisReference();
Expand Down
9 changes: 3 additions & 6 deletions src/plugins/visualize/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { VisualizeServices } from './application/types';
import { DEFAULT_APP_CATEGORIES } from '../../../core/public';
import { SavedObjectsStart } from '../../saved_objects/public';
import { EmbeddableStart } from '../../embeddable/public';
import { DashboardStart } from '../../dashboard/public';
import { UiActionsStart, VISUALIZE_FIELD_TRIGGER } from '../../ui_actions/public';
import {
setUISettings,
Expand All @@ -67,6 +68,7 @@ export interface VisualizePluginStartDependencies {
embeddable: EmbeddableStart;
kibanaLegacy: KibanaLegacyStart;
savedObjects: SavedObjectsStart;
dashboard: DashboardStart;
uiActions: UiActionsStart;
}

Expand All @@ -77,10 +79,6 @@ export interface VisualizePluginSetupDependencies {
share?: SharePluginSetup;
}

export interface FeatureFlagConfig {
showNewVisualizeFlow: boolean;
}

export class VisualizePlugin
implements
Plugin<void, void, VisualizePluginSetupDependencies, VisualizePluginStartDependencies> {
Expand Down Expand Up @@ -171,7 +169,6 @@ export class VisualizePlugin
* this should be replaced to use only scoped history after moving legacy apps to browser routing
*/
const history = createHashHistory();

const services: VisualizeServices = {
...coreStart,
history,
Expand All @@ -198,7 +195,7 @@ export class VisualizePlugin
savedObjectsPublic: pluginsStart.savedObjects,
scopedHistory: params.history,
restorePreviousUrl,
featureFlagConfig: this.initializerContext.config.get<FeatureFlagConfig>(),
dashboard: pluginsStart.dashboard,
};

params.element.classList.add('visAppWrapper');
Expand Down
11 changes: 1 addition & 10 deletions src/plugins/visualize/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,8 @@
* under the License.
*/

import { PluginInitializerContext, PluginConfigDescriptor } from 'kibana/server';
import { PluginInitializerContext } from 'kibana/server';
import { VisualizeServerPlugin } from './plugin';

import { ConfigSchema, configSchema } from '../config';

export const config: PluginConfigDescriptor<ConfigSchema> = {
exposeToBrowser: {
showNewVisualizeFlow: true,
},
schema: configSchema,
};

export const plugin = (initContext: PluginInitializerContext) =>
new VisualizeServerPlugin(initContext);
28 changes: 16 additions & 12 deletions test/functional/page_objects/vega_chart_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export function VegaChartPageProvider({
const find = getService('find');
const testSubjects = getService('testSubjects');
const browser = getService('browser');
const { common } = getPageObjects(['common']);
const retry = getService('retry');

class VegaChartPage {
Expand All @@ -49,6 +48,15 @@ export function VegaChartPageProvider({
return find.byCssSelector('div.vgaVis__controls');
}

public getYAxisContainer() {
return find.byCssSelector('[aria-label^="Y-axis"]');
}

public async getAceGutterContainer() {
const editor = await this.getEditor();
return editor.findByClassName('ace_gutter');
}

public async getRawSpec() {
// Adapted from console_page.js:getVisibleTextFromAceEditor(). Is there a common utilities file?
const editor = await this.getEditor();
Expand Down Expand Up @@ -83,20 +91,16 @@ export function VegaChartPageProvider({
}

public async typeInSpec(text: string) {
await this.focusEditor();
const aceGutter = await this.getAceGutterContainer();

let repeats = 20;
while (--repeats > 0) {
await browser.pressKeys(Key.ARROW_UP);
await common.sleep(50);
}
await browser.pressKeys(Key.ARROW_RIGHT);
await aceGutter.doubleClick();
await browser.pressKeys(Key.LEFT);
await browser.pressKeys(Key.RIGHT);
await browser.pressKeys(text);
}

public async cleanSpec() {
const editor = await this.getEditor();
const aceGutter = await editor.findByClassName('ace_gutter');
const aceGutter = await this.getAceGutterContainer();

await retry.try(async () => {
await aceGutter.doubleClick();
Expand All @@ -107,11 +111,11 @@ export function VegaChartPageProvider({
}

public async getYAxisLabels() {
const chart = await testSubjects.find('visualizationLoader');
const yAxis = await chart.findByCssSelector('[aria-label^="Y-axis"]');
const yAxis = await this.getYAxisContainer();
const tickGroup = await yAxis.findByClassName('role-axis-label');
const labels = await tickGroup.findAllByCssSelector('text');
const labelTexts: string[] = [];

for (const label of labels) {
labelTexts.push(await label.getVisibleText());
}
Expand Down
1 change: 0 additions & 1 deletion test/new_visualize_flow/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export default async function ({ readConfigFile }) {
...commonConfig.get('kbnTestServer.serverArgs'),
'--oss',
'--telemetry.optIn=false',
'--visualize.showNewVisualizeFlow=true',
],
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
FIELDS_BROWSER_SELECTED_CATEGORY_TITLE,
} from '../screens/fields_browser';
import {
EVENTS_PAGE,
HEADER_SUBTITLE,
HOST_GEO_CITY_NAME_HEADER,
HOST_GEO_COUNTRY_NAME_HEADER,
Expand Down Expand Up @@ -153,7 +154,7 @@ describe('Events Viewer', () => {
});
});

context.skip('Events columns', () => {
context('Events columns', () => {
before(() => {
loginAndWaitForPage(HOSTS_URL);
openEvents();
Expand All @@ -171,6 +172,7 @@ describe('Events Viewer', () => {
const expectedOrderAfterDragAndDrop =
'message@timestamphost.nameevent.moduleevent.datasetevent.actionuser.namesource.ipdestination.ip';

cy.get(EVENTS_PAGE).scrollTo('bottom');
cy.get(HEADERS_GROUP).invoke('text').should('equal', originalColumnOrder);
dragAndDropColumn({ column: 0, newPosition: 1 });
cy.get(HEADERS_GROUP).invoke('text').should('equal', expectedOrderAfterDragAndDrop);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { TABLE_COLUMN_EVENTS_MESSAGE } from '../screens/hosts/external_events';
import { waitsForEventsToBeLoaded, openEventsViewerFieldsBrowser } from '../tasks/hosts/events';
import { removeColumn, resetFields } from '../tasks/timeline';

// FLAKY: https://github.com/elastic/kibana/issues/72339
describe.skip('persistent timeline', () => {
describe('persistent timeline', () => {
before(() => {
loginAndWaitForPage(HOSTS_URL);
openEvents();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

export const CLOSE_MODAL = '[data-test-subj="modal-inspect-close"]';

export const EVENTS_PAGE = '[data-test-subj="pageContainer"]';

export const EVENTS_VIEWER_FIELDS_BUTTON =
'[data-test-subj="events-viewer-panel"] [data-test-subj="show-field-browser"]';

Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/security_solution/cypress/screens/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export const CREATE_NEW_TIMELINE = '[data-test-subj="timeline-new"]';
export const DRAGGABLE_HEADER =
'[data-test-subj="events-viewer-panel"] [data-test-subj="headers-group"] [data-test-subj="draggable-header"]';

export const HEADER = '[data-test-subj="header"]';

export const HEADERS_GROUP = '[data-test-subj="headers-group"]';

export const ID_HEADER_FIELD = '[data-test-subj="timeline"] [data-test-subj="header-text-_id"]';
Expand All @@ -23,8 +25,7 @@ export const PIN_EVENT = '[data-test-subj="pin"]';

export const PROVIDER_BADGE = '[data-test-subj="providerBadge"]';

export const REMOVE_COLUMN =
'[data-test-subj="events-viewer-panel"] [data-test-subj="remove-column"]';
export const REMOVE_COLUMN = '[data-test-subj="remove-column"]';

export const RESET_FIELDS =
'[data-test-subj="events-viewer-panel"] [data-test-subj="reset-fields"]';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ export const dragAndDropColumn = ({
.eq(column)
.then((header) => drag(header));

cy.wait(5000); // wait for DOM updates before moving

cy.get(DRAGGABLE_HEADER)
.eq(newPosition)
.then((targetPosition) => {
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/security_solution/cypress/tasks/timeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DATE_PICKER_APPLY_BUTTON_TIMELINE } from '../screens/date_picker';
import {
CLOSE_TIMELINE_BTN,
CREATE_NEW_TIMELINE,
HEADER,
ID_FIELD,
ID_HEADER_FIELD,
ID_TOGGLE_FIELD,
Expand Down Expand Up @@ -114,7 +115,7 @@ export const dragAndDropIdToggleFieldToTimeline = () => {
};

export const removeColumn = (column: number) => {
cy.get(REMOVE_COLUMN).first().should('exist');
cy.get(HEADER).eq(column).click();
cy.get(REMOVE_COLUMN).eq(column).click({ force: true });
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import expect from '@kbn/expect';

import { FtrProviderContext } from '../../../ftr_provider_context';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api';
import { USER } from '../../../../functional/services/ml/security_common';
import { Annotation } from '../../../../../plugins/ml/common/types/annotations';
import { createJobConfig, createAnnotationRequestBody } from './common_jobs';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api';
import { USER } from '../../../../functional/services/ml/security_common';
import { testSetupJobConfigs, jobIds, testSetupAnnotations } from './common_jobs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import expect from '@kbn/expect';
import { omit } from 'lodash';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api';
import { USER } from '../../../../functional/services/ml/security_common';
import { testSetupJobConfigs, jobIds, testSetupAnnotations } from './common_jobs';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import expect from '@kbn/expect';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api';
import { USER } from '../../../../functional/services/ml/security_common';
import { ANNOTATION_TYPE } from '../../../../../plugins/ml/common/constants/annotations';
import { Annotation } from '../../../../../plugins/ml/common/types/annotations';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import expect from '@kbn/expect';

import { FtrProviderContext } from '../../../ftr_provider_context';
import { USER } from '../../../../functional/services/ml/security_common';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common';
import { COMMON_REQUEST_HEADERS } from '../../../../functional/services/ml/common_api';

export default ({ getService }: FtrProviderContext) => {
const esArchiver = getService('esArchiver');
Expand Down
Loading

0 comments on commit a803061

Please sign in to comment.