Skip to content

Commit

Permalink
D8CORE-7074 Implement Search API Algolia (#743)
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Nov 16, 2023
1 parent ae413d5 commit 384c629
Show file tree
Hide file tree
Showing 44 changed files with 5,486 additions and 22 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@
"drupal/role_delegation": "^1.0@beta",
"drupal/scheduler": "^2.0",
"drupal/search_api": "^1.19",
"drupal/search_api_algolia": "^3.0@beta",
"drupal/seckit": "^2.0",
"drupal/shs": "^2.0@RC",
"drupal/smart_date": "^4.0",
Expand Down Expand Up @@ -160,7 +161,7 @@
"su-sws/stanford_fields": "^8.2",
"su-sws/stanford_media": "^10.0",
"su-sws/stanford_migrate": "^8.3",
"su-sws/stanford_profile_helper": "^9.3",
"su-sws/stanford_profile_helper": "9.x-dev",
"su-sws/stanford_samlauth": "^1.0"
},
"config": {
Expand Down
40 changes: 40 additions & 0 deletions config/sync/config_pages.type.stanford_basic_site_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,46 @@ third_party_settings:
config_item: settings.depth
prefix: ''
suffix: ''
c4beaf76-95bc-43de-a5b8-dc94351690ae:
field: su_site_algolia
delta: 0
column: value
config_name: search_api.server.algolia_search
config_item: status
prefix: ''
suffix: ''
06ad5b8d-698a-4c3b-a217-b71f986255ad:
field: su_site_algolia
delta: 0
column: value
config_name: search_api.index.algolia_search
config_item: status
prefix: ''
suffix: ''
b130f719-a257-4303-88b8-a20cfd06a4d7:
field: su_site_algolia_id
delta: 0
column: value
config_name: search_api.server.algolia_search
config_item: backend_config.application_id
prefix: ''
suffix: ''
bedb41db-a366-4e0e-a5c1-1dc6b39b76c3:
field: su_site_algolia_key
delta: 0
column: value
config_name: search_api.server.algolia_search
config_item: backend_config.api_key
prefix: ''
suffix: ''
b8e438b9-828c-41e2-bbfb-84c5a9c61637:
field: su_site_algolia_index
delta: 0
column: value
config_name: search_api.index.algolia_search
config_item: options.algolia_index_name
prefix: ''
suffix: ''
id: stanford_basic_site_settings
label: 'Site Settings'
token: null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ dependencies:
- field.field.config_pages.stanford_basic_site_settings.su_site_404
- field.field.config_pages.stanford_basic_site_settings.su_site_a11y_contact
- field.field.config_pages.stanford_basic_site_settings.su_site_admin_notes
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_file
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_id
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_index
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_key
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_search
- field.field.config_pages.stanford_basic_site_settings.su_site_dropdowns
- field.field.config_pages.stanford_basic_site_settings.su_site_email
- field.field.config_pages.stanford_basic_site_settings.su_site_home
Expand All @@ -28,6 +34,7 @@ dependencies:
- conditional_fields
- cshs
- field_group
- file
- link
- text
third_party_settings:
Expand All @@ -52,6 +59,7 @@ third_party_settings:
children:
- group_site_details
- group_contact_details
- group_search
label: Tabs
region: content
parent_name: ''
Expand All @@ -71,12 +79,10 @@ third_party_settings:
- su_google_analytics
- su_site_dropdowns
- su_site_menu_levels
- su_hide_site_search
- su_hide_ext_link_icons
- su_site_home
- su_site_404
- su_site_403
- su_site_nobots
- group_experimental
label: 'Site Settings/Features'
region: content
Expand Down Expand Up @@ -108,6 +114,28 @@ third_party_settings:
formatter: closed
description: "<h2>Contact and Affiliation Information for this Site</h2>\r\n<p>Site owners are required to provide the email addresses for important site contacts on an annual basis in order to renew the site. Please provide an email address for the primary site owner(s), primary site manager(s), and a contact who will be responsible for ensuring the accessibility of content on the site. Also select the site’s closest organizational affiliation(s).</p>\r\n<p>If you have questions about this information or policies around site renewal, please visit our <a href=\"https://sitesuserguide.stanford.edu/get-started/enter-site-ownership-information\">User Guide page about site ownership</a>.</p>"
required_fields: true
group_search:
children:
- su_hide_site_search
- su_site_nobots
- su_site_algolia
- su_site_algolia_id
- su_site_algolia_key
- su_site_algolia_search
- su_site_algolia_index
- su_site_algolia_file
label: Search
region: content
parent_name: group_tabs
weight: 21
format_type: tab
format_settings:
classes: ''
show_empty_fields: false
id: ''
formatter: closed
description: ''
required_fields: true
id: config_pages.stanford_basic_site_settings.default
targetEntityType: config_pages
bundle: stanford_basic_site_settings
Expand Down Expand Up @@ -163,6 +191,52 @@ content:
rows: 5
placeholder: ''
third_party_settings: { }
su_site_algolia:
type: boolean_checkbox
weight: 9
region: content
settings:
display_label: true
third_party_settings: { }
su_site_algolia_file:
type: file_generic
weight: 14
region: content
settings:
progress_indicator: throbber
third_party_settings: { }
su_site_algolia_id:
type: string_textfield
weight: 10
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
su_site_algolia_index:
type: string_textfield
weight: 13
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
su_site_algolia_key:
type: string_textfield
weight: 11
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
su_site_algolia_search:
type: string_textfield
weight: 12
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
su_site_dropdowns:
type: boolean_checkbox
weight: 5
Expand Down Expand Up @@ -225,7 +299,7 @@ content:
third_party_settings: { }
su_site_nobots:
type: boolean_checkbox
weight: 12
weight: 8
region: content
settings:
display_label: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ dependencies:
- field.field.config_pages.stanford_basic_site_settings.su_site_404
- field.field.config_pages.stanford_basic_site_settings.su_site_a11y_contact
- field.field.config_pages.stanford_basic_site_settings.su_site_admin_notes
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_file
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_id
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_index
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_key
- field.field.config_pages.stanford_basic_site_settings.su_site_algolia_search
- field.field.config_pages.stanford_basic_site_settings.su_site_dropdowns
- field.field.config_pages.stanford_basic_site_settings.su_site_email
- field.field.config_pages.stanford_basic_site_settings.su_site_home
Expand All @@ -25,6 +31,7 @@ dependencies:
- field.field.config_pages.stanford_basic_site_settings.su_site_url
module:
- datetime
- file
- link
- text
id: config_pages.stanford_basic_site_settings.default
Expand Down Expand Up @@ -90,6 +97,56 @@ content:
third_party_settings: { }
weight: 13
region: content
su_site_algolia:
type: boolean
label: above
settings:
format: default
format_custom_false: ''
format_custom_true: ''
third_party_settings: { }
weight: 19
region: content
su_site_algolia_file:
type: file_default
label: above
settings:
use_description_as_link_text: true
third_party_settings: { }
weight: 24
region: content
su_site_algolia_id:
type: string
label: above
settings:
link_to_entity: false
third_party_settings: { }
weight: 20
region: content
su_site_algolia_index:
type: string
label: above
settings:
link_to_entity: false
third_party_settings: { }
weight: 22
region: content
su_site_algolia_key:
type: string
label: above
settings:
link_to_entity: false
third_party_settings: { }
weight: 21
region: content
su_site_algolia_search:
type: string
label: above
settings:
link_to_entity: false
third_party_settings: { }
weight: 23
region: content
su_site_dropdowns:
type: boolean
label: above
Expand Down
1 change: 1 addition & 0 deletions config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ module:
samlauth_user_fields: 0
scheduler: 0
search_api: 0
search_api_algolia: 0
search_api_db: 0
seckit: 0
serialization: 0
Expand Down
12 changes: 6 additions & 6 deletions config/sync/editoria11y.settings.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
content_root: '#block-stanford-basic-content'
_core:
default_config_hash: 8d0nv-vvXs9MZkqD1mhxm8mPeF4yF9fqLLIcVp4cnLQ
content_root: '#page-content'
assertiveness: smart
no_load: ''
ignore_containers: .su-secondary-nav
embedded_content_warning: ''
allow_overflow: ''
assertiveness: smart
download_links: ''
hidden_handlers: ''
_core:
default_config_hash: 8d0nv-vvXs9MZkqD1mhxm8mPeF4yF9fqLLIcVp4cnLQ
ignore_containers: .su-secondary-nav
allow_overflow: ''
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
uuid: cc5e91e0-2ad3-40db-8ed2-bf2efcc16764
langcode: en
status: true
dependencies:
config:
- config_pages.type.stanford_basic_site_settings
- field.storage.config_pages.su_site_algolia
id: config_pages.stanford_basic_site_settings.su_site_algolia
field_name: su_site_algolia
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Use Algolia'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
uuid: c97426e2-6519-40d3-ada2-1c3b78ec6273
langcode: en
status: true
dependencies:
config:
- config_pages.type.stanford_basic_site_settings
- field.storage.config_pages.su_site_algolia_file
module:
- file
id: config_pages.stanford_basic_site_settings.su_site_algolia_file
field_name: su_site_algolia_file
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Override Algolia Results File'
description: 'Upload a compiled JS file to replace the provided display of search results. Leave empty to use the default results display.'
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:file'
handler_settings: { }
file_directory: algolia-search
file_extensions: js
max_filesize: 1MB
description_field: false
field_type: file
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: a91677d7-59bd-4c1d-9541-7bfffa39caa7
langcode: en
status: true
dependencies:
config:
- config_pages.type.stanford_basic_site_settings
- field.storage.config_pages.su_site_algolia_id
id: config_pages.stanford_basic_site_settings.su_site_algolia_id
field_name: su_site_algolia_id
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Algolia Application ID'
description: "This is your unique application identifier. It's used to identify you when using Algolia's API. Find this ID in <a href=\"https://dashboard.algolia.com/account/api-keys/all>Algolia dashboard</a>."
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: 6271cad8-dc2a-4e4f-82d2-29923f05ae9f
langcode: en
status: true
dependencies:
config:
- config_pages.type.stanford_basic_site_settings
- field.storage.config_pages.su_site_algolia_index
id: config_pages.stanford_basic_site_settings.su_site_algolia_index
field_name: su_site_algolia_index
entity_type: config_pages
bundle: stanford_basic_site_settings
label: 'Algolia Search Index'
description: ''
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Loading

0 comments on commit 384c629

Please sign in to comment.