So, for the new Data display type (#1819760: Add a REST export display plugin and serializer integration.) and probably feeds, we don't actually use area plugins, a.k.a, header, footer, and no results behaviour.

So let's make it possible to disable these for a display plugin. I have copied how we currently deal with the fields category of the UI, displaying a message saying 'The selected display type does not utilize @type plugins'.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

damiankloip’s picture

FileSize
4.39 KB
dawehner’s picture

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.phpundefined
@@ -182,4 +182,30 @@ public function testDisplayPluginsAlter() {
+  public function testDisplayAreas() {

Maybe this test function could have some more documentation what is going on.

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.phpundefined
@@ -182,4 +182,30 @@ public function testDisplayPluginsAlter() {
+      'empty' => 'no-results-behavior',

What odd class urg!!

+++ b/core/modules/views/lib/Drupal/views/Tests/UI/DisplayTest.phpundefined
@@ -182,4 +182,30 @@ public function testDisplayPluginsAlter() {
+      $this->assertEqual($text, "The selected display type does not utilize $type plugins");

Does it make sense to use format_string instead?

damiankloip’s picture

FileSize
4.55 KB

Thanks for the comments; I added some docs in the test. I am not using format string as I am just asserting the actual strings in the UI, not for a message.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
4.55 KB

Just renamed the $name variable in the test to $class.

tim.plunkett’s picture

+++ b/core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.phpundefined
@@ -89,6 +89,14 @@
+   * @var bool
+   *   TRUE if the display can use areas, or FALSE otherwise.

@@ -360,6 +368,15 @@ public function usesAttachments() {
+   * @return bool

I think the doc should be moved from the top to the bottom

Otherwise it looks good.

damiankloip’s picture

FileSize
5.68 KB

Thanks, fixed that, and also added the missing DisplayNoAreaTest file so this will actually pass.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1829424-6.patch, failed testing.

dawehner’s picture

You should probably post some screenshots about the change!

damiankloip’s picture

FileSize
6.81 KB

Rerolled and fixed based on #1798574: Refactor Views UI to be a form controller. Tim provided a fix for the UI form rendering.

damiankloip’s picture

Status: Needs work » Needs review
damiankloip’s picture

FileSize
6.79 KB

Just removed the $text variable from the test and cast the element value directly.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Yeah for making code a bit simpler.

damiankloip’s picture

FileSize
84.37 KB

Here is a screenshot of what it achieves on the area plugins in the UI.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. I'm going to rebase and push when I'm done with this current commit spree.

Automatically closed -- issue fixed for 2 weeks with no activity.