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

feat: Duplicate dashboard visualize #148

Merged
merged 62 commits into from
Sep 20, 2023
Merged

feat: Duplicate dashboard visualize #148

merged 62 commits into from
Sep 20, 2023

Conversation

yuye-aws
Copy link
Collaborator

@yuye-aws yuye-aws commented Sep 12, 2023

Description

  1. Implement duplicate on dashboard
  2. Implement duplicate on visualization
  3. Bug fix: re-duplicate when failed to duplicate some of the saved objects

Issues Resolved

Screenshot

image

Testing the changes

Check List

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

@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2023

Codecov Report

Merging #148 (3c76545) into workspace (3ecaf7d) will increase coverage by 25.76%.
Report is 3 commits behind head on workspace.
The diff coverage is 2.94%.

@@              Coverage Diff               @@
##           workspace     #148       +/-   ##
==============================================
+ Coverage      34.82%   60.59%   +25.76%     
==============================================
  Files           1942     2992     +1050     
  Lines          38428    58595    +20167     
  Branches        5499     9527     +4028     
==============================================
+ Hits           13384    35506    +22122     
+ Misses         24438    21002     -3436     
- Partials         606     2087     +1481     
Flag Coverage Δ
Linux_1 34.17% <1.47%> (-0.66%) ⬇️
Linux_2 55.05% <ø> (?)
Linux_3 42.76% <2.94%> (?)

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

Files Changed Coverage Δ
src/core/public/workspace/workspaces_service.ts 37.03% <ø> (+37.03%) ⬆️
...components/dashboard_top_nav/dashboard_top_nav.tsx 87.50% <ø> (+82.50%) ⬆️
...ts/dashboard_top_nav/top_nav/get_top_nav_config.ts 46.66% <0.00%> (+46.66%) ⬆️
...omponents/dashboard_top_nav/top_nav/top_nav_ids.ts 100.00% <ø> (ø)
...ns/navigation/public/top_nav_menu/top_nav_menu.tsx 16.66% <ø> (ø)
...c/plugins/saved_objects_management/public/index.ts 0.00% <ø> (ø)
...s_management/public/lib/duplicate_saved_objects.ts 0.00% <ø> (ø)
...ction/objects_table/components/duplicate_modal.tsx 0.00% <0.00%> (ø)
...gement_section/objects_table/components/header.tsx 16.66% <ø> (ø)
.../objects_table/components/show_duplicate_modal.tsx 0.00% <0.00%> (ø)
... and 4 more

... and 1640 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

