Fix "Assign object to spaces" flyout UX problems (#128946)

This commit is contained in:
Joe Portner 2022-03-31 12:11:31 -04:00 committed by GitHub
parent a5620502d0
commit 19e43a305d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 90 additions and 58 deletions

View file

@ -447,13 +447,17 @@ const shareToSpaceFlyoutProps: ShareToSpaceFlyoutProps = {
onClose: () => setShowFlyout(false),
};
const canAssignSpaces = !capabilities || !!capabilities.savedObjectsManagement.shareIntoSpace;
const clickProperties = canAssignSpaces
? { cursorStyle: 'pointer', listOnClick: () => setShowFlyout(true) }
: { cursorStyle: 'not-allowed' };
return (
<>
<LazySpaceList
namespaces={spaceIds}
displayLimit={8}
behaviorContext="outside-space" <4>
listOnClick={() => setShowFlyout(true)}
{...clickProperties}
/>
{showFlyout && <LazyShareToSpaceFlyout {...shareToSpaceFlyoutProps} />}
</>