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

[Workspace] Copy selected/all saved objects #6478

Merged
merged 41 commits into from
Jul 23, 2024

Conversation

yubonluo
Copy link
Contributor

@yubonluo yubonluo commented Apr 16, 2024

Description

This PR follows up #6288 which can be used to duplicate saved objects among workspaces.
Only UI change in this PR.

Issues Resolved

#6388

Screenshot

2024-06-21.14.59.04.mp4

There are three types of duplicate buttons on the saved objects management page.
image

If the user clicks the duplicate button, a modal window will pop up as follows:
image

Changelog

  • feat: [Workspace] Duplicate selected/all saved objects

Testing the changes

  1. Clone the latest code and run yarn osd bootstrap
  2. Modify config/opensearch_dashboards.yml, add workspace.enabled: true
  3. Run yarn start --no-base-path
  4. Create a workspace and create some saved objects like index patterns, visualizations, etc.
  5. Call the copy api following the above usage.

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

Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Copy link

codecov bot commented Apr 18, 2024

Codecov Report

Attention: Patch coverage is 91.89189% with 12 lines in your changes missing coverage. Please review.

Project coverage is 64.02%. Comparing base (9348bd4) to head (b850070).
Report is 3 commits behind head on main.

Files Patch % Lines
...ment_section/objects_table/saved_objects_table.tsx 87.03% 4 Missing and 3 partials ⚠️
...ction/objects_table/components/duplicate_modal.tsx 89.28% 1 Missing and 2 partials ⚠️
...jects_table/components/duplicate_result_flyout.tsx 97.43% 0 Missing and 1 partial ⚠️
...agement_section/objects_table/components/table.tsx 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6478      +/-   ##
==========================================
+ Coverage   63.96%   64.02%   +0.06%     
==========================================
  Files        3597     3603       +6     
  Lines       78262    78477     +215     
  Branches    12339    12382      +43     
==========================================
+ Hits        50057    50244     +187     
- Misses      25185    25207      +22     
- Partials     3020     3026       +6     
Flag Coverage Δ
Linux_1 30.68% <6.16%> (-0.40%) ⬇️
Linux_2 55.58% <ø> (+0.04%) ⬆️
Linux_3 40.64% <2.14%> (-0.67%) ⬇️
Linux_4 31.69% <91.54%> (+0.15%) ⬆️
Windows_1 30.70% <6.16%> (-0.40%) ⬇️
Windows_2 55.53% <ø> (+0.04%) ⬆️
Windows_3 40.65% <2.14%> (-0.66%) ⬇️
Windows_4 31.69% <91.54%> (+0.15%) ⬆️

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.

yubonluo and others added 2 commits April 19, 2024 15:53
Signed-off-by: yubonluo <yubonluo@amazon.com>
@yubonluo yubonluo changed the title [Workspace] Duplicate selected/all saved objects [Workspace] Copy selected/all saved objects Jun 21, 2024
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
Signed-off-by: yubonluo <yubonluo@amazon.com>
ruanyl
ruanyl previously approved these changes Jul 23, 2024
Copy link
Member

@ruanyl ruanyl left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, left some comments, should not be blocker

Signed-off-by: yubonluo <yubonluo@amazon.com>
@SuZhou-Joe SuZhou-Joe merged commit 9abde5c into opensearch-project:main Jul 23, 2024
58 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-6478-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9abde5c91b86bdcedde315f8ea7f650ffadac20e
# Push it to GitHub
git push --set-upstream origin backport/backport-6478-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-6478-to-2.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.16 failed:

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

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.16 2.16
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.16
# Create a new branch
git switch --create backport/backport-6478-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9abde5c91b86bdcedde315f8ea7f650ffadac20e
# Push it to GitHub
git push --set-upstream origin backport/backport-6478-to-2.16
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-6478-to-2.16.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 24, 2024
* [Worksapce][UI] duplicate selected/all saved objects

Signed-off-by: yubonluo <yubonluo@amazon.com>

* fix test error

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize code transfer memory

Signed-off-by: yubonluo <yubonluo@amazon.com>

* revert useless modify

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* add test id

Signed-off-by: yubonluo <yubonluo@amazon.com>

* Changeset file for PR #6478 created/updated

* According the last mockup to optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* Delete useless code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* Optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* delete useless code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* Optimize user experience

Signed-off-by: yubonluo <yubonluo@amazon.com>

* Solve the test snapshot error

Signed-off-by: yubonluo <yubonluo@amazon.com>

* modefy the ui text

Signed-off-by: yubonluo <yubonluo@amazon.com>

* support copy result flyout

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

* optimize the code

Signed-off-by: yubonluo <yubonluo@amazon.com>

---------

Signed-off-by: yubonluo <yubonluo@amazon.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit 9abde5c)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.16 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.16 2.16
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch-Dashboards/backport-2.16
# Create a new branch
git switch --create backport/backport-6478-to-2.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9abde5c91b86bdcedde315f8ea7f650ffadac20e
# Push it to GitHub
git push --set-upstream origin backport/backport-6478-to-2.16
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch-Dashboards/backport-2.16

Then, create a pull request where the base branch is 2.16 and the compare/head branch is backport/backport-6478-to-2.16.

ruanyl pushed a commit that referenced this pull request Jul 24, 2024
* [Worksapce][UI] duplicate selected/all saved objects



* fix test error



* optimize code transfer memory



* revert useless modify



* optimize the code



* add test id



* Changeset file for PR #6478 created/updated

* According the last mockup to optimize the code



* Delete useless code



* Optimize the code



* optimize code



* delete useless code



* Optimize user experience



* Solve the test snapshot error



* modefy the ui text



* support copy result flyout



* optimize the code



* optimize the code



---------



(cherry picked from commit 9abde5c)

Signed-off-by: yubonluo <yubonluo@amazon.com>
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>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
ananzh pushed a commit to ananzh/OpenSearch-Dashboards that referenced this pull request Jul 24, 2024
…opensearch-project#7429)

* [Worksapce][UI] duplicate selected/all saved objects



* fix test error



* optimize code transfer memory



* revert useless modify



* optimize the code



* add test id



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

* According the last mockup to optimize the code



* Delete useless code



* Optimize the code



* optimize code



* delete useless code



* Optimize user experience



* Solve the test snapshot error



* modefy the ui text



* support copy result flyout



* optimize the code



* optimize the code



---------



(cherry picked from commit 9abde5c)

Signed-off-by: yubonluo <yubonluo@amazon.com>
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>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[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.

7 participants