Sagas should handle the following functionalities:
addNewWidget:
a) if parentLayout uses a childTemplate. Construct a new layout using childTemplate json and add the movedWidgets to it.
b) Add childTemplate / movedWidgets to the parentLayout using components static method addChild.
c) Store the updated parent widget in redux.
removeWidget:
a) For each widget -
b) Traverse the layout tree of parentLayout to find the layoutId of the layout that wraps the widget.
c) Remove the widgetId from layout property of the affectedLayout.
d) If affectedLayout.layout is empty and affectedLayout.canBeDeleted, remove affectedLayoutId from the layout property of its parent layout.
e) Recursively perform the step d) until (i) parentLayout is reached; or (ii) current layout is not empty.
Sagas should handle the following functionalities:
addNewWidget
: a) if parentLayout uses achildTemplate
. Construct a new layout using childTemplate json and add the movedWidgets to it. b) Add childTemplate / movedWidgets to theparentLayout
using components static methodaddChild
. c) Store the updated parent widget in redux.removeWidget
: a) For each widget - b) Traverse the layout tree of parentLayout to find the layoutId of the layout that wraps the widget. c) Remove the widgetId fromlayout
property of the affectedLayout. d) IfaffectedLayout.layout
is empty andaffectedLayout.canBeDeleted
, remove affectedLayoutId from the layout property of its parent layout. e) Recursively perform the step d) until (i) parentLayout is reached; or (ii) current layout is not empty.