Skip to content

Commit

Permalink
Merge branch 'main' into UHF-8081-add-sentry-to-react-apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Jussiles committed Sep 7, 2023
2 parents 044dfa7 + 88784de commit 0648518
Show file tree
Hide file tree
Showing 43 changed files with 682 additions and 18 deletions.
32 changes: 14 additions & 18 deletions helfi_platform_config.module
Original file line number Diff line number Diff line change
Expand Up @@ -72,26 +72,22 @@ function helfi_platform_config_rebuild_handler_settings(
if ($field->isSyncing() || $field->getType() !== 'entity_reference_revisions') {
return;
}
static $collection = [];
$collection = [];
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler */
$moduleHandler = Drupal::service('module_handler');
$paragraphTypes = $moduleHandler->invokeAll('helfi_paragraph_types');

if (!$collection) {
/** @var \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler */
$moduleHandler = Drupal::service('module_handler');
$paragraphTypes = $moduleHandler->invokeAll('helfi_paragraph_types');

$collection = [];
foreach ($paragraphTypes as $type) {
if (!$type instanceof ParagraphTypeCollection) {
throw new LogicException(
sprintf('$type must be an instance of %s, %s given.', ParagraphTypeCollection::class, gettype($type))
);
}

if (!ParagraphsType::load($type->paragraph)) {
continue;
}
$collection[$type->entityType][$type->bundle][$type->field][] = $type;
foreach ($paragraphTypes as $type) {
if (!$type instanceof ParagraphTypeCollection) {
throw new LogicException(
sprintf('$type must be an instance of %s, %s given.', ParagraphTypeCollection::class, gettype($type))
);
}

if (!ParagraphsType::load($type->paragraph)) {
continue;
}
$collection[$type->entityType][$type->bundle][$type->field][] = $type;
}
if (!isset($collection[$field->getTargetEntityTypeId()][$field->getTargetBundle()][$field->getName()])) {
return;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.unit_accessibility_information.field_unit_accessibility_unit
- paragraphs.paragraphs_type.unit_accessibility_information
id: paragraph.unit_accessibility_information.default
targetEntityType: paragraph
bundle: unit_accessibility_information
mode: default
content:
field_unit_accessibility_unit:
type: entity_reference_autocomplete
weight: 0
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
hidden:
created: true
status: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.unit_contact_card.field_unit_contact_title
- field.field.paragraph.unit_contact_card.field_unit_contact_unit
- field.field.paragraph.unit_contact_card.field_unit_contact_use_address
- field.field.paragraph.unit_contact_card.field_unit_contact_use_details
- field.field.paragraph.unit_contact_card.field_unit_contact_use_link
- field.field.paragraph.unit_contact_card.field_unit_contact_use_opening
- field.field.paragraph.unit_contact_card.field_unit_contact_use_override
- field.field.paragraph.unit_contact_card.field_unit_contact_use_phone
- field.field.paragraph.unit_contact_card.field_unit_contact_use_picture
- field.field.paragraph.unit_contact_card.field_unit_contact_use_postal
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.default
targetEntityType: paragraph
bundle: unit_contact_card
mode: default
content:
field_unit_contact_title:
type: string_textfield
weight: 0
region: content
settings:
size: 60
placeholder: ''
third_party_settings: { }
field_unit_contact_unit:
type: entity_reference_autocomplete
weight: 1
region: content
settings:
match_operator: CONTAINS
match_limit: 10
size: 60
placeholder: ''
third_party_settings: { }
field_unit_contact_use_address:
type: boolean_checkbox
weight: 2
region: content
settings:
display_label: true
third_party_settings: { }
field_unit_contact_use_details:
type: boolean_checkbox
weight: 8
region: content
settings:
display_label: true
third_party_settings: { }
field_unit_contact_use_link:
type: boolean_checkbox
weight: 9
region: content
settings:
display_label: true
third_party_settings: { }
field_unit_contact_use_opening:
type: boolean_checkbox
weight: 5
region: content
settings:
display_label: true
third_party_settings: { }
field_unit_contact_use_override:
type: boolean_checkbox
weight: 7
region: content
settings:
display_label: true
third_party_settings: { }
field_unit_contact_use_phone:
type: boolean_checkbox
weight: 4
region: content
settings:
display_label: true
third_party_settings: { }
field_unit_contact_use_picture:
type: boolean_checkbox
weight: 6
region: content
settings:
display_label: true
third_party_settings: { }
field_unit_contact_use_postal:
type: boolean_checkbox
weight: 3
region: content
settings:
display_label: true
third_party_settings: { }
hidden:
created: true
status: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.unit_accessibility_information.field_unit_accessibility_unit
- paragraphs.paragraphs_type.unit_accessibility_information
id: paragraph.unit_accessibility_information.default
targetEntityType: paragraph
bundle: unit_accessibility_information
mode: default
content:
field_unit_accessibility_unit:
type: entity_reference_label
label: above
settings:
link: true
third_party_settings: { }
weight: 0
region: content
hidden: { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
langcode: en
status: true
dependencies:
config:
- field.field.paragraph.unit_contact_card.field_unit_contact_title
- field.field.paragraph.unit_contact_card.field_unit_contact_unit
- field.field.paragraph.unit_contact_card.field_unit_contact_use_address
- field.field.paragraph.unit_contact_card.field_unit_contact_use_details
- field.field.paragraph.unit_contact_card.field_unit_contact_use_link
- field.field.paragraph.unit_contact_card.field_unit_contact_use_opening
- field.field.paragraph.unit_contact_card.field_unit_contact_use_override
- field.field.paragraph.unit_contact_card.field_unit_contact_use_phone
- field.field.paragraph.unit_contact_card.field_unit_contact_use_picture
- field.field.paragraph.unit_contact_card.field_unit_contact_use_postal
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.default
targetEntityType: paragraph
bundle: unit_contact_card
mode: default
content:
field_unit_contact_title:
type: string
label: hidden
settings:
link_to_entity: false
third_party_settings: { }
weight: 0
region: content
field_unit_contact_unit:
type: entity_reference_label
label: hidden
settings:
link: false
third_party_settings: { }
weight: 1
region: content
hidden:
field_unit_contact_use_address: true
field_unit_contact_use_details: true
field_unit_contact_use_link: true
field_unit_contact_use_opening: true
field_unit_contact_use_override: true
field_unit_contact_use_phone: true
field_unit_contact_use_picture: true
field_unit_contact_use_postal: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_accessibility_unit
- paragraphs.paragraphs_type.unit_accessibility_information
id: paragraph.unit_accessibility_information.field_unit_accessibility_unit
field_name: field_unit_accessibility_unit
entity_type: paragraph
bundle: unit_accessibility_information
label: Unit
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:tpr_unit'
handler_settings:
target_bundles: null
sort:
field: name
direction: DESC
auto_create: false
field_type: entity_reference
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_contact_title
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.field_unit_contact_title
field_name: field_unit_contact_title
entity_type: paragraph
bundle: unit_contact_card
label: Title
description: ''
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings: { }
field_type: string
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_contact_unit
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.field_unit_contact_unit
field_name: field_unit_contact_unit
entity_type: paragraph
bundle: unit_contact_card
label: Unit
description: 'Add here the unit that you want to appear as the contact card. The unit doesn''t have to be published.'
required: true
translatable: false
default_value: { }
default_value_callback: ''
settings:
handler: 'default:tpr_unit'
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,22 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_contact_use_address
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.field_unit_contact_use_address
field_name: field_unit_contact_use_address
entity_type: paragraph
bundle: unit_contact_card
label: 'Show address'
description: ''
required: false
translatable: false
default_value:
-
value: 1
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,22 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_contact_use_details
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.field_unit_contact_use_details
field_name: field_unit_contact_use_details
entity_type: paragraph
bundle: unit_contact_card
label: 'Show additional details'
description: ''
required: false
translatable: false
default_value:
-
value: 0
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,22 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_contact_use_link
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.field_unit_contact_use_link
field_name: field_unit_contact_use_link
entity_type: paragraph
bundle: unit_contact_card
label: 'Show link to unit page'
description: ''
required: false
translatable: false
default_value:
-
value: 0
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,22 @@
langcode: en
status: true
dependencies:
config:
- field.storage.paragraph.field_unit_contact_use_opening
- paragraphs.paragraphs_type.unit_contact_card
id: paragraph.unit_contact_card.field_unit_contact_use_opening
field_name: field_unit_contact_use_opening
entity_type: paragraph
bundle: unit_contact_card
label: 'Show opening hours'
description: ''
required: false
translatable: false
default_value:
-
value: 0
default_value_callback: ''
settings:
on_label: 'On'
off_label: 'Off'
field_type: boolean
Loading

0 comments on commit 0648518

Please sign in to comment.