{"action":"closed","number":396,"pull_request":{"url":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/396","id":28026930,"html_url":"https://github.com/alphagov/specialist-publisher/pull/396","diff_url":"https://github.com/alphagov/specialist-publisher/pull/396.diff","patch_url":"https://github.com/alphagov/specialist-publisher/pull/396.patch","issue_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues/396","number":396,"state":"closed","locked":false,"title":"Make manual sections reorderable","user":{"login":"evilstreak","id":74812,"avatar_url":"https://avatars.githubusercontent.com/u/74812?v=3","gravatar_id":"","url":"https://api.github.com/users/evilstreak","html_url":"https://github.com/evilstreak","followers_url":"https://api.github.com/users/evilstreak/followers","following_url":"https://api.github.com/users/evilstreak/following{/other_user}","gists_url":"https://api.github.com/users/evilstreak/gists{/gist_id}","starred_url":"https://api.github.com/users/evilstreak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evilstreak/subscriptions","organizations_url":"https://api.github.com/users/evilstreak/orgs","repos_url":"https://api.github.com/users/evilstreak/repos","events_url":"https://api.github.com/users/evilstreak/events{/privacy}","received_events_url":"https://api.github.com/users/evilstreak/received_events","type":"User","site_admin":false},"body":"## Overview\r\n\r\nThis PR provides editors with a drag-drop interface for reordering the sections of a manual.\r\n\r\n![reorder-manual-sections](https://cloud.githubusercontent.com/assets/74812/5900129/32a347a4-a55d-11e4-928b-b251a9cf3dd6.gif)\r\n\r\nWe've added a link to the manual show page to allow reordering, and moved the existing link for adding a section next to it.\r\n\r\n![screen shot 2015-01-26 at 12 10 03](https://cloud.githubusercontent.com/assets/74812/5900162/e7f798b2-a55d-11e4-98d8-d5608b20f49b.png)\r\n\r\nThis is part of the firebreak work for iterating manuals.\r\n\r\n## Change history\r\n\r\nWe don't modify the change history for a manual when the sections are rearranged. Whether the new version of the manual is a major or minor change continues to be determined by whether there are any major changes on any of the sections being published.\r\n\r\nReordering isn't necessarily a substantive change in itself, and where it requires commentary we expect it will be as part of a larger piece of work restructuring whole sections, which will provide a place to add change notes.\r\n\r\n## Javascript\r\n\r\nJavascript is required for this to work. This is already true in many of our publishing apps, but this is the first feature to require javascript in Specialist Publisher.\r\n\r\nNon-javascript versions of this would require a hard-to-use interface (for example, a list of document IDs in a textarea to be cut-and-pasted into the correct order, or an input for each section with an index number) or a lot of intermediate round trips (for example, an up and down button for each section which moves it one position). We decided a javascript-only approach would be appropriate for this MVP.\r\n\r\n## Error feedback\r\n\r\nThe only guard against unexpected behaviour is checking the list of document IDs submitted for reordering against the current list of documents. If the IDs aren't a perfect match (probably because someone has added or removed a section in between the editor opening the reordering form and submitting it) then it will raise an `ArgumentError` which will result in a 500 error.\r\n\r\nThis should be a rare situation, but it would be good to show a proper validation error to the user instead of a stock 500.","created_at":"2015-01-26T13:41:58Z","updated_at":"2015-01-27T10:02:16Z","closed_at":"2015-01-27T10:02:16Z","merged_at":"2015-01-27T10:02:16Z","merge_commit_sha":"d5cb08beb4540da070ef318c9c1312cc12807496","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/396/commits","review_comments_url":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/396/comments","review_comment_url":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/comments/{number}","comments_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues/396/comments","statuses_url":"https://api.github.com/repos/alphagov/specialist-publisher/statuses/48088ac8bb573eadf48b6e42cb87ca5bbd993e23","head":{"label":"alphagov:make-manual-sections-reorderable","ref":"make-manual-sections-reorderable","sha":"48088ac8bb573eadf48b6e42cb87ca5bbd993e23","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":16176198,"name":"specialist-publisher","full_name":"alphagov/specialist-publisher","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/specialist-publisher","description":"","fork":false,"url":"https://api.github.com/repos/alphagov/specialist-publisher","forks_url":"https://api.github.com/repos/alphagov/specialist-publisher/forks","keys_url":"https://api.github.com/repos/alphagov/specialist-publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/specialist-publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/specialist-publisher/teams","hooks_url":"https://api.github.com/repos/alphagov/specialist-publisher/hooks","issue_events_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/specialist-publisher/events","assignees_url":"https://api.github.com/repos/alphagov/specialist-publisher/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/specialist-publisher/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/specialist-publisher/tags","blobs_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/specialist-publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/specialist-publisher/languages","stargazers_url":"https://api.github.com/repos/alphagov/specialist-publisher/stargazers","contributors_url":"https://api.github.com/repos/alphagov/specialist-publisher/contributors","subscribers_url":"https://api.github.com/repos/alphagov/specialist-publisher/subscribers","subscription_url":"https://api.github.com/repos/alphagov/specialist-publisher/subscription","commits_url":"https://api.github.com/repos/alphagov/specialist-publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/specialist-publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues/comments/{number}","contents_url":"https://api.github.com/repos/alphagov/specialist-publisher/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/specialist-publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/specialist-publisher/merges","archive_url":"https://api.github.com/repos/alphagov/specialist-publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/specialist-publisher/downloads","issues_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/specialist-publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/specialist-publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/specialist-publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/specialist-publisher/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/specialist-publisher/releases{/id}","created_at":"2014-01-23T15:21:42Z","updated_at":"2015-01-27T09:56:59Z","pushed_at":"2015-01-27T10:02:16Z","git_url":"git://github.com/alphagov/specialist-publisher.git","ssh_url":"git@github.com:alphagov/specialist-publisher.git","clone_url":"https://github.com/alphagov/specialist-publisher.git","svn_url":"https://github.com/alphagov/specialist-publisher","homepage":null,"size":11381,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":3,"default_branch":"master"}},"base":{"label":"alphagov:master","ref":"master","sha":"b35980b9d7f79ef7b30423fc88c442a31a857e4a","user":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"repo":{"id":16176198,"name":"specialist-publisher","full_name":"alphagov/specialist-publisher","owner":{"login":"alphagov","id":596977,"avatar_url":"https://avatars.githubusercontent.com/u/596977?v=3","gravatar_id":"","url":"https://api.github.com/users/alphagov","html_url":"https://github.com/alphagov","followers_url":"https://api.github.com/users/alphagov/followers","following_url":"https://api.github.com/users/alphagov/following{/other_user}","gists_url":"https://api.github.com/users/alphagov/gists{/gist_id}","starred_url":"https://api.github.com/users/alphagov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alphagov/subscriptions","organizations_url":"https://api.github.com/users/alphagov/orgs","repos_url":"https://api.github.com/users/alphagov/repos","events_url":"https://api.github.com/users/alphagov/events{/privacy}","received_events_url":"https://api.github.com/users/alphagov/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/alphagov/specialist-publisher","description":"","fork":false,"url":"https://api.github.com/repos/alphagov/specialist-publisher","forks_url":"https://api.github.com/repos/alphagov/specialist-publisher/forks","keys_url":"https://api.github.com/repos/alphagov/specialist-publisher/keys{/key_id}","collaborators_url":"https://api.github.com/repos/alphagov/specialist-publisher/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/alphagov/specialist-publisher/teams","hooks_url":"https://api.github.com/repos/alphagov/specialist-publisher/hooks","issue_events_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues/events{/number}","events_url":"https://api.github.com/repos/alphagov/specialist-publisher/events","assignees_url":"https://api.github.com/repos/alphagov/specialist-publisher/assignees{/user}","branches_url":"https://api.github.com/repos/alphagov/specialist-publisher/branches{/branch}","tags_url":"https://api.github.com/repos/alphagov/specialist-publisher/tags","blobs_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/refs{/sha}","trees_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/trees{/sha}","statuses_url":"https://api.github.com/repos/alphagov/specialist-publisher/statuses/{sha}","languages_url":"https://api.github.com/repos/alphagov/specialist-publisher/languages","stargazers_url":"https://api.github.com/repos/alphagov/specialist-publisher/stargazers","contributors_url":"https://api.github.com/repos/alphagov/specialist-publisher/contributors","subscribers_url":"https://api.github.com/repos/alphagov/specialist-publisher/subscribers","subscription_url":"https://api.github.com/repos/alphagov/specialist-publisher/subscription","commits_url":"https://api.github.com/repos/alphagov/specialist-publisher/commits{/sha}","git_commits_url":"https://api.github.com/repos/alphagov/specialist-publisher/git/commits{/sha}","comments_url":"https://api.github.com/repos/alphagov/specialist-publisher/comments{/number}","issue_comment_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues/comments/{number}","contents_url":"https://api.github.com/repos/alphagov/specialist-publisher/contents/{+path}","compare_url":"https://api.github.com/repos/alphagov/specialist-publisher/compare/{base}...{head}","merges_url":"https://api.github.com/repos/alphagov/specialist-publisher/merges","archive_url":"https://api.github.com/repos/alphagov/specialist-publisher/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/alphagov/specialist-publisher/downloads","issues_url":"https://api.github.com/repos/alphagov/specialist-publisher/issues{/number}","pulls_url":"https://api.github.com/repos/alphagov/specialist-publisher/pulls{/number}","milestones_url":"https://api.github.com/repos/alphagov/specialist-publisher/milestones{/number}","notifications_url":"https://api.github.com/repos/alphagov/specialist-publisher/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/alphagov/specialist-publisher/labels{/name}","releases_url":"https://api.github.com/repos/alphagov/specialist-publisher/releases{/id}","created_at":"2014-01-23T15:21:42Z","updated_at":"2015-01-27T09:56:59Z","pushed_at":"2015-01-27T10:02:16Z","git_url":"git://github.com/alphagov/specialist-publisher.git","ssh_url":"git@github.com:alphagov/specialist-publisher.git","clone_url":"https://github.com/alphagov/specialist-publisher.git","svn_url":"https://github.com/alphagov/specialist-publisher","homepage":null,"size":11381,"stargazers_count":3,"watchers_count":3,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":2,"forks":7,"open_issues":2,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/396"},"html":{"href":"https://github.com/alphagov/specialist-publisher/pull/396"},"issue":{"href":"https://api.github.com/repos/alphagov/specialist-publisher/issues/396"},"comments":{"href":"https://api.github.com/repos/alphagov/specialist-publisher/issues/396/comments"},"review_comments":{"href":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/396/comments"},"review_comment":{"href":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/alphagov/specialist-publisher/pulls/396/commits"},"statuses":{"href":"https://api.github.com/repos/alphagov/specialist-publisher/statuses/48088ac8bb573eadf48b6e42cb87ca5bbd993e23"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"tommyp","id":449004,"avatar_url":"https://avatars.githubusercontent.com/u/449004?v=3","gravatar_id":"","url":"https://api.github.com/users/tommyp","html_url":"https://github.com/tommyp","followers_url":"https://api.github.com/users/tommyp/followers","following_url":"https://api.github.com/users/tommyp/following{/other_user}","gists_url":"https://api.github.com/users/tommyp/gists{/gist_id}","starred_url":"https://api.github.com/users/tommyp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tommyp/subscriptions","organizations_url":"https://api.github.com/users/tommyp/orgs","repos_url":"https://api.github.com/users/tommyp/repos","events_url":"https://api.github.com/users/tommyp/events{/privacy}","received_events_url":"https://api.github.com/users/tommyp/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":7,"additions":260,"deletions":3,"changed_files":15}}