avo icon indicating copy to clipboard operation
avo copied to clipboard

Reorder key-value fields

Open iainbeeston opened this issue 3 years ago • 13 comments
trafficstars

Feature

It would be helpful to reorder key-value fields. At the moment when you enter key values the only way to reorder them is to delete and re-add, which is difficult if you have many entries.

Current workarounds

Delete and re-add those entries. Alternatively, when you display them to the user (outside of avo) you could apply a sort, but only very simple sorting would be possible (like alphabetical ordering).

Screenshots

Screenshot 2022-07-08 at 17 10 14

Additional context

You can see this in the avo demo app

iainbeeston avatar Jul 08 '22 16:07 iainbeeston

That sounds like a good idea. It shouldn't be that difficult to implement. Maybe someone can pick it up.

  • We have icon assets for records re-ordering (arrow-up.svg & arrow-down.svg).
  • The JS logic should be to move an item in an array. The field holds the items as array of arrays in memory ([['hoho', 'hohoho'], ['Teste', 'abc'], ...] in the above example).
  • The JS logic should enable/disable the up/down buttons when the item is first/last
  • That's it 🤷‍♂️

adrianthedev avatar Jul 10 '22 17:07 adrianthedev