Skip to content

Commit

Permalink
update data story plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rloos289 committed Jan 29, 2024
1 parent 9e274d2 commit cc1f5d0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function getReferencedData(array $entities) {
if (count($entity_data['value']) == 1) {
$entities_data[$key] = [
'type' => $entity_data['type'],
'value' => $entity_data['value']['value'],
'value' => reset($entity_data['value']),
];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* id = "node_data_story",
* title = @Translation("Node data_story"),
* bundle = "data_story",
* wag_bundle = "dataStory",
* wag_bundle = "DataStory",
* entity_id = {},
* langcode = {},
* )
Expand All @@ -27,7 +27,7 @@ public function setCustomData($entity) {
return [
'description' => $entity->get('field_description')->value,
'content' => $this->getReferencedData($entity->get('field_content')->referencedEntities()),
'field_departments' => $entity->get('field_departments')->value,
'partner_agencies' => $this->getReferencedEntity($entity->get('field_departments')->referencedEntities()),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DataStorySection extends SfgApiParagraphBase {
public function setCustomData($entity) {
return [
'title' => $entity->get('field_title')->value,
'field_content' => $this->getReferencedData($entity->get('field_content')->referencedEntities()),
'section_content' => $this->getReferencedData($entity->get('field_content')->referencedEntities()),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class PowerbiEmbed extends SfgApiParagraphBase {
*/
public function setCustomData($entity) {
return [
'alt_text' => $entity->get('field_title')->value,
'data_notes' => $entity->get('field_data_notes')->value,
'source_data' => $entity->get('field_source_data')->value,
'aspect_ratios' => [
Expand All @@ -39,7 +40,6 @@ public function setCustomData($entity) {
],
'desktop_embed_url' => $entity->get('field_desktop_embed_url')->value,
'mobile_embed_url' => $entity->get('field_mobile_embed_url')->value,
// 'field_title' => $entity->get('field_title')->value,
];
}

Expand Down

0 comments on commit cc1f5d0

Please sign in to comment.