OpenSearch-Dashboards icon indicating copy to clipboard operation
OpenSearch-Dashboards copied to clipboard

[Workspace] Copy selected/all saved objects

Open yubonluo opened this issue 1 year ago • 8 comments
trafficstars

Description

This PR follows up https://github.com/opensearch-project/OpenSearch-Dashboards/pull/6288 which can be used to duplicate saved objects among workspaces. Only UI change in this PR.

Issues Resolved

https://github.com/opensearch-project/OpenSearch-Dashboards/issues/6388

Screenshot

https://github.com/opensearch-project/OpenSearch-Dashboards/assets/71875999/89fe15e1-c876-4f7c-b64a-77a5c550002c

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

  • [x] All tests pass
    • [x] yarn test:jest
    • [x] yarn test:jest_integration
  • [x] New functionality includes testing.
  • [x] New functionality has been documented.
  • [x] Update CHANGELOG.md
  • [x] Commits are signed per the DCO using --signoff

yubonluo avatar Apr 16 '24 08:04 yubonluo

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 278 commits behind head on main.

Files with missing lines Patch % Lines
...ment_section/objects_table/saved_objects_table.tsx 87.03% 4 Missing and 3 partials :warning:
...ction/objects_table/components/duplicate_modal.tsx 89.28% 1 Missing and 2 partials :warning:
...jects_table/components/duplicate_result_flyout.tsx 97.43% 0 Missing and 1 partial :warning:
...agement_section/objects_table/components/table.tsx 80.00% 1 Missing :warning:
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%) :arrow_down:
Linux_2 55.58% <ø> (+0.04%) :arrow_up:
Linux_3 40.64% <2.14%> (-0.67%) :arrow_down:
Linux_4 31.69% <91.54%> (+0.15%) :arrow_up:
Windows_1 30.70% <6.16%> (-0.40%) :arrow_down:
Windows_2 55.53% <ø> (+0.04%) :arrow_up:
Windows_3 40.65% <2.14%> (-0.66%) :arrow_down:
Windows_4 31.69% <91.54%> (+0.15%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Apr 18 '24 04:04 codecov[bot]

❌ Invalid Changelog Heading

The '## Changelog' heading in your PR description is either missing or malformed. Please make sure that your PR description includes a '## Changelog' heading with proper spelling, capitalization, spacing, and Markdown syntax.

github-actions[bot] avatar Apr 24 '24 02:04 github-actions[bot]

Hey @yubonluo, thanks for opening. I'm not able to see the videos.

Do you have some screen shots? Also just confirming with @opensearch-project/opensearch-ux the expected workflow.

kavilla avatar Apr 27 '24 00:04 kavilla

Hey @yubonluo, thanks for opening. I'm not able to see the videos.

Do you have some screen shots? Also just confirming with @opensearch-project/opensearch-ux the expected workflow.

@yubonluo I’d like to make some adjustments to the workflow you shared earlier. I’m putting my recommendation together.

lauralexis avatar Apr 27 '24 17:04 lauralexis

Hey @yubonluo, thanks for opening. I'm not able to see the videos.

Do you have some screen shots? Also just confirming with @opensearch-project/opensearch-ux the expected workflow.

The screen shots has been added.

yubonluo avatar Apr 28 '24 02:04 yubonluo

CC @SuZhou-Joe @ruanyl could you please help me review this pr?

yubonluo avatar Jun 04 '24 02:06 yubonluo

Hi @yubonluo , are we targeting this PR for 2.15 or 2.16?

BionIT avatar Jun 05 '24 03:06 BionIT

Hi @yubonluo , are we targeting this PR for 2.15 or 2.16?

Hi @BionIT due to waiting for the final confirmation of the UI text, this PR will be released on 2.16.

yubonluo avatar Jun 05 '24 03:06 yubonluo

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.

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.

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.