Skip to content

Commit ff3c064

Browse files
Merge branch 'master' into canvas-to-np
2 parents 5bfda40 + 497c5da commit ff3c064

File tree

172 files changed

+2725
-1251
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+2725
-1251
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-core-public](./kibana-plugin-core-public.md) &gt; [AppBase](./kibana-plugin-core-public.appbase.md) &gt; [defaultPath](./kibana-plugin-core-public.appbase.defaultpath.md)
4+
5+
## AppBase.defaultPath property
6+
7+
Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the `path` option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)<!-- -->\`<!-- -->, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar.
8+
9+
<b>Signature:</b>
10+
11+
```typescript
12+
defaultPath?: string;
13+
```

docs/development/core/public/kibana-plugin-core-public.appbase.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export interface AppBase
1818
| [capabilities](./kibana-plugin-core-public.appbase.capabilities.md) | <code>Partial&lt;Capabilities&gt;</code> | Custom capabilities defined by the app. |
1919
| [category](./kibana-plugin-core-public.appbase.category.md) | <code>AppCategory</code> | The category definition of the product See [AppCategory](./kibana-plugin-core-public.appcategory.md) See DEFAULT\_APP\_CATEGORIES for more reference |
2020
| [chromeless](./kibana-plugin-core-public.appbase.chromeless.md) | <code>boolean</code> | Hide the UI chrome when the application is mounted. Defaults to <code>false</code>. Takes precedence over chrome service visibility settings. |
21+
| [defaultPath](./kibana-plugin-core-public.appbase.defaultpath.md) | <code>string</code> | Allow to define the default path a user should be directed to when navigating to the app. When defined, this value will be used as a default for the <code>path</code> option when calling [navigateToApp](./kibana-plugin-core-public.applicationstart.navigatetoapp.md)<!-- -->\`<!-- -->, and will also be appended to the [application navLink](./kibana-plugin-core-public.chromenavlink.md) in the navigation bar. |
2122
| [euiIconType](./kibana-plugin-core-public.appbase.euiicontype.md) | <code>string</code> | A EUI iconType that will be used for the app's icon. This icon takes precendence over the <code>icon</code> property. |
2223
| [icon](./kibana-plugin-core-public.appbase.icon.md) | <code>string</code> | A URL to an image file used as an icon. Used as a fallback if <code>euiIconType</code> is not provided. |
2324
| [id](./kibana-plugin-core-public.appbase.id.md) | <code>string</code> | The unique identifier of the application |

docs/development/core/public/kibana-plugin-core-public.appupdatablefields.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Defines the list of fields that can be updated via an [AppUpdater](./kibana-plug
99
<b>Signature:</b>
1010

1111
```typescript
12-
export declare type AppUpdatableFields = Pick<AppBase, 'status' | 'navLinkStatus' | 'tooltip'>;
12+
export declare type AppUpdatableFields = Pick<AppBase, 'status' | 'navLinkStatus' | 'tooltip' | 'defaultPath'>;
1313
```

docs/development/core/public/kibana-plugin-core-public.chromenavlink.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ export interface ChromeNavLink
2929
| [subUrlBase](./kibana-plugin-core-public.chromenavlink.suburlbase.md) | <code>string</code> | A url base that legacy apps can set to match deep URLs to an application. |
3030
| [title](./kibana-plugin-core-public.chromenavlink.title.md) | <code>string</code> | The title of the application. |
3131
| [tooltip](./kibana-plugin-core-public.chromenavlink.tooltip.md) | <code>string</code> | A tooltip shown when hovering over an app link. |
32-
| [url](./kibana-plugin-core-public.chromenavlink.url.md) | <code>string</code> | A url that legacy apps can set to deep link into their applications. |
32+
| [url](./kibana-plugin-core-public.chromenavlink.url.md) | <code>string</code> | The route used to open the [default path](./kibana-plugin-core-public.appbase.defaultpath.md) of an application. If unset, <code>baseUrl</code> will be used instead. |
3333

docs/development/core/public/kibana-plugin-core-public.chromenavlink.url.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
## ChromeNavLink.url property
66

7-
> Warning: This API is now obsolete.
8-
>
9-
>
10-
11-
A url that legacy apps can set to deep link into their applications.
7+
The route used to open the [default path](./kibana-plugin-core-public.appbase.defaultpath.md) of an application. If unset, `baseUrl` will be used instead.
128

139
<b>Signature:</b>
1410

docs/development/core/server/kibana-plugin-core-server.savedobjectmigrationfn.md

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,36 @@ A migration function for a [saved object type](./kibana-plugin-core-server.saved
99
<b>Signature:</b>
1010

1111
```typescript
12-
export declare type SavedObjectMigrationFn = (doc: SavedObjectUnsanitizedDoc, context: SavedObjectMigrationContext) => SavedObjectUnsanitizedDoc;
12+
export declare type SavedObjectMigrationFn<InputAttributes = unknown, MigratedAttributes = unknown> = (doc: SavedObjectUnsanitizedDoc<InputAttributes>, context: SavedObjectMigrationContext) => SavedObjectUnsanitizedDoc<MigratedAttributes>;
1313
```
1414

1515
## Example
1616

1717

1818
```typescript
19-
const migrateProperty: SavedObjectMigrationFn = (doc, { log }) => {
20-
if(doc.attributes.someProp === null) {
21-
log.warn('Skipping migration');
22-
} else {
23-
doc.attributes.someProp = migrateProperty(doc.attributes.someProp);
24-
}
25-
26-
return doc;
19+
interface TypeV1Attributes {
20+
someKey: string;
21+
obsoleteProperty: number;
2722
}
2823

24+
interface TypeV2Attributes {
25+
someKey: string;
26+
newProperty: string;
27+
}
28+
29+
const migrateToV2: SavedObjectMigrationFn<TypeV1Attributes, TypeV2Attributes> = (doc, { log }) => {
30+
const { obsoleteProperty, ...otherAttributes } = doc.attributes;
31+
// instead of mutating `doc` we make a shallow copy so that we can use separate types for the input
32+
// and output attributes. We don't need to make a deep copy, we just need to ensure that obsolete
33+
// attributes are not present on the returned doc.
34+
return {
35+
...doc,
36+
attributes: {
37+
...otherAttributes,
38+
newProperty: migrate(obsoleteProperty),
39+
},
40+
};
41+
};
42+
2943
```
3044

docs/development/core/server/kibana-plugin-core-server.savedobjectsanitizeddoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Describes Saved Object documents that have passed through the migration framewor
99
<b>Signature:</b>
1010

1111
```typescript
12-
export declare type SavedObjectSanitizedDoc = SavedObjectDoc & Referencable;
12+
export declare type SavedObjectSanitizedDoc<T = unknown> = SavedObjectDoc<T> & Referencable;
1313
```

docs/development/core/server/kibana-plugin-core-server.savedobjectunsanitizeddoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ Describes Saved Object documents from Kibana &lt; 7.0.0 which don't have a `refe
99
<b>Signature:</b>
1010

1111
```typescript
12-
export declare type SavedObjectUnsanitizedDoc = SavedObjectDoc & Partial<Referencable>;
12+
export declare type SavedObjectUnsanitizedDoc<T = unknown> = SavedObjectDoc<T> & Partial<Referencable>;
1313
```

docs/development/plugins/data/public/kibana-plugin-plugins-data-public.gettime.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
<b>Signature:</b>
88

99
```typescript
10-
export declare function getTime(indexPattern: IIndexPattern | undefined, timeRange: TimeRange, forceNow?: Date): import("../..").RangeFilter | undefined;
10+
export declare function getTime(indexPattern: IIndexPattern | undefined, timeRange: TimeRange, options?: {
11+
forceNow?: Date;
12+
fieldName?: string;
13+
}): import("../..").RangeFilter | undefined;
1114
```
1215

1316
## Parameters
@@ -16,7 +19,7 @@ export declare function getTime(indexPattern: IIndexPattern | undefined, timeRan
1619
| --- | --- | --- |
1720
| indexPattern | <code>IIndexPattern &#124; undefined</code> | |
1821
| timeRange | <code>TimeRange</code> | |
19-
| forceNow | <code>Date</code> | |
22+
| options | <code>{</code><br/><code> forceNow?: Date;</code><br/><code> fieldName?: string;</code><br/><code>}</code> | |
2023

2124
<b>Returns:</b>
2225

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
2+
3+
[Home](./index.md) &gt; [kibana-plugin-plugins-data-public](./kibana-plugin-plugins-data-public.md) &gt; [IIndexPattern](./kibana-plugin-plugins-data-public.iindexpattern.md) &gt; [getTimeField](./kibana-plugin-plugins-data-public.iindexpattern.gettimefield.md)
4+
5+
## IIndexPattern.getTimeField() method
6+
7+
<b>Signature:</b>
8+
9+
```typescript
10+
getTimeField?(): IFieldType | undefined;
11+
```
12+
<b>Returns:</b>
13+
14+
`IFieldType | undefined`
15+

0 commit comments

Comments
 (0)