Skip to content
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] feat: introduce new interface for group #7060

Merged
merged 36 commits into from
Jul 1, 2024

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Jun 19, 2024

Description

This PR mainly introduces new interface to register and get useCases from chrome service, and it is a fundamental change for the new navigation.

Issues Resolved

closes #7061

Screenshot

No UI changes.

Testing the changes

As there is no place using the new interfaces introduced in this PR. You can refer to the test cases here:
src/core/public/chrome/chrome_service.test.ts

Changelog

  • feat: Introduce new interface for group

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Jun 19, 2024

Codecov Report

Attention: Patch coverage is 86.59794% with 13 lines in your changes missing coverage. Please review.

Project coverage is 67.48%. Comparing base (b85e177) to head (35c1db7).

Files Patch % Lines
src/core/public/chrome/utils.ts 78.18% 7 Missing and 5 partials ⚠️
src/core/public/chrome/chrome_service.mock.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7060      +/-   ##
==========================================
+ Coverage   67.45%   67.48%   +0.02%     
==========================================
  Files        3448     3451       +3     
  Lines       67964    68060      +96     
  Branches    11057    11068      +11     
==========================================
+ Hits        45845    45928      +83     
- Misses      19446    19454       +8     
- Partials     2673     2678       +5     
Flag Coverage Δ
Linux_1 33.04% <7.21%> (-0.06%) ⬇️
Linux_2 55.18% <86.59%> (+0.12%) ⬆️
Linux_3 45.14% <7.21%> (-0.10%) ⬇️
Linux_4 34.76% <7.21%> (-0.07%) ⬇️
Windows_1 33.07% <7.21%> (-0.06%) ⬇️
Windows_2 55.13% <86.59%> (+0.12%) ⬆️
Windows_3 45.15% <7.21%> (-0.11%) ⬇️
Windows_4 34.76% <7.21%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/core/public/chrome/chrome_service.tsx Outdated Show resolved Hide resolved
src/core/public/chrome/chrome_service.tsx Outdated Show resolved Hide resolved
src/core/public/chrome/chrome_service.tsx Outdated Show resolved Hide resolved
src/core/public/chrome/chrome_service.tsx Outdated Show resolved Hide resolved
src/core/public/chrome/chrome_service.tsx Outdated Show resolved Hide resolved
src/core/public/chrome/chrome_service.tsx Outdated Show resolved Hide resolved
src/core/public/chrome/chrome_service.tsx Outdated Show resolved Hide resolved
opensearch-changeset-bot bot added a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Jun 20, 2024
SuZhou-Joe added a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Jun 28, 2024
SuZhou-Joe added a commit that referenced this pull request Jun 28, 2024
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
@SuZhou-Joe SuZhou-Joe marked this pull request as ready for review June 28, 2024 04:18
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
src/core/public/chrome/nav_group/nav_group_service.ts Outdated Show resolved Hide resolved
src/core/public/chrome/nav_group/nav_group_service.ts Outdated Show resolved Hide resolved
src/core/public/chrome/utils.ts Outdated Show resolved Hide resolved
src/core/public/chrome/utils.ts Show resolved Hide resolved
src/core/public/chrome/utils.ts Outdated Show resolved Hide resolved
src/core/public/chrome/utils.ts Outdated Show resolved Hide resolved
src/core/public/chrome/utils.ts Outdated Show resolved Hide resolved
Comment on lines 21 to 25
* Groups with type of NavGroupType.SYSTEM will:
* 1. Always display before USE_CASE_GROUP.
* 2. Not be pickable within the workspace creation page.
*
* @default undefined indicates it is of type useCase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment be adjusted a bit? Maybe the comment should be not in core, but at where the type is used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, move the comment to the enum NavGroupType, and the place which will use this type is in another PR and still waiting for finalized design.

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
SuZhou-Joe added a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Jul 1, 2024
@seraphjiang
Copy link
Member

@BionIT @ZilongX would you help to review and merge?

@BionIT BionIT merged commit 5212f09 into opensearch-project:main Jul 1, 2024
67 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch-Dashboards/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.x
# Create a new branch
git switch --create backport/backport-7060-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5212f09b780459c8212697a419d5651b83361d6d
# Push it to GitHub
git push --set-upstream origin backport/backport-7060-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-7060-to-2.x.

SuZhou-Joe added a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Jul 1, 2024
…-project#7060)

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Changeset file for PR opensearch-project#7060 created/updated

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update test snapshot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Changeset file for PR opensearch-project#7060 created/updated

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: add default nav group

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: type error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: type error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: expose DEFAULT_NAV_GROUPS in src/core/public

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: export NavGroupItemInMap type

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update README

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update README

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update interface

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* refactor: move navGroup related interface into a service

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: remove useless code

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* [Navigation-Next] Add nav group enabled in chrome service(7072)

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Remove useless code

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* use homepage flag

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update README

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: expose sorted navLinks

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: unit test

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: bootstrap error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: snapshot error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update according to comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: support parent link

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update according to comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update according to comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

---------

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com>
(cherry picked from commit 5212f09)
SuZhou-Joe added a commit that referenced this pull request Jul 2, 2024
)

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Changeset file for PR #7060 created/updated

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: introduce new interface for use case

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update test snapshot

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Changeset file for PR #7060 created/updated

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update based on comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: add default nav group

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: type error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: type error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: expose DEFAULT_NAV_GROUPS in src/core/public

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: export NavGroupItemInMap type

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update README

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update README

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update interface

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* refactor: move navGroup related interface into a service

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: remove useless code

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* [Navigation-Next] Add nav group enabled in chrome service(7072)

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* Remove useless code

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* use homepage flag

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update README

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: expose sorted navLinks

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: unit test

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: bootstrap error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* fix: snapshot error

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update according to comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: support parent link

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update according to comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update according to comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

---------

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Co-authored-by: ZilongX <99905560+ZilongX@users.noreply.github.com>
(cherry picked from commit 5212f09)
@zhyuanqi
Copy link
Collaborator

zhyuanqi commented Jul 9, 2024

#7136 Remove failed backport as it has been manually backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce group interfaces to OpenSearch Dashboards chrome service
9 participants