Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into fields-marked-as-mo…
Browse files Browse the repository at this point in the history
…dified-fix
  • Loading branch information
dplumlee committed Nov 18, 2024
2 parents adab757 + 598076e commit c2ed445
Show file tree
Hide file tree
Showing 78 changed files with 1,824 additions and 1,217 deletions.
62 changes: 52 additions & 10 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,23 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai
### END Observability Plugins

# Presentation
/x-pack/test/disable_ems @elastic/kibana-presentation
/test/interpreter_functional/snapshots @elastic/kibana-presentation # Assigned per https://github.com/elastic/kibana/pull/54342
/test/functional/services/inspector.ts @elastic/kibana-presentation
/x-pack/test/functional/services/canvas_element.ts @elastic/kibana-presentation
/x-pack/test/functional/page_objects/canvas_page.ts @elastic/kibana-presentation
/x-pack/test/accessibility/apps/group3/canvas.ts @elastic/kibana-presentation
/x-pack/test/upgrade/apps/canvas @elastic/kibana-presentation
/x-pack/test/upgrade/apps/dashboard @elastic/kibana-presentation
/test/functional/screenshots/baseline/tsvb_dashboard.png @elastic/kibana-presentation
/test/functional/screenshots/baseline/dashboard_*.png @elastic/kibana-presentation
/test/functional/screenshots/baseline/area_chart.png @elastic/kibana-presentation
/x-pack/test/disable_ems @elastic/kibana-presentation # Assigned per https://github.com/elastic/kibana/pull/165986
/x-pack/test/functional/fixtures/kbn_archiver/dashboard* @elastic/kibana-presentation
/test/functional/page_objects/dashboard_page* @elastic/kibana-presentation
/test/functional/firefox/dashboard.config.ts @elastic/kibana-presentation # Assigned per: https://github.com/elastic/kibana/issues/15023
/test/functional/fixtures/es_archiver/dashboard @elastic/kibana-presentation # Assigned per: https://github.com/elastic/kibana/issues/15023
/test/accessibility/apps/dashboard.ts @elastic/kibana-presentation
/test/accessibility/apps/filter_panel.ts @elastic/kibana-presentation
/x-pack/test/functional/apps/dashboard @elastic/kibana-presentation
/x-pack/test/accessibility/apps/group3/maps.ts @elastic/kibana-presentation
/x-pack/test/accessibility/apps/group1/dashboard_panel_options.ts @elastic/kibana-presentation
Expand All @@ -1382,6 +1398,17 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai
/test/plugin_functional/test_suites/panel_actions @elastic/kibana-presentation
/x-pack/test/functional/es_archives/canvas/logstash_lens @elastic/kibana-presentation
#CC# /src/plugins/kibana_react/public/code_editor/ @elastic/kibana-presentation
/x-pack/test/upgrade/services/maps_upgrade_services.ts @elastic/kibana-presentation
/x-pack/test/stack_functional_integration/apps/maps @elastic/kibana-presentation
/x-pack/test/functional/page_objects/geo_file_upload.ts @elastic/kibana-presentation
/x-pack/test/functional/page_objects/gis_page.ts @elastic/kibana-presentation
/x-pack/test/upgrade/apps/maps @elastic/kibana-presentation
/x-pack/test/api_integration/apis/maps/ @elastic/kibana-presentation
/x-pack/test/functional/apps/maps/ @elastic/kibana-presentation
/x-pack/test/functional/es_archives/maps/ @elastic/kibana-presentation
/x-pack/plugins/stack_alerts/server/rule_types/geo_containment @elastic/kibana-presentation
/x-pack/plugins/stack_alerts/public/rule_types/geo_containment @elastic/kibana-presentation


# Machine Learning
/x-pack/test/stack_functional_integration/apps/ml @elastic/ml-ui
Expand Down Expand Up @@ -1421,15 +1448,6 @@ x-pack/test_serverless/**/test_suites/observability/ai_assistant @elastic/obs-ai
/x-pack/test/functional/services/aiops @elastic/ml-ui
/x-pack/test/functional_basic/apps/transform/ @elastic/ml-ui

# Maps
#CC# /x-pack/plugins/maps/ @elastic/kibana-gis
/x-pack/test/api_integration/apis/maps/ @elastic/kibana-gis
/x-pack/test/functional/apps/maps/ @elastic/kibana-gis
/x-pack/test/functional/es_archives/maps/ @elastic/kibana-gis
/x-pack/plugins/stack_alerts/server/rule_types/geo_containment @elastic/kibana-gis
/x-pack/plugins/stack_alerts/public/rule_types/geo_containment @elastic/kibana-gis
#CC# /x-pack/plugins/file_upload @elastic/kibana-gis

# Operations
/test/package @elastic/kibana-operations
/test/package/roles @elastic/kibana-operations
Expand Down Expand Up @@ -1584,6 +1602,8 @@ x-pack/test/api_integration/deployment_agnostic/services/ @elastic/appex-qa
x-pack/test/**/deployment_agnostic/ @elastic/appex-qa #temporarily to monitor tests migration

# Core
/test/api_integration/apis/general/*.js @elastic/kibana-core # Assigned per https://github.com/elastic/kibana/pull/199795/files/894a8ede3f9d0398c5af56bf5a82654a9bc0610b#r1846691639
/x-pack/test/plugin_api_integration/plugins/feature_usage_test @elastic/kibana-core
/test/plugin_functional/plugins/rendering_plugin @elastic/kibana-core
/test/plugin_functional/plugins/session_notifications @elastic/kibana-core
/x-pack/test/cloud_integration/plugins/saml_provider @elastic/kibana-core
Expand Down Expand Up @@ -1640,6 +1660,28 @@ x-pack/plugins/cloud_integrations/cloud_full_story/server/config.ts @elastic/kib
#CC# /x-pack/plugins/translations/ @elastic/kibana-localization @elastic/kibana-core

# Kibana Platform Security
# security
/x-pack/test_serverless/functional/test_suites/observability/role_management @elastic/kibana-security
/x-pack/test/functional/config_security_basic.ts @elastic/kibana-security
/x-pack/test/functional/page_objects/user_profile_page.ts @elastic/kibana-security
/x-pack/test/functional/page_objects/space_selector_page.ts @elastic/kibana-security
/x-pack/test/functional/page_objects/security_page.ts @elastic/kibana-security
/x-pack/test/functional/page_objects/role_mappings_page.ts @elastic/kibana-security
/x-pack/test/functional/page_objects/copy_saved_objects_to_space_page.ts @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/39002
/x-pack/test/functional/page_objects/api_keys_page.ts @elastic/kibana-security
/x-pack/test/functional/page_objects/account_settings_page.ts @elastic/kibana-security
/x-pack/test/functional/apps/user_profiles @elastic/kibana-security
/x-pack/test/common/services/spaces.ts @elastic/kibana-security
/x-pack/test/api_integration/config_security_*.ts @elastic/kibana-security
/x-pack/test/functional/apps/api_keys @elastic/kibana-security
/x-pack/test/ftr_apis/security_and_spaces @elastic/kibana-security
/test/server_integration/services/supertest.js @elastic/kibana-security @elastic/kibana-core
/test/server_integration/http/ssl @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/53810
/test/server_integration/http/ssl_with_p12 @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/199795#discussion_r1846522206
/test/server_integration/http/ssl_with_p12_intermediate @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/199795#discussion_r1846522206

/test/server_integration/config.base.js @elastic/kibana-security @elastic/kibana-core # Assigned per https://github.com/elastic/kibana/pull/199795#discussion_r1846510782
/test/server_integration/__fixtures__ @elastic/kibana-security # Assigned per https://github.com/elastic/kibana/pull/53810
/.github/codeql @elastic/kibana-security
/.github/workflows/codeql.yml @elastic/kibana-security
/.github/workflows/codeql-stats.yml @elastic/kibana-security
Expand Down
7 changes: 2 additions & 5 deletions packages/kbn-esql-editor/src/esql_editor.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,20 @@ import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { ESQLEditor } from './esql_editor';
import type { ESQLEditorProps } from './types';
import { ReactWrapper } from 'enzyme';
import { of } from 'rxjs';
import { coreMock } from '@kbn/core/server/mocks';

describe('ESQLEditor', () => {
const uiConfig: Record<string, any> = {};
const uiSettings = {
get: (key: string) => uiConfig[key],
} as IUiSettingsClient;
const theme = {
theme$: of({ darkMode: false }),
};

const services = {
uiSettings,
settings: {
client: uiSettings,
},
theme,
core: coreMock.createStart(),
};

function renderESQLEditorComponent(testProps: ESQLEditorProps) {
Expand Down
14 changes: 11 additions & 3 deletions packages/kbn-esql-editor/src/esql_editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import type { AggregateQuery } from '@kbn/es-query';
import type { ExpressionsStart } from '@kbn/expressions-plugin/public';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { ESQLLang, ESQL_LANG_ID, ESQL_THEME_ID, monaco, type ESQLCallbacks } from '@kbn/monaco';
import {
ESQLLang,
ESQL_LANG_ID,
ESQL_DARK_THEME_ID,
ESQL_LIGHT_THEME_ID,
monaco,
type ESQLCallbacks,
} from '@kbn/monaco';
import memoize from 'lodash/memoize';
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { createPortal } from 'react-dom';
Expand Down Expand Up @@ -91,7 +98,8 @@ export const ESQLEditor = memo(function ESQLEditor({
fieldsMetadata,
uiSettings,
} = kibana.services;
const timeZone = core?.uiSettings?.get('dateFormat:tz');
const darkMode = core.theme?.getTheme().darkMode;
const timeZone = uiSettings?.get('dateFormat:tz');
const histogramBarTarget = uiSettings?.get('histogram:barTarget') ?? 50;
const [code, setCode] = useState<string>(query.esql ?? '');
// To make server side errors less "sticky", register the state of the code when submitting
Expand Down Expand Up @@ -597,7 +605,7 @@ export const ESQLEditor = memo(function ESQLEditor({
vertical: 'auto',
},
scrollBeyondLastLine: false,
theme: ESQL_THEME_ID,
theme: darkMode ? ESQL_DARK_THEME_ID : ESQL_LIGHT_THEME_ID,
wordWrap: 'on',
wrappingIndent: 'none',
};
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-monaco/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export {
} from './src/monaco_imports';
export { XJsonLang } from './src/xjson';
export { SQLLang } from './src/sql';
export { ESQL_LANG_ID, ESQL_THEME_ID, ESQLLang } from './src/esql';
export { ESQL_LANG_ID, ESQL_DARK_THEME_ID, ESQL_LIGHT_THEME_ID, ESQLLang } from './src/esql';
export type { ESQLCallbacks } from '@kbn/esql-validation-autocomplete';

export * from './src/painless';
Expand Down
4 changes: 2 additions & 2 deletions packages/kbn-monaco/src/esql/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
* License v3.0 only", or the "Server Side Public License, v 1".
*/

