Loading js/adminUi.js +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ /** * Callback used in {@link Drupal.behaviors.views_bulk_operations}. * * @param {object} $element * @param {object} element */ Drupal.viewsBulkOperationsUi = function (element) { var $uiElement = $(element); Loading js/frontUi.js +12 −7 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Select-All Button functionality. */ (function ($, Drupal) { (function ($, Drupal, drupalSettings) { 'use strict'; Loading Loading @@ -82,16 +82,17 @@ toggleButtonsState() { // If no rows are checked, disable any form submit actions. var buttons = $('[id^="edit-actions"] input[type="submit"], [id^="edit-actions"] button[type="submit"]', this.vbo_form); var anyItemsSelected; if (this.view_id.length && this.display_id.length) { var anyItemsSelected = this.totalCount; anyItemsSelected = this.totalCount; } else { var anyItemsSelected = $('.form-checkbox:checked', this.vbo_form).length; anyItemsSelected = $('.form-checkbox:checked', this.vbo_form).length; } if (this.$actionSelect.length) { var has_selection = anyItemsSelected && this.$actionSelect.val() !== ''; let has_selection = anyItemsSelected && this.$actionSelect.val() !== ''; buttons.prop('disabled', !has_selection); } else { Loading Loading @@ -164,7 +165,11 @@ } }; if (drupalSettings.hasOwnProperty('vbo') && drupalSettings.vbo.hasOwnProperty('ajax_loader') && drupalSettings.vbo.ajax_loader) { if ( Object.prototype.hasOwnProperty.call(drupalSettings, 'vbo') && Object.prototype.hasOwnProperty.call(drupalSettings.vbo, 'ajax_loader') && drupalSettings.vbo.ajax_loader ) { ajax_options.progress = {type: 'fullscreen'}; } Loading Loading @@ -274,4 +279,4 @@ vboSelection.toggleButtonsState(); }; })(jQuery, Drupal); })(jQuery, Drupal, drupalSettings); src/Service/ViewsBulkOperationsActionProcessor.php +2 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,8 @@ class ViewsBulkOperationsActionProcessor implements ViewsBulkOperationsActionPro $this->view->setItemsPerPage($this->bulkFormData['batch_size']); $this->view->setCurrentPage($page); $this->view->style_plugin = Views::pluginManager('style')->createInstance('default'); $this->view->style_plugin->init($this->view, $this->view->getDisplay()); $this->view->build(); $offset = $this->bulkFormData['batch_size'] * $page; Loading tests/src/FunctionalJavascript/ViewsBulkOperationsBulkFormTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ class ViewsBulkOperationsBulkFormTest extends WebDriverTestBase { $this->assertTrue($this->page->hasUncheckedField($node->label()), sprintf('%s should be still unchecked.', $node->label())); } } $this->createScreenshot('/var/www/html/page_' . $page . '.jpg'); if ($page + 1 === $npages) { break; } Loading tests/src/Kernel/ActionMessagesTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -39,7 +39,10 @@ class ActionMessagesTest extends ViewsBulkOperationsKernelTestBase { } /** * Data provider. * * @return mixed[] * The test data. */ public function actionDataProvider(): array { return [ Loading Loading
js/adminUi.js +1 −1 Original line number Diff line number Diff line Loading @@ -19,7 +19,7 @@ /** * Callback used in {@link Drupal.behaviors.views_bulk_operations}. * * @param {object} $element * @param {object} element */ Drupal.viewsBulkOperationsUi = function (element) { var $uiElement = $(element); Loading
js/frontUi.js +12 −7 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ * Select-All Button functionality. */ (function ($, Drupal) { (function ($, Drupal, drupalSettings) { 'use strict'; Loading Loading @@ -82,16 +82,17 @@ toggleButtonsState() { // If no rows are checked, disable any form submit actions. var buttons = $('[id^="edit-actions"] input[type="submit"], [id^="edit-actions"] button[type="submit"]', this.vbo_form); var anyItemsSelected; if (this.view_id.length && this.display_id.length) { var anyItemsSelected = this.totalCount; anyItemsSelected = this.totalCount; } else { var anyItemsSelected = $('.form-checkbox:checked', this.vbo_form).length; anyItemsSelected = $('.form-checkbox:checked', this.vbo_form).length; } if (this.$actionSelect.length) { var has_selection = anyItemsSelected && this.$actionSelect.val() !== ''; let has_selection = anyItemsSelected && this.$actionSelect.val() !== ''; buttons.prop('disabled', !has_selection); } else { Loading Loading @@ -164,7 +165,11 @@ } }; if (drupalSettings.hasOwnProperty('vbo') && drupalSettings.vbo.hasOwnProperty('ajax_loader') && drupalSettings.vbo.ajax_loader) { if ( Object.prototype.hasOwnProperty.call(drupalSettings, 'vbo') && Object.prototype.hasOwnProperty.call(drupalSettings.vbo, 'ajax_loader') && drupalSettings.vbo.ajax_loader ) { ajax_options.progress = {type: 'fullscreen'}; } Loading Loading @@ -274,4 +279,4 @@ vboSelection.toggleButtonsState(); }; })(jQuery, Drupal); })(jQuery, Drupal, drupalSettings);
src/Service/ViewsBulkOperationsActionProcessor.php +2 −0 Original line number Diff line number Diff line Loading @@ -219,6 +219,8 @@ class ViewsBulkOperationsActionProcessor implements ViewsBulkOperationsActionPro $this->view->setItemsPerPage($this->bulkFormData['batch_size']); $this->view->setCurrentPage($page); $this->view->style_plugin = Views::pluginManager('style')->createInstance('default'); $this->view->style_plugin->init($this->view, $this->view->getDisplay()); $this->view->build(); $offset = $this->bulkFormData['batch_size'] * $page; Loading
tests/src/FunctionalJavascript/ViewsBulkOperationsBulkFormTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -197,7 +197,7 @@ class ViewsBulkOperationsBulkFormTest extends WebDriverTestBase { $this->assertTrue($this->page->hasUncheckedField($node->label()), sprintf('%s should be still unchecked.', $node->label())); } } $this->createScreenshot('/var/www/html/page_' . $page . '.jpg'); if ($page + 1 === $npages) { break; } Loading
tests/src/Kernel/ActionMessagesTest.php +3 −0 Original line number Diff line number Diff line Loading @@ -39,7 +39,10 @@ class ActionMessagesTest extends ViewsBulkOperationsKernelTestBase { } /** * Data provider. * * @return mixed[] * The test data. */ public function actionDataProvider(): array { return [ Loading