Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Make UI more like other admin apps, prevent accidental publishing #464
Editing a document
Viewing a document
Truncated attachments table
* Make it harder to accidentally click the wrong one. * Put the more commonly used edit button first. * Hide the publish button altogether when you can’t publish, disabled buttons have proved to be confusing in the past and users continue to try and interact with them
* Correctly space sections with a consistent vertical rhythm * Use `lead` styles to make summary more readable * Remove collapsible body function, instead restrict height, and don’t show at all unless there is a body * Remove dependencies on govuk_frontend_toolkit – currently the admin template and the toolkit don’t play well together
* Bump admin gem to pick up confirm JS module * Use module to warn when clicking publish or withdraw buttons and to confirm user action * Separate publish, withdraw and edit buttons to avoid accidental clicks * Always include a title on the “publish” container * Completely hide publish button when unavailable, a disabled button is confusing
* Some documents have a couple of attachments, others have hundreds * Always show the first 5 attachments * When more than 5 and when JS is enabled, hide the rest behind a toggle with a link that indicates how many more attachments will be revealed * Pattern pulled from Transition where it was well received for tables containing hundreds of mappings
It looks like you've swapped a collapsing body for a fixed height display. How easy is it to scan through the content when it's shown in a small slice? Are editors looking at that content at all? If they're not, we could probably drop it. If they are, I worry that showing such a narrow slice will make scanning through long documents pretty impossible.
In a couple of commits you hide the publish button altogether when the action is unavailable because "disabled buttons have proved to be confusing in the past". The advantage of showing a disabled button is that it distinguishes between the user not having permissions to publish, and the content item not being a suitable state to be published. Is that a valuable distinction to maintain? If so, is there another way to solve it without using disabled buttons?
To summarise the hangout I've had with @evilstreak, for this PR we are going to:
For a later PR and after some research: