[Navigation-next] Enrich breadcrumbs by workspace and use case#7360
[Navigation-next] Enrich breadcrumbs by workspace and use case#7360ruanyl merged 4 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7360 +/- ##
==========================================
+ Coverage 67.70% 67.72% +0.01%
==========================================
Files 3520 3520
Lines 69700 69752 +52
Branches 11376 11388 +12
==========================================
+ Hits 47189 47237 +48
- Misses 19716 19719 +3
- Partials 2795 2796 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
| export function HeaderBreadcrumbs({ appTitle$, breadcrumbs$, breadcrumbsEnricher$ }: Props) { | ||
| const appTitle = useObservable(appTitle$, 'OpenSearch Dashboards'); | ||
| const breadcrumbs = useObservable(breadcrumbs$, []); | ||
| const [breadcrumbEnricher, setBreadcrumbEnricher] = useState< |
There was a problem hiding this comment.
useObservable should be good enough give the enriched value.
There was a problem hiding this comment.
as the enricher is a function, setBreadcrumbEnricher will call/execute the function automatically, that's why to use useEffect + useState and change default behavior to below. cc @wanglam
const sub = breadcrumbsEnricher$.subscribe((enricher) => {
setBreadcrumbEnricher(() => enricher);
});
There was a problem hiding this comment.
Can't we just do useObservable(breadcrumbsEnricher$)?
* breadcrumbs for workspace Signed-off-by: Hailong Cui <ihailong@amazon.com> * add unit test Signed-off-by: Hailong Cui <ihailong@amazon.com> * Changeset file for PR #7360 created/updated * add unit test Signed-off-by: Hailong Cui <ihailong@amazon.com> --------- Signed-off-by: Hailong Cui <ihailong@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 7ff8544) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* breadcrumbs for workspace Signed-off-by: Hailong Cui <ihailong@amazon.com> * add unit test Signed-off-by: Hailong Cui <ihailong@amazon.com> * Changeset file for PR #7360 created/updated * add unit test Signed-off-by: Hailong Cui <ihailong@amazon.com> --------- Signed-off-by: Hailong Cui <ihailong@amazon.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com> (cherry picked from commit 7ff8544) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
#7392) * breadcrumbs for workspace * add unit test * Changeset file for PR #7360 created/updated * add unit test --------- (cherry picked from commit 7ff8544) Signed-off-by: Hailong Cui <ihailong@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
#7393) * breadcrumbs for workspace * add unit test * Changeset file for PR #7360 created/updated * add unit test --------- (cherry picked from commit 7ff8544) Signed-off-by: Hailong Cui <ihailong@amazon.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Description
Issues Resolved
#7359
Screenshot
in workspace

workspace with all use case

workspace disabled

Testing the changes
Changelog
Check List
yarn test:jestyarn test:jest_integration