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

Update documentation/examples of deprecated namespaceAgnostic field #68039

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ import { SavedObjectsType } from 'src/core/server';
export const myType: SavedObjectsType = {
name: 'my-type',
hidden: false,
namespaceAgnostic: true,
namespaceType: 'single',
mappings: {
properties: {
someField: {
Expand Down
6 changes: 3 additions & 3 deletions src/core/MIGRATION_EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ import { SavedObjectsType } from 'src/core/server';
export const firstType: SavedObjectsType = {
name: 'first-type',
hidden: false,
namespaceAgnostic: true,
namespaceType: 'agnostic',
mappings: {
properties: {
someField: {
Expand Down Expand Up @@ -888,7 +888,7 @@ import { SavedObjectsType } from 'src/core/server';
export const secondType: SavedObjectsType = {
name: 'second-type',
hidden: true,
namespaceAgnostic: false,
namespaceType: 'single',
mappings: {
properties: {
textField: {
Expand Down Expand Up @@ -936,7 +936,7 @@ export class MyPlugin implements Plugin {

The NP `registerType` expected input is very close to the legacy format. However, there are some minor changes:

- The `schema.isNamespaceAgnostic` property has been renamed: `SavedObjectsType.namespaceAgnostic`
- The `schema.isNamespaceAgnostic` property has been renamed: `SavedObjectsType.namespaceType`. It no longer accepts a boolean but instead an enum of 'single', 'multiple', or 'agnostic' (see [SavedObjectsNamespaceType](/docs/development/core/server/kibana-plugin-core-server.savedobjectsnamespacetype.md)).

- The `schema.indexPattern` was accepting either a `string` or a `(config: LegacyConfig) => string`. `SavedObjectsType.indexPattern` only accepts a string, as you can access the configuration during your plugin's setup phase.

Expand Down