Added a basic index, view & facets for reporting

it is not a useful report, but it doesnt rely on defaults. It's just so that I can work on the reporting without the defaults. General stuff like css and preset support will not be dependent on the defaults. By the time this is properly released, I will have developed a way of generating what is needed for reporting automatically.
This commit is contained in:
Naomi 2018-09-06 19:11:49 +01:00
parent 2be2cc7837
commit 393ce2501c
9 changed files with 802 additions and 1 deletions

View File

@ -0,0 +1,28 @@
langcode: en
status: true
dependencies:
config:
- facets.facet.actor_type
module:
- facets
- system
theme:
- bartik
id: facet_actortype
theme: bartik
region: sidebar_second
weight: 0
provider: null
plugin: 'facet_block:actor_type'
settings:
id: 'facet_block:actor_type'
label: 'Actor type'
provider: facets
label_display: visible
block_id: facet_actortype
visibility:
request_path:
id: request_path
pages: /opencase/reporting/actors
negate: false
context_mapping: { }

View File

@ -0,0 +1,28 @@
langcode: en
status: true
dependencies:
config:
- facets.facet.created
module:
- facets
- system
theme:
- bartik
id: facet_created
theme: bartik
region: sidebar_second
weight: 0
provider: null
plugin: 'facet_block:created'
settings:
id: 'facet_block:created'
label: ''
provider: facets
label_display: visible
block_id: facet_created
visibility:
request_path:
id: request_path
pages: /opencase/reporting/actors
negate: false
context_mapping: { }

View File

@ -0,0 +1,59 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_actors
module:
- views_data_export
id: actor_type
name: 'Actor type'
url_alias: actor_type
weight: 0
min_count: 1
show_only_one_result: false
field_identifier: type
facet_source_id: 'search_api:views_page__reporting_actors__page_1'
widget:
type: checkbox
config:
show_numbers: true
soft_limit: 0
soft_limit_settings:
show_less_label: 'Show less'
show_more_label: 'Show more'
query_operator: or
use_hierarchy: false
expand_hierarchy: false
enable_parent_when_child_gets_disabled: true
hard_limit: 0
exclude: false
only_visible_when_facet_source_is_visible: true
processor_configs:
active_widget_order:
processor_id: active_widget_order
weights:
sort: 20
settings:
sort: DESC
count_widget_order:
processor_id: count_widget_order
weights:
sort: 30
settings:
sort: DESC
display_value_widget_order:
processor_id: display_value_widget_order
weights:
sort: 40
settings:
sort: ASC
url_processor_handler:
processor_id: url_processor_handler
weights:
pre_query: 50
build: 15
settings: { }
empty_behavior:
behavior: none
show_title: false

View File

@ -0,0 +1,59 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_actors
module:
- views_data_export
id: actor_type_export
name: 'Actor type - Export'
url_alias: actor_type
weight: 0
min_count: 1
show_only_one_result: false
field_identifier: type
facet_source_id: 'search_api:views_data_export__reporting_actors__data_export_1'
widget:
type: checkbox
config:
show_numbers: true
soft_limit: 0
soft_limit_settings:
show_less_label: 'Show less'
show_more_label: 'Show more'
query_operator: or
use_hierarchy: false
expand_hierarchy: false
enable_parent_when_child_gets_disabled: true
hard_limit: 0
exclude: false
only_visible_when_facet_source_is_visible: true
processor_configs:
active_widget_order:
processor_id: active_widget_order
weights:
sort: 20
settings:
sort: DESC
count_widget_order:
processor_id: count_widget_order
weights:
sort: 30
settings:
sort: DESC
display_value_widget_order:
processor_id: display_value_widget_order
weights:
sort: 40
settings:
sort: ASC
url_processor_handler:
processor_id: url_processor_handler
weights:
pre_query: 50
build: 15
settings: { }
empty_behavior:
behavior: none
show_title: false

View File

@ -0,0 +1,67 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_actors
module:
- views_data_export
id: created
name: Created
url_alias: created
weight: 0
min_count: 1
show_only_one_result: false
field_identifier: created
facet_source_id: 'search_api:views_page__reporting_actors__page_1'
widget:
type: checkbox
config:
show_numbers: true
soft_limit: 0
soft_limit_settings:
show_less_label: 'Show less'
show_more_label: 'Show more'
query_operator: or
use_hierarchy: false
expand_hierarchy: false
enable_parent_when_child_gets_disabled: true
hard_limit: 0
exclude: false
only_visible_when_facet_source_is_visible: true
processor_configs:
active_widget_order:
processor_id: active_widget_order
weights:
sort: 20
settings:
sort: DESC
count_widget_order:
processor_id: count_widget_order
weights:
sort: 30
settings:
sort: DESC
date_item:
processor_id: date_item
weights:
build: 35
settings:
date_display: actual_date
granularity: 5
date_format: ''
display_value_widget_order:
processor_id: display_value_widget_order
weights:
sort: 40
settings:
sort: ASC
url_processor_handler:
processor_id: url_processor_handler
weights:
pre_query: 50
build: 15
settings: { }
empty_behavior:
behavior: none
show_title: false

View File

