{"action":"created","comment":{"url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/comments/28932130","id":28932130,"diff_hunk":"@@ -297,101 +416,94 @@ var CaseverListItem = React.createClass({\n   }\n });\n \n+var SearchTableHeadConstTh = React.createClass({\n+  render: function(){\n+    return(\n+      <th>{this.props.text}</th>\n+    )\n+  }\n+})\n \n-var CaseverList = React.createClass({\n+var SearchTableHeadTh = React.createClass({\n+  handleSort: function(){\n+    var newOrder = \"\";\n+    if (this.state.order == \"\") {\n+      newOrder = \"-\";\n+    }\n+    this.setState({\"order\": newOrder})\n+    this.props.handleAddFilter(' orderby:' + newOrder + this.props.filter, / orderby:[-\\w]+/)\n+  },\n+  getInitialState: function(){\n+    return ({\"order\": null}) //+ and -\n+  }, render: function(){\n+    var marker=\"\"\n+    if (this.state.order == \"\"){\n+      marker = \"▼\";\n+    }\n+    else if (this.state.order == \"-\"){\n+      marker = \"▲\";\n+    }\n+\n+    return(\n+      <th onClick={this.handleSort}>{this.props.text}{marker}</th>\n+    )\n+  }\n+})\n+\n+var SearchTableHead = React.createClass({\n   render: function() {\n-    //can use the casevers.meta\n-    var casevers = this.props.casevers.objects.map(function(casever){\n-      return (<CaseverListItem casever={casever} onChange={this.props.handleCheck} handleAddFilter={this.props.handleAddFilter}/>)\n-    }.bind(this))\n+    var obj = this.props.setting.header;\n+    var tableheader = obj.map(\n+      function(setting){\n+        if (setting[\"sortable\"]) {\n+          return <SearchTableHeadTh\n+            text={setting[\"text\"]}\n+            filter={setting[\"filtername\"]}\n+            handleAddFilter={this.props.handleAddFilter} />\n+        } else {\n+          return <SearchTableHeadConstTh\n+            text={setting[\"text\"]} />\n+        }\n+      }.bind(this))\n \n     return (\n-      <Row>\n-      <Table striped condensed hover className=\"caseverList\">\n-        <tbody>\n-          <tr>\n-            <th></th>\n-            <th>ID</th>\n-            <th>status</th>\n-            <SortableTh name=\"name\" filter=\"name\" handleAddFilter={this.props.handleAddFilter}></SortableTh>\n-            <SortableTh name=\"priority\" filter=\"case__priority\" handleAddFilter={this.props.handleAddFilter}></SortableTh>\n-            <SortableTh name=\"product\" filter=\"productversion\" handleAddFilter={this.props.handleAddFilter}></SortableTh>\n-            <SortableTh name=\"modified\" filter=\"modified_on\" handleAddFilter={this.props.handleAddFilter}></SortableTh>\n-            <th></th>\n-            <th></th>\n-          </tr>\n-          {casevers}\n-        </tbody>\n-      </Table>\n-      </Row>\n+      <tr>{tableheader}</tr>\n     )\n   }\n-});\n-\n-var SearchableCaseverList = React.createClass({\n-  mixins: [SearchableRemoteListMixin],\n-  api_url: config.baseUrl + \"/api/v1/caseversion/\",\n-  //TODO: migrate to api_url: \"https://moztrap.mozilla.org/api/v1/caseversionsearch/\",\n-  buildURL: function(query) {\n-      return (buildQueryUrl(this.api_url, query, caseversionCodegen) + \n-              \"&limit=\" + config.defaultListLimit\n-              //\"&order_by=\" + \"-modified_on\"\n-             );\n-  },\n+})\n \n-  handleQueueUpdate: function(e) {\n-    if (e.target.checked){\n-      var newState = {};\n-      newState['checked'] = this.state['checked'].concat(e.target.value);\n-      //console.log('will set state')\n-      this.setState(newState);\n-    }\n-    else {\n-      this.state['checked'].splice(this.state['checked'].indexOf(e.target.value), 1);\n-      var newState = {};\n-      newState['checked'] = this.state['checked'];\n-      //console.log('will set state')\n-      this.setState(newState);\n-    }\n-  },\n-  /*\n-  diff: function(){\n-    alert(this.state.checked)\n-  },\n-  */\n+var SearchTable = React.createClass({\n   render: function() {\n-    //update\n-    //\n-    var diffURL = \"\"\n-    var diffDisabled = true;\n-    if (typeof this.state.checked !== \"undefined\"){\n-      console.log(\"this.state is not undefined\")\n-      diffURL = \"diff.html?lhs=\" + this.state.checked[0] + \"&rhs=\" + this.state.checked[1]\n-      if (this.state.checked.length == 2){\n-        var diffDisabled = false;\n-      }\n+    var content\n+    if (this.props.setting.pagename == \"caseversion\") {\n+      content = this.props.data.objects.map(\n+          function(casever) {\n+            return (<CaseverListItem","path":"js/app.jsx","position":266,"original_position":275,"commit_id":"a494809f041c100c09eab15b7d663722903341cd","original_commit_id":"d948ff13bde50ea5d19ef3844538afb5f2a45279","user":{"login":"shinglyu","id":3250983,"avatar_url":"https://avatars.githubusercontent.com/u/3250983?v=3","gravatar_id":"","url":"https://api.github.com/users/shinglyu","html_url":"https://github.com/shinglyu","followers_url":"https://api.github.com/users/shinglyu/followers","following_url":"https://api.github.com/users/shinglyu/following{/other_user}","gists_url":"https://api.github.com/users/shinglyu/gists{/gist_id}","starred_url":"https://api.github.com/users/shinglyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shinglyu/subscriptions","organizations_url":"https://api.github.com/users/shinglyu/orgs","repos_url":"https://api.github.com/users/shinglyu/repos","events_url":"https://api.github.com/users/shinglyu/events{/privacy}","received_events_url":"https://api.github.com/users/shinglyu/received_events","type":"User","site_admin":false},"body":"Ah, then let's make it `<CaseverListItem data={data}/>` and `<SuiteListItem data={data}/>`, or perhaps `rowdata`, `item` or something.","created_at":"2015-04-23T02:21:55Z","updated_at":"2015-04-23T02:21:55Z","html_url":"https://github.com/shinglyu/moztrap-new-ui/pull/133#discussion_r28932130","pull_request_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133","_links":{"self":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/comments/28932130"},"html":{"href":"https://github.com/shinglyu/moztrap-new-ui/pull/133#discussion_r28932130"},"pull_request":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133"}}},"pull_request":{"url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133","id":33681102,"html_url":"https://github.com/shinglyu/moztrap-new-ui/pull/133","diff_url":"https://github.com/shinglyu/moztrap-new-ui/pull/133.diff","patch_url":"https://github.com/shinglyu/moztrap-new-ui/pull/133.patch","issue_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/issues/133","number":133,"state":"open","locked":false,"title":"Refactor merge case suite view","user":{"login":"yodalee","id":1913143,"avatar_url":"https://avatars.githubusercontent.com/u/1913143?v=3","gravatar_id":"","url":"https://api.github.com/users/yodalee","html_url":"https://github.com/yodalee","followers_url":"https://api.github.com/users/yodalee/followers","following_url":"https://api.github.com/users/yodalee/following{/other_user}","gists_url":"https://api.github.com/users/yodalee/gists{/gist_id}","starred_url":"https://api.github.com/users/yodalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yodalee/subscriptions","organizations_url":"https://api.github.com/users/yodalee/orgs","repos_url":"https://api.github.com/users/yodalee/repos","events_url":"https://api.github.com/users/yodalee/events{/privacy}","received_events_url":"https://api.github.com/users/yodalee/received_events","type":"User","site_admin":false},"body":"This should not apply to master, but I don't know which should it goes.\r\nThe PR try to merge `Caseversion` and `Suite` into a single class list. It's almost done but only the Table content left independent.\r\nI'm not quite sure is this a good design or not. Maybe the origin one is better, we just separate different kind of data into their class. Using `require` can solve the problem that they merge together in one file. So maybe we don't have to merge them into one Class List.","created_at":"2015-04-20T16:15:50Z","updated_at":"2015-04-23T02:21:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8183fae20cab1626f1e771a8a28b757db5c87780","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133/commits","review_comments_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133/comments","review_comment_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/issues/133/comments","statuses_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/statuses/a494809f041c100c09eab15b7d663722903341cd","head":{"label":"yodalee:refactor-merge-case-suite-view","ref":"refactor-merge-case-suite-view","sha":"a494809f041c100c09eab15b7d663722903341cd","user":{"login":"yodalee","id":1913143,"avatar_url":"https://avatars.githubusercontent.com/u/1913143?v=3","gravatar_id":"","url":"https://api.github.com/users/yodalee","html_url":"https://github.com/yodalee","followers_url":"https://api.github.com/users/yodalee/followers","following_url":"https://api.github.com/users/yodalee/following{/other_user}","gists_url":"https://api.github.com/users/yodalee/gists{/gist_id}","starred_url":"https://api.github.com/users/yodalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yodalee/subscriptions","organizations_url":"https://api.github.com/users/yodalee/orgs","repos_url":"https://api.github.com/users/yodalee/repos","events_url":"https://api.github.com/users/yodalee/events{/privacy}","received_events_url":"https://api.github.com/users/yodalee/received_events","type":"User","site_admin":false},"repo":{"id":33731780,"name":"moztrap-new-ui","full_name":"yodalee/moztrap-new-ui","owner":{"login":"yodalee","id":1913143,"avatar_url":"https://avatars.githubusercontent.com/u/1913143?v=3","gravatar_id":"","url":"https://api.github.com/users/yodalee","html_url":"https://github.com/yodalee","followers_url":"https://api.github.com/users/yodalee/followers","following_url":"https://api.github.com/users/yodalee/following{/other_user}","gists_url":"https://api.github.com/users/yodalee/gists{/gist_id}","starred_url":"https://api.github.com/users/yodalee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yodalee/subscriptions","organizations_url":"https://api.github.com/users/yodalee/orgs","repos_url":"https://api.github.com/users/yodalee/repos","events_url":"https://api.github.com/users/yodalee/events{/privacy}","received_events_url":"https://api.github.com/users/yodalee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yodalee/moztrap-new-ui","description":"A new frontend UI for MozTrap that levarages on its REST API","fork":true,"url":"https://api.github.com/repos/yodalee/moztrap-new-ui","forks_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/forks","keys_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/teams","hooks_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/hooks","issue_events_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/issues/events{/number}","events_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/events","assignees_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/assignees{/user}","branches_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/branches{/branch}","tags_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/tags","blobs_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/languages","stargazers_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/stargazers","contributors_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/contributors","subscribers_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/subscribers","subscription_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/subscription","commits_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/contents/{+path}","compare_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/merges","archive_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/downloads","issues_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/issues{/number}","pulls_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/labels{/name}","releases_url":"https://api.github.com/repos/yodalee/moztrap-new-ui/releases{/id}","created_at":"2015-04-10T14:08:04Z","updated_at":"2015-04-12T13:03:24Z","pushed_at":"2015-04-22T15:40:38Z","git_url":"git://github.com/yodalee/moztrap-new-ui.git","ssh_url":"git@github.com:yodalee/moztrap-new-ui.git","clone_url":"https://github.com/yodalee/moztrap-new-ui.git","svn_url":"https://github.com/yodalee/moztrap-new-ui","homepage":"","size":3249,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"shinglyu:master","ref":"master","sha":"5cbad44879abd21ab9684f5a854849edd7b16d94","user":{"login":"shinglyu","id":3250983,"avatar_url":"https://avatars.githubusercontent.com/u/3250983?v=3","gravatar_id":"","url":"https://api.github.com/users/shinglyu","html_url":"https://github.com/shinglyu","followers_url":"https://api.github.com/users/shinglyu/followers","following_url":"https://api.github.com/users/shinglyu/following{/other_user}","gists_url":"https://api.github.com/users/shinglyu/gists{/gist_id}","starred_url":"https://api.github.com/users/shinglyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shinglyu/subscriptions","organizations_url":"https://api.github.com/users/shinglyu/orgs","repos_url":"https://api.github.com/users/shinglyu/repos","events_url":"https://api.github.com/users/shinglyu/events{/privacy}","received_events_url":"https://api.github.com/users/shinglyu/received_events","type":"User","site_admin":false},"repo":{"id":28496688,"name":"moztrap-new-ui","full_name":"shinglyu/moztrap-new-ui","owner":{"login":"shinglyu","id":3250983,"avatar_url":"https://avatars.githubusercontent.com/u/3250983?v=3","gravatar_id":"","url":"https://api.github.com/users/shinglyu","html_url":"https://github.com/shinglyu","followers_url":"https://api.github.com/users/shinglyu/followers","following_url":"https://api.github.com/users/shinglyu/following{/other_user}","gists_url":"https://api.github.com/users/shinglyu/gists{/gist_id}","starred_url":"https://api.github.com/users/shinglyu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shinglyu/subscriptions","organizations_url":"https://api.github.com/users/shinglyu/orgs","repos_url":"https://api.github.com/users/shinglyu/repos","events_url":"https://api.github.com/users/shinglyu/events{/privacy}","received_events_url":"https://api.github.com/users/shinglyu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shinglyu/moztrap-new-ui","description":"A new frontend UI for MozTrap that levarages on its REST API","fork":false,"url":"https://api.github.com/repos/shinglyu/moztrap-new-ui","forks_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/forks","keys_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/teams","hooks_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/hooks","issue_events_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/issues/events{/number}","events_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/events","assignees_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/assignees{/user}","branches_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/branches{/branch}","tags_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/tags","blobs_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/languages","stargazers_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/stargazers","contributors_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/contributors","subscribers_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/subscribers","subscription_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/subscription","commits_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/contents/{+path}","compare_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/merges","archive_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/downloads","issues_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/issues{/number}","pulls_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/labels{/name}","releases_url":"https://api.github.com/repos/shinglyu/moztrap-new-ui/releases{/id}","created_at":"2014-12-26T02:16:09Z","updated_at":"2015-04-22T05:19:34Z","pushed_at":"2015-04-22T15:40:39Z","git_url":"git://github.com/shinglyu/moztrap-new-ui.git","ssh_url":"git@github.com:shinglyu/moztrap-new-ui.git","clone_url":"https://github.com/shinglyu/moztrap-new-ui.git","svn_url":"https://github.com/shinglyu/moztrap-new-ui","homepage":"","size":3592,"stargazers_count":8,"watchers_count":8,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":11,"mirror_url":null,"open_issues_count":90,"forks":11,"open_issues":90,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133"},"html":{"href":"https://github.com/shinglyu/moztrap-new-ui/pull/133"},"issue":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/issues/133"},"comments":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/issues/133/comments"},"review_comments":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133/comments"},"review_comment":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/pulls/133/commits"},"statuses":{"href":"https://api.github.com/repos/shinglyu/moztrap-new-ui/statuses/a494809f041c100c09eab15b7d663722903341cd"}}}}