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

[MD] Add dropdown header to data source single selector #6431

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

zhongnansu
Copy link
Member

@zhongnansu zhongnansu commented Apr 12, 2024

Description

  • Add dropdown header to data source single selector. This header includes
    • a counter showing the count of datasource options avaliable
    • a link with text "Manage", that honors SPA(single page application) to redirect to data source management page
  • Fix bug of opensearch cluster group label being rendered multiple times when toggling between options
  • Add and update related unit tests

Issues Resolved

#6429

Screenshot

image

iShot_2024-04-12_11.18.17.mp4

Testing the changes

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

@zhongnansu
Copy link
Member Author

@xeniatup Hi Xenia, could you also help review the video and screenshot I attached, to make sure this is the correct UI/UX? Thanks

BionIT
BionIT previously approved these changes Apr 16, 2024
BionIT
BionIT previously approved these changes Apr 16, 2024
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.62%. Comparing base (e785fd3) to head (59d7fe8).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6431      +/-   ##
==========================================
+ Coverage   49.55%   54.62%   +5.06%     
==========================================
  Files        2670     2276     -394     
  Lines       54290    44615    -9675     
  Branches     8878     8294     -584     
==========================================
- Hits        26906    24372    -2534     
+ Misses      25720    18480    -7240     
- Partials     1664     1763      +99     
Flag Coverage Δ
Linux_3 45.16% <100.00%> (?)
Linux_4 34.93% <26.66%> (?)
Windows_1 ?
Windows_3 ?

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.

}) => {
const dataSourceCounterPrefix = totalDataSourceCount === 1 ? 'DATA SOURCE' : 'DATA SOURCES';
const dataSourceCounter =
activeDataSourceCount !== undefined
Copy link
Member

Choose a reason for hiding this comment

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

Should we use activeDataSourceCount != null to check undefined and null both?

Copy link
Member Author

Choose a reason for hiding this comment

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

since bother activeCount and totalCount should be coming from somOptionsArray.length(), Since .length on an array in JavaScript always returns a non-negative integer, we should be good to not do null check here

Flyingliuhub
Flyingliuhub previously approved these changes Apr 16, 2024
Signed-off-by: Zhongnan Su <szhongna@amazon.com>
@zhongnansu zhongnansu merged commit a1c8b8c into opensearch-project:main Apr 16, 2024
70 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-6431-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a1c8b8c437e34d186f3bc44436f71b62371432f1
# Push it to GitHub
git push --set-upstream origin backport/backport-6431-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-6431-to-2.x.

zhongnansu added a commit to zhongnansu/OpenSearch-Dashboards that referenced this pull request Apr 16, 2024
zhongnansu added a commit to zhongnansu/OpenSearch-Dashboards that referenced this pull request Apr 16, 2024
zhongnansu added a commit to zhongnansu/OpenSearch-Dashboards that referenced this pull request Apr 16, 2024
…roject#6431)

(cherry picked from commit a1c8b8c)

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
zhongnansu added a commit to zhongnansu/OpenSearch-Dashboards that referenced this pull request Apr 16, 2024
…roject#6431)

(cherry picked from commit a1c8b8c)

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
zhongnansu added a commit that referenced this pull request Apr 16, 2024
(cherry picked from commit a1c8b8c)

Signed-off-by: Zhongnan Su <szhongna@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x enhancement New feature or request multiple datasource multiple datasource project v2.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants