Closed Quazia closed 4 years ago
On every widget header, navigation arrows should appear. Left and right should always be present, and down and up should only be present if there are other widgets in the same column.
@Quazia What if there's only one full-width column because secondary column issues were never added? In that case, if there's only one widget, there'd be no navigation controls; and if there were more than one, there'd only be up and down navigation controls.
Partially done in AutarkLabs/about#54
Acceptance criteria:
Create an Actions dropdown on the top right corner, which has "New widget" and "Edit layout" buttons.
When the "Edit layout" button is clicked, two buttons appear, "Cancel" and "Submit".
On every widget header, navigation arrows should appear. Left and right should always be present, and down and up should only be present if there are other widgets in the same column.
Clicking these navigation arrows allows the widgets to be repositioned
Clicking on "Cancel" reverts all the changes
Clicking on "Submit" saves all the changes
In order to handle the position of widgets, the contract needs to be updated with a "position" CID (
updateWidget('POSITION_LAYOUT', this_is_a_cid)
, this CID will link into the individual widget CIDs and attach position data at the top level. This way the CID will only change when there are discrete differences in the layout change, and that layout is itself unique compared to other layouts that have been used previously.Currently widgets are only being set as either
PRIMARY
orSECONDARY
, going forward we would maintain a single CID (thePOSITION_LAYOUT
CID) that contains both the layout information, and the CIDs of all of the individual widgets. This means on both anew widget
call, and anupdate widget
call this CID would need to be updated.