Skip to content

Commit c898b47

Browse files
committed
Merge remote-tracking branch 'upstream/master' into switch-to-core-application-service
2 parents bc83e30 + 0f5c1ed commit c898b47

File tree

19 files changed

+96
-119
lines changed

19 files changed

+96
-119
lines changed

src/plugins/console/public/styles/_app.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// TODO: Move all of the styles here (should be modularised by, e.g., CSS-in-JS or CSS modules).
22
@import '@elastic/eui/src/components/header/variables';
33

4+
// This value is calculated to static value using SCSS because calc in calc has issues in IE11
5+
$headerHeightOffset: $euiHeaderHeightCompensation * 2;
6+
47
#consoleRoot {
5-
height: calc(100vh - calc(#{$euiHeaderChildSize} * 2));
8+
height: calc(100vh - #{$headerHeightOffset});
69
display: flex;
710
flex: 1 1 auto;
811
// Make sure the editor actions don't create scrollbars on this container

src/plugins/data/common/es_query/es_query/migrate_filter.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,25 @@ export function migrateFilter(filter: Filter, indexPattern?: IIndexPattern) {
4343
if (isDeprecatedMatchPhraseFilter(filter)) {
4444
const fieldName = Object.keys(filter.query.match)[0];
4545
const params: Record<string, any> = get(filter, ['query', 'match', fieldName]);
46+
let query = params.query;
4647
if (indexPattern) {
4748
const field = indexPattern.fields.find(f => f.name === fieldName);
4849

4950
if (field) {
50-
params.query = getConvertedValueForField(field, params.query);
51+
query = getConvertedValueForField(field, params.query);
5152
}
5253
}
5354
return {
5455
...filter,
5556
query: {
5657
match_phrase: {
57-
[fieldName]: omit(params, 'type'),
58+
[fieldName]: omit(
59+
{
60+
...params,
61+
query,
62+
},
63+
'type'
64+
),
5865
},
5966
},
6067
};

src/plugins/visualizations/public/embeddable/visualize_embeddable.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ export interface VisualizeOutput extends EmbeddableOutput {
7474

7575
type ExpressionLoader = InstanceType<ExpressionsStart['ExpressionLoader']>;
7676

77+
const visTypesWithoutInspector = ['markdown', 'input_control_vis', 'metrics', 'vega', 'timelion'];
78+
7779
export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOutput> {
7880
private handler?: ExpressionLoader;
7981
private timefilter: TimefilterContract;
@@ -131,7 +133,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
131133
}
132134

133135
public getInspectorAdapters = () => {
134-
if (!this.handler) {
136+
if (!this.handler || visTypesWithoutInspector.includes(this.vis.type.name)) {
135137
return undefined;
136138
}
137139
return this.handler.inspect();
@@ -220,19 +222,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut
220222

221223
// this is a hack to make editor still work, will be removed once we clean up editor
222224
// @ts-ignore
223-
hasInspector = () => {
224-
const visTypesWithoutInspector = [
225-
'markdown',
226-
'input_control_vis',
227-
'metrics',
228-
'vega',
229-
'timelion',
230-
];
231-
if (visTypesWithoutInspector.includes(this.vis.type.name)) {
232-
return false;
233-
}
234-
return this.getInspectorAdapters();
235-
};
225+
hasInspector = () => Boolean(this.getInspectorAdapters());
236226

237227
/**
238228
*

test/functional/services/find.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,16 @@
1717
* under the License.
1818
*/
1919

20-
import { WebDriver, WebElement, By } from 'selenium-webdriver';
20+
import { WebDriver, WebElement, By, until } from 'selenium-webdriver';
2121
import { FtrProviderContext } from '../ftr_provider_context';
2222
import { WebElementWrapper } from './lib/web_element_wrapper';
2323

2424
export async function FindProvider({ getService }: FtrProviderContext) {
2525
const log = getService('log');
2626
const config = getService('config');
27-
const webdriver = await getService('__webdriver__').init();
27+
const { driver, browserType } = await getService('__webdriver__').init();
2828
const retry = getService('retry');
2929

30-
const driver = webdriver.driver;
31-
const until = webdriver.until;
32-
const browserType = webdriver.browserType;
33-
3430
const WAIT_FOR_EXISTS_TIME = config.get('timeouts.waitForExists');
3531
const POLLING_TIME = 500;
3632
const defaultFindTimeout = config.get('timeouts.find');
@@ -40,7 +36,7 @@ export async function FindProvider({ getService }: FtrProviderContext) {
4036
WebElementWrapper.create(
4137
webElement,
4238
locator,
43-
webdriver,
39+
driver,
4440
defaultFindTimeout,
4541
fixedHeaderHeight,
4642
log,

test/functional/services/lib/web_element_wrapper/web_element_wrapper.ts

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
import { delay } from 'bluebird';
21-
import { WebElement, WebDriver, By, Key, until } from 'selenium-webdriver';
21+
import { WebElement, WebDriver, By, Key } from 'selenium-webdriver';
2222
import { PNG } from 'pngjs';
2323
// @ts-ignore not supported yet
2424
import cheerio from 'cheerio';
@@ -29,12 +29,6 @@ import { CustomCheerio, CustomCheerioStatic } from './custom_cheerio_api';
2929
import { scrollIntoViewIfNecessary } from './scroll_into_view_if_necessary';
3030
import { Browsers } from '../../remote/browsers';
3131

32-
interface Driver {
33-
driver: WebDriver;
34-
By: typeof By;
35-
until: typeof until;
36-
}
37-
3832
interface TypeOptions {
3933
charByChar: boolean;
4034
}
@@ -51,16 +45,15 @@ const RETRY_CLICK_RETRY_ON_ERRORS = [
5145
];
5246

5347
export class WebElementWrapper {
54-
private By = this.webDriver.By;
55-
private driver: WebDriver = this.webDriver.driver;
48+
private By = By;
5649
private Keys = Key;
57-
public isW3CEnabled: boolean = (this.webDriver.driver as any).executor_.w3c === true;
50+
public isW3CEnabled: boolean = (this.driver as any).executor_.w3c === true;
5851
public isChromium: boolean = [Browsers.Chrome, Browsers.ChromiumEdge].includes(this.browserType);
5952

6053
public static create(
6154
webElement: WebElement | WebElementWrapper,
6255
locator: By | null,
63-
webDriver: Driver,
56+
driver: WebDriver,
6457
timeout: number,
6558
fixedHeaderHeight: number,
6659
logger: ToolingLog,
@@ -73,7 +66,7 @@ export class WebElementWrapper {
7366
return new WebElementWrapper(
7467
webElement,
7568
locator,
76-
webDriver,
69+
driver,
7770
timeout,
7871
fixedHeaderHeight,
7972
logger,
@@ -84,7 +77,7 @@ export class WebElementWrapper {
8477
constructor(
8578
public _webElement: WebElement,
8679
private locator: By | null,
87-
private webDriver: Driver,
80+
private driver: WebDriver,
8881
private timeout: number,
8982
private fixedHeaderHeight: number,
9083
private logger: ToolingLog,
@@ -109,7 +102,7 @@ export class WebElementWrapper {
109102
return WebElementWrapper.create(
110103
otherWebElement,
111104
locator,
112-
this.webDriver,
105+
this.driver,
113106
this.timeout,
114107
this.fixedHeaderHeight,
115108
this.logger,

test/functional/services/remote/remote.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export async function RemoteProvider({ getService }: FtrProviderContext) {
5858
Fs.writeFileSync(path, JSON.stringify(JSON.parse(coverageJson), null, 2));
5959
};
6060

61-
const { driver, By, until, consoleLog$ } = await initWebDriver(
61+
const { driver, consoleLog$ } = await initWebDriver(
6262
log,
6363
browserType,
6464
lifecycle,
@@ -153,5 +153,5 @@ export async function RemoteProvider({ getService }: FtrProviderContext) {
153153
await driver.quit();
154154
});
155155

156-
return { driver, By, until, browserType, consoleLog$ };
156+
return { driver, browserType, consoleLog$ };
157157
}

test/functional/services/remote/webdriver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { delay } from 'bluebird';
2828
import chromeDriver from 'chromedriver';
2929
// @ts-ignore types not available
3030
import geckoDriver from 'geckodriver';
31-
import { Builder, Capabilities, By, logging, until } from 'selenium-webdriver';
31+
import { Builder, Capabilities, logging } from 'selenium-webdriver';
3232
import chrome from 'selenium-webdriver/chrome';
3333
import firefox from 'selenium-webdriver/firefox';
3434
import edge from 'selenium-webdriver/edge';
@@ -310,7 +310,7 @@ async function attemptToCreateCommand(
310310
return;
311311
} // abort
312312

313-
return { driver: session, By, until, consoleLog$ };
313+
return { driver: session, consoleLog$ };
314314
}
315315

316316
export async function initWebDriver(

x-pack/plugins/advanced_ui_actions/public/drilldowns/drilldown_definition.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ import { ActionFactoryDefinition } from '../dynamic_actions';
1515
* `Config` is a serializable object containing the configuration that the
1616
* drilldown is able to collect using UI.
1717
*
18-
* `PlaceContext` is an object that the app that opens drilldown management
19-
* flyout provides to the React component, specifying the contextual information
20-
* about that app. For example, on Dashboard app this context contains
21-
* information about the current embeddable and dashboard.
22-
*
2318
* `ExecutionContext` is an object created in response to user's interaction
2419
* and provided to the `execute` function of the drilldown. This object contains
2520
* information about the action user performed.

x-pack/plugins/advanced_ui_actions/public/dynamic_actions/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* you may not use this file except in compliance with the Elastic License.
55
*/
66

7-
export interface SerializedAction<Config> {
7+
export interface SerializedAction<Config = unknown> {
88
readonly factoryId: string;
99
readonly name: string;
1010
readonly config: Config;
@@ -16,5 +16,5 @@ export interface SerializedAction<Config> {
1616
export interface SerializedEvent {
1717
eventId: string;
1818
triggers: string[];
19-
action: SerializedAction<unknown>;
19+
action: SerializedAction;
2020
}

x-pack/plugins/dashboard_enhanced/public/services/drilldowns/actions/flyout_create_drilldown/flyout_create_drilldown.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export class FlyoutCreateDrilldownAction implements ActionByType<typeof OPEN_FLY
7272
toMountPoint(
7373
<plugins.drilldowns.FlyoutManageDrilldowns
7474
onClose={() => handle.close()}
75-
placeContext={context}
7675
viewMode={'create'}
7776
dynamicActionManager={embeddable.enhancements.dynamicActions}
7877
/>

0 commit comments

Comments
 (0)