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

[MDS] Refactor DataSourceAggregatedView #6500

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

huyaboo
Copy link
Member

@huyaboo huyaboo commented Apr 16, 2024

Description

Based on discussion from UX, this PR will refactor the DataSourceAggregatedView.

TODO:

  • Add support for the Empty state (when there are no datasource connections and local cluster is hidden)

Issues Resolved

N/A

Screenshot

Screen.Recording.2024-04-17.at.11.57.41.AM.mov
Screen.Recording.2024-04-17.at.11.59.44.AM.mov

image

Testing the changes

Used the developer example plugin to test 3 scenarios of DataSourceAggregatedView:

  • When there is an activeDataSourceId and displayAllCompatibleDataSources: false: This will render the switch to show only the selected components
  • When nothing is selected and displayAllCompatibleDataSources: false: This will render the switch and show an empty state
  • When displayAllCompatibleDataSources: true: The activeDataSourceIds is ignored, all datasources are unchecked, and no switch will be rendered.
  • If no datasource connections: The NoDataSources component is rendered

Changelog

  • skip

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
Contributor

ℹ️ Manual Changeset Creation Reminder

Please ensure manual commit for changeset file 6500.yml under folder changelogs/fragments to complete this PR.

If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link.

For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool.

@huyaboo huyaboo force-pushed the aggregate-view branch 2 times, most recently from a38567e to eddd667 Compare April 16, 2024 23:06
Copy link

codecov bot commented Apr 16, 2024

Codecov Report

Attention: Patch coverage is 0% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 55.72%. Comparing base (d2d410b) to head (4b40a87).
Report is 3 commits behind head on main.

❗ Current head 4b40a87 differs from pull request most recent head 62905d9. Consider uploading reports for the commit 62905d9 to get more accurate results

Files Patch % Lines
...ce_aggregated_view/data_source_aggregated_view.tsx 0.00% 19 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6500       +/-   ##
===========================================
+ Coverage   32.93%   55.72%   +22.78%     
===========================================
  Files        2260     2283       +23     
  Lines       45769    42759     -3010     
  Branches     7200     7608      +408     
===========================================
+ Hits        15075    23827     +8752     
+ Misses      29984    17501    -12483     
- Partials      710     1431      +721     
Flag Coverage Δ
Linux_1 ?
Linux_2 55.63% <ø> (?)
Linux_4 34.90% <0.00%> (?)

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.

@huyaboo huyaboo changed the title Aggregate view [MDS] Refactor DataSourceAggregatedView Apr 16, 2024
Copy link
Contributor

❌ Changeset File Not Added Yet

Please ensure manual commit for changeset file 6500.yml under folder changelogs/fragments to complete this PR. File still missing.

Copy link
Contributor

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "feat". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

@github-actions github-actions bot added Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry and removed failed changeset labels Apr 16, 2024
@huyaboo huyaboo marked this pull request as ready for review April 16, 2024 23:35
@BionIT
Copy link
Collaborator

BionIT commented Apr 16, 2024

When nothing is selected: This will not render the switch and instead show all datasources

The active view allows passing activeDataSourceIds which can be empty: in maps plugin, when creating the first layer, activeDataSourceIds may be empty, but we should show the active view instead of list all view, also, in maps plugin, when removing the layer, activeDataSourceIds may be empty as well

Signed-off-by: Huy Nguyen <[email protected]>
BionIT
BionIT previously approved these changes Apr 17, 2024
Signed-off-by: Huy Nguyen <[email protected]>
@BionIT BionIT merged commit bd0ea35 into opensearch-project:main Apr 17, 2024
72 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-6500-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 bd0ea35ae6967c7594d316e3ab3b08534c3b3264
# Push it to GitHub
git push --set-upstream origin backport/backport-6500-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-6500-to-2.x.

huyaboo added a commit to huyaboo/OpenSearch-Dashboards that referenced this pull request Apr 17, 2024
* Refactor aggregated view

Signed-off-by: Huy Nguyen <[email protected]>

* Add empty state support

Signed-off-by: Huy Nguyen <[email protected]>

---------

Signed-off-by: Huy Nguyen <[email protected]>
(cherry picked from commit bd0ea35)
@huyaboo huyaboo deleted the aggregate-view branch April 18, 2024 00:15
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 18, 2024
* Refactor aggregated view

Signed-off-by: Huy Nguyen <[email protected]>

* Add empty state support

Signed-off-by: Huy Nguyen <[email protected]>

---------

Signed-off-by: Huy Nguyen <[email protected]>
(cherry picked from commit bd0ea35)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
BionIT pushed a commit that referenced this pull request Apr 18, 2024
* Refactor aggregated view



* Add empty state support



---------


(cherry picked from commit bd0ea35)

Signed-off-by: Huy Nguyen <[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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x multiple datasource multiple datasource project Skip-Changelog PRs that are too trivial to warrant a changelog or release notes entry v2.14.0 valued-contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants