Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New maps embeddable #175233

Closed
wants to merge 37 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
2ac2782
initialize presentation panel and presentation publishing packages
ThomThomson Nov 27, 2023
4fe15eb
[CI] Auto-commit changed files from 'node scripts/eslint --no-cache -…
kibanamachine Nov 27, 2023
050712c
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Nov 27, 2023
4130eb2
Initialize readmes and add tests
ThomThomson Dec 1, 2023
67a679d
remove Dashboard from embeddable tests
ThomThomson Dec 1, 2023
af34cb7
Merge remote-tracking branch 'refs/remotes/origin/createPresentationP…
ThomThomson Dec 1, 2023
4041175
Fix & add jest tests
ThomThomson Dec 5, 2023
be1b357
remove accidental modifications, fix tsconfig
ThomThomson Dec 5, 2023
067b3fc
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Dec 5, 2023
f396fd1
[CI] Auto-commit changed files from 'node scripts/generate codeowners'
kibanamachine Dec 5, 2023
48a2238
[CI] Auto-commit changed files from 'node scripts/build_plugin_list_d…
kibanamachine Dec 5, 2023
c2d7a88
Merge remote-tracking branch 'upstream/main' into createPresentationP…
ThomThomson Dec 5, 2023
84e0e04
Merge remote-tracking branch 'refs/remotes/origin/createPresentationP…
ThomThomson Dec 6, 2023
e1aea30
fix jest tests & types
ThomThomson Dec 6, 2023
907b80d
fix test subjects
ThomThomson Dec 6, 2023
e5c6593
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Dec 6, 2023
ebf90b1
revert class name changes, make drilldown notification responsive, fi…
ThomThomson Dec 7, 2023
0fcca6a
Merge remote-tracking branch 'refs/remotes/origin/createPresentationP…
ThomThomson Dec 7, 2023
83fc26b
fix more tests
ThomThomson Dec 8, 2023
a3d55e9
Merge remote-tracking branch 'upstream/main' into createPresentationP…
ThomThomson Dec 8, 2023
9874b83
[CI] Auto-commit changed files from 'node scripts/lint_ts_projects --…
kibanamachine Dec 8, 2023
04cd8a4
Merge remote-tracking branch 'upstream/main' into createPresentationP…
ThomThomson Jan 3, 2024
f6bf649
[UnifiedSearch] Expose QueryStringInput via plugin contract (#173810)
shahzad31 Jan 3, 2024
fbd5c38
[artifacts] Publish ubi9 docker image (#170264)
jbudz Jan 3, 2024
1a52b0f
[maps] ES|QL source (#173481)
nreese Jan 3, 2024
3c8d245
[ML][Enterprise Search] Reword E5 model description (#174171)
demjened Jan 3, 2024
610c5b7
[DOCS] Warn against using ES|QL query rules on production environment…
lcawl Jan 3, 2024
9853d73
Upgrade [email protected]→2.9.2 (#174108)
jeramysoucy Jan 3, 2024
70ff1ab
[build] Remove ubi8 (#173873)
jbudz Jan 3, 2024
aef1174
[SLOs] Configuration inspect api and flyout (#173723)
shahzad31 Jan 3, 2024
a881abd
[ML] Fix filter for boolean fields filtering for numbers in Field sta…
qn895 Jan 3, 2024
afd13d2
[Logs Explorer] Add AI assistant to Logs Explorer (#174079)
thomheymann Jan 3, 2024
e0903c9
MapTestPage
nreese Jan 4, 2024
2783584
render map
nreese Jan 4, 2024
c20e71c
PanelNotificationsAction
nreese Jan 5, 2024
1f079fb
get panel actions running
nreese Jan 5, 2024
3b39875
syncronize map movement
nreese Jan 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .buildkite/scripts/steps/artifacts/docker_context.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ case $KIBANA_DOCKER_CONTEXT in
cloud)
DOCKER_CONTEXT_FILE="kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz"
;;
ubi8)
DOCKER_CONTEXT_FILE="kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz"
;;
ubi)
# Currently ubi9. After ubi8 we're moving to a version agnostic filename
DOCKER_CONTEXT_FILE="kibana-ubi-$FULL_VERSION-docker-build-context.tar.gz"
;;
ironbank)
Expand Down
4 changes: 2 additions & 2 deletions .buildkite/scripts/steps/artifacts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ download "kibana-$FULL_VERSION-docker-image.tar.gz"
download "kibana-$FULL_VERSION-docker-image-aarch64.tar.gz"
download "kibana-cloud-$FULL_VERSION-docker-image.tar.gz"
download "kibana-cloud-$FULL_VERSION-docker-image-aarch64.tar.gz"
download "kibana-ubi8-$FULL_VERSION-docker-image.tar.gz"
download "kibana-ubi-$FULL_VERSION-docker-image.tar.gz"

download "kibana-$FULL_VERSION-arm64.deb"
download "kibana-$FULL_VERSION-amd64.deb"
Expand All @@ -30,7 +30,7 @@ download "kibana-$FULL_VERSION-aarch64.rpm"
download "kibana-$FULL_VERSION-docker-build-context.tar.gz"
download "kibana-cloud-$FULL_VERSION-docker-build-context.tar.gz"
download "kibana-ironbank-$FULL_VERSION-docker-build-context.tar.gz"
download "kibana-ubi8-$FULL_VERSION-docker-build-context.tar.gz"
download "kibana-ubi-$FULL_VERSION-docker-build-context.tar.gz"

download "kibana-$FULL_VERSION-linux-aarch64.tar.gz"
download "kibana-$FULL_VERSION-linux-x86_64.tar.gz"
Expand Down
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,10 @@ packages/kbn-plugin-generator @elastic/kibana-operations
packages/kbn-plugin-helpers @elastic/kibana-operations
examples/portable_dashboards_example @elastic/kibana-presentation
examples/preboot_example @elastic/kibana-security @elastic/kibana-core
packages/presentation/kbn-presentation-containers @elastic/kibana-presentation
packages/presentation/kbn-presentation-library @elastic/kibana-presentation
src/plugins/presentation_panel @elastic/kibana-presentation
packages/presentation/kbn-presentation-publishing @elastic/kibana-presentation
src/plugins/presentation_util @elastic/kibana-presentation
x-pack/plugins/profiling_data_access @elastic/obs-ux-infra_services-team
x-pack/plugins/profiling @elastic/obs-ux-infra_services-team
Expand Down
4 changes: 4 additions & 0 deletions docs/developer/plugin-list.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ Content is fetched from the remote (https://feeds.elastic.co) once a day, with p
|Helps to globally configure the no data page components


|{kib-repo}blob/{branch}/src/plugins/presentation_panel/README.md[presentationPanel]
|The Presentation Panel is the point of contact between any React component and any registered UI actions. Components provided to the Presentation Panel should use an imperative handle to expose methods and state.


|{kib-repo}blob/{branch}/src/plugins/presentation_util/README.mdx[presentationUtil]
|The Presentation Utility Plugin is a set of common, shared components and toolkits for solutions within the Presentation space, (e.g. Dashboards, Canvas).

Expand Down
2 changes: 1 addition & 1 deletion docs/user/alerting/rule-types/es-query.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ For example:
If you use {kibana-ref}/kuery-query.html[KQL] or {kibana-ref}/lucene-query.html[Lucene], you must specify a data view then define a text-based query.
For example, `http.request.referrer: "https://example.com"`.

preview:[] If you use {ref}/esql.html[ES|QL], you must provide a source command followed by an optional series of processing commands, separated by pipe characters (|).
preview:["Do not use {esql} on production environments. This functionality is in technical preview and may be changed or removed in a future release. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features."] If you use {ref}/esql.html[ES|QL], you must provide a source command followed by an optional series of processing commands, separated by pipe characters (|).
For example:

[source,sh]
Expand Down
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,10 @@
"@kbn/panel-loader": "link:packages/kbn-panel-loader",
"@kbn/portable-dashboards-example": "link:examples/portable_dashboards_example",
"@kbn/preboot-example-plugin": "link:examples/preboot_example",
"@kbn/presentation-containers": "link:packages/presentation/kbn-presentation-containers",
"@kbn/presentation-library": "link:packages/presentation/kbn-presentation-library",
"@kbn/presentation-panel-plugin": "link:src/plugins/presentation_panel",
"@kbn/presentation-publishing": "link:packages/presentation/kbn-presentation-publishing",
"@kbn/presentation-util-plugin": "link:src/plugins/presentation_util",
"@kbn/profiling-data-access-plugin": "link:x-pack/plugins/profiling_data_access",
"@kbn/profiling-plugin": "link:x-pack/plugins/profiling",
Expand Down Expand Up @@ -1111,6 +1115,7 @@
"vega-spec-injector": "^0.0.2",
"vega-tooltip": "^0.28.0",
"vinyl": "^2.2.0",
"wellknown": "^0.5.0",
"whatwg-fetch": "^3.0.0",
"xml2js": "^0.5.0",
"xstate": "^4.38.2",
Expand Down Expand Up @@ -1582,7 +1587,7 @@
"jsondiffpatch": "0.4.1",
"license-checker": "^25.0.1",
"listr": "^0.14.1",
"lmdb": "^2.6.9",
"lmdb": "^2.9.2",
"loader-utils": "^2.0.4",
"marge": "^1.0.1",
"micromatch": "^4.0.5",
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es-query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export {
getAggregateQueryMode,
getIndexPatternFromSQLQuery,
getIndexPatternFromESQLQuery,
getLimitFromESQLQuery,
getLanguageDisplayName,
cleanupESQLQueryForLensSuggestions,
} from './src/es_query';
Expand Down
28 changes: 28 additions & 0 deletions packages/kbn-es-query/src/es_query/es_aggregate_query.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
getAggregateQueryMode,
getIndexPatternFromSQLQuery,
getIndexPatternFromESQLQuery,
getLimitFromESQLQuery,
cleanupESQLQueryForLensSuggestions,
} from './es_aggregate_query';

Expand Down Expand Up @@ -117,6 +118,33 @@ describe('sql query helpers', () => {
});
});

describe('getLimitFromESQLQuery', () => {
it('should return default limit when ES|QL query is empty', () => {
const limit = getLimitFromESQLQuery('');
expect(limit).toBe(500);
});

it('should return default limit when ES|QL query does not contain LIMIT command', () => {
const limit = getLimitFromESQLQuery('FROM foo');
expect(limit).toBe(500);
});

it('should return default limit when ES|QL query contains invalid LIMIT command', () => {
const limit = getLimitFromESQLQuery('FROM foo | LIMIT iAmNotANumber');
expect(limit).toBe(500);
});

it('should return limit when ES|QL query contains LIMIT command', () => {
const limit = getLimitFromESQLQuery('FROM foo | LIMIT 10000 | KEEP myField');
expect(limit).toBe(10000);
});

it('should return last limit when ES|QL query contains multiple LIMIT command', () => {
const limit = getLimitFromESQLQuery('FROM foo | LIMIT 200 | LIMIT 0');
expect(limit).toBe(0);
});
});

describe('cleanupESQLQueryForLensSuggestions', () => {
it('should not remove anything if a drop command is not present', () => {
expect(cleanupESQLQueryForLensSuggestions('from a | eval b = 1')).toBe('from a | eval b = 1');
Expand Down
14 changes: 14 additions & 0 deletions packages/kbn-es-query/src/es_query/es_aggregate_query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/

import type { Query, AggregateQuery } from '../filters';

type Language = keyof AggregateQuery;

const DEFAULT_ESQL_LIMIT = 500;

// Checks if the query is of type Query
export function isOfQueryType(arg?: Query | AggregateQuery): arg is Query {
return Boolean(arg && 'query' in arg);
Expand Down Expand Up @@ -67,6 +70,17 @@ export function getIndexPatternFromESQLQuery(esql?: string): string {
return '';
}

export function getLimitFromESQLQuery(esql: string): number {
const limitCommands = esql.match(new RegExp(/LIMIT\s[0-9]+/, 'ig'));
if (!limitCommands) {
return DEFAULT_ESQL_LIMIT;
}

const lastIndex = limitCommands.length - 1;
const split = limitCommands[lastIndex].split(' ');
return parseInt(split[1], 10);
}

export function cleanupESQLQueryForLensSuggestions(esql?: string): string {
const pipes = (esql || '').split('|');
return pipes.filter((statement) => !/DROP\s/i.test(statement)).join('|');
Expand Down
1 change: 1 addition & 0 deletions packages/kbn-es-query/src/es_query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export {
getIndexPatternFromSQLQuery,
getLanguageDisplayName,
getIndexPatternFromESQLQuery,
getLimitFromESQLQuery,
cleanupESQLQueryForLensSuggestions,
} from './es_aggregate_query';
export { fromCombinedFilter } from './from_combined_filter';
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-es-types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ export type {
ESFilter,
MaybeReadonlyArray,
ClusterDetails,
ESQLColumn,
ESQLRow,
ESQLSearchReponse,
} from './src';
6 changes: 6 additions & 0 deletions packages/kbn-es-types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import {
AggregateOfMap as AggregationResultOfMap,
SearchHit,
ClusterDetails,
ESQLColumn,
ESQLRow,
ESQLSearchReponse,
} from './search';

export type ESFilter = estypes.QueryDslQueryContainer;
Expand Down Expand Up @@ -41,4 +44,7 @@ export type {
AggregationResultOfMap,
SearchHit,
ClusterDetails,
ESQLColumn,
ESQLRow,
ESQLSearchReponse,
};
12 changes: 12 additions & 0 deletions packages/kbn-es-types/src/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,3 +653,15 @@ export interface ClusterDetails {
_shards?: estypes.ShardStatistics;
failures?: estypes.ShardFailure[];
}

export interface ESQLColumn {
name: string;
type: string;
}

export type ESQLRow = unknown[];

export interface ESQLSearchReponse {
columns: ESQLColumn[];
values: ESQLRow[];
}
1 change: 1 addition & 0 deletions packages/kbn-optimizer/limits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ pageLoadAssetSize:
observabilityShared: 52256
osquery: 107090
painlessLab: 179748
presentationPanel: 55463
presentationUtil: 58834
profiling: 36694
remoteClusters: 51327
Expand Down
13 changes: 12 additions & 1 deletion packages/kbn-panel-loader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,25 @@

import React from 'react';
import { EuiLoadingChart, EuiPanel } from '@elastic/eui';
import { css } from '@emotion/react';

export const PanelLoader = (props: { showShadow?: boolean; dataTestSubj?: string }) => {
return (
<EuiPanel
css={css`
z-index: auto;
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
min-height: $euiSizeL + 2px;
position: relative;
justify-content: center;
align-items: center;
`}
role="figure"
paddingSize="none"
hasShadow={props.showShadow ?? false}
className={'embPanel embPanel--loading embPanel-isLoading'}
data-test-subj={props.dataTestSubj}
>
<EuiLoadingChart size="l" mono />
Expand Down
3 changes: 3 additions & 0 deletions packages/kbn-text-based-editor/src/editor_footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ interface EditorFooterProps {
disableSubmitAction?: boolean;
editorIsInline?: boolean;
isSpaceReduced?: boolean;
isLoading?: boolean;
}

export const EditorFooter = memo(function EditorFooter({
Expand All @@ -214,6 +215,7 @@ export const EditorFooter = memo(function EditorFooter({
disableSubmitAction,
editorIsInline,
isSpaceReduced,
isLoading,
}: EditorFooterProps) {
const { euiTheme } = useEuiTheme();
const [isErrorPopoverOpen, setIsErrorPopoverOpen] = useState(false);
Expand Down Expand Up @@ -331,6 +333,7 @@ export const EditorFooter = memo(function EditorFooter({
size="s"
fill
onClick={runQuery}
isLoading={isLoading}
isDisabled={Boolean(disableSubmitAction)}
data-test-subj="TextBasedLangEditor-run-query-button"
minWidth={isSpaceReduced ? false : undefined}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ export interface TextBasedLanguagesEditorProps {
errors?: Error[];
/** Warning string as it comes from ES */
warning?: string;
/** Disables the editor and displays loading icon in run button */
isLoading?: boolean;
/** Disables the editor */
isDisabled?: boolean;
/** Indicator if the editor is on dark mode */
Expand Down Expand Up @@ -149,6 +151,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({
detectTimestamp = false,
errors: serverErrors,
warning: serverWarning,
isLoading,
isDisabled,
isDarkMode,
hideMinimizeButton,
Expand Down Expand Up @@ -540,7 +543,9 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({
},
overviewRulerBorder: false,
readOnly:
isDisabled || Boolean(!isCompactFocused && codeOneLiner && codeOneLiner.includes('...')),
isLoading ||
isDisabled ||
Boolean(!isCompactFocused && codeOneLiner && codeOneLiner.includes('...')),
};

if (isCompactFocused) {
Expand Down Expand Up @@ -836,6 +841,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({
disableSubmitAction={disableSubmitAction}
hideRunQueryText={hideRunQueryText}
isSpaceReduced={isSpaceReduced}
isLoading={isLoading}
/>
)}
</div>
Expand Down Expand Up @@ -925,6 +931,7 @@ export const TextBasedLanguagesEditor = memo(function TextBasedLanguagesEditor({
editorIsInline={editorIsInline}
disableSubmitAction={disableSubmitAction}
isSpaceReduced={isSpaceReduced}
isLoading={isLoading}
{...editorMessages}
/>
)}
Expand Down
3 changes: 3 additions & 0 deletions packages/presentation/kbn-presentation-containers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @kbn/presentation-containers

Contains interfaces and type guards which can be used to define and consume "containers" which are pages or elements which render multiple panels.
22 changes: 22 additions & 0 deletions packages/presentation/kbn-presentation-containers/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* 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.
*/

export {
apiCanDuplicatePanels,
apiCanExpandPanels,
useExpandedPanelId,
type CanDuplicatePanels,
type CanExpandPanels,
} from './interfaces/panel_management';
export {
apiIsPresentationContainer,
getContainerParentFromAPI,
type PanelPackage,
type PresentationContainer,
} from './interfaces/presentation_container';
export { tracksOverlays, type TracksOverlays } from './interfaces/tracks_overlays';
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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 {
PublishingSubject,
useReactiveVarFromSubject,
} from '@kbn/presentation-publishing/publishing_utils';

export interface CanDuplicatePanels {
duplicatePanel: (panelId: string) => void;
}

export const apiCanDuplicatePanels = (
unknownApi: unknown | null
): unknownApi is CanDuplicatePanels => {
return Boolean((unknownApi as CanDuplicatePanels)?.duplicatePanel !== undefined);
};

export interface CanExpandPanels {
expandPanel: (panelId?: string) => void;
expandedPanelId: PublishingSubject<string | undefined>;
}

export const apiCanExpandPanels = (unknownApi: unknown | null): unknownApi is CanExpandPanels => {
return Boolean((unknownApi as CanExpandPanels)?.expandPanel !== undefined);
};

/**
* Gets this API's expanded panel state as a reactive variable which will cause re-renders on change.
*/
export const useExpandedPanelId = (api: Partial<CanExpandPanels> | undefined) =>
useReactiveVarFromSubject<string | undefined, CanExpandPanels['expandedPanelId']>(
apiCanExpandPanels(api) ? api.expandedPanelId : undefined
);
Loading