Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UHF-10259: Curated event list #830

Merged
merged 18 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions helfi_platform_config.install
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,15 @@ function helfi_platform_config_update_9312() : void {
\Drupal::service('module_installer')->install(['helfi_users']);
}
}

/**
* UHF-10259: Enable helfi_paragraphs_curated_event_list module.
*/
function helfi_platform_config_update_9313() : void {
$module_installer = \Drupal::service('module_installer');

// Enable helfi_paragraphs_curated_event_list.
if (!\Drupal::moduleHandler()->moduleExists('helfi_paragraphs_curated_event_list')) {
$module_installer->install(['helfi_paragraphs_curated_event_list']);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
uuid: b5c5ed81-d651-4db2-8d72-a67e7b66390e
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.curated_event_list.field_all_events_link
- field.field.paragraph.curated_event_list.field_events
- paragraphs.paragraphs_type.curated_event_list
module:
- link
id: paragraph.curated_event_list.default
targetEntityType: paragraph
bundle: curated_event_list
mode: default
content:
field_all_events_link:
type: link_default
weight: 1
region: content
settings:
placeholder_url: ''
placeholder_title: ''
third_party_settings: { }
field_events:
type: entity_reference_autocomplete
weight: 0
region: content
settings:
match_operator: CONTAINS
match_limit: 5
size: 60
placeholder: ''
third_party_settings: { }
hidden:
created: true
status: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
uuid: 22363443-8bc6-4b97-980f-6bfb225edb1b
langcode: en
status: true
dependencies:
config:
- responsive_image.styles.card_teaser
module:
- datetime
- external_entities
- imagecache_external
- linkit
id: linkedevents_event.linkedevents_event.default
targetEntityType: linkedevents_event
bundle: linkedevents_event
mode: default
content:
end_time:
type: datetime_default
label: hidden
settings:
timezone_override: ''
format_type: medium
third_party_settings: { }
weight: 3
region: content
external_link:
type: linkit
label: hidden
settings:
trim_length: 80
url_only: false
url_plain: false
rel: ''
target: ''
linkit_profile: default
third_party_settings: { }
weight: 4
region: content
langcode:
type: string_default
label: hidden
settings: { }
third_party_settings: { }
weight: 5
region: content
main_image:
type: imagecache_external_responsive_image
label: hidden
settings:
imagecache_external_link: ''
imagecache_external_responsive_style: card_teaser
third_party_settings: { }
weight: 1
region: content
start_time:
type: datetime_default
label: hidden
settings:
timezone_override: ''
format_type: medium
third_party_settings: { }
weight: 2
region: content
title:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 0
region: content
hidden:
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
uuid: 313ec60d-d84a-4e82-9ae3-ee3221c0e631
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.curated_event_list.field_all_events_link
- field.field.paragraph.curated_event_list.field_events
- paragraphs.paragraphs_type.curated_event_list
module:
- link
id: paragraph.curated_event_list.default
targetEntityType: paragraph
bundle: curated_event_list
mode: default
content:
field_all_events_link:
type: link
label: hidden
settings:
trim_length: 80
url_only: false
url_plain: false
rel: ''
target: ''
third_party_settings: { }
weight: 1
region: content
field_events:
type: entity_reference_entity_view
label: hidden
settings:
view_mode: default
link: false
third_party_settings: { }
weight: 0
region: content
hidden:
search_api_excerpt: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
uuid: 66fe8cbc-203c-40aa-ac7b-6e0e89470312
langcode: en
status: true
dependencies: { }
id: linkedevents_event
label: 'LinkedEvents: Event'
label_plural: 'LinkedEvents: Events'
description: 'Event entities from https://api.hel.fi/linkedevents.'
read_only: true
generate_aliases: false
field_mapper_id: jsonpath
field_mapper_config:
field_mappings:
id:
value: $.id
uuid:
value: $.id
title:
value: $.title
main_image:
uri: '$.images[0].url'
title: '$.images[0].alt_text'
start_time:
value: $.start_time
end_time:
value: $.end_time
external_link:
uri: $.external_link
title: $.clean_title
storage_client_id: linkedevents_events
storage_client_config: null
persistent_cache_max_age: 0
annotation_entity_type_id: null
annotation_bundle_id: null
annotation_field_name: null
inherits_annotation_fields: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
uuid: b144b934-3c5a-4c5b-ae89-b477bfb8367d
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_all_events_link
- paragraphs.paragraphs_type.curated_event_list
module:
- link
id: paragraph.curated_event_list.field_all_events_link
field_name: field_all_events_link
entity_type: paragraph
bundle: curated_event_list
label: 'All events link'
description: "Add a link to the tapahtumat.hel.fi website. You may also filter the events in the event calendar as desired and copy the page's URL.\r\n<br><br>\r\nAlso provide a text for the link, eg. <i>View all events.</i>"
required: false
translatable: false
default_value:
-
attributes: { }
uri: 'https://tapahtumat.hel.fi'
title: 'View all events'
options: { }
default_value_callback: ''
settings:
title: 2
link_type: 16
field_type: link
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
uuid: 41acbd4d-63ba-4cb7-919c-d6435553d4a9
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_events
- paragraphs.paragraphs_type.curated_event_list
id: paragraph.curated_event_list.field_events
field_name: field_events
entity_type: paragraph
bundle: curated_event_list
label: Events
description: "Pick events to display in the list. You may either search event by their name <i>or</i> enter their ID. \r\n <br><br>\r\nYou can find the ID of an event on tapahtumat.hel.fi site from the URL of the page. For example, in the url <a>https://tapahtumat.hel.fi/fi/events/helsinki:agiy4m4ida</a> the <b>helsinki:agiy4m4ida</b> part is the ID of the event.\r\n <br><br>\r\nThe page will display the top three events. You can arrange the events by dragging. Expired events will be automatically removed from the page."
required: false
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:linkedevents_event'
handler_settings:
target_bundles: null
sort:
field: _none
direction: ASC
auto_create: false
field_type: entity_reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
uuid: 1dd4d7e6-e3be-490e-9309-e9380e0c33b4
langcode: en
status: true
dependencies:
module:
- link
- paragraphs
id: paragraph.field_all_events_link
field_name: field_all_events_link
entity_type: paragraph
type: link
settings: { }
module: link
locked: false
cardinality: 1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
uuid: a381685c-627a-4ba4-8be3-5bb2d2a705bd
langcode: en
status: true
dependencies:
module:
- external_entities
- paragraphs
id: paragraph.field_events
field_name: field_events
entity_type: paragraph
type: entity_reference
settings:
target_type: linkedevents_event
module: core
locked: false
cardinality: -1
translatable: true
indexes: { }
persist_with_no_fields: false
custom_storage: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
uuid: 5b0c689e-1733-47ff-ba7c-63923e4f2116
langcode: en
status: true
dependencies: { }
id: curated_event_list
label: 'Curated event list'
icon_uuid: null
icon_default: null
description: 'Event list with curated event picks loaded from Linked Events API.'
behavior_plugins: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
label: 'Kaikki tapahtumat -linkki'
description: "Lisää likki tapahtumat.hel.fi -sivulle. Voit halutessasi tehdä tapahtumakalenterissa haluamasi tapahtumien rajauksen ja kopioida sivun URL-osoitteen.\r\nLisää myös teksti linkille, esimerkiksi. <i>Katso kaikki tapahtumat</i>"
default_value:
-
title: 'Katso kaikki tapahtumat'
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: Tapahtumat
description: "Valitse tapahtumat, jotka näytetään listassa. Voit hakea tapahtumaa sen nimellä <i>tai</i> tapahtuman ID:llä.\r\n<br><br>\r\nLöydät tapahtuman ID:n tapahtumat.hel.fi-sivun osoitteesta: esimerkiksi osoitteessa <a>https://tapahtumat.hel.fi/fi/events/helsinki:agiy4m4ida</a> kohta <b>helsinki:agiy4m4ida</b> on tapahtuman ID.\r\n<br><br>\r\nSivulla näytetään kolme ylintä tapahtumaa. Voit järjestää tapahtumia raahaamalla. Vanhentuneet tapahtumat poistuvat sivulta automaattisesti."
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
label: 'Kuratoitu tapahtumalista'
description: 'Manuaalisesti ylläpidettävä tapahtumalista tapahtumille Linked Events -rajapinnasta.'
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'HELfi Paragraphs: Curated Event List'
type: module
core_version_requirement: '^9 || ^10'
dependencies:
- drupal:link
- drupal:field
- external_entities:external_entities
- helfi_api_base:helfi_api_base
- helfi_platform_config:helfi_platform_config
- paragraphs:paragraphs
'interface translation project': helfi_paragraphs_curated_event_list
'interface translation server pattern': modules/contrib/helfi_platform_config/modules/helfi_paragraphs_curated_event_list/translations/%language.po
Loading