Added config files for reporting on cases

And moved indexes to optional config so as not to have to keep
rebuilding them
This commit is contained in:
Naomi 2019-07-15 18:36:53 +01:00
parent 6b9ff3a5e7
commit 873f751795
11 changed files with 764 additions and 3 deletions

View File

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

View File

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

View File

@ -0,0 +1,55 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_cases
- views.view.reporting_cases
module:
- search_api
id: involved_parties
name: 'Involved Parties'
url_alias: involved_parties
weight: 0
min_count: 0
show_only_one_result: false
field_identifier: actors_involved
facet_source_id: 'search_api:views_page__reporting_cases__page_1'
widget:
type: checkbox
config:
show_numbers: false
soft_limit: 0
soft_limit_settings:
show_less_label: 'Show less'
show_more_label: 'Show more'
show_reset_link: false
reset_text: 'Show all'
hide_reset_when_no_selection: false
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:
display_value_widget_order:
processor_id: display_value_widget_order
weights:
sort: 40
settings:
sort: ASC
translate_entity:
processor_id: translate_entity
weights:
build: 5
settings: { }
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,55 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_cases
- views.view.reporting_cases
module:
- search_api
id: involved_parties_export
name: 'Involved Parties (Export)'
url_alias: involved_parties
weight: 0
min_count: 0
show_only_one_result: false
field_identifier: actors_involved
facet_source_id: 'search_api:views_data_export__reporting_cases__data_export_1'
widget:
type: checkbox
config:
show_numbers: false
soft_limit: 0
soft_limit_settings:
show_less_label: 'Show less'
show_more_label: 'Show more'
show_reset_link: false
reset_text: 'Show all'
hide_reset_when_no_selection: false
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:
display_value_widget_order:
processor_id: display_value_widget_order
weights:
sort: 40
settings:
sort: ASC
translate_entity:
processor_id: translate_entity
weights:
build: 5
settings: { }
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,52 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_cases
- views.view.reporting_cases
module:
- search_api
id: outcome
name: Outcome
url_alias: outcome
weight: 0
min_count: 0
show_only_one_result: false
field_identifier: field_outcome
facet_source_id: 'search_api:views_page__reporting_cases__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'
show_reset_link: false
reset_text: 'Show all'
hide_reset_when_no_selection: false
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: false
processor_configs:
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: text
text_format: plain_text
text: ''
show_title: false

View File

@ -0,0 +1,52 @@
langcode: en
status: true
dependencies:
config:
- search_api.index.opencase_reporting_cases
- views.view.reporting_cases
module:
- search_api
id: outcome_export
name: Outcome (Export)
url_alias: outcome
weight: 0
min_count: 0
show_only_one_result: false
field_identifier: field_outcome
facet_source_id: 'search_api:views_data_export__reporting_cases__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'
show_reset_link: false
reset_text: 'Show all'
hide_reset_when_no_selection: false
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: false
processor_configs:
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: text
text_format: plain_text
text: ''
show_title: false

View File

@ -0,0 +1,482 @@
langcode: en
status: true
dependencies:
config:
- field.storage.oc_case.field_outcome
- search_api.index.opencase_reporting_cases
module:
- csv_serialization
- options
- rest
- search_api
- serialization
- user
- views_data_export
id: reporting_cases
label: 'Reporting: Cases'
module: views
description: ''
tag: ''
base_table: search_api_index_opencase_reporting_cases
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: 'use opencase'
cache:
type: none
options: { }
query:
type: views_query
options:
bypass_access: false
skip_access: false
preserve_facet_query_args: 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: 20
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:
name: name
type: type
actors_involved: actors_involved
field_outcome: field_outcome
info:
name:
align: ''
separator: ''
empty_column: false
responsive: ''
type:
align: ''
separator: ''
empty_column: false
responsive: ''
actors_involved:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
field_outcome:
sortable: false
default_sort_order: asc
align: ''
separator: ''
empty_column: false
responsive: ''
default: '-1'
empty_table: false
row:
type: fields
fields:
name:
id: name
table: search_api_datasource_opencase_reporting_cases_entity_oc_case
field: name
relationship: none
group_type: group
admin_label: ''
label: ''
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: false
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
field_rendering: true
fallback_handler: search_api
fallback_options:
link_to_item: false
use_highlighting: false
multi_type: separator
multi_separator: ', '
entity_type: oc_case
plugin_id: search_api_field
type:
id: type
table: search_api_datasource_opencase_reporting_cases_entity_oc_case
field: type
relationship: none
group_type: group
admin_label: ''
label: ''
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: false
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_case_type:
display_method: label
entity_type: oc_case
plugin_id: search_api_field
actors_involved:
table: search_api_index_opencase_reporting_cases
field: actors_involved
id: actors_involved
entity_type: null
entity_field: null
plugin_id: search_api_field
relationship: none
group_type: group
admin_label: ''
label: ''
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: { }
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: { }
field_outcome:
id: field_outcome
table: search_api_index_opencase_reporting_cases
field: field_outcome
relationship: none
group_type: group
admin_label: ''
label: ''
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: false
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
field_rendering: true
fallback_handler: search_api
fallback_options:
link_to_item: false
use_highlighting: false
multi_type: separator
multi_separator: ', '
plugin_id: search_api_field
filters: { }
sorts: { }
title: 'Reporting: Cases'
header: { }
footer: { }
empty: { }
relationships: { }
arguments: { }
display_extenders: { }
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- user.permissions
tags:
- 'config:field.storage.oc_case.field_outcome'
data_export_1:
display_plugin: data_export
id: data_export_1
display_title: 'Data export'
position: 2
display_options:
display_extenders: { }
path: opencase/reporting/cases
filename: '[view:title].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_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- request_format
- user.permissions
tags:
- 'config:field.storage.oc_case.field_outcome'
page_1:
display_plugin: page
id: page_1
display_title: Page
position: 1
display_options:
display_extenders: { }
path: opencase/reporting/cases
cache_metadata:
max-age: -1
contexts:
- 'languages:language_content'
- 'languages:language_interface'
- url.query_args
- user.permissions
tags:
- 'config:field.storage.oc_case.field_outcome'

View File

@ -2,17 +2,21 @@
function opencase_default_reporting_uninstall() { function opencase_default_reporting_uninstall() {
$configs = [ $configs = [
'search_api.index.opencase_reporting_cases', // 'search_api.index.opencase_reporting_cases',
'search_api.index.opencase_reporting_clients', // 'search_api.index.opencase_reporting_clients',
'search_api.index.opencase_reporting_volunteers', // 'search_api.index.opencase_reporting_volunteers',
'block.block.facet_asylum_status', 'block.block.facet_asylum_status',
'block.block.facet_created', 'block.block.facet_created',
'block.block.facet_disability', 'block.block.facet_disability',
'block.block.facet_gender_identified_with', 'block.block.facet_gender_identified_with',
'block.block.facet_languages', 'block.block.facet_languages',
'block.block.nationalities', 'block.block.nationalities',
'block.block.osiclevel',
'block.block.outcome',
'block.block.involvedparties',
'views.view.reporting_clients', 'views.view.reporting_clients',
'views.view.reporting_volunteers', 'views.view.reporting_volunteers',
'views.view.reporting_cases',
'facets.facet.asylum_status_export', 'facets.facet.asylum_status_export',
'facets.facet.disability', 'facets.facet.disability',
'facets.facet.nationalities_export', 'facets.facet.nationalities_export',
@ -27,6 +31,10 @@ function opencase_default_reporting_uninstall() {
'facets.facet.osic_level', 'facets.facet.osic_level',
'facets.facet.disability_export', 'facets.facet.disability_export',
'facets.facet.languages', 'facets.facet.languages',
'facets.facet.outcome',
'facets.facet.outcome_export',
'facets.facet.involved_parties',
'facets.facet.involved_parties_export',
]; ];
foreach($configs as $config) { foreach($configs as $config) {
Drupal::configFactory()->getEditable($config)->delete(); Drupal::configFactory()->getEditable($config)->delete();