const getDuplicateWorkspaces = async (): Promise<WorkspaceAttribute[]> => {
let result;
try {
result = await getWorkspacesWithWritePermission(http);
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ruanyl @SuZhou-Joe How do you think about add a permitted workspace list in the core public workspace service? Not sure if suitable to call workspace plugin API via this way. Another option will be expose this method in workspace start service result.

dashboardSavedObject.meta = { title: savedDashboard.title };

const duplicateModal = (
<SavedObjectsDuplicateModal
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 move these duplicateModal create logic to show_duplicate_modal.tsx file?

) {
createVisReference();
} else if (savedVis) {
showDuplicateModal(duplicateModal, I18nContext);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems we are using the same SavedObjectsDuplicateModal with src/plugins/dashboard/public/application/utils/get_nav_actions.tsx, why we need to pass I18nContext here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

It seems the differences between two showDuplicateModal are error messages. Could we merge these two showDuplicateModal into one with SavedObjectsDuplicateModal component? We can pass different messages from outside.

@@ -55,6 +55,7 @@ export function getTopNavConfig(
getFullScreenConfig(actions[TopNavIds.FULL_SCREEN]),
getShareConfig(actions[TopNavIds.SHARE]),
getCloneConfig(actions[TopNavIds.CLONE]),
getDuplicateConfig(actions[TopNavIds.DUPLICATE]),
Copy link
Owner

Choose a reason for hiding this comment

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

Is duplicate supposed to replace clone? If so, can we remove clone?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, clone should be replaced

onClose: () => void;
}

export function showDuplicateModal(duplicateModal: React.ReactElement<MinimalDuplicateModalProps>) {
Copy link
Owner

Choose a reason for hiding this comment

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

I see two showDuplicateModal function and they are almost the same except one accepts i18n, I think we can reuse the showDuplicateModal in src/plugins/saved_objects/public/duplicate_modal/show_saved_object_duplicate_modal.tsx.
And i18n should also be passed to duplicate dashboard modal, am I right?

import { WorkspaceAttribute, WorkspaceStart } from 'opensearch-dashboards/public';
import { SavedObjectWithMetadata } from '../../../../../../saved_objects_management/public';

interface MinimalDuplicateModalProps {
Copy link
Owner

Choose a reason for hiding this comment

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

What does Minimal mean in this context?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It means minimal required props for DuplicateModal. I think this file can be deleted and we use src/plugins/saved_objects/public/duplicate_modal/show_saved_object_duplicate_modal.tsx instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

MinimalDuplicateModalProps has been replaced by ShowDuplicateModalProps

interface MinimalDuplicateModalProps {
selectedSavedObjects: SavedObjectWithMetadata[];
workspaces: WorkspaceStart;
getDuplicateWorkspaces: (...args: any[]) => Promise<WorkspaceAttribute[]>;
Copy link
Owner

Choose a reason for hiding this comment

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

We should avoid any[] and it seems getDuplicateWorkspaces doesn't necessarily to have arguments.
Also the function name sounds a bit misleading, what about getTargetWorkspaces?

selectedSavedObjects: SavedObjectWithMetadata[];
workspaces: WorkspaceStart;
getDuplicateWorkspaces: (...args: any[]) => Promise<WorkspaceAttribute[]>;
onDuplicate: (...args: any[]) => Promise<void>;
Copy link
Owner

@ruanyl ruanyl Sep 13, 2023

Choose a reason for hiding this comment

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

No any, let's get it properly typed

Comment on lines 285 to 305
const getDuplicateWorkspaces = async (): Promise<WorkspaceAttribute[]> => {
let result;
try {
result = await getWorkspacesWithWritePermission(http);
} catch (error) {
notifications?.toasts.addDanger({
title: i18n.translate(
'savedObjectsManagement.objectsTable.duplicateWorkspaces.dangerNotification',
{
defaultMessage: 'Unable to get workspaces with write permission',
}
),
text: error instanceof Error ? error.message : JSON.stringify(error),
});
}
if (result?.success) {
return result.result?.workspaces ?? [];
} else {
return [];
}
};
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
const getDuplicateWorkspaces = async (): Promise<WorkspaceAttribute[]> => {
let result;
try {
result = await getWorkspacesWithWritePermission(http);
} catch (error) {
notifications?.toasts.addDanger({
title: i18n.translate(
'savedObjectsManagement.objectsTable.duplicateWorkspaces.dangerNotification',
{
defaultMessage: 'Unable to get workspaces with write permission',
}
),
text: error instanceof Error ? error.message : JSON.stringify(error),
});
}
if (result?.success) {
return result.result?.workspaces ?? [];
} else {
return [];
}
};
const getDuplicateWorkspaces = async (): Promise<WorkspaceAttribute[]> => {
try {
const result = await getWorkspacesWithWritePermission(http);
if (result?.success) {
return result.result?.workspaces ?? [];
}
} catch (error) {
notifications?.toasts.addDanger({
title: i18n.translate(
'savedObjectsManagement.objectsTable.duplicateWorkspaces.dangerNotification',
{
defaultMessage: 'Unable to get workspaces with write permission',
}
),
text: error instanceof Error ? error.message : JSON.stringify(error),
});
}
return [];
};

Comment on lines 313 to 290
const objectsToDuplicate = visualizationSavedObjects.map((obj) => ({
id: obj.id,
type: 'visualization',
}));
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
const objectsToDuplicate = visualizationSavedObjects.map((obj) => ({
id: obj.id,
type: 'visualization',
}));
// object must be visualization type
const objectsToDuplicate = visualizationSavedObjects.filter(obj => obj.type === 'visualization').map((obj) => ({
id: obj.id,
type: obj.type,
}));

});
};

const visualizationSavedObject = (savedVis || {}) as SavedObjectWithMetadata;
Copy link
Owner

Choose a reason for hiding this comment

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

If savedVis is undefined, it should display error toast, now it creates an empty object which I think is not right.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Duplicate behavior for visualization will be disabled if savedVis is undefined.

dashboard.dashboardFeatureFlagConfig.allowByValueEmbeddables &&
!isSaveAsButton
) {
createVisReference();
Copy link
Owner

Choose a reason for hiding this comment

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

Q: Could you leave a comment on when and why it should call createVisReference?

yuye-aws and others added 19 commits September 18, 2023 12:09
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
yuye-aws and others added 21 commits September 20, 2023 10:19
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
…ops to workspace attribute

Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
const currentWorkspace = workspaces.currentWorkspace$.value;
const currentWorkspaceName = currentWorkspace?.name;
const duplicateWorkspaceList = this.getDuplicateWorkspaces();
Copy link
Owner

Choose a reason for hiding this comment

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

Let's rename duplicateWorkspaceList -> targetWorkspaces, getDuplicateWorkspaces -> getTargetWorkspaces

Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: yuye-aws <yuyezhu@amazon.com>
@yuye-aws yuye-aws merged commit ccd0520 into ruanyl:workspace Sep 20, 2023
18 of 20 checks passed
@yuye-aws yuye-aws deleted the duplicate_dashboard_visualize branch September 20, 2023 05:14
@opensearch-workspace-development

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

Then, create a pull request where the base branch is workspace-2.9 and the compare/head branch is backport/backport-148-to-workspace-2.9.

SuZhou-Joe pushed a commit that referenced this pull request Apr 16, 2024
* Add copy saved objects among workspaces functionality (#53)

* Add copy saved objects among workspaces functionality

Signed-off-by: gaobinlong <gbinlong@amazon.com>

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix bug

Signed-off-by: gaobinlong <gbinlong@amazon.com>

* Fix bug

Signed-off-by: gaobinlong <gbinlong@amazon.com>

---------

Signed-off-by: gaobinlong <gbinlong@amazon.com>
# Conflicts:
#	src/core/server/saved_objects/routes/copy.ts
#	src/plugins/saved_objects_management/public/constants.ts
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
#	src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx

* feat: duplicate selected objects (#113)

* fix typo

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* adjust copy modal

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* list workspace with write permission on copy modal

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add copy icon and move getcopyworkspaces function from copy_modal to saved_object table

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* fix duplicate error in public workspace and change copy to duplicate all in header

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* bug fix: create saved objects in public workspace

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* update snapshots

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove unused import

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change validate schema

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* behavior subject bug fix for workspace plugin

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

---------

Signed-off-by: yuye-aws <yuyezhu@amazon.com>
# Conflicts:
#	src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap
#	src/core/server/saved_objects/permission_control/acl.test.ts
#	src/core/server/saved_objects/permission_control/client.ts
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/copy_modal.tsx
#	src/plugins/workspace/server/plugin.ts
#	src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts

* Saved objects page change (#123)

* hide import for application home page

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add workpspace into gotoApp link

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* remove special logic for management workspace

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* variable name change and more UTs

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
# Conflicts:
#	src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/__snapshots__/header.test.tsx.snap
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/table.test.tsx
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/table.tsx
#	src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.test.tsx
#	src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx

* feat: duplicate all and single objects (#121)

* implement all duplicate copy modal

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add spacer after checkbox list

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add fail message for copy saved objects

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change title wording to manage library

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* single duplicate

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change wording

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove comment

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* bug fix: keep selected saved objects info when cancel duplicate all

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* fix typo

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* use icu syntax in copy message

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* bug fix: keep selected saved objects info when cancel duplicate single

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* set current workspace as the first option

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* update snapshot

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* resolve conflict

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* update snapshot

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* bug fix for saved object table

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* update snapshot

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove unused file

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change i18n constant

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove empty push

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* hide duplicate when workspace is disabled

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* update snapshots

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

---------

Signed-off-by: yuye-aws <yuyezhu@amazon.com>
# Conflicts:
#	src/plugins/saved_objects_management/public/constants.ts
#	src/plugins/saved_objects_management/public/management_section/objects_table/__snapshots__/saved_objects_table.test.tsx.snap
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/copy_modal.tsx
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/header.tsx
#	src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
#	src/plugins/saved_objects_management/public/plugin.ts

* feat: Duplicate dashboard visualize (#148)

* rename copy to duplicate

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* duplicate in visualization

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* duplicate in dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* resolve conflict

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* update test and snapshots

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* re-duplicate if some objects cannot be duplicated

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove clone for dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* rename duplicateState to duplicateMode

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change workspace prop to currentWorkspace in SavedObjectsDuplicateModal

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change wording

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* move duplicate modal to saved_objects for reuse

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* move duplicate modal to saved objects management for reuse

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove minimal duplicate modal props logic

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* refactor duplicate modal props for dashboard and visualization

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* Update getDuplicateWorkspaces function

Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>

* update function onDuplicate for dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* Update doDuplicate for visualization

Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>

* refactor function getDuplicateWorkspaces

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add i18n context to saved objects table duplicate modal

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* refactor duplicate modal logic in saved object table

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add error message for partial duplicate failed

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* merge commits

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add type info for dashboard and visualization

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remote create vis reference logic

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* Revert "remove clone for dashboard"

This reverts commit 84f77fb.

* hide duplicate when workspace disabled in dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* feat: skip permission validate when no workspaces and permissions attributes (#163)

* feat: skip permission validate when saved object without workspaces and permissions attributes

Signed-off-by: Lin Wang <wonglam@amazon.com>

* feat: add annontation to skip permission check

Signed-off-by: Lin Wang <wonglam@amazon.com>

* refactor: remove bind and simplify validate logic

Signed-off-by: Lin Wang <wonglam@amazon.com>

* feat: remove library write for object based ACL

Signed-off-by: Lin Wang <wonglam@amazon.com>

---------

Signed-off-by: Lin Wang <wonglam@amazon.com>

* remove get workspaces with write permission logic and add readonly props to workspace attribute

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change type definition logic

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* Fix typo (#176)

---------

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>

* remove exit workspace logic (#179)

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* rename copy to duplicate

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* duplicate in visualization

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* duplicate in dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* resolve conflict

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* update test and snapshots

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* re-duplicate if some objects cannot be duplicated

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove clone for dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* rename duplicateState to duplicateMode

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change workspace prop to currentWorkspace in SavedObjectsDuplicateModal

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change wording

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* move duplicate modal to saved_objects for reuse

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* move duplicate modal to saved objects management for reuse

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove minimal duplicate modal props logic

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* refactor duplicate modal props for dashboard and visualization

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* Update getDuplicateWorkspaces function

Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>

* update function onDuplicate for dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* Update doDuplicate for visualization

Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>

* refactor function getDuplicateWorkspaces

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add i18n context to saved objects table duplicate modal

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* refactor duplicate modal logic in saved object table

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add error message for partial duplicate failed

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* merge commits

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* add type info for dashboard and visualization

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remote create vis reference logic

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* Revert "remove clone for dashboard"

This reverts commit 84f77fb.

* hide duplicate when workspace disabled in dashboard

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* remove get workspaces with write permission logic and add readonly props to workspace attribute

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change type definition logic

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* rename variable and function name

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

* change permission mode to get target workspaces when duplicate

Signed-off-by: yuye-aws <yuyezhu@amazon.com>

---------

Signed-off-by: yuye-aws <yuyezhu@amazon.com>
Signed-off-by: Lin Wang <wonglam@amazon.com>
Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Co-authored-by: Yulong Ruan <ruanyu1@gmail.com>
Co-authored-by: Lin Wang <wonglam@amazon.com>
Co-authored-by: Yulong Ruan <ruanyl@amazon.com>
# Conflicts:
#	src/core/public/workspace/workspaces_service.ts
#	src/plugins/saved_objects_management/public/constants.ts
#	src/plugins/saved_objects_management/public/management_section/objects_table/components/duplicate_modal.tsx
#	src/plugins/saved_objects_management/public/management_section/objects_table/saved_objects_table.tsx
#	src/plugins/workspace/server/saved_objects/workspace_saved_objects_client_wrapper.ts

* delete useless code

* refactor dupicate_model code and fix test error

* add duplicate all/selected saved objects unit test

* add util and copy unit test

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

* fix bug

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

* fix unit test error

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

* add all unit test and fix code error

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

* revert useless modifications

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

* add snapshot code

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

* delete useless code

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

* optimize code

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

* split duplicate_modal

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

* optimize code

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

* fix unit test

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

* optimize code

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

* Fixed the bug that can not duplicate all saved objects

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

* Fixed the bug that can not duplicate all saved objects

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>

---------

Signed-off-by: yubonluo <yubonluo@amazon.com>
Co-authored-by: gaobinlong <gbl_long@163.com>
Co-authored-by: Yuye Zhu <yuyezhu@amazon.com>
Co-authored-by: Hailong Cui <ihailong@amazon.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.

4 participants