Skip to content

Commit

Permalink
Update documentation/examples of deprecated namespaceAgnostic field (#…
Browse files Browse the repository at this point in the history
…68039) (#68195)

* 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>

Co-authored-by: Brandon Kobel <brandon.kobel@gmail.com>
  • Loading branch information
Constance and kobelb authored Jun 3, 2020
1 parent 289e1c8 commit be8bdd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/core/CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
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 @@ -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: {
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit be8bdd7

Please sign in to comment.