3
0
Fork 0
mirror of https://github.com/farmOS/farmOS.git synced 2024-02-23 11:37:38 +01:00

Issue #3185217: farmOS 2.x Generic Plans Views

This commit is contained in:
Michael Stenta 2020-12-06 16:05:18 -05:00
parent 26ab4ed331
commit 0299d66b6d
2 changed files with 914 additions and 5 deletions

View file

@ -0,0 +1,909 @@
langcode: en
status: true
dependencies:
config:
- system.menu.admin
enforced:
module:
- farm_ui_views
module:
- csv_serialization
- options
- plan
- rest
- serialization
- state_machine
- user
id: farm_plan
label: 'Farm Plans'
module: views
description: ''
tag: ''
base_table: plan_field_data
base_field: id
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'view any plan'
cache:
type: tag
options: { }
query:
type: views_query
options:
disable_sql_rewrite: false
distinct: false
replica: false
query_comment: ''
query_tags: { }
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: true
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: full
options:
items_per_page: 50
offset: 0
id: 0
total_pages: null
tags:
previous:
next:
first: '« First'
last: 'Last »'
expose:
items_per_page: true
items_per_page_label: 'Items per page'
items_per_page_options: '25, 50, 100, 250, 500'
items_per_page_options_all: true
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
quantity: 9
style:
type: table
options:
grouping: { }
row_class: ''
default_row_class: true
override: true
sticky: false
caption: ''
summary: ''
description: ''
columns:
plan_bulk_form: plan_bulk_form
image_target_id: image_target_id
id: id
name: name
type: type
flag_value: flag_value
status: status
info:
plan_bulk_form:
align: ''
separator: ''
empty_column: false
responsive: ''
image_target_id:
align: ''
separator: ''
empty_column: false
responsive: ''
id:
sortable: true
default_sort_order: desc
align: ''
separator: ''
empty_column: false
responsive: ''
name:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
type:
sortable: true
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
flag_value:
align: ''
separator: ''
empty_column: false
responsive: ''
status:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
default: name
empty_table: true
row:
type: fields
options:
inline: { }
separator: ''
hide_empty: false
default_field_elements: true
fields:
plan_bulk_form:
id: plan_bulk_form
table: plan
field: plan_bulk_form
relationship: none
group_type: group
admin_label: ''
label: 'Bulk update'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
action_title: Action
include_exclude: exclude
selected_actions: { }
entity_type: plan
plugin_id: bulk_form
id:
id: id
table: plan_field_data
field: id
relationship: none
group_type: group
admin_label: ''
label: ID
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: number_integer
settings:
thousand_separator: ''
prefix_suffix: true
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: plan
entity_field: id
plugin_id: field
name:
id: name
table: plan_field_data
field: name
relationship: none
group_type: group
admin_label: ''
label: 'Plan name'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: string
settings:
link_to_entity: true
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: null
entity_field: name
plugin_id: field
type:
id: type
table: plan_field_data
field: type
relationship: none
group_type: group
admin_label: ''
label: 'Plan type'
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: target_id
type: entity_reference_label
settings:
link: false
group_column: target_id
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: plan
entity_field: type
plugin_id: field
flag_value:
id: flag_value
table: plan__flag
field: flag_value
relationship: none
group_type: group
admin_label: ''
label: Flags
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: list_default
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: plan
entity_field: flag
plugin_id: field
status:
id: status
table: plan_field_data
field: status
relationship: none
group_type: group
admin_label: ''
label: Status
exclude: false
alter:
alter_text: false
text: ''
make_link: false
path: ''
absolute: false
external: false
replace_spaces: false
path_case: none
trim_whitespace: false
alt: ''
rel: ''
link_class: ''
prefix: ''
suffix: ''
target: ''
nl2br: false
max_length: 0
word_boundary: true
ellipsis: true
more_link: false
more_link_text: ''
more_link_path: ''
strip_tags: false
trim: false
preserve_tags: ''
html: false
element_type: ''
element_class: ''
element_label_type: ''
element_label_class: ''
element_label_colon: true
element_wrapper_type: ''
element_wrapper_class: ''
element_default_classes: true
empty: ''
hide_empty: false
empty_zero: false
hide_alter_empty: true
click_sort_column: value
type: list_default
settings: { }
group_column: value
group_columns: { }
group_rows: true
delta_limit: 0
delta_offset: 0
delta_reversed: false
delta_first_last: false
multi_type: separator
separator: ', '
field_api_classes: false
entity_type: plan
entity_field: status
plugin_id: field
filters:
name:
id: name
table: plan_field_data
field: name
relationship: none
group_type: group
admin_label: ''
operator: contains
value: ''
group: 1
exposed: true
expose:
operator_id: name_op
label: Name
description: ''
use_operator: false
operator: name_op
operator_limit_selection: false
operator_list: { }
identifier: name
required: false
remember: false
multiple: false
remember_roles:
authenticated: authenticated
anonymous: '0'
farm_manager: '0'
farm_viewer: '0'
farm_worker: '0'
placeholder: ''
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: plan
entity_field: name
plugin_id: string
type:
id: type
table: plan_field_data
field: type
relationship: none
group_type: group
admin_label: ''
operator: in
value: { }
group: 1
exposed: true
expose:
operator_id: type_op
label: 'Plan type'
description: ''
use_operator: false
operator: type_op
operator_limit_selection: false
operator_list: { }
identifier: type
required: false
remember: false
multiple: true
remember_roles:
authenticated: authenticated
anonymous: '0'
farm_manager: '0'
farm_viewer: '0'
farm_worker: '0'
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: plan
entity_field: type
plugin_id: bundle
flag_value:
id: flag_value
table: plan__flag
field: flag_value
relationship: none
group_type: group
admin_label: ''
operator: or
value: { }
group: 1
exposed: true
expose:
operator_id: flag_value_op
label: Flags
description: ''
use_operator: false
operator: flag_value_op
operator_limit_selection: false
operator_list: { }
identifier: flag_value
required: false
remember: false
multiple: true
remember_roles:
authenticated: authenticated
anonymous: '0'
farm_manager: '0'
farm_viewer: '0'
farm_worker: '0'
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
reduce_duplicates: false
entity_type: plan
entity_field: flag
plugin_id: list_field
status:
id: status
table: plan_field_data
field: status
relationship: none
group_type: group
admin_label: ''
operator: in
value: { }
group: 1
exposed: true
expose:
operator_id: status_op
label: Status
description: ''
use_operator: false
operator: status_op
operator_limit_selection: false
operator_list: { }
identifier: status
required: false
remember: false
multiple: true
remember_roles:
authenticated: authenticated
anonymous: '0'
farm_manager: '0'
farm_viewer: '0'
farm_worker: '0'
reduce: false
is_grouped: false
group_info:
label: ''
description: ''
identifier: ''
optional: true
widget: select
multiple: false
remember: false
default_group: All
default_group_multiple: { }
group_items: { }
entity_type: plan
entity_field: status
plugin_id: state_machine_state
sorts: { }
header: { }
footer:
result:
id: result
table: views
field: result
relationship: none
group_type: group
admin_label: ''
empty: false
content: 'Displaying @start - @end of @total'
plugin_id: result
display_link:
id: display_link
table: views
field: display_link
relationship: none
group_type: group
admin_label: ''
empty: false
display_id: csv
label: 'Export CSV'
plugin_id: display_link
empty:
area_text_custom:
id: area_text_custom
table: views
field: area_text_custom
relationship: none
group_type: group
admin_label: ''
empty: true
tokenize: false
content: 'No plans found.'
plugin_id: text_custom
relationships: { }
arguments: { }
display_extenders: { }
title: Plans
filter_groups:
operator: AND
groups:
1: AND
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }
csv:
display_plugin: rest_export
id: csv
display_title: 'CSV export (rest)'
position: 3
display_options:
display_extenders: { }
style:
type: serializer
options:
uses_fields: false
formats:
csv: csv
path: plans.csv
auth:
- cookie
pager:
type: none
options:
offset: 0
display_description: ''
row:
type: data_field
options:
field_options:
plan_bulk_form:
alias: ''
raw_output: false
image_target_id:
alias: ''
raw_output: false
id:
alias: ''
raw_output: false
name:
alias: ''
raw_output: false
type:
alias: ''
raw_output: false
flag_value:
alias: ''
raw_output: false
status:
alias: ''
raw_output: false
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- url
- user.permissions
tags: { }
page:
display_plugin: page
id: page
display_title: 'All plans (page)'
position: 1
display_options:
display_extenders: { }
path: plans
display_description: ''
menu:
type: normal
title: Plans
description: ''
expanded: true
parent: farm.records
weight: 0
context: '0'
menu_name: admin
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }
page_type:
display_plugin: page
id: page_type
display_title: 'By type (page)'
position: 2
display_options:
display_extenders: { }
display_description: ''
path: plans/%
arguments:
type:
id: type
table: plan_field_data
field: type
relationship: none
group_type: group
admin_label: ''
default_action: 'not found'
exception:
value: all
title_enable: false
title: All
title_enable: false
title: ''
default_argument_type: fixed
default_argument_options:
argument: ''
default_argument_skip_url: false
summary_options:
base_path: ''
count: true
items_per_page: 25
override: false
summary:
sort_order: asc
number_of_records: 0
format: default_summary
specify_validation: true
validate:
type: 'entity:plan_type'
fail: 'not found'
validate_options:
operation: view
multiple: 0
access: false
bundles: { }
glossary: false
limit: 0
case: ucfirst
path_case: none
transform_dash: false
break_phrase: false
entity_type: plan
entity_field: type
plugin_id: string
defaults:
arguments: false
cache_metadata:
max-age: 0
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url
- url.query_args
- user.permissions
tags: { }

