-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Navigation-next] Enrich breadcrumbs by workspace and use case #7360
Conversation
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>
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. |
const appTitle = useObservable(appTitle$, 'OpenSearch Dashboards'); | ||
const breadcrumbs = useObservable(breadcrumbs$, []); | ||
const [breadcrumbEnricher, setBreadcrumbEnricher] = useState< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useObservable should be good enough give the enriched value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do useObservable(breadcrumbsEnricher$)
?
* breadcrumbs for workspace Signed-off-by: Hailong Cui <[email protected]> * add unit test Signed-off-by: Hailong Cui <[email protected]> * Changeset file for PR #7360 created/updated * add unit test Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> 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 <[email protected]> * add unit test Signed-off-by: Hailong Cui <[email protected]> * Changeset file for PR #7360 created/updated * add unit test Signed-off-by: Hailong Cui <[email protected]> --------- Signed-off-by: Hailong Cui <[email protected]> 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 <[email protected]> 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 <[email protected]> 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:jest
yarn test:jest_integration