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 <brandon.kobel@gmail.com>

Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
This commit is contained in:
Constance 2020-06-03 12:40:11 -07:00 committed by GitHub
parent ee323bd86e
commit b3e7ab3f5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -336,7 +336,7 @@ import { SavedObjectsType } from 'src/core/server';
export const myType: SavedObjectsType = {
name: 'my-type',
hidden: false,
namespaceAgnostic: true,
namespaceType: 'single',
mappings: {
properties: {
someField: {

View file

@ -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: {
@ -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: {
@ -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.