An idea from sun and coming from #1090592: [meta] Use HTML5 data-drupal-* attributes instead of #ID selectors in Drupal.settings the module page is a pretty good use-case.

When checking to enable a module there is a JS check on dependencies and check all unchecked dependencies hence avoiding the confirm step.

The patch is very rough but it works :) any comment on this is welcome. It should be using jquery ui instead of a confirm (or maybe not, which is better for screen-readers?).

I'm not certain i'll be super-fast with 100+ modules enabled, there is a lot of room for perf improvement at this point.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nod_’s picture

me no right spelling.

nod_’s picture

Status: Active » Needs review

forgot this too.

cosmicdreams’s picture

@nod_ I looked into doing something like this a while back as well. But quickly got distracted by all the markup that is injected into the render array for the module page and sought out to search and destroy all instances of from that page.

Find the code that builds up the markup for the module page and you'll see what I mean.

IMO, the addition of data attributes gives us a great opportunity to work on the markup being output here. I think a refactoring of the markup should be apart of this patch.

As a next step, I'll try to put out a patch that shows what I mean.

nod_’s picture

Title: Use data- attributes to check modules dependencies before submit » Use data-* to check modules dependencies before submit
RobLoach’s picture

Fabianx’s picture

Wow, this would be great to have in ...

nod_’s picture

reroll for the fun of it :)

Wim Leers’s picture

I think this can happen post-feature freeze?

Bojhan’s picture

I am a little skeptical about this, could this have some screens on the intended flow?

nod_’s picture

Issue tags: -JavaScript

Status: Needs review » Needs work

The last submitted patch, core-js-modules-dependencies-1473760-7.patch, failed testing.

capynet’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: +D8SVQ, +SprintWeekend2014
FileSize
4.44 KB

Re-rolled.
And added modal with a list of modules being marked.

capynet’s picture

Replaced $.ui.dialog() by Drupal.dialog();

capynet’s picture

Replaced wrong library "drupal.dialog.ajax" by "drupal.dialog"

tstoeckler’s picture

Status: Needs review » Needs work

The patch includes the patch file itself... :-)

capynet’s picture

Status: Needs work » Needs review
FileSize
4.44 KB

Fix patch loop o_O

Status: Needs review » Needs work

The last submitted patch, 16: core-js-modules-dependencies-1473760-10.patch, failed testing.

capynet’s picture

Status: Needs work » Needs review
FileSize
4.41 KB

Re-rolled.

nod_’s picture

Status: Needs review » Needs work
Issue tags: +JavaScript

the dialog dependency should be in the library definition of drupal.system.modules, not attached with it.

Can you put gettingDependencies: false outside Drupal.behavior? We should only have attach/detach in there.

$that.is(':checked') to replace by $that.prop('checked')

Drupal.dialog expects a HTMLElement, not a jQuery object.

Can you use the Array version of the button option? (We're told it's the preferred way to declare them http://api.jqueryui.com/dialog/#option-buttons).

Drupal.system is useless after all, I can bet people will confuse it for something it's not. Let's drop it and have the getDeps as a banal function in the closure.

The wording could use a little help. Feels different than the usual confirm step.

Can you also make the click handler a function instead of anon function? and also separate the declaration of the dialog options from the call of Drupal.dialog? There is too much nesting, we need to bring it down.

And as an optimisation for getDeps, we could try to use CSS selectors to do the work, kinda same way it's done in #2180921: [META] Use data attributes rather than classes wherever possible.

Thanks!

capynet’s picture

Status: Needs work » Needs review
FileSize
4.99 KB

"The wording could use a little help. Feels different than the usual confirm step."
In fact, I copied the confirm step.

"And as an optimisation for getDeps, we could try to use CSS selectors to do the work..."
Sorry, I dont understand what you mean.

nod_’s picture

What changed exactly, still seeing extra stuff in Drupal.behaviors, anon functions, not a HTMLElement in Drupal.dialog call and too much nesting.

We can delegate the event as well here.

alansaviolobo’s picture

Status: Needs review » Needs work

The last submitted patch, 22: use_data_to_check-1473760-22.patch, failed testing.

alansaviolobo’s picture

Status: Needs work » Needs review
FileSize
4.26 KB

sorry. wrong patch added earlier.

Status: Needs review » Needs work

The last submitted patch, 24: use_data_to_check-1473760-24.patch, failed testing.

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

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.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.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.

martin107’s picture

we MUST no longer be modifying *.js files directly

We modify *.es6.js and then transpile as described here :-

https://www.drupal.org/node/2815083

as a ultra trivial point new code in ModulesListForm uses array() when [] is preferred.

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.

nod_’s picture

Version: 8.9.x-dev » 9.2.x-dev
Issue tags: -JavaScript +JavaScript

hesitating on closing this one. Is there really a UX benefit of doing this?

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

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.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.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.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.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now 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.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now 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.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.