Skip to content

Commit

Permalink
pkp/pkp-lib#10444 Improve dialog component design (#89)
Browse files Browse the repository at this point in the history
* pkp/pkp-lib#10444 Add modalStyle when using dialog component

* pkp/pkp-lib#10444 Adjust cypress test to click the Appearance tab first before clicking its content

* pkp/pkp-lib#10444 [cypress] Reload website page after adding new customBlock

* pkp/pkp-lib#10444 Change modalStyle value when opening custom block modal

* pkp/pkp-lib#10444 Remove modalStyle param when using AjaxModal class
  • Loading branch information
blesildaramirez authored Nov 17, 2024
1 parent 8222089 commit dd8c68d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CustomBlockManagerPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function getActions($request, $actionArgs): array
'category' => $this->getCategory(),
'action' => 'index'
]),
$this->getDisplayName()
$this->getDisplayName(),
);
return array_merge([new LinkAction('settings', $ajaxModal, __('plugins.generic.customBlockManager.manage'))], $actions);
}
Expand Down
1 change: 0 additions & 1 deletion controllers/grid/CustomBlockGridHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public function initialize($request, $args = null)
new AjaxModal(
$router->url($request, null, null, 'addCustomBlock'),
__('plugins.generic.customBlockManager.addBlock'),
'modal_add_item'
),
__('plugins.generic.customBlockManager.addBlock'),
'add_item'
Expand Down
4 changes: 2 additions & 2 deletions controllers/grid/CustomBlockGridRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function initialize($request, $template = null)
new AjaxModal(
$router->url($request, null, null, 'editCustomBlock', null, ['blockName' => $blockName]),
__('grid.action.edit'),
'modal_edit',
null,
true
),
__('grid.action.edit'),
Expand All @@ -63,7 +63,7 @@ public function initialize($request, $template = null)
__('common.confirmDelete'),
__('grid.action.delete'),
$router->url($request, null, null, 'deleteCustomBlock', null, ['blockName' => $blockName]),
'modal_delete'
'negative'
),
__('grid.action.delete'),
'delete'
Expand Down
11 changes: 5 additions & 6 deletions cypress/tests/functional/CustomBlocks.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,11 @@ describe('Custom Block Manager plugin tests', function() {
cy.wait(500); // Make sure the form has closed
cy.get('[role="dialog"] button:contains(\'Close\')').click();

// FIXME: The settings area has to be reloaded before the new block will appear.a
// This click should be unnecessary.
cy.get('nav').contains('Settings').click();
// Ensure submenu item click despite animation
cy.get('nav').contains('Website').click({ force: true });
cy.get('#appearance > .pkpTabs > .pkpTabs__buttons > #appearance-setup-button').click();
cy.reload();
cy.waitJQuery();

cy.get('button[id="appearance-button"]').click();
cy.get('#appearance-setup-button').click();
cy.get('#appearance-setup span:contains("test-custom-block"):first').click();
cy.get('#appearance-setup button:contains("Save")').click();
cy.waitJQuery();
Expand Down

0 comments on commit dd8c68d

Please sign in to comment.