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.

Files: 
CommentFileSizeAuthor
#24 use_data_to_check-1473760-24.patch4.26 KBalansaviolobo
FAILED: [[SimpleTest]]: [PHP 5.5 MySQL] 97,525 pass(es), 0 fail(s), and 59,314 exception(s). View
#22 use_data_to_check-1473760-22.patch1023 bytesalansaviolobo
FAILED: [[SimpleTest]]: [PHP 5.5 MySQL] Unable to apply patch use_data_to_check-1473760-22.patch. Unable to apply patch. See the log in the details link for more information. View
#20 core-js-modules-dependencies-1473760-12.patch4.99 KBcapynet
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 66,600 pass(es). View
#18 core-js-modules-dependencies-1473760-11.patch4.41 KBcapynet
PASSED: [[SimpleTest]]: [MySQL] 63,364 pass(es). View
#7 core-js-modules-dependencies-1473760-7.patch3.42 KBnod_
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch core-js-modules-dependencies-1473760-7.patch. Unable to apply patch. See the log in the details link for more information. View
#1 core-js-modules-dependencies-1473760-1.patch2.72 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 37,004 pass(es). View
core-js-modules-dependencies.patch2.72 KBnod_
PASSED: [[SimpleTest]]: [MySQL] 35,152 pass(es). View

Comments

nod_’s picture

FileSize
2.72 KB
PASSED: [[SimpleTest]]: [MySQL] 37,004 pass(es). View

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

FileSize
3.42 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch core-js-modules-dependencies-1473760-7.patch. Unable to apply patch. See the log in the details link for more information. View

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
PASSED: [[SimpleTest]]: [MySQL] 63,087 pass(es). View

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

capynet’s picture

FileSize
4.45 KB
PASSED: [[SimpleTest]]: [MySQL] 63,181 pass(es). View

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

capynet’s picture

FileSize
9.38 KB
PASSED: [[SimpleTest]]: [MySQL] 63,153 pass(es). View

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
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch core-js-modules-dependencies-1473760-10.patch. Unable to apply patch. See the log in the details link for more information. View

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
PASSED: [[SimpleTest]]: [MySQL] 63,364 pass(es). View

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
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 66,600 pass(es). View

"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

FileSize
1023 bytes
FAILED: [[SimpleTest]]: [PHP 5.5 MySQL] Unable to apply patch use_data_to_check-1473760-22.patch. Unable to apply patch. See the log in the details link for more information. View

reroll

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
FAILED: [[SimpleTest]]: [PHP 5.5 MySQL] 97,525 pass(es), 0 fail(s), and 59,314 exception(s). View

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.