Problem/Motivation
The farm/settings/modules form provides a simplified UI for privileged roles to enable farmOS modules.
We recently added the ability to enable "contrib" modules as well: #3220609: Add a mechanism for detecting/displaying contrib farmOS modules in /farm/settings/modules
However it isn't always clear what a contrib module adds/includes, which makes it a bit of a guessing game to enable modules (unless you search elsewhere in the community to discover what the module does).
Further, it is not possible to disable modules through this UI (yet) - so once it's enabled you're stuck with it.
Proposed resolution
We talked about potentially looking to the module's *.info.yml
or composer.json
files and including relevant information from there.
I think using composer.json
would be easier, because they already include information like project URL, alongside description, etc. We could also consider adding some custom properties.
Or to take it even further... maybe we could add some auto-detection of specific types of code that the module provides. For example, it would be great if we could easily see which asset, log, plan types the module adds... or which flags, etc. These could potentially be detected from the module's config/install
directory.
Remaining tasks
TBD
User interface changes
Show more information about farmOS contrib modules in farm/settings/modules.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#7 | module_descriptions.png | 136.51 KB | paul121 |
#3 | farm_packages.png | 80.34 KB | paul121 |
Issue fork farm-3243336
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2.x-farm-contrib-description changes, plain diff MR !42
Comments
Comment #2
m.stentaAnother question to consider: do we do the same thing with farmOS core modules? I think we should. But those don't have
composer.json
files...Comment #3
paul121 CreditAttribution: paul121 commentedThinking about this a bit..
Notably,
*.info.yml
has a description as well! And it seems like we can toss custom properties in there. Also there's already a Drupal service provided for loading this module info, and we're already using it which makes it a bit more convenient: https://github.com/farmOS/farmOS/blob/1a7582b8abb719828d5a7f707780248974...Also submodules from a contrib module! These wouldn't have
composer.json
either. I think*.info.yml
is our best bet.Should we consider re-structuring the fieldsets to be the different high-level farmOS packages, instead of a core/contrib distinction? Each module could have
(Core)
or(Contrib)
appended to its name in different colors to differentiate the two types. I'm attaching a screenshot of what these packages look like right now in theadmin/modules
page. I guess it largely depends on the user, but this type of navigation seems like it would be more effective than clicking through individual modules to see what they provide. For example, I like that "farmOS Maps" has it's own category. This is really intuitive! (maybe we drop the "farmOS" prefix and only have a subset of the current ones?)I guess when it comes to flags, id tags, categories... higher level fieldsets would be excessive. But maybe a hybrid of more high-level categories, with "tags" for these different config entities they provide?
Of course it's possible for a module to provide multiple of these different entity types... but maybe this helps encourage separating such features into distinct modules? A module could always choose to be a part of a more general "farmOS Contrib" package as well and use the "tags" to show what all it provides. Could we allow contrib modules to create their own categories too?
So... what if we added new
farm_module_link
andfarm_module_category
properties to*.info.yml
. These could be used instead of the current modulepackage
to show more info about core & contrib modules?Comment #4
m.stentaAh those are really good points! Ok -
*.info.yml
it is. :-)I'm not sure I like this. My gut tells me we want to keep the
package
more internal/administrative - and always use "farmOS Contrib" as the mechanism for finding modules that should be included in this list. Contrib will always be less granular than core too. We break things up into very specific modules by the type of thing they provide in core, but contrib will probably tend to put lots of different types of things in the same module - categorizing more on the subject matter than the granular data types. I don't think we need to discourage this.This is probably too ambitious for now... but could potentially be added in the future.
What if we just keep this super simple for now and just add the
description
text next to the module's name? Then it's up to the module maintainers to make sure their descriptions are decent?Comment #6
paul121 CreditAttribution: paul121 commentedDone! This is a pretty simple change. I made it so the core module descriptions are used as well, but we still use the special names we have given them. Attached is a screenshot of what this looks like.
Good points, I agree. Maybe it would be worth while having those "subjects" be high-level categories just under the farmOS Contrib fieldset. But easy to let that be TBD and add later once there are more contrib modules and a need to organize them.
Comment #7
paul121 CreditAttribution: paul121 commentedAdding descriptions nearly doubles the length of the list. It seems that descriptions might not be needed for *all* of the core modules, but I think it is good to have for others.
Comment #8
m.stentaThanks @paul121 - this looks great IMO! I don't mind the long list. We can address that later if we need to.
I added one commit, which moves all the description loading logic into
FarmSettingsModulesForm::moduleOptions()
, and out offarm_modules()
, so we can keep that clean/simple.What do you think? I think this is ready to merge otherwise!
Comment #10
m.stenta(Spoke with @paul121 in chat.) Merged!