mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
## Summary
close https://github.com/elastic/kibana/issues/161545
close https://github.com/elastic/kibana/issues/153257
This PR makes `SavedObjectFinder` component backward compatible. It is
achieved by going through content- management layer, more technical
details
[here](https://docs.google.com/document/d/1ssYmqSEUPrsuCR4iz8DohkEWekoYrm2yL4QR_fVxXLg/edit)
### Testing
`SavedObjectFinder` is this component that allows to pick a saved object
(supports: `search` `index-pattern` `map` `visualization` `lens`
`event-annotation-group`:
![Screenshot 2023-08-07 at 16 53
32](
|
||
---|---|---|
.. | ||
src | ||
index.ts | ||
jest.config.js | ||
kibana.jsonc | ||
package.json | ||
README.md | ||
tsconfig.json |
Content management utils
Utilities to ease the implementation of the Content Management API with Saved Objects.
import type {
ContentManagementCrudTypes,
CreateOptions,
SearchOptions,
UpdateOptions,
} from '@kbn/content-management-utils';
import { MapContentType } from '../types';
export type MapCrudTypes = ContentManagementCrudTypes<MapContentType, MapAttributes>;
/* eslint-disable-next-line @typescript-eslint/consistent-type-definitions */
export type MapAttributes = {
title: string;
description?: string;
mapStateJSON?: string;
layerListJSON?: string;
uiStateJSON?: string;
};
export type MapItem = MapCrudTypes['Item'];
export type PartialMapItem = MapCrudTypes['PartialItem'];
// ----------- GET --------------
export type MapGetIn = MapCrudTypes['GetIn'];
export type MapGetOut = MapCrudTypes['GetOut'];
// ----------- CREATE --------------
export type MapCreateIn = MapCrudTypes['CreateIn'];
export type MapCreateOut = MapCrudTypes['CreateOut'];
export type MapCreateOptions = CreateOptions;
// ----------- UPDATE --------------
export type MapUpdateIn = MapCrudTypes['UpdateIn'];
export type MapUpdateOut = MapCrudTypes['UpdateOut'];
export type MapUpdateOptions = UpdateOptions;
// ----------- DELETE --------------
export type MapDeleteIn = MapCrudTypes['DeleteIn'];
export type MapDeleteOut = MapCrudTypes['DeleteOut'];
// ----------- SEARCH --------------
export type MapSearchIn = MapCrudTypes['SearchIn'];
export type MapSearchOut = MapCrudTypes['SearchOut'];
export type MapSearchOptions = SearchOptions;