Allow source components to control how hydrated values are mapped into the clientside model

Created on 18 December 2024, 1 day ago

Overview

In πŸ“Œ Add support for global regions Active we added this code

-      if (isset($hydrated[$component_instance_uuid]['props'])) {
-        $model[$component_instance_uuid] = $hydrated[$component_instance_uuid]['props'];
+      if (isset($hydrated[$component_instance_uuid])) {
+        $model[$component_instance_uuid] = $hydrated[$component_instance_uuid]['props'] ?? $hydrated[$component_instance_uuid]['settings'];

However that hard-codes knowledge of how a component source plugin maps its hydrated values to the client model

Proposed resolution

Add a new method to ComponentSourceInterface and move this logic into each of the respective plugins

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Data model

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024