- Issue created by @m.stenta
- Status changed to Needs work
over 1 year ago 6:30pm 13 April 2023 - πΊπΈUnited States m.stenta
I opened a draft PR with my progress on this so far. Not complete, but the basic functionality is working. Still need to address all the questions in the issue description.
- πΊπΈUnited States m.stenta
Should comment be enabled as a default farmOS module?
We talked about this on the dev call today, and consensus was that "no" this should be optional.
Should comment subject field be hidden?
My branch hides it, but this is open to further discussion if anyone feels strongly otherwise.
How should permissions work? Should Viewer role be able to see comments?
The simplest way to start is to add the non-administrative comment permissions to all managed farmOS roles by default. We can refine this further in follow-up work.
Should comments be accessible via API?
I don't see any reason not to. This will work the same as all other entities by default, so restricting it would be more work anyway.
Should we document this in the farmOS data model?
I could see arguments both ways for this.
The broader question is are they something we want to officially consider part of the "farmOS data model" - or more of just an application-specific add-on feature? Comments will not be enabled by default, and will only be added if a particular farm decides they would be useful. They are very much an "add-on" enhancement, intended mainly for internal discussions, but not canonical "management data".
They are also somewhat Drupal-specific in their implementation.
How will other modules enable comments on their entity types?
Refer to the
farm_comment_asset
orfarm_comment_log
modules as an example. Some config needs to be provided, including the entity comment type, the comment_body field for that type, and entity form/view display config to hide the subject field. They also need to implementhook_entity_base_field_info()
and use thefarm_comment_base_field_definition($entity_type)
helper function to generate acomment
base field definition on their entity type(s).Should we provide configuration options for default behavior of assets and logs and their bundles? (eg: allow the user to decide which types allow comments by default)
We discussed this and decided that the simplest approach is to create two separate modules for enabling comments on assets/logs (
farm_comment_asset
andfarm_comment_log
). There isn't an immediate need for more flexibility than that, but if there is in the future we can consider that in follow-up work. - πΊπΈUnited States m.stenta
Updated PR against farmOS 3.x branch: https://github.com/farmOS/farmOS/pull/798
- πΊπΈUnited States m.stenta
I think that all that's left to do for MVP is some simple styling to distinguish the "authored by" and "links" from the comment text itself, and maybe also wrapping/delineating separate comments visually so they are more easily distinguished from each other.
-
m.stenta β
committed 8036f272 on 3.x
Issue #3352183: Comments on farmOS records
-
m.stenta β
committed 8036f272 on 3.x
-
m.stenta β
committed 292ecce4 on 3.x
Add CHANGELOG.md line for Issue #3352183.
-
m.stenta β
committed 292ecce4 on 3.x
- Status changed to Fixed
9 months ago 9:12pm 10 April 2024 - πΊπΈUnited States m.stenta
PR merged: https://github.com/farmOS/farmOS/pull/804
Automatically closed - issue fixed for 2 weeks with no activity.