parent
2498b6212c
commit
b6f1682635
|
@ -50,7 +50,7 @@ console.log(discoverUrl); // http://localhost:5601/bpr/s/space/app/discover
|
||||||
const discoverUrlWithSomeState = core.http.basePath.prepend(`/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2020-09-10T11:39:50.203Z',to:'2020-09-10T11:40:20.249Z'))&_a=(columns:!(_source),filters:!(),index:'90943e30-9a47-11e8-b64d-95841ca0b247',interval:auto,query:(language:kuery,query:''),sort:!())`);
|
const discoverUrlWithSomeState = core.http.basePath.prepend(`/discover#/?_g=(filters:!(),refreshInterval:(pause:!t,value:0),time:(from:'2020-09-10T11:39:50.203Z',to:'2020-09-10T11:40:20.249Z'))&_a=(columns:!(_source),filters:!(),index:'90943e30-9a47-11e8-b64d-95841ca0b247',interval:auto,query:(language:kuery,query:''),sort:!())`);
|
||||||
```
|
```
|
||||||
|
|
||||||
Instead, each app should expose {kib-repo}tree/{branch}/src/plugins/share/common/url_service/locators/README.md[a locator].
|
Instead, each app should expose [a locator](https://github.com/elastic/kibana/blob/master/src/plugins/share/common/url_service/locators/README.md).
|
||||||
Other apps should use those locators for navigation or URL creation.
|
Other apps should use those locators for navigation or URL creation.
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
|
@ -114,8 +114,7 @@ const MySPALink = () =>
|
||||||
As it would be too much boilerplate to do this for each link in your app, there is a handy wrapper that helps with it:
|
As it would be too much boilerplate to do this for each link in your app, there is a handy wrapper that helps with it:
|
||||||
[RedirectAppLinks](https://github.com/elastic/kibana/blob/master/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx#L49).
|
[RedirectAppLinks](https://github.com/elastic/kibana/blob/master/src/plugins/kibana_react/public/app_links/redirect_app_link.tsx#L49).
|
||||||
|
|
||||||
[source,typescript jsx]
|
```jsx
|
||||||
----
|
|
||||||
const MyApp = () =>
|
const MyApp = () =>
|
||||||
<RedirectAppLinks application={core.application}>
|
<RedirectAppLinks application={core.application}>
|
||||||
{/*...*/}
|
{/*...*/}
|
||||||
|
@ -123,7 +122,7 @@ const MyApp = () =>
|
||||||
<a href={urlToADashboard}>Go to Dashboard</a>
|
<a href={urlToADashboard}>Go to Dashboard</a>
|
||||||
{/*...*/}
|
{/*...*/}
|
||||||
</RedirectAppLinks>
|
</RedirectAppLinks>
|
||||||
----
|
```
|
||||||
|
|
||||||
## Setting up internal app routing
|
## Setting up internal app routing
|
||||||
|
|
||||||
|
@ -167,7 +166,7 @@ Common use-case for using `core`'s `ScopedHistory` directly:
|
||||||
## Syncing state with URL
|
## Syncing state with URL
|
||||||
|
|
||||||
Historically Kibana apps store _a lot_ of application state in the URL.
|
Historically Kibana apps store _a lot_ of application state in the URL.
|
||||||
The most common pattern that {kib} apps follow today is storing state in `_a` and `_g` query params in [rison](https://github.com/w33ble/rison-node#readme) format.
|
The most common pattern that Kibana apps follow today is storing state in `_a` and `_g` query params in [rison](https://github.com/w33ble/rison-node#readme) format.
|
||||||
|
|
||||||
Those query params follow the convention:
|
Those query params follow the convention:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue