AutarkLabs / open-enterprise

A suite of apps that includes allocation, dot voting, issue curation, and other planning tools so organizations can collectively budget and design custom reward & bounty systems.
GNU General Public License v3.0
92 stars 54 forks source link

Modify widgets so position can be changed #1880

Closed Quazia closed 4 years ago

Quazia commented 4 years ago

Acceptance criteria:

  1. Create an Actions dropdown on the top right corner, which has "New widget" and "Edit layout" buttons. Screenshot from 2020-01-14 12-06-53

  2. When the "Edit layout" button is clicked, two buttons appear, "Cancel" and "Submit". Screenshot from 2020-01-14 12-07-20

  3. 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. Screenshot from 2020-01-14 12-07-47 Screenshot from 2020-01-14 12-08-11

  4. Clicking these navigation arrows allows the widgets to be repositioned

  5. Clicking on "Cancel" reverts all the changes

  6. 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 or SECONDARY, going forward we would maintain a single CID (the POSITION_LAYOUT CID) that contains both the layout information, and the CIDs of all of the individual widgets. This means on both a new widget call, and an update widget call this CID would need to be updated.

javieralaves commented 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.

ottodevs commented 4 years ago

Partially done in AutarkLabs/about#54