Problem/Motivation

Unable to install modules: module 'js_example' is missing its dependency module jquery_ui_accordion.

Add "drupal/jquery_ui_accordion": "^1.0" to composer.json to make drupal ci running tests from js_example.

Proposed resolution

Adjust composer.json file's indention to 4 spaces, meanwhile.

Comments

jungle created an issue. See original summary.

jungle’s picture

Assigned: jungle » Unassigned
Status: Active » Needs review
StatusFileSize
new1.44 KB
valthebald’s picture

Status: Needs review » Needs work

Adding a dependency to composer.json won't enable the module, should it be added to dependencies section of js_examples.info.yml?

mile23’s picture

Relevant change record: https://www.drupal.org/node/3067969

The best change would be to not use jquery ui accordion to demonstrate adding a script depending on an asset library.

jungle’s picture

Yes, core/jquery.ui.accordion was removed from core. See the change recored in #4. The contrib module jquery_ui_accordion should be added as a dependency, not only should be added to .info file, but also the composer.json file. Or CI won't get the code of jquery_ui_accordion module ready for use by composer.

It's a brilliant idea to rewrite the example without jquery_ui_accordion.

Another option is to use a pure javascript/jQuery accordion implementation replacing the usage of the contrib module.

- Simple jQuery accordion: https://css-tricks.com/snippets/jquery/simple-jquery-accordion/
- Pure javascript accordion: https://codepen.io/sureshrkm/pen/ZbzBpr

Wait for the final decision from maintainers for what to do next.

valthebald’s picture

@jungle: I also think that it's better to avoid including contrib dependency. I'm OK with including Simple jQuery accordion or pure javascript accordion - that would be also an example of adding a library to module itself

jungle’s picture

Title: Add "drupal/jquery_ui_accordion": "^1.0" to composer.json » Rewrite the accordion example without using jquery_ui_accordion
Status: Needs work » Needs review
StatusFileSize
new7.92 KB

Used this one "Pure javascript accordion: https://codepen.io/sureshrkm/pen/ZbzBpr"

jungle’s picture

StatusFileSize
new705.72 KB
new8.7 KB
new3.74 KB

Adjusted a little bit

Status: Needs review » Needs work

The last submitted patch, 8: 3103593-8.patch, failed testing. View results

jungle’s picture

+++ b/js_example/js_example.libraries.yml
@@ -1,11 +1,11 @@
+# https://codepen.io/sureshrkm/pen/ZbzBpr

Missing a full stop. will correct it on committing.

  • jungle committed 0d23139 on 8.x-1.x
    Issue #3103593 by jungle: Rewrite the accordion example without using...
jungle’s picture

Status: Needs work » Fixed

  • valthebald committed 7dd3947 on 3.x
    Cherry pick Issue #3103593 by jungle: Rewrite the accordion example...

Status: Fixed » Closed (fixed)

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