From a765a48ff9e87021653e1869a33d7e6f681fe703 Mon Sep 17 00:00:00 2001 From: Constance Date: Wed, 3 Jun 2020 12:40:11 -0700 Subject: [PATCH] Update documentation/examples of deprecated namespaceAgnostic field (#68039) * Update documentation/examples of deprecated namespaceAgnostic field to namespaceType * Update src/core/CONVENTIONS.md Co-authored-by: Brandon Kobel Co-authored-by: Brandon Kobel --- src/core/CONVENTIONS.md | 2 +- src/core/MIGRATION_EXAMPLES.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/CONVENTIONS.md b/src/core/CONVENTIONS.md index a82cc27839a1d..afcc122c11b90 100644 --- a/src/core/CONVENTIONS.md +++ b/src/core/CONVENTIONS.md @@ -302,7 +302,7 @@ import { SavedObjectsType } from 'src/core/server'; export const myType: SavedObjectsType = { name: 'my-type', hidden: false, - namespaceAgnostic: true, + namespaceType: 'single', mappings: { properties: { someField: { diff --git a/src/core/MIGRATION_EXAMPLES.md b/src/core/MIGRATION_EXAMPLES.md index c91c00bc1aa02..59a142fa3ebd7 100644 --- a/src/core/MIGRATION_EXAMPLES.md +++ b/src/core/MIGRATION_EXAMPLES.md @@ -844,7 +844,7 @@ import { SavedObjectsType } from 'src/core/server'; export const firstType: SavedObjectsType = { name: 'first-type', hidden: false, - namespaceAgnostic: true, + namespaceType: 'agnostic', mappings: { properties: { someField: { @@ -882,7 +882,7 @@ import { SavedObjectsType } from 'src/core/server'; export const secondType: SavedObjectsType = { name: 'second-type', hidden: true, - namespaceAgnostic: false, + namespaceType: 'single', mappings: { properties: { textField: { @@ -930,7 +930,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.