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] display workspace picker content when outside workspace and nav group #7716

Conversation

SuZhou-Joe
Copy link
Member

@SuZhou-Joe SuZhou-Joe commented Aug 15, 2024

Description

Left navigation will always be expandable in 2.17, and in order to prevent user creating objects in global when workspace is enabled, we will show workspace picker when outside workspace and nav group.

  • Display workspace picker content when outside workspace and nav group
  • Only register global index pattern page when workspace is disabled.
  • Split src/core/public/chrome/ui/header/collapsible_nav_group_enabled.tsx to two files.
  • Append manage category when:
    • Workspace enabled and out of workspace or nav group.
    • Workspace disabled and in all nav group.
  • Always show expand / collapsed icon.
  • Hide home from new left nav.

Issues Resolved

Screenshot

Workspace enabled and outside any workspace or nav group

image

Workspace disabled

image

Testing the changes

Changelog

  • feat: display workspace picker content when outside workspace

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

opensearch-changeset-bot bot added a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Aug 15, 2024
Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 89.04110% with 16 lines in your changes missing coverage. Please review.

Project coverage is 64.18%. Comparing base (6931a41) to head (3096bea).
Report is 9 commits behind head on main.

Files Patch % Lines
...chrome/ui/header/collapsible_nav_group_enabled.tsx 84.90% 0 Missing and 8 partials ⚠️
...public/chrome/ui/header/collapsible_nav_groups.tsx 87.09% 1 Missing and 3 partials ⚠️
src/core/public/chrome/ui/header/header.tsx 0.00% 0 Missing and 2 partials ⚠️
.../plugins/index_pattern_management/public/plugin.ts 66.66% 0 Missing and 1 partial ⚠️
...kspace_picker_content/workspace_picker_content.tsx 96.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7716      +/-   ##
==========================================
+ Coverage   63.86%   64.18%   +0.31%     
==========================================
  Files        3665     3661       -4     
  Lines       81441    80842     -599     
  Branches    12994    12882     -112     
==========================================
- Hits        52010    51885     -125     
+ Misses      26243    25770     -473     
+ Partials     3188     3187       -1     
Flag Coverage Δ
Linux_1 30.30% <27.27%> (+0.11%) ⬆️
Linux_2 55.92% <86.91%> (+0.04%) ⬆️
Linux_3 40.66% <3.63%> (+0.26%) ⬆️
Linux_4 31.45% <5.45%> (+0.07%) ⬆️
Windows_1 30.32% <27.27%> (+0.09%) ⬆️
Windows_2 55.87% <86.91%> (+0.04%) ⬆️
Windows_3 40.65% <3.63%> (+0.25%) ⬆️
Windows_4 31.45% <5.45%> (+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.

SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Aug 15, 2024
@SuZhou-Joe SuZhou-Joe force-pushed the feature/display-workspace-picker-content branch 5 times, most recently from 1dcc264 to 5a10dc1 Compare August 19, 2024 03:56
@SuZhou-Joe SuZhou-Joe force-pushed the feature/display-workspace-picker-content branch from 3b0db4f to ffc57c3 Compare August 20, 2024 00:34
@SuZhou-Joe SuZhou-Joe marked this pull request as ready for review August 20, 2024 00:34
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
@SuZhou-Joe SuZhou-Joe merged commit 56fc8f4 into opensearch-project:main Aug 28, 2024
66 of 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-7716-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 56fc8f4057c1d6b3e58f4b77394f9bf8c4a9447c
# Push it to GitHub
git push --set-upstream origin backport/backport-7716-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-7716-to-2.x.

@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-7716-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 56fc8f4057c1d6b3e58f4b77394f9bf8c4a9447c
# Push it to GitHub
git push --set-upstream origin backport/backport-7716-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-7716-to-2.x.

SuZhou-Joe added a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this pull request Aug 28, 2024
…and nav group (opensearch-project#7716)

* feat: show workspace picker content in left nav

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: bootstrap error

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test error

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: finish picker content

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: finish picker content

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: only register index patterns to settings and setup when workspace is disabled

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: put discover 2.0 behind discover

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: improve test coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: merge conflict

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code based on comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code based on comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize filter code

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
(cherry picked from commit 56fc8f4)
SuZhou-Joe added a commit that referenced this pull request Aug 28, 2024
…and nav group (#7716) (#7880)

* feat: show workspace picker content in left nav

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: bootstrap error

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test error

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: finish picker content

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: finish picker content

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: only register index patterns to settings and setup when workspace is disabled

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: put discover 2.0 behind discover

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: improve test coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: merge conflict

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code based on comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code based on comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize filter code

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
(cherry picked from commit 56fc8f4)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 28, 2024
…and nav group (#7716) (#7880)

* feat: show workspace picker content in left nav

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: bootstrap error

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test error

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: finish picker content

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: finish picker content

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: only register index patterns to settings and setup when workspace is disabled

Signed-off-by: SuZhou-Joe <[email protected]>

* fix: unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: put discover 2.0 behind discover

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: improve test coverage

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: merge conflict

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code based on comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code based on comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize filter code

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
(cherry picked from commit 56fc8f4)
(cherry picked from commit b02dd2b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
SuZhou-Joe pushed a commit that referenced this pull request Aug 28, 2024
…and nav group (#7716) (#7880) (#7882)

* feat: show workspace picker content in left nav



* fix: bootstrap error



* fix: unit test error



* feat: finish picker content



* feat: finish picker content



* feat: only register index patterns to settings and setup when workspace is disabled



* fix: unit test



* feat: put discover 2.0 behind discover



* feat: add coverage



* feat: improve test coverage



* feat: merge conflict



* feat: optimize code based on comment



* feat: optimize code based on comment



* feat: optimize filter code



* feat: update



---------


(cherry picked from commit 56fc8f4)
(cherry picked from commit b02dd2b)

Signed-off-by: SuZhou-Joe <[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>
@AMoo-Miki
Copy link
Collaborator

Manually backported with #7882

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.

4 participants