export { ESQL_LANG_ID, ESQL_THEME_ID } from './lib/constants';
export { ESQL_LANG_ID, ESQL_DARK_THEME_ID, ESQL_LIGHT_THEME_ID } from './lib/constants';
export { ESQLLang } from './language';
export { buildESQlTheme } from './lib/esql_theme';
export { buildESQLTheme } from './lib/esql_theme';
3 changes: 2 additions & 1 deletion packages/kbn-monaco/src/esql/lib/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/

export const ESQL_LANG_ID = 'esql';
export const ESQL_THEME_ID = 'esqlTheme';
export const ESQL_LIGHT_THEME_ID = 'esqlThemeLight';
export const ESQL_DARK_THEME_ID = 'esqlThemeDark';

export const ESQL_TOKEN_POSTFIX = '.esql';
8 changes: 4 additions & 4 deletions packages/kbn-monaco/src/esql/lib/esql_theme.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

import { ESQLErrorListener, getLexer as _getLexer } from '@kbn/esql-ast';
import { ESQL_TOKEN_POSTFIX } from './constants';
import { buildESQlTheme } from './esql_theme';
import { buildESQLTheme } from './esql_theme';
import { CharStreams } from 'antlr4';

describe('ESQL Theme', () => {
it('should not have multiple rules for a single token', () => {
const theme = buildESQlTheme();
const theme = buildESQLTheme({ darkMode: false });

const seen = new Set<string>();
const duplicates: string[] = [];
Expand All @@ -40,7 +40,7 @@ describe('ESQL Theme', () => {
.map((name) => name!.toLowerCase());

it('every rule should apply to a valid lexical name', () => {
const theme = buildESQlTheme();
const theme = buildESQLTheme({ darkMode: false });

// These names aren't from the lexer... they are added on our side
// see packages/kbn-monaco/src/esql/lib/esql_token_helpers.ts
Expand All @@ -62,7 +62,7 @@ describe('ESQL Theme', () => {
});

it('every valid lexical name should have a corresponding rule', () => {
const theme = buildESQlTheme();
const theme = buildESQLTheme({ darkMode: false });
const tokenIDs = theme.rules.map((rule) => rule.token.replace(ESQL_TOKEN_POSTFIX, ''));

const validExceptions = [
Expand Down
Loading

0 comments on commit c2ed445

Please sign in to comment.