-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fleet/openapi-tags
- Loading branch information
Showing
160 changed files
with
3,749 additions
and
1,860 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[[cases-api-find-case-activity]] | ||
== Find case activity API | ||
++++ | ||
<titleabbrev>Find case activity</titleabbrev> | ||
++++ | ||
|
||
Finds user activity for a case. | ||
|
||
[NOTE] | ||
==== | ||
For the most up-to-date API details, refer to the | ||
{kib-repo}/tree/{branch}/x-pack/plugins/cases/docs/openapi[open API specification]. For a preview, check out <<case-apis>>. | ||
==== | ||
|
||
=== {api-request-title} | ||
|
||
`GET <kibana host>:<port>/api/cases/<case_id>/user_actions/_find` | ||
|
||
`GET <kibana host>:<port>/s/<space_id>/api/cases/<case_id>/user_actions/_find` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Content Management Examples | ||
|
||
An example plugin that shows how to integrate with the Kibana "content management" plugin. |
9 changes: 9 additions & 0 deletions
9
examples/content_management_examples/common/examples/todos/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* 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 * from './todos'; |
63 changes: 63 additions & 0 deletions
63
examples/content_management_examples/common/examples/todos/todos.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* 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 { schema } from '@kbn/config-schema'; | ||
import { | ||
CreateIn, | ||
DeleteIn, | ||
GetIn, | ||
SearchIn, | ||
UpdateIn, | ||
} from '@kbn/content-management-plugin/common'; | ||
|
||
export const TODO_CONTENT_ID = 'todos'; | ||
export interface Todo { | ||
id: string; | ||
title: string; | ||
completed: boolean; | ||
} | ||
const todoSchema = schema.object({ | ||
id: schema.string(), | ||
title: schema.string(), | ||
completed: schema.boolean(), | ||
}); | ||
|
||
export type TodoCreateIn = CreateIn<'todos', { title: string }>; | ||
export type TodoCreateOut = Todo; // TODO: Is this correct? | ||
export const createInSchema = schema.object({ title: schema.string() }); | ||
export const createOutSchema = todoSchema; | ||
|
||
export type TodoUpdateIn = UpdateIn<'todos', Partial<Omit<Todo, 'id'>>>; | ||
export type TodoUpdateOut = Todo; | ||
export const updateInSchema = schema.object({ | ||
title: schema.maybe(schema.string()), | ||
completed: schema.maybe(schema.boolean()), | ||
}); | ||
export const updateOutSchema = todoSchema; | ||
|
||
export type TodoDeleteIn = DeleteIn<'todos', { id: string }>; | ||
export type TodoDeleteOut = void; | ||
|
||
export type TodoGetIn = GetIn<'todos'>; | ||
export type TodoGetOut = Todo; | ||
export const getOutSchema = todoSchema; | ||
|
||
export type TodoSearchIn = SearchIn<'todos', { filter?: 'todo' | 'completed' }>; | ||
export interface TodoSearchOut { | ||
hits: Todo[]; | ||
} | ||
export const searchInSchema = schema.object({ | ||
filter: schema.maybe( | ||
schema.oneOf([schema.literal('todo'), schema.literal('completed')], { | ||
defaultValue: undefined, | ||
}) | ||
), | ||
}); | ||
export const searchOutSchema = schema.object({ | ||
hits: schema.arrayOf(todoSchema), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
module.exports = { | ||
preset: '@kbn/test', | ||
rootDir: '../..', | ||
roots: ['<rootDir>/examples/content_management_examples'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"type": "plugin", | ||
"id": "@kbn/content-management-examples-plugin", | ||
"owner": "@elastic/appex-sharedux", | ||
"description": "Example plugin integrating with content management plugin", | ||
"plugin": { | ||
"id": "contentManagementExamples", | ||
"server": true, | ||
"browser": true, | ||
"requiredPlugins": [ | ||
"contentManagement", | ||
"developerExamples" | ||
] | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
examples/content_management_examples/public/examples/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import { EuiPageTemplate } from '@elastic/eui'; | ||
import { AppMountParameters, CoreStart } from '@kbn/core/public'; | ||
import { StartDeps } from '../types'; | ||
import { TodoApp } from './todos'; | ||
|
||
export const renderApp = ( | ||
{ notifications }: CoreStart, | ||
{ contentManagement }: StartDeps, | ||
{ element }: AppMountParameters | ||
) => { | ||
ReactDOM.render( | ||
<EuiPageTemplate offset={0}> | ||
<EuiPageTemplate.Section> | ||
<TodoApp contentClient={contentManagement.client} /> | ||
</EuiPageTemplate.Section> | ||
</EuiPageTemplate>, | ||
element | ||
); | ||
|
||
return () => ReactDOM.unmountComponentAtNode(element); | ||
}; |
9 changes: 9 additions & 0 deletions
9
examples/content_management_examples/public/examples/todos/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* 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 { TodoApp } from './todo_app'; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
examples/content_management_examples/public/examples/todos/todo_app.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/* | ||
* 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 React from 'react'; | ||
import { ContentClientProvider, type ContentClient } from '@kbn/content-management-plugin/public'; | ||
import { Todos } from './todos'; | ||
|
||
export const TodoApp = (props: { contentClient: ContentClient }) => { | ||
return ( | ||
<ContentClientProvider contentClient={props.contentClient}> | ||
<Todos /> | ||
</ContentClientProvider> | ||
); | ||
}; |
Oops, something went wrong.