* [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> |
||
---|---|---|
.. | ||
__mocks__ | ||
strip_slashes | ||
types | ||
constants.ts | ||
version.ts |