All of the links to Views modals can actually be opened in a separate browser window, and work as a standalone form. This allows use of Views without JS (and is also useful when debugging custom Views components, as modals that crash don't show error messages).

However, the 'rearrange filters' dialog's layout is broken when viewed in this way.

Eg, see admin/structure/views/nojs/rearrange-filter/content/default:

Furthermore, there is no way to add a new filter group.

Comments

joachim created an issue. See original summary.

joachim’s picture

Title: noJS version of Views rearrange filters dialog has broken layout » noJS version of Views rearrange filters dialog is broken
Issue summary: View changes
dawehner’s picture

Issue tags: +Needs tests

Wow, I haven't seen that

msankhala’s picture

Assigned: Unassigned » msankhala

Assigning to myself to verify this issue and provide solution if possible.

msankhala’s picture

I can verify this issue exists for drupal 8.2.0-dev as well.

msankhala’s picture

The reason why nojs verson of rearrange filer form style is broken because of missing css library admin.styling which adds views_ui.admin.theme.css file. Here is working patch which resolve this issue.

I attached this library with response returned in case of nojs, I tried attaching css with $form render array after line 214 in ajaxFormWrapper method of core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php

like:

$form = $renderer->executeInRenderContext($render_context, $callable);
$form['#attached']['library'][] = 'views_ui/admin.styling';

But that doesn't seem to work.

dawehner’s picture

+++ b/core/modules/views_ui/src/Form/Ajax/ViewsFormBase.php
@@ -260,7 +260,15 @@ protected function ajaxFormWrapper($form_class, FormStateInterface &$form_state)
+    return $title ? $response : $output;

Don't we want $response, aka. the library in every case?

msankhala’s picture

Yeah, @dawehner we want that library in every case. I think best place to add that library would be in $form render array, I tried with that but i don't know why that doesn't work so i added in $response render element.

a_thakur’s picture

Status: Active » Needs review

Changed issue status to *Needs Review*

msankhala’s picture

@dawehner Can you please help me to understand why attaching views_ui/admin.styling with $form was not working?

$form['#attached']['library'][] = 'views_ui/admin.styling';

The above snippet was attaching views admin styling with form before form render but it was not working so i attached this css library with rendered form response.

dawehner’s picture

$form = $renderer->executeInRenderContext($render_context, $callable);
$form['#attached']['library'][] = 'views_ui/admin.styling';

This doesn't work, because the first line renders, and the second line tries to add the library. It simply has to be the other way round :)

msankhala’s picture

@dawehner I think first line is not rendering form if i do kint($form) after first line it shows me render array rather then rendered html.

joachim’s picture

Status: Needs review » Needs work

The patch fixes the layout issue, and correctly hides the 'No filters' message which shows on my screenshot.

However, we're still missing the link to add groups.

I can see this in the HTML source: it's this:

<input class="views-add-group js-hide button js-form-submit form-submit" data-drupal-selector="views-add-group" id="views-add-group" name="op" value="Create new filter group" type="submit">

and the js-hide class is what's causing it to be hidden.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lendude’s picture

Status: Needs work » Closed (outdated)
Issue tags: +Bug Smash Initiative

Going through old bugs for the Bug Smash Initiative

The rearrange works now, as far as I can tell, the styling isn't great, but if you switch off javascript in Claro and then view the Views UI, this is not the first thing you trip over by far.

So if we start caring about the layout of nojs, I think that should be a whole new thing.

Closing this for now