{"action":"created","comment":{"url":"https://api.github.com/repos/kbase/narrative/pulls/comments/204577303","pull_request_review_id":139682403,"id":204577303,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwNDU3NzMwMw==","diff_hunk":"@@ -71,156 +64,64 @@ define([\n                 color: color,\n                 fontWeight: 'bold'\n             },\n-            class: icon\n-        }, label);\n-    }\n-\n-    function updateRowStatus(ui, jobState, container, clickFunction) {\n-        if(!jobState){\n-            return;\n-        }\n-        var selector = '[data-element-job-id=\"' + jobState.job_id + '\"]';\n-        var row = container.querySelector(selector);\n-        if(row === null){\n-            row = document.createElement('tr');\n-            row.setAttribute('data-element-job-id', jobState.job_id);\n-            if(clickFunction){\n-                row.onclick = () => {clickFunction(jobState.job_id)};\n-            }\n-            container.appendChild(row);\n-        }        \n-        var jobStatus = jobState ? jobState.job_state : 'Determining Job State...';\n-        row.innerHTML = th(jobState.job_id) + niceState(jobStatus);\n+        }, [\n+            span({\n+                class: icon\n+            }),\n+            ' ' + label\n+        ]);\n     }\n \n     function factory() {\n-        var container, ui, listeners = [],\n-            jobState = null,\n-            runtime = Runtime.make(),\n-            listeningForJob = false,\n-            jobId;\n-\n-\n-        function startJobUpdates() {\n-            if (listeningForJob) {\n-                return;\n+        var container,\n+            ui,\n+            name,\n+            jobId,\n+            clickFunction,\n+            isParentJob;\n+\n+        function updateRowStatus(jobStatus) {\n+            jobStatus = jobStatus ? jobStatus : 'Job still pending.';\n+            var jobIdDiv = '';\n+            if (jobId) {\n+                jobIdDiv = div({'style': 'font-size:8pt; color:gray'}, [jobId]);\n             }\n-            runtime.bus().emit('request-job-update', {\n-                jobId: jobId\n-            });\n-            listeningForJob = true;\n-        }\n-\n-        function stopJobUpdates() {\n-            if (listeningForJob) {\n-                runtime.bus().emit('request-job-completion', {\n-                    jobId: jobId\n-                });\n-                listeningForJob = false;\n-            }\n-        }\n-\n-        function handleJobDoesNotExistUpdate(message) {\n-            stopJobUpdates();\n-            jobState = {\n-                job_state: 'does_not_exist'\n-            };\n-        }\n-\n-        function handleJobStatusUpdate(message) {\n-            jobState = message.jobState;\n-            switch (jobState.job_state) {\n-            case 'queued':\n-            case 'in-progress':\n-                startJobUpdates();\n-                break;\n-            case 'completed':\n-                stopJobUpdates();\n-                break;\n-            case 'error':\n-            case 'suspend':\n-            case 'canceled':\n-                stopJobUpdates();\n-                break;\n-            default:\n-                stopJobUpdates();\n-                console.error('Unknown job status', jobState.job_state, message);\n-                throw new Error('Unknown job status ' + jobState.job_state);\n-            }\n-        }\n-\n-        function listenForJobStatus() {\n-            var ev = runtime.bus().listen({\n-                channel: {\n-                    jobId: jobId\n-                },\n-                key: {\n-                    type: 'job-status'\n-                },\n-                handle: handleJobStatusUpdate\n-            });\n-            listeners.push(ev);\n-\n-            ev = runtime.bus().listen({\n-                channel: {\n-                    jobId: jobId\n-                },\n-                key: {\n-                    type: 'job-canceled'\n-                },\n-                handle: function() {\n-                    console.warn('job cancelled');\n-                }\n-            });\n-            listeners.push(ev);\n-\n-            ev = runtime.bus().listen({\n-                channel: {\n-                    jobId: jobId\n-                },\n-                key: {\n-                    type: 'job-does-not-exist'\n-                },\n-                handle: handleJobDoesNotExistUpdate\n-            });\n-            listeners.push(ev);\n-        }\n-\n-        function stopListeningForJobStatus() {\n-            runtime.bus().removeListeners(listeners);\n+            container.innerHTML = th({}, [div(isParentJob ? name.toUpperCase() : name), jobIdDiv]) + niceState(jobStatus);\n         }\n \n         function start(arg) {\n             return Promise.try(function() {\n-                container = arg.node;\n+                container = arg.node;               // this is the row (tr) that this renders\n+                container.onclick = () => {\n+                    if (jobId) {\n+                        clickFunction(container, jobId, isParentJob);\n+                    }\n+                };\n                 ui = UI.make({ node: container });\n \n-                jobId = arg.jobId;\n-                var clickFunction = arg.clickFunction;\n-                listeners.push(runtime.bus().on('clock-tick', function() {\n-                    updateRowStatus(ui, jobState, container, clickFunction);\n-                }));\n-\n-                listenForJobStatus();\n-                runtime.bus().emit('request-job-status', {\n-                    jobId: jobId\n-                });\n-\n-                listeningForJob = true;\n-\n+                jobId = arg.jobId;                  // id of child job\n+                name = arg.name;\n+                isParentJob = arg.isParentJob;\n+                clickFunction = arg.clickFunction;  // called on click (after some ui junk)\n+                updateRowStatus(arg.initialState);\n             });\n         }\n \n         function stop() {\n-            return Promise.try(function() {","path":"nbextensions/appCell2/widgets/tabs/jobStateListRow.js","position":213,"original_position":213,"commit_id":"c4ce0a9047ca338b41bb3e2bc2b925544c377b96","original_commit_id":"d952d4341f1ec7fcf739c6372127846fa2a6f0be","user":{"login":"tiramisu24","id":13957313,"node_id":"MDQ6VXNlcjEzOTU3MzEz","avatar_url":"https://avatars2.githubusercontent.com/u/13957313?v=4","gravatar_id":"","url":"https://api.github.com/users/tiramisu24","html_url":"https://github.com/tiramisu24","followers_url":"https://api.github.com/users/tiramisu24/followers","following_url":"https://api.github.com/users/tiramisu24/following{/other_user}","gists_url":"https://api.github.com/users/tiramisu24/gists{/gist_id}","starred_url":"https://api.github.com/users/tiramisu24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiramisu24/subscriptions","organizations_url":"https://api.github.com/users/tiramisu24/orgs","repos_url":"https://api.github.com/users/tiramisu24/repos","events_url":"https://api.github.com/users/tiramisu24/events{/privacy}","received_events_url":"https://api.github.com/users/tiramisu24/received_events","type":"User","site_admin":false},"body":"ohh okay so basically the row doesn't have anything it needs to stop as the child job display widgets stop and restart with the clicked jobId. ","created_at":"2018-07-23T22:50:54Z","updated_at":"2018-07-23T22:50:54Z","html_url":"https://github.com/kbase/narrative/pull/1353#discussion_r204577303","pull_request_url":"https://api.github.com/repos/kbase/narrative/pulls/1353","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kbase/narrative/pulls/comments/204577303"},"html":{"href":"https://github.com/kbase/narrative/pull/1353#discussion_r204577303"},"pull_request":{"href":"https://api.github.com/repos/kbase/narrative/pulls/1353"}},"in_reply_to_id":204567112},"pull_request":{"url":"https://api.github.com/repos/kbase/narrative/pulls/1353","id":198196269,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4MTk2MjY5","html_url":"https://github.com/kbase/narrative/pull/1353","diff_url":"https://github.com/kbase/narrative/pull/1353.diff","patch_url":"https://github.com/kbase/narrative/pull/1353.patch","issue_url":"https://api.github.com/repos/kbase/narrative/issues/1353","number":1353,"state":"open","locked":false,"title":"[WIP] Batch frontend work","user":{"login":"briehl","id":2152243,"node_id":"MDQ6VXNlcjIxNTIyNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2152243?v=4","gravatar_id":"","url":"https://api.github.com/users/briehl","html_url":"https://github.com/briehl","followers_url":"https://api.github.com/users/briehl/followers","following_url":"https://api.github.com/users/briehl/following{/other_user}","gists_url":"https://api.github.com/users/briehl/gists{/gist_id}","starred_url":"https://api.github.com/users/briehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briehl/subscriptions","organizations_url":"https://api.github.com/users/briehl/orgs","repos_url":"https://api.github.com/users/briehl/repos","events_url":"https://api.github.com/users/briehl/events{/privacy}","received_events_url":"https://api.github.com/users/briehl/received_events","type":"User","site_admin":false},"body":"This should *mostly* all be working now. It's hard to tell without being able to test, since the CI queue is clogged (as of 7pm PDT). But I want to get this staged.\r\n\r\nIt's primarily for the Job Status tab of the app cell, tracking progress of individual jobs.\r\n\r\nThings to verify before merging:\r\n- [x] Transition from queued state to any other state should happen seamlessly.\r\n- [x] Child jobs should appear as they start.\r\n- [x] Logs should appear for each job.\r\n- [x] Currently selected job should be highlighted.\r\n\r\nThings still to-do (possibly next sprint):\r\n- Wire output for kb_BatchApp so it shows up. --> this will get its own PR.\r\n- [x] Placeholders for each non-started job in the status tab (take advantage of job metadata for count).\r\n- [ ] Improve tests.","created_at":"2018-06-29T01:56:54Z","updated_at":"2018-07-23T22:50:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c150fb6ad9744dec961fe280914a3733f8f78279","assignee":null,"assignees":[],"requested_reviewers":[{"login":"eapearson","id":7674378,"node_id":"MDQ6VXNlcjc2NzQzNzg=","avatar_url":"https://avatars0.githubusercontent.com/u/7674378?v=4","gravatar_id":"","url":"https://api.github.com/users/eapearson","html_url":"https://github.com/eapearson","followers_url":"https://api.github.com/users/eapearson/followers","following_url":"https://api.github.com/users/eapearson/following{/other_user}","gists_url":"https://api.github.com/users/eapearson/gists{/gist_id}","starred_url":"https://api.github.com/users/eapearson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eapearson/subscriptions","organizations_url":"https://api.github.com/users/eapearson/orgs","repos_url":"https://api.github.com/users/eapearson/repos","events_url":"https://api.github.com/users/eapearson/events{/privacy}","received_events_url":"https://api.github.com/users/eapearson/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kbase/narrative/pulls/1353/commits","review_comments_url":"https://api.github.com/repos/kbase/narrative/pulls/1353/comments","review_comment_url":"https://api.github.com/repos/kbase/narrative/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kbase/narrative/issues/1353/comments","statuses_url":"https://api.github.com/repos/kbase/narrative/statuses/c4ce0a9047ca338b41bb3e2bc2b925544c377b96","head":{"label":"briehl:SCT-961-batch-frontend","ref":"SCT-961-batch-frontend","sha":"c4ce0a9047ca338b41bb3e2bc2b925544c377b96","user":{"login":"briehl","id":2152243,"node_id":"MDQ6VXNlcjIxNTIyNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2152243?v=4","gravatar_id":"","url":"https://api.github.com/users/briehl","html_url":"https://github.com/briehl","followers_url":"https://api.github.com/users/briehl/followers","following_url":"https://api.github.com/users/briehl/following{/other_user}","gists_url":"https://api.github.com/users/briehl/gists{/gist_id}","starred_url":"https://api.github.com/users/briehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briehl/subscriptions","organizations_url":"https://api.github.com/users/briehl/orgs","repos_url":"https://api.github.com/users/briehl/repos","events_url":"https://api.github.com/users/briehl/events{/privacy}","received_events_url":"https://api.github.com/users/briehl/received_events","type":"User","site_admin":false},"repo":{"id":22262489,"node_id":"MDEwOlJlcG9zaXRvcnkyMjI2MjQ4OQ==","name":"narrative","full_name":"briehl/narrative","owner":{"login":"briehl","id":2152243,"node_id":"MDQ6VXNlcjIxNTIyNDM=","avatar_url":"https://avatars1.githubusercontent.com/u/2152243?v=4","gravatar_id":"","url":"https://api.github.com/users/briehl","html_url":"https://github.com/briehl","followers_url":"https://api.github.com/users/briehl/followers","following_url":"https://api.github.com/users/briehl/following{/other_user}","gists_url":"https://api.github.com/users/briehl/gists{/gist_id}","starred_url":"https://api.github.com/users/briehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briehl/subscriptions","organizations_url":"https://api.github.com/users/briehl/orgs","repos_url":"https://api.github.com/users/briehl/repos","events_url":"https://api.github.com/users/briehl/events{/privacy}","received_events_url":"https://api.github.com/users/briehl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/briehl/narrative","description":null,"fork":true,"url":"https://api.github.com/repos/briehl/narrative","forks_url":"https://api.github.com/repos/briehl/narrative/forks","keys_url":"https://api.github.com/repos/briehl/narrative/keys{/key_id}","collaborators_url":"https://api.github.com/repos/briehl/narrative/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/briehl/narrative/teams","hooks_url":"https://api.github.com/repos/briehl/narrative/hooks","issue_events_url":"https://api.github.com/repos/briehl/narrative/issues/events{/number}","events_url":"https://api.github.com/repos/briehl/narrative/events","assignees_url":"https://api.github.com/repos/briehl/narrative/assignees{/user}","branches_url":"https://api.github.com/repos/briehl/narrative/branches{/branch}","tags_url":"https://api.github.com/repos/briehl/narrative/tags","blobs_url":"https://api.github.com/repos/briehl/narrative/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/briehl/narrative/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/briehl/narrative/git/refs{/sha}","trees_url":"https://api.github.com/repos/briehl/narrative/git/trees{/sha}","statuses_url":"https://api.github.com/repos/briehl/narrative/statuses/{sha}","languages_url":"https://api.github.com/repos/briehl/narrative/languages","stargazers_url":"https://api.github.com/repos/briehl/narrative/stargazers","contributors_url":"https://api.github.com/repos/briehl/narrative/contributors","subscribers_url":"https://api.github.com/repos/briehl/narrative/subscribers","subscription_url":"https://api.github.com/repos/briehl/narrative/subscription","commits_url":"https://api.github.com/repos/briehl/narrative/commits{/sha}","git_commits_url":"https://api.github.com/repos/briehl/narrative/git/commits{/sha}","comments_url":"https://api.github.com/repos/briehl/narrative/comments{/number}","issue_comment_url":"https://api.github.com/repos/briehl/narrative/issues/comments{/number}","contents_url":"https://api.github.com/repos/briehl/narrative/contents/{+path}","compare_url":"https://api.github.com/repos/briehl/narrative/compare/{base}...{head}","merges_url":"https://api.github.com/repos/briehl/narrative/merges","archive_url":"https://api.github.com/repos/briehl/narrative/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/briehl/narrative/downloads","issues_url":"https://api.github.com/repos/briehl/narrative/issues{/number}","pulls_url":"https://api.github.com/repos/briehl/narrative/pulls{/number}","milestones_url":"https://api.github.com/repos/briehl/narrative/milestones{/number}","notifications_url":"https://api.github.com/repos/briehl/narrative/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/briehl/narrative/labels{/name}","releases_url":"https://api.github.com/repos/briehl/narrative/releases{/id}","deployments_url":"https://api.github.com/repos/briehl/narrative/deployments","created_at":"2014-07-25T15:58:23Z","updated_at":"2018-07-20T23:08:36Z","pushed_at":"2018-07-23T22:18:56Z","git_url":"git://github.com/briehl/narrative.git","ssh_url":"git@github.com:briehl/narrative.git","clone_url":"https://github.com/briehl/narrative.git","svn_url":"https://github.com/briehl/narrative","homepage":null,"size":55189,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"kbase:develop","ref":"develop","sha":"d510bf3e7c47e7fa6429dabb3065dc734358d41c","user":{"login":"kbase","id":1263946,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjM5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1263946?v=4","gravatar_id":"","url":"https://api.github.com/users/kbase","html_url":"https://github.com/kbase","followers_url":"https://api.github.com/users/kbase/followers","following_url":"https://api.github.com/users/kbase/following{/other_user}","gists_url":"https://api.github.com/users/kbase/gists{/gist_id}","starred_url":"https://api.github.com/users/kbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbase/subscriptions","organizations_url":"https://api.github.com/users/kbase/orgs","repos_url":"https://api.github.com/users/kbase/repos","events_url":"https://api.github.com/users/kbase/events{/privacy}","received_events_url":"https://api.github.com/users/kbase/received_events","type":"Organization","site_admin":false},"repo":{"id":20769520,"node_id":"MDEwOlJlcG9zaXRvcnkyMDc2OTUyMA==","name":"narrative","full_name":"kbase/narrative","owner":{"login":"kbase","id":1263946,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNjM5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/1263946?v=4","gravatar_id":"","url":"https://api.github.com/users/kbase","html_url":"https://github.com/kbase","followers_url":"https://api.github.com/users/kbase/followers","following_url":"https://api.github.com/users/kbase/following{/other_user}","gists_url":"https://api.github.com/users/kbase/gists{/gist_id}","starred_url":"https://api.github.com/users/kbase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbase/subscriptions","organizations_url":"https://api.github.com/users/kbase/orgs","repos_url":"https://api.github.com/users/kbase/repos","events_url":"https://api.github.com/users/kbase/events{/privacy}","received_events_url":"https://api.github.com/users/kbase/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kbase/narrative","description":null,"fork":false,"url":"https://api.github.com/repos/kbase/narrative","forks_url":"https://api.github.com/repos/kbase/narrative/forks","keys_url":"https://api.github.com/repos/kbase/narrative/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kbase/narrative/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kbase/narrative/teams","hooks_url":"https://api.github.com/repos/kbase/narrative/hooks","issue_events_url":"https://api.github.com/repos/kbase/narrative/issues/events{/number}","events_url":"https://api.github.com/repos/kbase/narrative/events","assignees_url":"https://api.github.com/repos/kbase/narrative/assignees{/user}","branches_url":"https://api.github.com/repos/kbase/narrative/branches{/branch}","tags_url":"https://api.github.com/repos/kbase/narrative/tags","blobs_url":"https://api.github.com/repos/kbase/narrative/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kbase/narrative/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kbase/narrative/git/refs{/sha}","trees_url":"https://api.github.com/repos/kbase/narrative/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kbase/narrative/statuses/{sha}","languages_url":"https://api.github.com/repos/kbase/narrative/languages","stargazers_url":"https://api.github.com/repos/kbase/narrative/stargazers","contributors_url":"https://api.github.com/repos/kbase/narrative/contributors","subscribers_url":"https://api.github.com/repos/kbase/narrative/subscribers","subscription_url":"https://api.github.com/repos/kbase/narrative/subscription","commits_url":"https://api.github.com/repos/kbase/narrative/commits{/sha}","git_commits_url":"https://api.github.com/repos/kbase/narrative/git/commits{/sha}","comments_url":"https://api.github.com/repos/kbase/narrative/comments{/number}","issue_comment_url":"https://api.github.com/repos/kbase/narrative/issues/comments{/number}","contents_url":"https://api.github.com/repos/kbase/narrative/contents/{+path}","compare_url":"https://api.github.com/repos/kbase/narrative/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kbase/narrative/merges","archive_url":"https://api.github.com/repos/kbase/narrative/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kbase/narrative/downloads","issues_url":"https://api.github.com/repos/kbase/narrative/issues{/number}","pulls_url":"https://api.github.com/repos/kbase/narrative/pulls{/number}","milestones_url":"https://api.github.com/repos/kbase/narrative/milestones{/number}","notifications_url":"https://api.github.com/repos/kbase/narrative/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kbase/narrative/labels{/name}","releases_url":"https://api.github.com/repos/kbase/narrative/releases{/id}","deployments_url":"https://api.github.com/repos/kbase/narrative/deployments","created_at":"2014-06-12T14:06:05Z","updated_at":"2018-07-18T22:45:10Z","pushed_at":"2018-07-23T22:18:57Z","git_url":"git://github.com/kbase/narrative.git","ssh_url":"git@github.com:kbase/narrative.git","clone_url":"https://github.com/kbase/narrative.git","svn_url":"https://github.com/kbase/narrative","homepage":null,"size":55110,"stargazers_count":14,"watchers_count":14,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":44,"mirror_url":null,"archived":false,"open_issues_count":25,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":44,"open_issues":25,"watchers":14,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/kbase/narrative/pulls/1353"},"html":{"href":"https://github.com/kbase/narrative/pull/1353"},"issue":{"href":"https://api.github.com/repos/kbase/narrative/issues/1353"},"comments":{"href":"https://api.github.com/repos/kbase/narrative/issues/1353/comments"},"review_comments":{"href":"https://api.github.com/repos/kbase/narrative/pulls/1353/comments"},"review_comment":{"href":"https://api.github.com/repos/kbase/narrative/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kbase/narrative/pulls/1353/commits"},"statuses":{"href":"https://api.github.com/repos/kbase/narrative/statuses/c4ce0a9047ca338b41bb3e2bc2b925544c377b96"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"tiramisu24"}}