@ -0,0 +1,67 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_actors
module:
- views_data_export
id: created_export
name: 'Created - Export'
url_alias: created
weight: 0
min_count: 1
show_only_one_result: false
field_identifier: created
facet_source_id: 'search_api:views_data_export__reporting_actors__data_export_1'
widget:
type: checkbox
config:
show_numbers: true
soft_limit: 0
soft_limit_settings:
show_less_label: 'Show less'
show_more_label: 'Show more'
query_operator: or
use_hierarchy: false
expand_hierarchy: false
enable_parent_when_child_gets_disabled: true
hard_limit: 0
exclude: false
only_visible_when_facet_source_is_visible: true
processor_configs:
active_widget_order:
processor_id: active_widget_order
weights:
sort: 20
settings:
sort: DESC
count_widget_order:
processor_id: count_widget_order
weights:
sort: 30
settings:
sort: DESC
date_item:
processor_id: date_item
weights:
build: 35
settings:
date_display: actual_date
granularity: 5
date_format: ''
display_value_widget_order:
processor_id: display_value_widget_order
weights:
sort: 40
settings:
sort: ASC
url_processor_handler:
processor_id: url_processor_handler
weights:
pre_query: 50
build: 15
settings: { }
empty_behavior:
behavior: none
show_title: false

View File

@ -0,0 +1,480 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_actors
module:
- csv_serialization
- rest
- search_api
- serialization
- user
- views_data_export
id: reporting_actors
label: 'Reporting: Actors'
module: views
description: 'A basic reporting view, for illustrative purposes, that does not assume the existence of any specific actor types or fields'
tag: ''
base_table: search_api_index_opencase_reporting_actors
base_field: search_api_id
core: 8.x
display:
default:
display_plugin: default
id: default
display_title: Master
position: 0
display_options:
access:
type: perm
options:
perm: 'access content'
cache:
type: tag
options: { }
query:
type: views_query
options:
bypass_access: false
skip_access: false
exposed_form:
type: basic
options:
submit_button: Apply
reset_button: false
reset_button_label: Reset
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
pager:
type: mini
options:
items_per_page: 10
offset: 0
id: 0
total_pages: null
expose:
items_per_page: false
items_per_page_label: 'Items per page'
items_per_page_options: '5, 10, 25, 50'
items_per_page_options_all: false
items_per_page_options_all_label: '- All -'
offset: false
offset_label: Offset
tags:
previous:
next:
style:
type: table
options:
grouping: { }
row_class: ''
default_row_class: true
override: true
sticky: false
caption: ''
summary: ''
description: ''
columns:
created: created
type: type
info:
created:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
type:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
default: '-1'
empty_table: false
row:
type: fields
fields:
first_name:
id: first_name
table: search_api_datasource_opencase_reporting_actors_entity_oc_actor
field: first_name
relationship: none
group_type: group
admin_label: ''
label: 'First 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: false
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
field_rendering: true
fallback_handler: search_api
fallback_options:
link_to_item: false
use_highlighting: false
multi_type: separator
multi_separator: ', '
entity_type: oc_actor
plugin_id: search_api_field
last_name:
id: last_name
table: search_api_datasource_opencase_reporting_actors_entity_oc_actor
field: last_name
relationship: none
group_type: group
admin_label: ''
label: 'Last 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: false
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
field_rendering: true
fallback_handler: search_api
fallback_options:
link_to_item: false
use_highlighting: false
multi_type: separator
multi_separator: ', '
entity_type: oc_actor
plugin_id: search_api_field
type:
id: type
table: search_api_index_opencase_reporting_actors
field: type
relationship: none
group_type: group
admin_label: ''
label: 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
field_rendering: true
fallback_handler: search_api_entity
fallback_options:
link_to_item: false
use_highlighting: false
multi_type: separator
multi_separator: ', '
display_methods:
oc_actor_type:
display_method: label
plugin_id: search_api_field
created:
id: created
table: search_api_index_opencase_reporting_actors
field: created
relationship: none
group_type: group
admin_label: ''
label: 'Created date'
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: timestamp
settings:
date_format: medium
custom_date_format: ''
timezone: ''
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
field_rendering: true
fallback_handler: search_api_date
fallback_options:
date_format: fallback
custom_date_format: ''
timezone: ''
link_to_item: false
use_highlighting: false
multi_type: separator
multi_separator: ', '
entity_type: null
entity_field: null
plugin_id: search_api_field
filters: { }
sorts: { }
title: 'Reporting: Actors'
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
use_ajax: true
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- user.permissions
tags: { }
data_export_1:
display_plugin: data_export
id: data_export_1
display_title: 'Data export'
position: 3
display_options:
display_extenders: { }
path: opencase/reporting/actors/export
filename: opencase-reporting-actors.csv
displays:
page_1: page_1
default: '0'
style:
type: data_export
options:
formats:
csv: csv
csv_settings:
delimiter: ','
enclosure: '"'
escape_char: \
strip_tags: true
trim: true
encoding: utf8
xls_settings:
xls_format: Excel2007
metadata:
creator: ''
last_modified_by: ''
title: ''
description: ''
subject: ''
keywords: ''
category: ''
manager: ''
company: ''
cache:
type: none
defaults:
cache: false
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- user.permissions
tags: { }
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders: { }
path: opencase/reporting/actors
cache:
type: none
defaults:
cache: false
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- user.permissions
tags: { }

View File

@ -8,5 +8,11 @@ dependencies:
- search_api
- search_api_db
- facets
- csv_serialization
- rest
- serialization
- user
- views_data_export
libraries:
- opencase_reporting/opencase-reporting-lib

View File

@ -30,7 +30,14 @@ function opencase_reporting_help($route_name, RouteMatchInterface $route_match)
function opencase_reporting_uninstall() {
$configs = [
'search_api.server.opencase_reporting_server',
'search_api.index.opencase_reporting_actors'
'search_api.index.opencase_reporting_actors',
'facets.facet.actor_type',
'facets.facet.actor_type_export',
'facets.facet.created',
'facets.facet.created_export',
'views.view.reporting_actors',
'block.block.facet_actortype',
'block.block.facet_created',
];
foreach($configs as $config) {
Drupal::configFactory()->getEditable($config)->delete();