-
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.
- Loading branch information
Showing
84 changed files
with
475 additions
and
816 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
"developerExamples", | ||
"kibanaReact", | ||
"savedObjectsTaggingOss" | ||
] | ||
], | ||
"requiredBundles": ["savedObjectsFinder"] | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
examples/content_management_examples/public/examples/finder/finder_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,49 @@ | ||
/* | ||
* 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 type { CoreStart } from '@kbn/core/public'; | ||
import { I18nProvider } from '@kbn/i18n-react'; | ||
import { SavedObjectTaggingOssPluginStart } from '@kbn/saved-objects-tagging-oss-plugin/public'; | ||
import { SavedObjectFinder } from '@kbn/saved-objects-finder-plugin/public'; | ||
|
||
export const FinderApp = (props: { | ||
contentClient: ContentClient; | ||
core: CoreStart; | ||
savedObjectsTagging: SavedObjectTaggingOssPluginStart; | ||
}) => { | ||
return ( | ||
<ContentClientProvider contentClient={props.contentClient}> | ||
<I18nProvider> | ||
<SavedObjectFinder | ||
showFilter={true} | ||
services={{ | ||
savedObjectsTagging: props.savedObjectsTagging.getTaggingApi(), | ||
contentClient: props.contentClient, | ||
}} | ||
onChoose={(...args) => { | ||
alert(JSON.stringify(args)); | ||
}} | ||
savedObjectMetaData={[ | ||
{ | ||
type: `search`, | ||
getIconForSavedObject: () => 'discoverApp', | ||
name: 'Saved search', | ||
}, | ||
{ | ||
type: 'index-pattern', | ||
getIconForSavedObject: () => 'indexPatternApp', | ||
name: 'Data view', | ||
}, | ||
]} | ||
/> | ||
</I18nProvider> | ||
</ContentClientProvider> | ||
); | ||
}; |
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
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
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
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
17 changes: 17 additions & 0 deletions
17
src/plugins/dashboard/public/services/content_management/content_management_service.stub.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,17 @@ | ||
/* | ||
* 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 { PluginServiceFactory } from '@kbn/presentation-util-plugin/public'; | ||
import { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; | ||
import { contentManagementMock } from '@kbn/content-management-plugin/public/mocks'; | ||
|
||
export type ContentManagementServiceFactory = PluginServiceFactory<ContentManagementPublicStart>; | ||
|
||
export const contentManagementServiceFactory: ContentManagementServiceFactory = () => { | ||
return contentManagementMock.createStartContract(); | ||
}; |
24 changes: 24 additions & 0 deletions
24
src/plugins/dashboard/public/services/content_management/content_management_service.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,24 @@ | ||
/* | ||
* 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 { KibanaPluginServiceFactory } from '@kbn/presentation-util-plugin/public'; | ||
import { ContentManagementPublicStart } from '@kbn/content-management-plugin/public'; | ||
import { DashboardStartDependencies } from '../../plugin'; | ||
|
||
export type ContentManagementServiceFactory = KibanaPluginServiceFactory< | ||
ContentManagementPublicStart, | ||
DashboardStartDependencies | ||
>; | ||
|
||
export const contentManagementServiceFactory: ContentManagementServiceFactory = ({ | ||
startPlugins, | ||
}) => { | ||
const { contentManagement } = startPlugins; | ||
|
||
return contentManagement; | ||
}; |
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
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
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
Oops, something went wrong.