In D7 you could use contextual links on the preview to alter the View.

This had no test coverage, and at some point was broken.

Let's fix it, and add coverage.

Any accessibility or usability issues related to it will have to be addressed here, and not in issues like #1806022: Views' text color does not have sufficient contrast

Comments

dawehner’s picture

Assigned: Unassigned » dawehner

Assign to myself.

dawehner’s picture

Status: Active » Needs work
StatusFileSize
new4.32 KB
new32.92 KB
new6.61 KB

So far this should work, though there is one fundamental issue behind it (which probably also causes contextual filters to fail).
The actual POST request produces a 302 which leads to a GET request, which does not have the ajax_page_state attached anymore,
which automatically leads to the problem that no new js is added.

    // It is highly suspicious if $_POST['ajax_page_state'][$type] is empty,
    // since the base page ought to have at least one JS file and one CSS file
    // loaded. It probably indicates an error, and rather than making the page
    // reload all of the files, instead we return no new files.
    if (empty($_POST['ajax_page_state'][$type])) {
      $items[$type] = array();
    }

For reference i uploaded both the network output of d7 and d8 when you click on preview.

dawehner’s picture

Status: Needs work » Needs review

This one has a dependency on #1841442: Contextual filters are broken in the Views UI preview, so this actual code can be already reviewed

Status: Needs review » Needs work
Issue tags: -VDC

The last submitted patch, drupal-1837982-2.patch, failed testing.

dawehner’s picture

Status: Needs work » Needs review

#2: drupal-1837982-2.patch queued for re-testing.

dawehner’s picture

Issue tags: +VDC

#2: drupal-1837982-2.patch queued for re-testing.

tim.plunkett’s picture

Assigned: dawehner » tim.plunkett
Issue tags: +Needs tests

Going to write a test

tim.plunkett’s picture

Assigned: tim.plunkett » dawehner
Issue tags: -Needs tests
StatusFileSize
new5.51 KB
new1.19 KB
tim.plunkett’s picture

StatusFileSize
new5.38 KB

Whoops, left a test method commented out

dawehner’s picture

The tests are looking great, so they are looking RTBC.

aspilicious’s picture

Status: Needs review » Reviewed & tested by the community

This means we seriously lacking tests ;). Good job in finding/fixing this and writing a test for it. Go VDC team!

catch’s picture

Issue tags: -VDC

#9: vdc-1837982-9.patch queued for re-testing.

Status: Reviewed & tested by the community » Needs work
Issue tags: +VDC

The last submitted patch, vdc-1837982-9.patch, failed testing.

tim.plunkett’s picture

Status: Needs work » Needs review
StatusFileSize
new5.39 KB

views_ui/theme/theme.inc is now views_ui/views_ui.theme.inc

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Back to rtbc.

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

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