Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds Reorderable lists component #1905

Merged
merged 1 commit into from
Mar 9, 2021
Merged

Conversation

DilwoarH
Copy link
Contributor

@DilwoarH DilwoarH commented Feb 4, 2021

What

A list of items that can be reordered

List items can be reordered by drag and drop or by using the up/down buttons. On small viewports the drag and drop feature is disabled to prevent being triggered when scrolling on touch devices.

This component uses SortableJS - a JavaScript library for drag and drop interactions. When JavaScript is disabled a set of inputs will be shown allowing users to provide an order index for each item.

Why

This is used by publishing tools to allow reordering of lists such as steps in step by step, entries in timelines and order of visual presentation of attachments.

Disclaimer

This is a port/extension of the work that @alex-ju has done on the content publisher app.

Demo

https://govuk-publis-add-reorde-g116bw.herokuapp.com/component-guide/reorderable_list

Visual Changes

screenshot-localhost_3212-2021 03 03-11_22_34

No JS view

Screenshot 2021-02-05 at 18 41 03

https://trello.com/c/SD4pLfen/1086-add-reorder-component-to-govukpublishingcomponents

@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-nlmptj February 4, 2021 19:22 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from 7da65e0 to b9d1a81 Compare February 4, 2021 19:27
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-rfpnsc February 4, 2021 19:28 Inactive
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-flwlxe February 4, 2021 19:34 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from 8317225 to 5660c52 Compare February 4, 2021 19:45
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-gcd7v5 February 4, 2021 19:46 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from 5660c52 to 99228dd Compare February 4, 2021 19:53
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 4, 2021 19:54 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from 99228dd to 5708a2f Compare February 5, 2021 10:21
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 5, 2021 10:22 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from 5708a2f to 43c14e4 Compare February 5, 2021 10:56
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 5, 2021 10:56 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from 43c14e4 to d51648f Compare February 5, 2021 18:17
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 5, 2021 18:18 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from d51648f to b7a9347 Compare February 5, 2021 18:27
@DilwoarH DilwoarH changed the title [WIP] Reorder-able component Reorder-able lists component Feb 5, 2021
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 5, 2021 18:27 Inactive
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from b7a9347 to db68e89 Compare February 5, 2021 18:30
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 5, 2021 18:30 Inactive
@DilwoarH DilwoarH changed the title Reorder-able lists component Adds Reorder-able lists component Feb 5, 2021
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from db68e89 to 90f6669 Compare February 5, 2021 18:31
@DilwoarH DilwoarH requested review from alex-ju and kevindew February 5, 2021 18:31
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 5, 2021 18:31 Inactive
@DilwoarH DilwoarH requested a review from leenagupte February 5, 2021 18:31
@DilwoarH DilwoarH force-pushed the add-reorderable-component branch from 90f6669 to 8aa73aa Compare February 5, 2021 18:35
@bevanloon bevanloon temporarily deployed to govuk-publis-add-reorde-g116bw February 5, 2021 18:35 Inactive
@DilwoarH DilwoarH marked this pull request as ready for review February 5, 2021 18:37
@kevindew
Copy link
Member

kevindew commented Feb 8, 2021

Nice one putting this together Dilwoar.

I do still think there needs to be more consolidation between the two implementations rather than having options for all. Nikin is available to have a meeting tomorrow to work towards this consolidation.

@alex-ju do you have any recollections for why Content Publisher made particular design decisions and or opinions on any parts where the collections-publisher designer is an improvement? as I understand the difference's we've got are:

  1. Green and grey secondary buttons (Collections Publisher) vs grey secondary buttons (Content Publisher) - seems fine and non-divisive to go with just grey secondary buttons
  2. Draggable elements in boxes (Collections Publisher) vs border bottom line (Content Publisher) - this seems the most divisive with a few people stating that boxes are easier to understand for drag and drop and probably the biggest decision
  3. Whether to have numbers or not - these seem to be confusing and they seem reasonable to be implemented as an option, though I do wonder whether they're needed at all?

@alex-ju
Copy link
Contributor

alex-ju commented Feb 8, 2021

Nice one putting this together Dilwoar.

I do still think there needs to be more consolidation between the two implementations rather than having options for all. Nikin is available to have a meeting tomorrow to work towards this consolidation.

@alex-ju do you have any recollections for why Content Publisher made particular design decisions and or opinions on any parts where the collections-publisher designer is an improvement? as I understand the difference's we've got are:

  1. Green and grey secondary buttons (Collections Publisher) vs grey secondary buttons (Content Publisher) - seems fine and non-divisive to go with just grey secondary buttons
  2. Draggable elements in boxes (Collections Publisher) vs border bottom line (Content Publisher) - this seems the most divisive with a few people stating that boxes are easier to understand for drag and drop and probably the biggest decision
  3. Whether to have numbers or not - these seem to be confusing and they seem reasonable to be implemented as an option, though I do wonder whether they're needed at all?

Hi both,

I don't have strong opinions on this, but I can provide a bit of background being involved with both:

  • Collections Publisher implementation was a rough improvement of an existing implementation in a rush to replace the old publishing interface for step-by-steps; this was tested internally with a limited number of users.
  • Content Publisher implementation was developed afterwards, was build from scratch and iterated a few times; this was tested with external stakeholders in a round of research.

Some of my design-related recollections of this during the Content Publisher times, in relation to the above points:

  • grey secondary buttons were used not to stand out as we found that users were less inclined to take the button-based approach to reorder
  • a boxes-based approach was considered but we realised it involved more vertical spacing – which became a problem on documents with lots of attachments as users needed to combine drag-and-drop with scroll and things end up messy
  • users didn't explicitly complain about the numbers, but some colleagues were confused by them after starting the reorder

I share the view that having as fewer options as possible would be ideal.

This was referenced Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants