Add a farm_comment_plan module for commenting on plans.
This commit is contained in:
parent
5f62c36cc2
commit
533a42077d
|
@ -62,6 +62,7 @@ function farm_modules() {
|
||||||
'farm_import_kml' => t('KML asset importer'),
|
'farm_import_kml' => t('KML asset importer'),
|
||||||
'farm_comment_asset' => t('Asset comments'),
|
'farm_comment_asset' => t('Asset comments'),
|
||||||
'farm_comment_log' => t('Log comments'),
|
'farm_comment_log' => t('Log comments'),
|
||||||
|
'farm_comment_plan' => t('Plan comments'),
|
||||||
'farm_map_mapbox' => t('Mapbox map layers: Satellite, Outdoors'),
|
'farm_map_mapbox' => t('Mapbox map layers: Satellite, Outdoors'),
|
||||||
'farm_api_default_consumer' => t('Default API Consumer'),
|
'farm_api_default_consumer' => t('Default API Consumer'),
|
||||||
'farm_fieldkit' => t('Field Kit integration'),
|
'farm_fieldkit' => t('Field Kit integration'),
|
||||||
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
enforced:
|
||||||
|
module:
|
||||||
|
- farm_comment_plan
|
||||||
|
id: plan
|
||||||
|
label: 'Plan comment'
|
||||||
|
target_entity_type_id: plan
|
||||||
|
description: ''
|
|
@ -0,0 +1,31 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
config:
|
||||||
|
- comment.type.plan
|
||||||
|
- field.field.comment.plan.comment_body
|
||||||
|
enforced:
|
||||||
|
module:
|
||||||
|
- farm_comment_plan
|
||||||
|
module:
|
||||||
|
- text
|
||||||
|
id: comment.plan.default
|
||||||
|
targetEntityType: comment
|
||||||
|
bundle: plan
|
||||||
|
mode: default
|
||||||
|
content:
|
||||||
|
author:
|
||||||
|
weight: 0
|
||||||
|
region: content
|
||||||
|
settings: { }
|
||||||
|
third_party_settings: { }
|
||||||
|
comment_body:
|
||||||
|
type: text_textarea
|
||||||
|
weight: 1
|
||||||
|
region: content
|
||||||
|
settings:
|
||||||
|
rows: 5
|
||||||
|
placeholder: ''
|
||||||
|
third_party_settings: { }
|
||||||
|
hidden:
|
||||||
|
subject: true
|
|
@ -0,0 +1,29 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
config:
|
||||||
|
- comment.type.plan
|
||||||
|
- field.field.comment.plan.comment_body
|
||||||
|
enforced:
|
||||||
|
module:
|
||||||
|
- farm_comment_plan
|
||||||
|
module:
|
||||||
|
- text
|
||||||
|
id: comment.plan.default
|
||||||
|
targetEntityType: comment
|
||||||
|
bundle: plan
|
||||||
|
mode: default
|
||||||
|
content:
|
||||||
|
comment_body:
|
||||||
|
type: text_default
|
||||||
|
label: hidden
|
||||||
|
settings: { }
|
||||||
|
third_party_settings: { }
|
||||||
|
weight: 0
|
||||||
|
region: content
|
||||||
|
links:
|
||||||
|
settings: { }
|
||||||
|
third_party_settings: { }
|
||||||
|
weight: 1
|
||||||
|
region: content
|
||||||
|
hidden: { }
|
|
@ -0,0 +1,23 @@
|
||||||
|
langcode: en
|
||||||
|
status: true
|
||||||
|
dependencies:
|
||||||
|
config:
|
||||||
|
- comment.type.plan
|
||||||
|
- field.storage.comment.comment_body
|
||||||
|
enforced:
|
||||||
|
module:
|
||||||
|
- farm_comment_plan
|
||||||
|
module:
|
||||||
|
- text
|
||||||
|
id: comment.plan.comment_body
|
||||||
|
field_name: comment_body
|
||||||
|
entity_type: comment
|
||||||
|
bundle: plan
|
||||||
|
label: Comment
|
||||||
|
description: ''
|
||||||
|
required: true
|
||||||
|
translatable: true
|
||||||
|
default_value: { }
|
||||||
|
default_value_callback: ''
|
||||||
|
settings: { }
|
||||||
|
field_type: text_long
|
|
@ -0,0 +1,8 @@
|
||||||
|
name: Plan comments
|
||||||
|
description: Enables comments on farmOS plans.
|
||||||
|
type: module
|
||||||
|
package: farmOS
|
||||||
|
core_version_requirement: ^9
|
||||||
|
dependencies:
|
||||||
|
- farm:farm_comment
|
||||||
|
- farm:plan
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
* Contains farm_comment_plan.module.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Drupal\Core\Entity\EntityTypeInterface;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Implements hook_entity_base_field_info().
|
||||||
|
*/
|
||||||
|
function farm_comment_plan_entity_base_field_info(EntityTypeInterface $entity_type) {
|
||||||
|
$fields = [];
|
||||||
|
|
||||||
|
// Add comment base field to plans.
|
||||||
|
if ($entity_type->id() == 'plan') {
|
||||||
|
$fields['comment'] = farm_comment_base_field_definition('plan');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $fields;
|
||||||
|
}
|
Loading…
Reference in New Issue