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

UI change for datasource view picker to enable selectable #6497

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

zhyuanqi
Copy link
Collaborator

@zhyuanqi zhyuanqi commented Apr 16, 2024

Description

UI change for datasource view picker to enable selectable #6497

Issues Resolved

Screenshot

  1. activeOption={[{id: ''}]} with hideLocalCluster is set to true in yaml
    Toast: Data source is not available
Screenshot 2024-04-16 at 3 32 04 PM
  1. activeOption={[{id: 'invalid'}]}
    Toast: Failed to fetch data source
Screenshot 2024-04-16 at 3 32 49 PM
  1. activeOption={[{id: ''}]} with hideLocalCluster is set to false in yaml
    Show local cluster

Testing the changes

Screenshot 2024-04-16 at 3 33 37 PM

4.activeOption={[{id: 'valid id'}]}
show selected cluster
Screenshot 2024-04-16 at 3 34 53 PM

  1. activeOption={[{id: 'valid id', iabel:"show label"}]}
    show selected cluster with label name
Screenshot 2024-04-16 at 3 36 01 PM
  1. When valid id pass in, but it has been filtered out
    activeOption: [{ id: '6304d1d0-f826-11ee-ab60-439c91fde80b', label:'show label' }],
    dataSourceFilter: (ds) => {return ds.id != '6304d1d0-f826-11ee-ab60-439c91fde80b'},
    toast: datasource is not available
Screenshot 2024-04-16 at 3 36 35 PM
  1. With real long name
Screenshot 2024-04-16 at 3 49 34 PM

Changelog

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 6497.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.

@zhyuanqi zhyuanqi changed the title UI change for data source view to enable selectable UI change for datasource view picker to enable selectable Apr 16, 2024
Copy link
Contributor

❌ Changeset File Not Added Yet

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

@zhyuanqi zhyuanqi force-pushed the readonly-ui branch 2 times, most recently from 4973e7b to cf0f3a1 Compare April 16, 2024 22:25
Copy link
Contributor

❌ Changeset File Not Added Yet

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

1 similar comment
Copy link
Contributor

❌ Changeset File Not Added Yet

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

});
if (this.props.onSelectedDataSources) {
this.props.onSelectedDataSources([]);
}
handleDataSourceFetchError(this.onError.bind(this), this.props.notifications!);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we see if we can remove line 118-124 and use the handleDataSourceFetchError instead?

@zhyuanqi zhyuanqi force-pushed the readonly-ui branch 2 times, most recently from b11dd29 to 912208c Compare April 17, 2024 05:41
BionIT
BionIT previously approved these changes Apr 17, 2024
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

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

Project coverage is 34.95%. Comparing base (d2d410b) to head (1f92f51).
Report is 3 commits behind head on main.

❗ Current head 1f92f51 differs from pull request most recent head 8967ee4. Consider uploading reports for the commit 8967ee4 to get more accurate results

Files Patch % Lines
...c/components/data_source_view/data_source_view.tsx 0.00% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6497      +/-   ##
==========================================
+ Coverage   32.93%   34.95%   +2.01%     
==========================================
  Files        2260     1916     -344     
  Lines       45769    37077    -8692     
  Branches     7200     6824     -376     
==========================================
- Hits        15075    12961    -2114     
+ Misses      29984    23256    -6728     
- Partials      710      860     +150     
Flag Coverage Δ
Linux_1 ?
Linux_4 34.95% <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.

BionIT
BionIT previously approved these changes Apr 17, 2024
Copy link
Member

@zhongnansu zhongnansu left a comment

Choose a reason for hiding this comment

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

lgtm, except 1 typo

@zhyuanqi zhyuanqi force-pushed the readonly-ui branch 3 times, most recently from 8397e97 to 599c531 Compare April 17, 2024 18:37
Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
@zhongnansu zhongnansu merged commit b6978f2 into opensearch-project:main Apr 17, 2024
71 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-6497-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 b6978f235fc6004c679420e6eb3b801db1d602a1
# Push it to GitHub
git push --set-upstream origin backport/backport-6497-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-6497-to-2.x.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 18, 2024
* UI change for data source view to enable selectable

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>

* Fix typo and rebase

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>

---------

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
(cherry picked from commit b6978f2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md
zhongnansu pushed a commit that referenced this pull request Apr 18, 2024
…6538)

* UI change for data source view to enable selectable

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>

* Fix typo and rebase

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>

---------

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
(cherry picked from commit b6978f2)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants