Skip to content

Commit

Permalink
Close #3262 Add ability for content admins to set finder overrides. (#…
Browse files Browse the repository at this point in the history
…3420)

Co-authored-by: Joe Parsons <[email protected]>
Co-authored-by: Dana Hertzberg <[email protected]>
Co-authored-by: Brian Berndt <[email protected]>
Co-authored-by: tadean <[email protected]>
  • Loading branch information
5 people authored Jul 24, 2024
1 parent 383e443 commit 5d110eb
Show file tree
Hide file tree
Showing 21 changed files with 1,086 additions and 66 deletions.
1 change: 1 addition & 0 deletions config/install/user.role.az_content_admin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ permissions:
- 'administer blocks'
- 'administer book outlines'
- 'administer easy breadcrumb'
- 'administer az_finder settings'
- 'administer flaggings'
- 'administer flags'
- 'administer languages'
Expand Down
28 changes: 27 additions & 1 deletion modules/custom/az_demo/config/install/views.view.az_finder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -580,15 +580,20 @@ display:
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
field_az_event_category_target_id:
plugin_id: az_finder_tid_widget
advanced:
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
reset_button_position: top
reset_button_counter: true
orientation: vertical
Expand Down Expand Up @@ -859,27 +864,34 @@ display:
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
field_az_byline_value:
plugin_id: default
advanced:
placeholder_text: ''
collapsible: true
collapsible_disable_automatic_open: false
is_secondary: false
field_az_published_value:
plugin_id: bef_datepicker
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
field_az_news_tags_target_id:
plugin_id: az_finder_tid_widget
advanced:
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
reset_button_position: top
reset_button_counter: true
orientation: vertical
Expand Down Expand Up @@ -1263,15 +1275,20 @@ display:
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
field_az_page_category_target_id:
plugin_id: az_finder_tid_widget
advanced:
sort_options: true
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
reset_button_position: top
reset_button_counter: true
orientation: vertical
Expand Down Expand Up @@ -1548,23 +1565,32 @@ display:
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
field_az_person_category_target_id:
plugin_id: az_finder_tid_widget
advanced:
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
field_az_person_category_sec_target_id:
plugin_id: az_finder_tid_widget
advanced:
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
reset_button_position: top
reset_button_counter: true
orientation: vertical
Expand Down
1 change: 1 addition & 0 deletions modules/custom/az_finder/az_finder.info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ core_version_requirement: ^9 || ^10
package: 'The University of Arizona - Experimental'
dependencies:
- better_exposed_filters:better_exposed_filters
configure: az_finder.settings
5 changes: 5 additions & 0 deletions modules/custom/az_finder/az_finder.links.task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
az_finder.settings_tab:
title: 'AZ Finder'
route_name: az_finder.settings
base_route: az_core.az_settings
weight: 0
3 changes: 3 additions & 0 deletions modules/custom/az_finder/az_finder.permissions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
administer az_finder settings:
title: 'Administer Quickstart Finder Settings'
description: 'Allows users to manage Quickstart Finder settings.'
7 changes: 7 additions & 0 deletions modules/custom/az_finder/az_finder.routing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
az_finder.settings:
path: '/admin/config/az-quickstart/settings/az-finder'
defaults:
_form: '\Drupal\az_finder\Form\AZFinderSettingsForm'
_title: 'AZ Finder Settings'
requirements:
_permission: 'administer az_finder settings'
19 changes: 18 additions & 1 deletion modules/custom/az_finder/az_finder.services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,21 @@ services:
_defaults:
autoconfigure: true
az_finder.icons:
class: Drupal\az_finder\AZFinderIcons
class: Drupal\az_finder\Service\AZFinderIcons
az_finder.view_options:
class: Drupal\az_finder\Service\AZFinderViewOptions
arguments:
- '@cache.default'
- '@entity_type.manager'
az_finder.vocabulary:
class: Drupal\az_finder\Service\AZFinderVocabulary
arguments:
- '@entity_type.manager'
- '@string_translation'
az_finder.overrides:
class: Drupal\az_finder\Service\AZFinderOverrides
arguments:
- '@config.factory'
logger.channel.az_finder:
parent: logger.channel_base
arguments: ['az_finder']
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tid_widget:
default_state: 'expand'
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ display:
type: full
options:
offset: 0
pagination_heading_level: h4
items_per_page: 50
total_pages: null
id: 0
Expand Down Expand Up @@ -143,15 +144,20 @@ display:
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
tid:
plugin_id: az_finder_tid_widget
advanced:
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
reset_button_position: top
reset_button_counter: true
orientation: vertical
Expand Down Expand Up @@ -407,6 +413,55 @@ display:
display_plugin: page
position: 2
display_options:
exposed_form:
type: az_better_exposed_filters
options:
submit_button: Apply
reset_button: true
reset_button_label: 'Reset filters'
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
text_input_required: 'Select any filter and click on Apply to see results'
text_input_required_format: az_standard
bef:
general:
autosubmit: true
autosubmit_exclude_textfield: false
autosubmit_textfield_delay: 500
autosubmit_hide: true
input_required: false
allow_secondary: false
secondary_label: 'Advanced options'
secondary_open: false
reset_button_always_show: false
filter:
title:
plugin_id: default
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
tid:
plugin_id: az_finder_tid_widget
advanced:
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
reset_button_position: top
reset_button_counter: true
orientation: vertical
skip_link: true
skip_link_text: 'Skip to search and filter'
skip_link_id: search-filter
style:
type: views_bootstrap_grid
options:
Expand All @@ -425,6 +480,7 @@ display:
relationship: none
view_mode: az_card
defaults:
exposed_form: false
style: false
style_options: false
row: false
Expand All @@ -450,6 +506,55 @@ display:
display_plugin: page
position: 1
display_options:
exposed_form:
type: az_better_exposed_filters
options:
submit_button: Apply
reset_button: true
reset_button_label: 'Reset filters'
exposed_sorts_label: 'Sort by'
expose_sort_order: true
sort_asc_label: Asc
sort_desc_label: Desc
text_input_required: 'Select any filter and click on Apply to see results'
text_input_required_format: az_standard
bef:
general:
autosubmit: true
autosubmit_exclude_textfield: false
autosubmit_textfield_delay: 500
autosubmit_hide: true
input_required: false
allow_secondary: false
secondary_label: 'Advanced options'
secondary_open: false
reset_button_always_show: false
filter:
title:
plugin_id: default
advanced:
placeholder_text: ''
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
tid:
plugin_id: az_finder_tid_widget
advanced:
sort_options: false
placeholder_text: ''
rewrite:
filter_rewrite_values: ''
filter_rewrite_values_key: false
collapsible: false
collapsible_disable_automatic_open: false
is_secondary: false
default_states: { }
reset_button_position: top
reset_button_counter: true
orientation: vertical
skip_link: true
skip_link_text: 'Skip to search and filter'
skip_link_id: search-filter
style:
type: default
options:
Expand All @@ -463,6 +568,7 @@ display:
view_mode: az_row
defaults:
css_class: false
exposed_form: false
style: false
style_options: false
row: false
Expand Down
69 changes: 69 additions & 0 deletions modules/custom/az_finder/config/schema/az_finder.schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
az_finder.settings:
type: config_object
label: 'AZ Finder Settings'
mapping:
tid_widget:
type: mapping
label: 'Global Default Settings'
mapping:
default_state:
type: string
label: 'Global Default State for Exposed Filters'
constraints:
Choice:
- 'expand'
- 'collapse'

az_finder.tid_widget.[view_id].[display_id]:
type: config_object
label: 'AZ Finder Override for a specific View Display'
mapping:
vocabularies:
type: sequence
label: 'Vocabulary settings for this view display'
sequence:
type: mapping
mapping:
vocabulary_id:
type: string
label: 'Vocabulary ID'
terms:
type: sequence
label: 'Settings for each term in the vocabulary'
sequence:
type: mapping
mapping:
term_id:
type: string
label: 'Term ID'
default_state:
type: string
label: 'Setting for each term'
constraints:
Required: false
Choice:
- 'expand'
- 'collapse'

views.exposed_form.az_better_exposed_filters:
type: views.exposed_form.bef
label: 'Quickstart Exposed Filters'
mapping:
reset_button_position:
type: string
label: 'Reset Button Position'
reset_button_counter:
type: boolean
label: 'Show Active Filter Counter'
orientation:
type: string
label: 'Orientation'
skip_link:
type: boolean
label: 'Add Skip Link'
skip_link_text:
type: string
label: 'Skip Link Text'
skip_link_id:
type: string
label: 'Skip Link ID'
Loading

0 comments on commit 5d110eb

Please sign in to comment.