Skip to content

Commit

Permalink
Editor: Can't edit sharing for a widget in a zone
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao committed Mar 21, 2024
1 parent 49f018f commit c1a6b3a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions ui/src/layout-editor/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3003,10 +3003,13 @@ lD.openContextMenu = function(obj, position = {x: 0, y: 0}) {
layoutObject.type === 'element-group'
);

// If target is a frame, send single widget info
// If target is a frame or zone, send single widget info
const singleWidget = (
layoutObject.type === 'region' &&
layoutObject.subType === 'frame'
(
layoutObject.subType === 'frame' ||
layoutObject.subType === 'zone'
)
) ? Object.values(layoutObject.widgets)[0] : {};

// If target is group or element group, send parent widget
Expand Down Expand Up @@ -3397,12 +3400,15 @@ lD.openContextMenu = function(obj, position = {x: 0, y: 0}) {
const property = target.data('property');
const propertyType = target.data('propertyType');

// If we're editing permissions and it's a frame
// If we're editing permissions and it's a frame ( or zone )
// edit the widget's permissions instead
if (
property === 'PermissionsWidget' &&
layoutObject.type === 'region' &&
layoutObject.subType === 'frame'
(
layoutObject.subType === 'frame' ||
layoutObject.subType === 'zone'
)
) {
// Call edit for widget instead
const regionWidget = Object.values(layoutObject.widgets)[0];
Expand Down
2 changes: 1 addition & 1 deletion ui/src/templates/context-menu.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
</div>
{{/if}}

{{#if isFrame}}
{{#if isFrameOrZone}}
{{#if widget.isPermissionsModifiable}}
<div class="context-menu-btn permissionsBtn" data-title="{{trans.editPermissions}}" data-property="PermissionsWidget" data-toggle="tooltip" data-container=".context-menu" data-placement="bottom">
<i class="tool-icon-permissions"></i><span>{{trans.editPermissions}}</span>
Expand Down

0 comments on commit c1a6b3a

Please sign in to comment.