| 283 | `${stringifyId(id)}.${persistedProp}.${JSON.stringify(persistence)}`; |
| 284 | |
| 285 | const getProps = layout => { |
| 286 | const {props, type, namespace} = layout; |
| 287 | if (!type || !namespace) { |
| 288 | // not a real component - just need the props for recursion |
| 289 | return {props}; |
| 290 | } |
| 291 | const {id, persistence} = props; |
| 292 | |
| 293 | const element = Registry.resolve(layout); |
| 294 | const getVal = prop => |
| 295 | props[prop] || |
| 296 | (element.defaultProps || element.dashPersistence || {})[prop]; |
| 297 | const persisted_props = getVal('persisted_props'); |
| 298 | const persistence_type = getVal('persistence_type'); |
| 299 | const canPersist = id && persisted_props && persistence_type; |
| 300 | |
| 301 | return { |
| 302 | canPersist, |
| 303 | id, |
| 304 | props, |
| 305 | element, |
| 306 | persistence, |
| 307 | persisted_props, |
| 308 | persistence_type |
| 309 | }; |
| 310 | }; |
| 311 | |
| 312 | export function recordUiEdit(layout, newProps, dispatch) { |
| 313 | const { |
no test coverage detected
searching dependent graphs…