apostrophecms / docs

ApostropheCMS documentation.
MIT License
4 stars 14 forks source link

add styles and draggable option to inline array #299

Closed haroun closed 1 year ago

haroun commented 1 year ago

Summary

Add styles and draggable option to inline array

What are the specific steps to test this change?

For example:

  1. Run the website and log in as an admin
  2. Open a piece manager modal and select several pieces
  3. Click the "Archive" button on the top left of the manager and confirm that it should proceed
  4. Check that all pieces have been archived properly

What kind of change does this PR introduce?

(Check at least one)

Make sure the PR fulfills these requirements:

If adding a new feature without an already open issue, it's best to open a feature request issue first and wait for approval before working on it.

Other information:

linear[bot] commented 1 year ago
PRO-3522 As an editor, I can comfortably work with more rows in an inline array

Currently inline array fields display labels again for each row. Change this to a more tabular view, per Stu's design: [image.png](https://uploads.linear.app/4e73c947-c168-4b4a-9281-01a7243d77be/38257e5a-c61a-45a1-809b-75cb0c10be95/fd75fd37-1d8b-477d-9dbd-dbea2189df7c) Note that the table headers only appear once. **Revision 2/14/23 (Stu and Tom):** * However, **we can't use this new layout and markup all the time.** Stu shared a very convincing screenshot of why, see below. We just can't assume all inline arrays are a good fit for this. * So this behavior should be triggered by `style: 'table'` being explicitly set on an inline array field. Otherwise we should get the existing inline appearance and behavior. * In either case, drag and drop should work unless `draggable: false` is set. However for the sake of time, it is acceptable to leave implementing `draggable` for another ticket, and for now just say that `style: 'table'` does not support dragging and the regular style always does. In which case, please open a followup ticket for the `draggable` option. Screenshot of why we can't do this for all inline arrays 100% of the time: [image.png](https://uploads.linear.app/4e73c947-c168-4b4a-9281-01a7243d77be/a891bd88-581b-4d67-b1df-8362798da655/9cdc1d19-8d4c-48b9-9e3d-eb248abd3f07) **Acceptance criteria** * When `style: 'table'` is set on the field and it is also marked `inline: true`, Headings appear on inline array fields only once at the top. * When `style: 'table'` is set on the field and it is also marked `inline: true`, inline array fields line up appropriately on each row as more are added. * Items should be draggable, either way, unless `draggable: false` is set. However if time does not permit, make sure they remain draggable for the case where `style: 'table'` is NOT set, and open a followup ticket to make this consistent.