diff --git a/composer.json b/composer.json index f54ca7e7e..01e73eb8f 100644 --- a/composer.json +++ b/composer.json @@ -87,7 +87,6 @@ "drupal/paragraphs_paste": "^2.0-beta3", "drupal/password_policy": "^4.0", "drupal/pathauto": "^1.11", - "drupal/responsive_preview": "^2.1", "drupal/redirect": "^1.7", "drupal/scheduler": "^2.0.2", "drupal/scheduler_content_moderation_integration": "^2.0", diff --git a/config/install/user.role.editor.yml b/config/install/user.role.editor.yml index 7002b33fa..89b5fa4e6 100644 --- a/config/install/user.role.editor.yml +++ b/config/install/user.role.editor.yml @@ -20,7 +20,6 @@ dependencies: - media - node - path - - responsive_preview - scheduler - system - taxonomy @@ -37,7 +36,6 @@ permissions: - 'access contextual links' - 'access files overview' - 'access media overview' - - 'access responsive preview' - 'access tokens overview' - 'access toolbar' - 'administer menu' diff --git a/config/install/user.role.restricted_editor.yml b/config/install/user.role.restricted_editor.yml index 5ba4d7272..8b74a5ad5 100644 --- a/config/install/user.role.restricted_editor.yml +++ b/config/install/user.role.restricted_editor.yml @@ -20,7 +20,6 @@ dependencies: - media - node - path - - responsive_preview - scheduler - system - taxonomy @@ -35,7 +34,6 @@ permissions: - 'access contextual links' - 'access files overview' - 'access media overview' - - 'access responsive preview' - 'access tokens overview' - 'access toolbar' - 'break content lock' diff --git a/config/install/user.role.seo.yml b/config/install/user.role.seo.yml index e4ba12e84..dcffbd6f9 100644 --- a/config/install/user.role.seo.yml +++ b/config/install/user.role.seo.yml @@ -22,7 +22,6 @@ dependencies: - node - path - redirect - - responsive_preview - scheduler - system - taxonomy @@ -40,7 +39,6 @@ permissions: - 'access contextual links' - 'access files overview' - 'access media overview' - - 'access responsive preview' - 'access tokens overview' - 'access toolbar' - 'administer menu' diff --git a/docs/user-guide/feature-overview.md b/docs/user-guide/feature-overview.md index c3a706408..df4b17568 100644 --- a/docs/user-guide/feature-overview.md +++ b/docs/user-guide/feature-overview.md @@ -127,10 +127,6 @@ system that uses tokens which the administrator can change.\ **Redirect**: The Redirect module automatically adds redirects if the URL of an article has been changed.\ [https://www.drupal.org/project/redirect](https://www.drupal.org/project/redirect) -**Responsive Preview**: The Responsive Preview module provides editors with a quick way to preview how their site's -pages will appear at narrow and wide width dimensions on different devices.\ -[https://www.drupal.org/project/responsive_preview](https://www.drupal.org/project/responsive_preview) - **Scheduler**: Scheduler gives content editors the ability to schedule nodes to be published and unpublished at specified dates and times in the future. Dates can be entered either as plain text or with calendar popups.\ [https://www.drupal.org/project/scheduler](https://www.drupal.org/project/scheduler) diff --git a/tests/src/Functional/ModuleUninstallTest.php b/tests/src/Functional/ModuleUninstallTest.php index 0f47cc9b4..152402548 100644 --- a/tests/src/Functional/ModuleUninstallTest.php +++ b/tests/src/Functional/ModuleUninstallTest.php @@ -20,7 +20,6 @@ class ModuleUninstallTest extends ThunderTestBase { ['diff'], ['content_lock'], ['access_unpublished'], - ['responsive_preview'], ['length_indicator'], ['redirect'], ['simple_sitemap'], diff --git a/tests/src/FunctionalJavascript/Integration/ResponsivePreviewTest.php b/tests/src/FunctionalJavascript/Integration/ResponsivePreviewTest.php deleted file mode 100644 index dfc7e22b9..000000000 --- a/tests/src/FunctionalJavascript/Integration/ResponsivePreviewTest.php +++ /dev/null @@ -1,104 +0,0 @@ -assertSession(); - - /** @var \Behat\Mink\Session $session */ - $session = $this->getSession(); - - // Check channel page. - $this->drupalGet('news'); - - // The selection of device should create overlay with iframe to news page. - $this->selectDevice('(//*[@id="responsive-preview-toolbar-tab"]//button[@data-responsive-preview-name])[1]'); - $assert_session->elementNotExists('xpath', '//*[@id="responsive-preview-orientation" and contains(@class, "rotated")]'); - $assert_session->elementExists('xpath', '//*[@id="responsive-preview-frame"]'); - $this->waitForIframeContent(); - $this->assertTrue($session->evaluateScript("document.getElementById('responsive-preview-frame').contentWindow.location.href.endsWith('news')")); - - // Clicking of rotate should rotate iframe sizes. - $current_width = $session->evaluateScript("document.getElementById('responsive-preview-frame').clientWidth"); - $current_height = $session->evaluateScript("document.getElementById('responsive-preview-frame').clientHeight"); - $this->changeDeviceRotation(); - $this->waitForIframeContent(); - $assert_session->elementExists('xpath', '//*[@id="responsive-preview-orientation" and contains(@class, "rotated")]'); - $this->assertEquals($current_height, $session->evaluateScript("document.getElementById('responsive-preview-frame').clientWidth")); - $this->assertEquals($current_width, $session->evaluateScript("document.getElementById('responsive-preview-frame').clientHeight")); - - // @todo Device switcher is not accessible from overlay when using gin secondary toolbar. - // Switching of device should keep rotation. - // Clicking on preview close, should remove overlay. - $this->getSession() - ->getPage() - ->find('xpath', '//*[@id="responsive-preview-close"]') - ->click(); - $this->getSession() - ->wait(5000, "document.getElementById('responsive-preview-frame') === null"); - $assert_session->elementNotExists('xpath', '//*[@id="responsive-preview"]'); - - $node = $this->loadNodeByUuid('bbb1ee17-15f8-46bd-9df5-21c58040d741'); - $this->drupalGet($node->toUrl('edit-form')); - - // Using preview on entity edit should use preview page. - $this->selectDevice('(//*[@id="responsive-preview-toolbar-tab"]//button[@data-responsive-preview-name])[1]'); - $this->waitForIframeContent(); - $this->assertNotEquals(-1, $session->evaluateScript("document.getElementById('responsive-preview-frame').contentWindow.location.href.indexOf('/node/preview/')")); - $this->changeDeviceRotation(); - } - - /** - * Change device rotation for device preview. - */ - protected function changeDeviceRotation(): void { - $this->getSession() - ->getPage() - ->find('xpath', '//*[@id="responsive-preview-orientation"]') - ->click(); - $this->assertWaitOnAjaxRequest(); - } - - /** - * Wait for iframe content loaded. - */ - protected function waitForIframeContent(): void { - $this->getSession()->evaluateScript("document.getElementById('responsive-preview-frame').setAttribute('name', 'responsive-preview-frame-testing')"); - $this->getSession()->switchToIFrame('responsive-preview-frame-testing'); - $this->assertSession()->waitForElement('css', 'h1.page-title'); - $this->getSession()->switchToIFrame(); - } - - /** - * Select device for device preview. - * - * NOTE: Index starts from 1. - * - * @param string $xpath_device_button - * The xpath of the device in drop-down list. - */ - protected function selectDevice(string $xpath_device_button): void { - $page = $this->getSession()->getPage(); - - $page->find('xpath', '//*[@id="responsive-preview-toolbar-tab"]/button') - ->click(); - $this->assertWaitOnAjaxRequest(); - - $page->find('xpath', $xpath_device_button)->click(); - $this->assertWaitOnAjaxRequest(); - } - -} diff --git a/thunder.info.yml b/thunder.info.yml index 8e024d289..cfd7c884c 100644 --- a/thunder.info.yml +++ b/thunder.info.yml @@ -83,7 +83,6 @@ install: - select2:select2 - simple_sitemap:simple_sitemap - slick:slick - - responsive_preview:responsive_preview - update_helper_checklist:update_helper_checklist - views_bulk_edit:views_bulk_edit # thunder