Skip to content

Commit

Permalink
Fix 182 (#186)
Browse files Browse the repository at this point in the history
* add area layout for bricks without configuration
* fix codeception
  • Loading branch information
solverat authored Nov 16, 2022
1 parent c45ea75 commit 7771862
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeception.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ jobs:
- name: Start Webserver and Chrome
run: |
wget https://get.symfony.com/cli/installer -O - | bash
~/.symfony/bin/symfony server:start --port=8080 --dir=public --force-php-discovery --allow-http --no-tls --daemon
curl -sS https://get.symfony.com/cli/installer | bash -s -- --install-dir=$HOME/.symfony/bin
~/.symfony/bin/symfony server:start --port=8080 --dir=public --allow-http --no-tls --daemon
- name: Get Composer Cache Directory
id: composer-cache
Expand Down
3 changes: 3 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Upgrade Notes

## Version 4.0.9
- [BUGFIX] Missing area layout for bricks without configuration [#182](https://github.com/dachcom-digital/pimcore-toolbox/issues/182)

## Version 4.0.8
- [BUGFIX] Fix wrong query identifier for MembersBundle connector [@scrummer](https://github.com/dachcom-digital/pimcore-toolbox/pull/179)

Expand Down
4 changes: 4 additions & 0 deletions src/ToolboxBundle/Resources/public/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,10 @@ body > .single-teaser img {
opacity: 1;
}

.toolbox-element-edit-button.not-configurable {
padding: 3px 0 0 0;
}

.toolbox-element-edit-button.no-interaction {
height: 26px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ pimcore.document.editables.areablock = Class.create(pimcore.document.editables.a

addToolboxEditBar: function () {

var i, $areaEl, $areaButtonsEl, $editDiv, $labelDiv, $el, $editButton;
var i, $areaEl, $areaButtonsEl, $editDiv, $labelDiv, $el, $editButton, isConfigurable;

if (this.elements.length === 0) {
return;
Expand All @@ -95,39 +95,42 @@ pimcore.document.editables.areablock = Class.create(pimcore.document.editables.a
$areaButtonsEl = $areaEl.query('.pimcore_area_buttons[data-name="' + this.name + '"]')[0];
$editDiv = $areaEl.query('.pimcore_block_dialog[data-name="' + this.name + '"]')[0];
$labelDiv = $areaEl.query('.pimcore_block_label[data-name="' + this.name + '"] b')[0];
isConfigurable = typeof $editDiv !== 'undefined';

// check for permission
if (this.hasToolboxPermissionForEditable($areaEl.getAttribute('type')) === false) {
$areaEl.addCls('editable-blocked');
}

if ($editDiv && Ext.get($editDiv).isVisible() === true) {
if ($labelDiv && !$areaEl.hasCls('toolbox-initialized')) {

//$areaEl.clearListeners();
$areaEl.addCls('toolbox-initialized');

$el = Ext.DomHelper.insertAfter($areaButtonsEl, {
'tag': 'div',
'class': 'toolbox-element-edit-button',
'class': 'toolbox-element-edit-button' + ( isConfigurable ? '' : ' not-configurable'),
'data-title': $labelDiv.innerHTML
}, true);

//remove pimcore default button!
Ext.get($editDiv).setVisible(false);

$editButton = new Ext.Button({
cls: 'pimcore_block_button_plus',
iconCls: 'pimcore_icon_edit',
text: t('edit'),
handler: this.openEditableDialogBox.bind(this, this.elements[i], $editDiv),
listeners: {
afterrender: function(ev) {
$areaEl.fireEvent('toolbox.bar.added', $areaEl);
}
}
});
if (isConfigurable === true) {

$editButton.render($el);
//remove pimcore default edit button!
Ext.get($editDiv).setVisible(false);

$editButton = new Ext.Button({
cls: 'pimcore_block_button_plus',
iconCls: 'pimcore_icon_edit',
text: t('edit'),
handler: this.openEditableDialogBox.bind(this, this.elements[i], $editDiv),
listeners: {
afterrender: function(ev) {
$areaEl.fireEvent('toolbox.bar.added', $areaEl);
}
}
});

$editButton.render($el);
}
}

} catch (e) {
Expand Down

0 comments on commit 7771862

Please sign in to comment.