Skip to content

Commit

Permalink
Fix #10852 Edit properties button for Anonymuos user (#10863)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Feb 26, 2025
1 parent 2742c6c commit 5a0d476
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,29 @@ function ResourceDetails({
onChange(options, resourcesGridId);
}

// resource details component can be used with the resources grid (resourceType equal to undefined)
// or inside a specific viewer viewer
const isSpecificResourceType = resourceType !== undefined;

// canCopy is possible only inside a specific viewer
const canEditResource = !!(resource?.canEdit
|| (isSpecificResourceType && resource?.canCopy));
return (
<div className="ms-details-panel">
<DetailsHeader
resource={resource || {}}
editing={editing}
tools={
<FlexBox centerChildrenVertically gap="sm">
{resourceType === undefined && editing ? <Button
{!isSpecificResourceType && editing ? <Button
tooltipId="resourcesCatalog.apply"
className={isEmpty(pendingChanges?.changes) ? undefined : 'ms-notification-circle warning'}
disabled={isEmpty(pendingChanges?.changes)}
onClick={() => handleUpdateResource(pendingChanges.saveResource)}
>
<Icon glyph="floppy-disk" type="glyphicon" />
</Button> : null}
{(resource?.canEdit || resource?.canCopy) ? <Button
{canEditResource ? <Button
tooltipId="resourcesCatalog.editResourceProperties"
square
variant={editing ? 'success' : undefined}
Expand Down

0 comments on commit 5a0d476

Please sign in to comment.