kibana/x-pack/plugins/enterprise_search/common
Constance 5812217631
[Enterprise Search] Update chrome/breadcrumbs to support dynamic/nested breadcrumbs (#79231)
* [Setup] Add new stripLeadingSlash util

- will be used by upcoming breadcrumb/path logic
- rename folder + update references
+ clean up tests

* Update breadcrumb helpers with new useGenerateBreadcrumbs
- responsible for generating an array of IBreadcrumb objs with correct react router paths, given an array of breadcrumb text

+ rename previous generic useBreadcrumbs helper to a more specific useEuiBreadcrumbs (indicates the type of transforming happening)

+ misc typing updates/improvements

* Update SetChrome helpers
- to use new useGenerateBreadcrumbs() helper

+ simplify props - remove `isRoot` and `text` (now just accepts a single `trail` array - an empty trail creates the same effect as isRoot
+ simplify/improve typing as a result (yay!)
- improve docs

+ useEffect update - update breadcrumbs/titles if `trail` ever changes. This will primarily be most helpful for pages that fetch dynamic data on page load (e.g. a dynamic engineName, groupName, etc.)
- note that in the above case trail arrays should probably be wrapped in useMemo() to reduce unnecessary rerenders

* Update all instances of SetPageChrome to new props

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
2020-10-05 10:08:13 -07:00
..
__mocks__
strip_slashes [Enterprise Search] Update chrome/breadcrumbs to support dynamic/nested breadcrumbs (#79231) 2020-10-05 10:08:13 -07:00
types [Enterprise Search] Added Logic for the Credentials View (#77626) 2020-09-28 09:39:46 -04:00
constants.ts [Enterprise Search] Add read-only mode interceptor and error handler (#77569) 2020-09-17 08:43:40 -07:00
version.ts