Skip to content

Commit

Permalink
Merge branch 'main' of github.com:elastic/kibana into config-schema-a…
Browse files Browse the repository at this point in the history
…s-server-only
  • Loading branch information
afharo committed Aug 29, 2024
2 parents 45d3b57 + 2853279 commit 0e21ee6
Show file tree
Hide file tree
Showing 93 changed files with 1,788 additions and 202 deletions.
4 changes: 2 additions & 2 deletions docs/api/dashboard-api.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[[dashboard-api]]
== Import and export dashboard APIs

deprecated::[7.15.0,Both of these APIs have been deprecated in favor of the {api-kibana}/group/endpoint-saved-objects[saved objects API].]
deprecated::[7.15.0,Both of these APIs have been deprecated and will be removed in 9.0.0]

Import and export dashboards with the corresponding saved objects, such as visualizations, saved
searches, and data views.
Expand All @@ -16,4 +16,4 @@ The following import and export dashboard APIs are available:
* <<dashboard-api-export, Export dashboard API>> to export dashboards and corresponding saved objects

include::dashboard/import-dashboard.asciidoc[]
include::dashboard/export-dashboard.asciidoc[]
include::dashboard/export-dashboard.asciidoc[]
2 changes: 0 additions & 2 deletions docs/api/data-views.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ For the latest details, refer to {api-kibana}/group/endpoint-data-views[data vie
WARNING: Do not write documents directly to the `.kibana` index. When you write directly
to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions.

WARNING: Use the data views APIs for managing data views instead of lower-level <<saved-objects-api, saved objects API>>.

2 changes: 1 addition & 1 deletion docs/api/osquery-manager.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

experimental[] Run live queries, manage packs and saved queries

WARNING: Use the osquery manager APIs for managing packs and saved queries instead of lower-level <<saved-objects-api, saved objects API>>.
Use the osquery manager APIs for managing packs and saved queries.

The following osquery manager APIs are available:

Expand Down
7 changes: 1 addition & 6 deletions docs/api/saved-objects.asciidoc
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
[[saved-objects-api]]
== Saved objects APIs

Manage {kib} saved objects, including dashboards, visualizations, and more.

For the latest details, refer to the {api-kibana}/group/endpoint-saved-objects[saved object API].

WARNING: Do not write documents directly to the `.kibana` index. When you write directly
to the `.kibana` index, the data becomes corrupted and permanently breaks future {kib} versions.
For the latest details, refer to the {api-kibana}/group/endpoint-saved-objects[saved objects API].
9 changes: 8 additions & 1 deletion docs/api/short-urls.asciidoc
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
[[short-urls-api]]
== Short URLs APIs

Manage {kib} short URLs.
experimental[] Manage {kib} short URLs.

The following short urls APIs are available:

* <<short-urls-api-create, Create short URL API>>
* <<short-urls-api-get, Get short URL API>>
* <<short-urls-api-delete, Delete short URL API>>
* <<short-urls-api-resolve, Resolve short URL API>>

include::short-urls/create-short-url.asciidoc[]
include::short-urls/get-short-url.asciidoc[]
Expand Down
21 changes: 18 additions & 3 deletions oas_docs/output/kibana.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19031,10 +19031,25 @@ tags:
- name: Fleet uninstall tokens
- description: Machine learning
name: ml
- description: >-
Manage Kibana saved objects, including dashboards, visualizations, and
more.
- description: >
Export sets of saved objects that you want to import into {kib}, resolve
import errors, and rotate an encryption key for encrypted saved objects
with the saved objects APIs.


To manage a specific type of saved object, use the corresponding APIs.

For example, use:


[Data views](../group/endpoint-data-views)


Warning: Do not write documents directly to the `.kibana` index. When you
write directly to the `.kibana` index, the data becomes corrupted and
permanently breaks future Kibana versions.
name: saved objects
x-displayName: Saved objects
- description: 'SLO APIs enable you to define, manage and track service-level objectives'
name: slo
- name: system
26 changes: 23 additions & 3 deletions oas_docs/output/kibana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27592,10 +27592,30 @@ tags:
- name: Fleet uninstall tokens
- description: Machine learning
name: ml
- description: >-
Manage Kibana saved objects, including dashboards, visualizations, and
more.
- description: >
Export sets of saved objects that you want to import into {kib}, resolve
import errors, and rotate an encryption key for encrypted saved objects
with the saved objects APIs.


To manage a specific type of saved object, use the corresponding APIs.

For example, use:


* [Data views](../group/endpoint-data-views)

* [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html)

* [Short
URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html)


Warning: Do not write documents directly to the `.kibana` index. When you
write directly to the `.kibana` index, the data becomes corrupted and
permanently breaks future Kibana versions.
name: saved objects
x-displayName: Saved objects
- description: 'SLO APIs enable you to define, manage and track service-level objectives'
name: slo
- name: system
4 changes: 0 additions & 4 deletions oas_docs/overlays/kibana.overlays.serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ actions:
description: Change displayName
update:
x-displayName: "Machine learning"
- target: '$.tags[?(@.name=="saved objects")]'
description: Change displayName
update:
x-displayName: "Saved objects"
- target: '$.tags[?(@.name=="slo")]'
description: Change displayName
update:
Expand Down
4 changes: 0 additions & 4 deletions oas_docs/overlays/kibana.overlays.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ actions:
description: Change displayName
update:
x-displayName: "Machine learning"
- target: '$.tags[?(@.name=="saved objects")]'
description: Change displayName
update:
x-displayName: "Saved objects"
- target: '$.tags[?(@.name=="slo")]'
description: Change displayName
update:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@
"buildkite-test-collector": "^1.7.0",
"callsites": "^3.1.0",
"chance": "1.0.18",
"chromedriver": "^127.0.3",
"chromedriver": "^128.0.0",
"clean-webpack-plugin": "^3.0.0",
"cli-progress": "^3.12.0",
"cli-table3": "^0.6.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/core/saved-objects/docs/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"tags": [
{
"name": "saved objects",
"description": "Manage Kibana saved objects, including dashboards, visualizations, and more."
"x-displayName": "Saved objects",
"description": "Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.\n\nTo manage a specific type of saved object, use the corresponding APIs.\nFor example, use:\n\n* [Data views](../group/endpoint-data-views)\n* [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html)\n* [Short URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html)\n\nWarning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.\n"
}
],
"paths": {
Expand Down
13 changes: 12 additions & 1 deletion packages/core/saved-objects/docs/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ servers:
- url: /
tags:
- name: saved objects
description: Manage Kibana saved objects, including dashboards, visualizations, and more.
x-displayName: Saved objects
description: |
Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.
To manage a specific type of saved object, use the corresponding APIs.
For example, use:
* [Data views](../group/endpoint-data-views)
* [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html)
* [Short URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html)
Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.
paths:
/api/encrypted_saved_objects/_rotate_key:
post:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"tags": [
{
"name": "saved objects",
"description": "Manage Kibana saved objects, including dashboards, visualizations, and more."
"x-displayName": "Saved objects",
"description": "Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.\n\nTo manage a specific type of saved object, use the corresponding APIs.\nFor example, use:\n\n[Data views](../group/endpoint-data-views)\n\nWarning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.\n"
}
],
"paths": {
Expand Down
11 changes: 10 additions & 1 deletion packages/core/saved-objects/docs/openapi/bundled_serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,16 @@ servers:
default: localhost:5601
tags:
- name: saved objects
description: Manage Kibana saved objects, including dashboards, visualizations, and more.
x-displayName: Saved objects
description: |
Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.
To manage a specific type of saved object, use the corresponding APIs.
For example, use:
[Data views](../group/endpoint-data-views)
Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.
paths:
/api/saved_objects/_export:
post:
Expand Down
13 changes: 12 additions & 1 deletion packages/core/saved-objects/docs/openapi/entrypoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,18 @@ info:
url: https://www.elastic.co/licensing/elastic-license
tags:
- name: saved objects
description: Manage Kibana saved objects, including dashboards, visualizations, and more.
x-displayName: Saved objects
description: |
Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.
To manage a specific type of saved object, use the corresponding APIs.
For example, use:
* [Data views](../group/endpoint-data-views)
* [Spaces](https://www.elastic.co/guide/en/kibana/current/spaces-api.html)
* [Short URLs](https://www.elastic.co/guide/en/kibana/current/short-urls-api.html)
Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.
servers:
- url: /
paths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ info:
url: https://www.elastic.co/licensing/elastic-license
tags:
- name: saved objects
description: Manage Kibana saved objects, including dashboards, visualizations, and more.
x-displayName: Saved objects
description: |
Export sets of saved objects that you want to import into {kib}, resolve import errors, and rotate an encryption key for encrypted saved objects with the saved objects APIs.
To manage a specific type of saved object, use the corresponding APIs.
For example, use:
[Data views](../group/endpoint-data-views)
Warning: Do not write documents directly to the `.kibana` index. When you write directly to the `.kibana` index, the data becomes corrupted and permanently breaks future Kibana versions.
servers:
- url: 'https://{kibana_url}'
variables:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ const runAddTelemetry = (
export const AddPanelFlyout = ({
container,
onAddPanel,
modalTitleId,
}: {
container: PresentationContainer;
onAddPanel?: (id: string) => void;
modalTitleId?: string;
}) => {
const legacyFactoriesBySavedObjectType: LegacyFactoryMap = useMemo(() => {
return [...embeddableStart.getEmbeddableFactories()]
Expand Down Expand Up @@ -187,7 +189,7 @@ export const AddPanelFlyout = ({
<>
<EuiFlyoutHeader hasBorder>
<EuiTitle size="m">
<h2>
<h2 id={modalTitleId}>
{i18n.translate('embeddableApi.addPanel.Title', { defaultMessage: 'Add from library' })}
</h2>
</EuiTitle>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import React, { Suspense } from 'react';

import { OverlayRef } from '@kbn/core/public';
import { EuiLoadingSpinner } from '@elastic/eui';
import { EuiLoadingSpinner, htmlIdGenerator } from '@elastic/eui';
import { toMountPoint } from '@kbn/react-kibana-mount';

import { PresentationContainer } from '@kbn/presentation-containers';
Expand All @@ -20,6 +20,8 @@ const LazyAddPanelFlyout = React.lazy(async () => {
return { default: module.AddPanelFlyout };
});

const htmlId = htmlIdGenerator('modalTitleId');

export const openAddPanelFlyout = ({
container,
onAddPanel,
Expand All @@ -29,21 +31,28 @@ export const openAddPanelFlyout = ({
onAddPanel?: (id: string) => void;
onClose?: () => void;
}): OverlayRef => {
const modalTitleId = htmlId();

// send the overlay ref to the root embeddable if it is capable of tracking overlays
const flyoutSession = core.overlays.openFlyout(
toMountPoint(
<Suspense fallback={<EuiLoadingSpinner />}>
<LazyAddPanelFlyout container={container} onAddPanel={onAddPanel} />
<LazyAddPanelFlyout
container={container}
onAddPanel={onAddPanel}
modalTitleId={modalTitleId}
/>
</Suspense>,
core
),
{
'data-test-subj': 'dashboardAddPanel',
ownFocus: true,
onClose: (overlayRef) => {
if (onClose) onClose();
overlayRef.close();
},
'data-test-subj': 'dashboardAddPanel',
'aria-labelledby': modalTitleId,
}
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const EmptyConvo: React.FC<Props> = ({
setIsSettingsModalVisible,
}) => {
return (
<EuiFlexGroup alignItems="center" justifyContent="center">
<EuiFlexGroup alignItems="center" justifyContent="center" data-test-subj="emptyConvo">
<EuiFlexItem grow={false}>
<EuiPanel
hasShadow={false}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export const WelcomeSetup: React.FC<Props> = ({
text-align: center;
`}
>
<EuiFlexGroup alignItems="center" justifyContent="center" direction="column">
<EuiFlexGroup
alignItems="center"
justifyContent="center"
direction="column"
data-test-subj="welcome-setup"
>
<EuiFlexItem grow={false}>
<AssistantAnimatedIcon />
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ export const FlyoutNavigation = memo<FlyoutNavigationProps>(
size="xs"
color="primary"
iconType="newChat"
data-test-subj="newChatFromOverlay"
onClick={onConversationCreate}
disabled={isLoading || !isAssistantEnabled}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const AssistantTitle: React.FC<{
`}
>
<EuiInlineEditTitle
data-test-subj="conversationTitle"
heading="h2"
inputAriaLabel="Edit text inline"
value={newTitle ?? NEW_CHAT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ export const ConversationSidePanel = React.memo<Props>(
onConversationSelected({ cId: conversation.id, cTitle: conversation.title })
}
label={conversation.title}
data-test-subj={`conversation-select-${conversation.title}`}
isActive={
!isEmpty(conversation.id)
? conversation.id === currentConversation?.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ const AssistantComponent: React.FC<Props> = ({
overflow: hidden;
`}
>
<CommentContainer>
<CommentContainer data-test-subj="assistantChat">
<EuiFlexGroup
css={css`
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,13 @@ const SelectedPromptContextsComponent: React.FC<Props> = ({
<EuiFlexGroup data-test-subj="selectedPromptContexts" direction="column" gutterSize={'s'}>
{Object.keys(selectedPromptContexts)
.sort()
.map((id) => (
.map((id, i) => (
<EuiFlexItem data-test-subj={`selectedPromptContext-${id}`} grow={false} key={id}>
<EuiAccordion
buttonContent={promptContexts[id]?.description}
buttonProps={{
'data-test-subj': `selectedPromptContext-${i}-button`,
}}
extraAction={
<EuiToolTip content={i18n.REMOVE_CONTEXT}>
<EuiButtonIcon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ describe('helpers', () => {

render(<TestProviders>{option.dropdownDisplay}</TestProviders>);

expect(screen.getByTestId('name')).toHaveTextContent(mockSystemPrompt.name);
expect(screen.getByTestId(`systemPrompt-${mockSystemPrompt.name}`)).toHaveTextContent(
mockSystemPrompt.name
);
});

it('shows the expected prompt content in the dropdownDisplay', () => {
Expand Down
Loading

0 comments on commit 0e21ee6

Please sign in to comment.