{"action":"created","comment":{"url":"https://api.github.com/repos/oppia/oppia/pulls/comments/236073529","pull_request_review_id":178082057,"id":236073529,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNjA3MzUyOQ==","diff_hunk":"@@ -70,41 +115,94 @@ oppia.directive('storyNodeEditor', [\n               $scope.story, $scope.getId());\n           };\n \n-          $scope.addNewDestinationNode = function() {\n-            var nextNodeId = $scope.story.getStoryContents().getNextNodeId();\n-            StoryUpdateService.addStoryNode($scope.story);\n-            StoryUpdateService.addDestinationNodeIdToNode(\n-              $scope.story, $scope.getId(), nextNodeId);\n-          };\n-\n-          $scope.addExistingDestinationNode = function(nodeId) {\n-            StoryUpdateService.addDestinationNodeIdToNode(\n-              $scope.story, $scope.getId(), nodeId);\n-            $scope.newDestinationNodeId = '';\n-            $scope.closeNodeIdEditor();\n+          $scope.addDestinationNode = function(nodeId) {\n+            if (nodeId === null) {\n+              var nodeTitles =\n+                $scope.story.getStoryContents().getNodes().map(function(node) {\n+                  return node.getTitle();\n+                });\n+              var modalInstance = $uibModal.open({\n+                templateUrl: UrlInterpolationService.getDirectiveTemplateUrl(\n+                  '/pages/story_editor/main_editor/' +\n+                  'new_chapter_title_modal_directive.html'),\n+                backdrop: true,\n+                controller: [\n+                  '$scope', '$uibModalInstance',\n+                  function($scope, $uibModalInstance) {\n+                    $scope.nodeTitle = '';\n+                    $scope.nodeTitles = nodeTitles;\n+                    $scope.errorMsg = null;\n+\n+                    $scope.resetErrorMsg = function() {\n+                      $scope.errorMsg = null;\n+                    };\n+                    $scope.isNodeTitleEmpty = function(nodeTitle) {\n+                      return (nodeTitle === '');\n+                    };\n+                    $scope.save = function(title) {\n+                      if ($scope.nodeTitles.indexOf(title) !== -1) {\n+                        $scope.errorMsg =\n+                          'A chapter with this title already exists';\n+                        return;\n+                      }\n+                      $uibModalInstance.close(title);\n+                    };\n+                    $scope.cancel = function() {\n+                      $uibModalInstance.dismiss('cancel');\n+                    };\n+                  }\n+                ]\n+              });\n+\n+              modalInstance.result.then(function(title) {\n+                var nextNodeId =\n+                  $scope.story.getStoryContents().getNextNodeId();\n+                StoryUpdateService.addStoryNode($scope.story, title);\n+                StoryUpdateService.addDestinationNodeIdToNode(\n+                  $scope.story, $scope.getId(), nextNodeId);\n+                _init();\n+                _recalculateAvailableNodes();\n+              });\n+            } else {\n+              if (nodeId === $scope.getId()) {\n+                AlertsService.addInfoMessage(\n+                  'A chapter cannot lead to itself.', 3000);\n+                return;\n+              }\n+              if (nodeId === undefined) {","path":"core/templates/dev/head/pages/story_editor/main_editor/StoryNodeEditorDirective.js","position":143,"original_position":143,"commit_id":"f847cbc6b87a185bb394cbd9961de0df7380003d","original_commit_id":"f847cbc6b87a185bb394cbd9961de0df7380003d","user":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"body":"Done, removed null and undefined objects from the availableNodes array.","created_at":"2018-11-25T13:36:19Z","updated_at":"2018-11-25T13:36:19Z","html_url":"https://github.com/oppia/oppia/pull/5724#discussion_r236073529","pull_request_url":"https://api.github.com/repos/oppia/oppia/pulls/5724","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments/236073529"},"html":{"href":"https://github.com/oppia/oppia/pull/5724#discussion_r236073529"},"pull_request":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5724"}},"in_reply_to_id":235352035},"pull_request":{"url":"https://api.github.com/repos/oppia/oppia/pulls/5724","id":220162058,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIwMTYyMDU4","html_url":"https://github.com/oppia/oppia/pull/5724","diff_url":"https://github.com/oppia/oppia/pull/5724.diff","patch_url":"https://github.com/oppia/oppia/pull/5724.patch","issue_url":"https://api.github.com/repos/oppia/oppia/issues/5724","number":5724,"state":"open","locked":false,"title":"UI modifications to story editor.","user":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"body":"In this PR:\r\n- Chapters have been added to stories (internally implemented as story node titles).\r\n- Empty stories (with no nodes) are allowed, also added UI for this.\r\n- UI changes to process of adding a new 'chapter'.\r\n- Other minor UI changes to story editor.\r\n\r\n@tjiang11's story editor mocks have been used as reference for the UI,","created_at":"2018-10-03T20:02:49Z","updated_at":"2018-11-25T13:36:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2d46efd2e63f3b3c2da88b03eaefb8482170e6df","assignee":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"assignees":[{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"apb7","id":24826041,"node_id":"MDQ6VXNlcjI0ODI2MDQx","avatar_url":"https://avatars2.githubusercontent.com/u/24826041?v=4","gravatar_id":"","url":"https://api.github.com/users/apb7","html_url":"https://github.com/apb7","followers_url":"https://api.github.com/users/apb7/followers","following_url":"https://api.github.com/users/apb7/following{/other_user}","gists_url":"https://api.github.com/users/apb7/gists{/gist_id}","starred_url":"https://api.github.com/users/apb7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apb7/subscriptions","organizations_url":"https://api.github.com/users/apb7/orgs","repos_url":"https://api.github.com/users/apb7/repos","events_url":"https://api.github.com/users/apb7/events{/privacy}","received_events_url":"https://api.github.com/users/apb7/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/oppia/oppia/pulls/5724/commits","review_comments_url":"https://api.github.com/repos/oppia/oppia/pulls/5724/comments","review_comment_url":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/oppia/oppia/issues/5724/comments","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/f847cbc6b87a185bb394cbd9961de0df7380003d","head":{"label":"aks681:story-changes","ref":"story-changes","sha":"f847cbc6b87a185bb394cbd9961de0df7380003d","user":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"repo":{"id":112202645,"node_id":"MDEwOlJlcG9zaXRvcnkxMTIyMDI2NDU=","name":"oppia","full_name":"aks681/oppia","private":false,"owner":{"login":"aks681","id":22347970,"node_id":"MDQ6VXNlcjIyMzQ3OTcw","avatar_url":"https://avatars3.githubusercontent.com/u/22347970?v=4","gravatar_id":"","url":"https://api.github.com/users/aks681","html_url":"https://github.com/aks681","followers_url":"https://api.github.com/users/aks681/followers","following_url":"https://api.github.com/users/aks681/following{/other_user}","gists_url":"https://api.github.com/users/aks681/gists{/gist_id}","starred_url":"https://api.github.com/users/aks681/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aks681/subscriptions","organizations_url":"https://api.github.com/users/aks681/orgs","repos_url":"https://api.github.com/users/aks681/repos","events_url":"https://api.github.com/users/aks681/events{/privacy}","received_events_url":"https://api.github.com/users/aks681/received_events","type":"User","site_admin":false},"html_url":"https://github.com/aks681/oppia","description":"Tool for collaboratively building interactive lessons.","fork":true,"url":"https://api.github.com/repos/aks681/oppia","forks_url":"https://api.github.com/repos/aks681/oppia/forks","keys_url":"https://api.github.com/repos/aks681/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aks681/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aks681/oppia/teams","hooks_url":"https://api.github.com/repos/aks681/oppia/hooks","issue_events_url":"https://api.github.com/repos/aks681/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/aks681/oppia/events","assignees_url":"https://api.github.com/repos/aks681/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/aks681/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/aks681/oppia/tags","blobs_url":"https://api.github.com/repos/aks681/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aks681/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aks681/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/aks681/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aks681/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/aks681/oppia/languages","stargazers_url":"https://api.github.com/repos/aks681/oppia/stargazers","contributors_url":"https://api.github.com/repos/aks681/oppia/contributors","subscribers_url":"https://api.github.com/repos/aks681/oppia/subscribers","subscription_url":"https://api.github.com/repos/aks681/oppia/subscription","commits_url":"https://api.github.com/repos/aks681/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/aks681/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/aks681/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/aks681/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/aks681/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/aks681/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aks681/oppia/merges","archive_url":"https://api.github.com/repos/aks681/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aks681/oppia/downloads","issues_url":"https://api.github.com/repos/aks681/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/aks681/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/aks681/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/aks681/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aks681/oppia/labels{/name}","releases_url":"https://api.github.com/repos/aks681/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/aks681/oppia/deployments","created_at":"2017-11-27T13:56:34Z","updated_at":"2018-11-24T22:15:58Z","pushed_at":"2018-11-24T22:15:51Z","git_url":"git://github.com/aks681/oppia.git","ssh_url":"git@github.com:aks681/oppia.git","clone_url":"https://github.com/aks681/oppia.git","svn_url":"https://github.com/aks681/oppia","homepage":"https://www.oppia.org","size":108020,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"oppia:develop","ref":"develop","sha":"e6febe47cab40e14d93200d45a15133431585908","user":{"login":"oppia","id":11620230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjIwMjMw","avatar_url":"https://avatars1.githubusercontent.com/u/11620230?v=4","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"repo":{"id":40687563,"node_id":"MDEwOlJlcG9zaXRvcnk0MDY4NzU2Mw==","name":"oppia","full_name":"oppia/oppia","private":false,"owner":{"login":"oppia","id":11620230,"node_id":"MDEyOk9yZ2FuaXphdGlvbjExNjIwMjMw","avatar_url":"https://avatars1.githubusercontent.com/u/11620230?v=4","gravatar_id":"","url":"https://api.github.com/users/oppia","html_url":"https://github.com/oppia","followers_url":"https://api.github.com/users/oppia/followers","following_url":"https://api.github.com/users/oppia/following{/other_user}","gists_url":"https://api.github.com/users/oppia/gists{/gist_id}","starred_url":"https://api.github.com/users/oppia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oppia/subscriptions","organizations_url":"https://api.github.com/users/oppia/orgs","repos_url":"https://api.github.com/users/oppia/repos","events_url":"https://api.github.com/users/oppia/events{/privacy}","received_events_url":"https://api.github.com/users/oppia/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/oppia/oppia","description":"Tool for collaboratively building interactive lessons.","fork":false,"url":"https://api.github.com/repos/oppia/oppia","forks_url":"https://api.github.com/repos/oppia/oppia/forks","keys_url":"https://api.github.com/repos/oppia/oppia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oppia/oppia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oppia/oppia/teams","hooks_url":"https://api.github.com/repos/oppia/oppia/hooks","issue_events_url":"https://api.github.com/repos/oppia/oppia/issues/events{/number}","events_url":"https://api.github.com/repos/oppia/oppia/events","assignees_url":"https://api.github.com/repos/oppia/oppia/assignees{/user}","branches_url":"https://api.github.com/repos/oppia/oppia/branches{/branch}","tags_url":"https://api.github.com/repos/oppia/oppia/tags","blobs_url":"https://api.github.com/repos/oppia/oppia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oppia/oppia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oppia/oppia/git/refs{/sha}","trees_url":"https://api.github.com/repos/oppia/oppia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oppia/oppia/statuses/{sha}","languages_url":"https://api.github.com/repos/oppia/oppia/languages","stargazers_url":"https://api.github.com/repos/oppia/oppia/stargazers","contributors_url":"https://api.github.com/repos/oppia/oppia/contributors","subscribers_url":"https://api.github.com/repos/oppia/oppia/subscribers","subscription_url":"https://api.github.com/repos/oppia/oppia/subscription","commits_url":"https://api.github.com/repos/oppia/oppia/commits{/sha}","git_commits_url":"https://api.github.com/repos/oppia/oppia/git/commits{/sha}","comments_url":"https://api.github.com/repos/oppia/oppia/comments{/number}","issue_comment_url":"https://api.github.com/repos/oppia/oppia/issues/comments{/number}","contents_url":"https://api.github.com/repos/oppia/oppia/contents/{+path}","compare_url":"https://api.github.com/repos/oppia/oppia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oppia/oppia/merges","archive_url":"https://api.github.com/repos/oppia/oppia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oppia/oppia/downloads","issues_url":"https://api.github.com/repos/oppia/oppia/issues{/number}","pulls_url":"https://api.github.com/repos/oppia/oppia/pulls{/number}","milestones_url":"https://api.github.com/repos/oppia/oppia/milestones{/number}","notifications_url":"https://api.github.com/repos/oppia/oppia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oppia/oppia/labels{/name}","releases_url":"https://api.github.com/repos/oppia/oppia/releases{/id}","deployments_url":"https://api.github.com/repos/oppia/oppia/deployments","created_at":"2015-08-14T00:16:14Z","updated_at":"2018-11-24T18:01:43Z","pushed_at":"2018-11-25T09:33:02Z","git_url":"git://github.com/oppia/oppia.git","ssh_url":"git@github.com:oppia/oppia.git","clone_url":"https://github.com/oppia/oppia.git","svn_url":"https://github.com/oppia/oppia","homepage":"https://www.oppia.org","size":108532,"stargazers_count":811,"watchers_count":811,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":810,"mirror_url":null,"archived":false,"open_issues_count":396,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":810,"open_issues":396,"watchers":811,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5724"},"html":{"href":"https://github.com/oppia/oppia/pull/5724"},"issue":{"href":"https://api.github.com/repos/oppia/oppia/issues/5724"},"comments":{"href":"https://api.github.com/repos/oppia/oppia/issues/5724/comments"},"review_comments":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5724/comments"},"review_comment":{"href":"https://api.github.com/repos/oppia/oppia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/oppia/oppia/pulls/5724/commits"},"statuses":{"href":"https://api.github.com/repos/oppia/oppia/statuses/f847cbc6b87a185bb394cbd9961de0df7380003d"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"aks681"}}