bdcd2ec859
* Replace EuiCodeBlock with JsonCodeEditor in DiscoverGrid * Add optional "hasLineNumbers" property to JsonCodeEditor and removed line numbers from the popover * Update json_code_editor snapshot * Add functional test for cell expanded content popover * Remove unused code * Fix geo point case and refactor some code Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
29 lines
917 B
TypeScript
29 lines
917 B
TypeScript
/*
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
* 2.0 and the Server Side Public License, v 1; you may not use this file except
|
|
* in compliance with, at your election, the Elastic License 2.0 or the Server
|
|
* Side Public License, v 1.
|
|
*/
|
|
|
|
import { FtrProviderContext } from '../ftr_provider_context';
|
|
|
|
export function MonacoEditorProvider({ getService }: FtrProviderContext) {
|
|
const retry = getService('retry');
|
|
const browser = getService('browser');
|
|
|
|
return new (class MonacoEditor {
|
|
public async getCodeEditorValue() {
|
|
let request: string = '';
|
|
|
|
await retry.try(async () => {
|
|
request = await browser.execute(
|
|
() => (window as any).MonacoEnvironment.monaco.editor.getModels()[0].getValue() as string
|
|
);
|
|
});
|
|
|
|
return request;
|
|
}
|
|
})();
|
|
}
|