View file

@ -33,7 +33,7 @@ function farm_ui_views_farm_dashboard_panes() {
function farm_ui_views_views_pre_view(ViewExecutable $view, $display_id, array &$args) {
// We only want to alter the Views we provide.
if (!in_array($view->id(), ['farm_asset', 'farm_log'])) {
if (!in_array($view->id(), ['farm_asset', 'farm_log', 'farm_plan'])) {
return;
}
@ -44,9 +44,9 @@ function farm_ui_views_views_pre_view(ViewExecutable $view, $display_id, array &
$view->removeHandler($display_id, 'filter', 'type');
}
// If this is the "Upcoming" or "Late" block display, add a "more" link that
// points to the default page display with appropriate filters.
if (in_array($display_id, ['block_upcoming', 'block_late'])) {
// If this is the "Upcoming" or "Late" Logs block display, add a "more" link
// that points to the default page display with appropriate filters.
if ($view->id() == 'farm_log' && in_array($display_id, ['block_upcoming', 'block_late'])) {
$view->display_handler->setOption('use_more', TRUE);
$view->display_handler->setOption('use_more_always', TRUE);
$view->display_handler->setOption('link_display', 'custom_url');
@ -68,7 +68,7 @@ function farm_ui_views_views_pre_view(ViewExecutable $view, $display_id, array &
function farm_ui_views_views_pre_render(ViewExecutable $view) {
// We only want to alter the Views we provide.
if (!in_array($view->id(), ['farm_asset', 'farm_log'])) {
if (!in_array($view->id(), ['farm_asset', 'farm_log', 'farm_plan'])) {
return;
}