Skip to content

Copy saved object flyout should not allow copying into the active space #116650

@jportner

Description

@jportner

Kibana version: 7.16 (unreleased)

Describe the bug:

Steps to reproduce:

  1. Start a fresh ES cluster and fresh Kibana instance
  2. Navigate to Stack Management > Saved objects
  3. Find the config object and click the "Copy to space" action

Expected behavior:

The flyout should exclude the active space from the list of target spaces. If there are no target spaces, the flyout should inform you that there are no other spaces to copy this object to.

Screenshots (if relevant):

This is currently what it looks like:

image

This is what it should look like:

image

Any additional context:

This was introduced during #109258 but we did not catch it because the unit test was unstable (failed under heavy CPU load) and it had been skipped 🤦

Need to make this change to fix it:

diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx
index 7697780c352..3ff72e131aa 100644
--- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx
+++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout_internal.tsx
@@ -75,7 +75,7 @@ export const CopyToSpaceFlyoutInternal = (props: CopyToSpaceFlyoutProps) => {
           isLoading: false,
           spaces: [...spacesMap.values()].filter(
             ({ isActiveSpace, isAuthorizedForPurpose }) =>
-              isActiveSpace || isAuthorizedForPurpose('copySavedObjectsIntoSpace')
+              !isActiveSpace && isAuthorizedForPurpose('copySavedObjectsIntoSpace')
           ),
         });
       })

Thanks @XavierM for fixing the tests and discovering this!

Metadata

Metadata

Assignees

Labels

Team:SecurityPlatform Security: Auth, Users, Roles, Spaces, Audit Logging, etc t//bugFixes for quality problems that affect the customer experience

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions