{"action":"created","comment":{"url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/comments/97792711","pull_request_review_id":18413078,"id":97792711,"diff_hunk":"@@ -5,59 +5,60 @@ Template.organizationCatalogueToolbar.onRendered(function () {\n   // Get reference to template instance\n   const instance = this;\n \n-  // Check URL parameter for sorting\n-  const sortByParameter = FlowRouter.getQueryParam('sortBy');\n+  // Separate autoruns to runs own function for each parameter\n \n-  // Check URL parameter for sort direction\n-  const sortDirectionParameter = FlowRouter.getQueryParam('sortDirection');\n+  // Runs a function that depends only on SortBy parameter\n+  instance.autorun(() => {\n+    // Check URL parameter for sorting\n+    const sortByParameter = FlowRouter.getQueryParam('sortBy');\n \n-  // Check URL parameter for filtering\n-  const filterByParameter = FlowRouter.getQueryParam('filterBy');\n-\n-  // Check URL parameter for view mode\n-  const viewModeParameter = FlowRouter.getQueryParam('viewMode');\n-\n-  if (sortByParameter) {\n     // Set the sorting by UI state from URL parameter\n     instance.$('#organization-sort-select').val(`${sortByParameter}`).change();\n-  } else {\n-    // Get sorting from template\n-    const sortBy = instance.$('[name=sort-menu]').val();\n+  });\n \n-    // Set sorting URL parameter from template value\n-    FlowRouter.setQueryParams({ sortBy });\n-  }\n+  // Runs a function that depends only on sortDirection parameter\n+  instance.autorun(() => {\n+    // Check URL parameter for sort direction\n+    const sortDirectionParameter = FlowRouter.getQueryParam('sortDirection');\n \n-  if (sortDirectionParameter) {\n     // Set the sorting direction by UI state from URL parameter\n     instance.$(`#organization-sort-${sortDirectionParameter}`).button('toggle');\n-  } else {\n-    // Get sorting direction from template\n-    const sortDirection = instance.$('[name=sort-direction]:checked').val();\n+  });\n \n-    // Set sorting direction URL parameter from template value\n-    FlowRouter.setQueryParams({ sortDirection });\n-  }\n+  // Runs a function that depends only on filterBy parameter\n+  instance.autorun(() => {\n+    // Check URL parameter for filtering\n+    const filterByParameter = FlowRouter.getQueryParam('filterBy');\n \n-  if (filterByParameter) {\n     // Set the filter by UI state from URL parameter\n     instance.$(`#filter-${filterByParameter}`).button('toggle');\n-  } else {\n-    // Get filtering from template\n-    const filterBy = instance.$('[name=filter-options]:checked').val();\n+  });\n \n-    // Set filtering URL parameter from template value\n-    FlowRouter.setQueryParams({ filterBy });\n-  }\n+  // Runs a function that depends only on viewMode parameter\n+  instance.autorun(() => {\n+    // Check URL parameter for view mode\n+    const viewModeParameter = FlowRouter.getQueryParam('viewMode');\n \n-  if (viewModeParameter) {\n     // Set the view mode direction by UI state from URL parameter\n     instance.$(`[for=${viewModeParameter}-view]`).button('toggle');\n-  } else {\n-    // Get view mode direction from template\n-    const viewMode = instance.$('[name=view-mode]:checked').val();\n+  });\n+});\n \n-    // Set view mode direction URL parameter from template value\n-    FlowRouter.setQueryParams({ viewMode });\n-  }\n+Template.organizationCatalogueToolbar.events({\n+  'change #organization-sort-select': function (event) {","path":"organizations/client/catalog/toolbar/toolbar.js","position":82,"original_position":82,"commit_id":"2140a966386dc9f0d5ace25449af08956b74e1a6","original_commit_id":"bdfc9900004a65d1dafad6e961095dc7a1b50d13","user":{"login":"marla-singer","id":20643403,"avatar_url":"https://avatars.githubusercontent.com/u/20643403?v=3","gravatar_id":"","url":"https://api.github.com/users/marla-singer","html_url":"https://github.com/marla-singer","followers_url":"https://api.github.com/users/marla-singer/followers","following_url":"https://api.github.com/users/marla-singer/following{/other_user}","gists_url":"https://api.github.com/users/marla-singer/gists{/gist_id}","starred_url":"https://api.github.com/users/marla-singer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marla-singer/subscriptions","organizations_url":"https://api.github.com/users/marla-singer/orgs","repos_url":"https://api.github.com/users/marla-singer/repos","events_url":"https://api.github.com/users/marla-singer/events{/privacy}","received_events_url":"https://api.github.com/users/marla-singer/received_events","type":"User","site_admin":false},"body":"```javascript\r\nconst queryParam = {};\r\n    queryParam[parameterName] = parameterValue;\r\n\r\n    // Set URL parameter\r\n    FlowRouter.setQueryParams(queryParam);\r\n```","created_at":"2017-01-25T14:46:40Z","updated_at":"2017-01-25T14:46:40Z","html_url":"https://github.com/Digipalvelutehdas/APIKA/pull/292#discussion_r97792711","pull_request_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292","_links":{"self":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/comments/97792711"},"html":{"href":"https://github.com/Digipalvelutehdas/APIKA/pull/292#discussion_r97792711"},"pull_request":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292"}}},"pull_request":{"url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292","id":103075813,"html_url":"https://github.com/Digipalvelutehdas/APIKA/pull/292","diff_url":"https://github.com/Digipalvelutehdas/APIKA/pull/292.diff","patch_url":"https://github.com/Digipalvelutehdas/APIKA/pull/292.patch","issue_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/292","number":292,"state":"open","locked":false,"title":"My organizations filter","user":{"login":"marla-singer","id":20643403,"avatar_url":"https://avatars.githubusercontent.com/u/20643403?v=3","gravatar_id":"","url":"https://api.github.com/users/marla-singer","html_url":"https://github.com/marla-singer","followers_url":"https://api.github.com/users/marla-singer/followers","following_url":"https://api.github.com/users/marla-singer/following{/other_user}","gists_url":"https://api.github.com/users/marla-singer/gists{/gist_id}","starred_url":"https://api.github.com/users/marla-singer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marla-singer/subscriptions","organizations_url":"https://api.github.com/users/marla-singer/orgs","repos_url":"https://api.github.com/users/marla-singer/repos","events_url":"https://api.github.com/users/marla-singer/events{/privacy}","received_events_url":"https://api.github.com/users/marla-singer/received_events","type":"User","site_admin":false},"body":"Closes #287 \r\n- Add filter in organization catalog by \"My organizations\"\r\n- Add autorun function to watch changing of query parameters\r\n- Separate these autorun functions to each parameter","created_at":"2017-01-25T08:43:45Z","updated_at":"2017-01-25T14:46:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"714f8c3f7b009b8d5579854e29dec5342139d92b","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/milestones/5","html_url":"https://github.com/Digipalvelutehdas/APIKA/milestone/5","labels_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/milestones/5/labels","id":2264147,"number":5,"title":"R1-Sprint 5","description":"Sprint 5: 23 - 31 January 2017","creator":{"login":"bajiat","id":11626388,"avatar_url":"https://avatars.githubusercontent.com/u/11626388?v=3","gravatar_id":"","url":"https://api.github.com/users/bajiat","html_url":"https://github.com/bajiat","followers_url":"https://api.github.com/users/bajiat/followers","following_url":"https://api.github.com/users/bajiat/following{/other_user}","gists_url":"https://api.github.com/users/bajiat/gists{/gist_id}","starred_url":"https://api.github.com/users/bajiat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bajiat/subscriptions","organizations_url":"https://api.github.com/users/bajiat/orgs","repos_url":"https://api.github.com/users/bajiat/repos","events_url":"https://api.github.com/users/bajiat/events{/privacy}","received_events_url":"https://api.github.com/users/bajiat/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":14,"state":"open","created_at":"2017-01-19T13:57:33Z","updated_at":"2017-01-25T14:22:00Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292/commits","review_comments_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292/comments","review_comment_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/292/comments","statuses_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/statuses/2140a966386dc9f0d5ace25449af08956b74e1a6","head":{"label":"Digipalvelutehdas:bugfix/my-organizations","ref":"bugfix/my-organizations","sha":"2140a966386dc9f0d5ace25449af08956b74e1a6","user":{"login":"Digipalvelutehdas","id":12421888,"avatar_url":"https://avatars.githubusercontent.com/u/12421888?v=3","gravatar_id":"","url":"https://api.github.com/users/Digipalvelutehdas","html_url":"https://github.com/Digipalvelutehdas","followers_url":"https://api.github.com/users/Digipalvelutehdas/followers","following_url":"https://api.github.com/users/Digipalvelutehdas/following{/other_user}","gists_url":"https://api.github.com/users/Digipalvelutehdas/gists{/gist_id}","starred_url":"https://api.github.com/users/Digipalvelutehdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digipalvelutehdas/subscriptions","organizations_url":"https://api.github.com/users/Digipalvelutehdas/orgs","repos_url":"https://api.github.com/users/Digipalvelutehdas/repos","events_url":"https://api.github.com/users/Digipalvelutehdas/events{/privacy}","received_events_url":"https://api.github.com/users/Digipalvelutehdas/received_events","type":"Organization","site_admin":false},"repo":{"id":46119242,"name":"APIKA","full_name":"Digipalvelutehdas/APIKA","owner":{"login":"Digipalvelutehdas","id":12421888,"avatar_url":"https://avatars.githubusercontent.com/u/12421888?v=3","gravatar_id":"","url":"https://api.github.com/users/Digipalvelutehdas","html_url":"https://github.com/Digipalvelutehdas","followers_url":"https://api.github.com/users/Digipalvelutehdas/followers","following_url":"https://api.github.com/users/Digipalvelutehdas/following{/other_user}","gists_url":"https://api.github.com/users/Digipalvelutehdas/gists{/gist_id}","starred_url":"https://api.github.com/users/Digipalvelutehdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digipalvelutehdas/subscriptions","organizations_url":"https://api.github.com/users/Digipalvelutehdas/orgs","repos_url":"https://api.github.com/users/Digipalvelutehdas/repos","events_url":"https://api.github.com/users/Digipalvelutehdas/events{/privacy}","received_events_url":"https://api.github.com/users/Digipalvelutehdas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Digipalvelutehdas/APIKA","description":"APIKA dashboard","fork":false,"url":"https://api.github.com/repos/Digipalvelutehdas/APIKA","forks_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/forks","keys_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/teams","hooks_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/hooks","issue_events_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/events{/number}","events_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/events","assignees_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/assignees{/user}","branches_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/branches{/branch}","tags_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/tags","blobs_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/statuses/{sha}","languages_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/languages","stargazers_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/stargazers","contributors_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/contributors","subscribers_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/subscribers","subscription_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/subscription","commits_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/contents/{+path}","compare_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/merges","archive_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/downloads","issues_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues{/number}","pulls_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls{/number}","milestones_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/milestones{/number}","notifications_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/labels{/name}","releases_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/releases{/id}","deployments_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/deployments","created_at":"2015-11-13T11:54:50Z","updated_at":"2016-11-22T08:35:06Z","pushed_at":"2017-01-25T14:34:54Z","git_url":"git://github.com/Digipalvelutehdas/APIKA.git","ssh_url":"git@github.com:Digipalvelutehdas/APIKA.git","clone_url":"https://github.com/Digipalvelutehdas/APIKA.git","svn_url":"https://github.com/Digipalvelutehdas/APIKA","homepage":null,"size":20228,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":87,"forks":2,"open_issues":87,"watchers":1,"default_branch":"develop"}},"base":{"label":"Digipalvelutehdas:develop","ref":"develop","sha":"765b89183efc6ba9bd69104f12a72c0ac6045c93","user":{"login":"Digipalvelutehdas","id":12421888,"avatar_url":"https://avatars.githubusercontent.com/u/12421888?v=3","gravatar_id":"","url":"https://api.github.com/users/Digipalvelutehdas","html_url":"https://github.com/Digipalvelutehdas","followers_url":"https://api.github.com/users/Digipalvelutehdas/followers","following_url":"https://api.github.com/users/Digipalvelutehdas/following{/other_user}","gists_url":"https://api.github.com/users/Digipalvelutehdas/gists{/gist_id}","starred_url":"https://api.github.com/users/Digipalvelutehdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digipalvelutehdas/subscriptions","organizations_url":"https://api.github.com/users/Digipalvelutehdas/orgs","repos_url":"https://api.github.com/users/Digipalvelutehdas/repos","events_url":"https://api.github.com/users/Digipalvelutehdas/events{/privacy}","received_events_url":"https://api.github.com/users/Digipalvelutehdas/received_events","type":"Organization","site_admin":false},"repo":{"id":46119242,"name":"APIKA","full_name":"Digipalvelutehdas/APIKA","owner":{"login":"Digipalvelutehdas","id":12421888,"avatar_url":"https://avatars.githubusercontent.com/u/12421888?v=3","gravatar_id":"","url":"https://api.github.com/users/Digipalvelutehdas","html_url":"https://github.com/Digipalvelutehdas","followers_url":"https://api.github.com/users/Digipalvelutehdas/followers","following_url":"https://api.github.com/users/Digipalvelutehdas/following{/other_user}","gists_url":"https://api.github.com/users/Digipalvelutehdas/gists{/gist_id}","starred_url":"https://api.github.com/users/Digipalvelutehdas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Digipalvelutehdas/subscriptions","organizations_url":"https://api.github.com/users/Digipalvelutehdas/orgs","repos_url":"https://api.github.com/users/Digipalvelutehdas/repos","events_url":"https://api.github.com/users/Digipalvelutehdas/events{/privacy}","received_events_url":"https://api.github.com/users/Digipalvelutehdas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Digipalvelutehdas/APIKA","description":"APIKA dashboard","fork":false,"url":"https://api.github.com/repos/Digipalvelutehdas/APIKA","forks_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/forks","keys_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/teams","hooks_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/hooks","issue_events_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/events{/number}","events_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/events","assignees_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/assignees{/user}","branches_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/branches{/branch}","tags_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/tags","blobs_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/refs{/sha}","trees_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/statuses/{sha}","languages_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/languages","stargazers_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/stargazers","contributors_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/contributors","subscribers_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/subscribers","subscription_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/subscription","commits_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/commits{/sha}","git_commits_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/git/commits{/sha}","comments_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/comments{/number}","issue_comment_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/comments{/number}","contents_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/contents/{+path}","compare_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/merges","archive_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/downloads","issues_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues{/number}","pulls_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls{/number}","milestones_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/milestones{/number}","notifications_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/labels{/name}","releases_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/releases{/id}","deployments_url":"https://api.github.com/repos/Digipalvelutehdas/APIKA/deployments","created_at":"2015-11-13T11:54:50Z","updated_at":"2016-11-22T08:35:06Z","pushed_at":"2017-01-25T14:34:54Z","git_url":"git://github.com/Digipalvelutehdas/APIKA.git","ssh_url":"git@github.com:Digipalvelutehdas/APIKA.git","clone_url":"https://github.com/Digipalvelutehdas/APIKA.git","svn_url":"https://github.com/Digipalvelutehdas/APIKA","homepage":null,"size":20228,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":87,"forks":2,"open_issues":87,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292"},"html":{"href":"https://github.com/Digipalvelutehdas/APIKA/pull/292"},"issue":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/292"},"comments":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/issues/292/comments"},"review_comments":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292/comments"},"review_comment":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/pulls/292/commits"},"statuses":{"href":"https://api.github.com/repos/Digipalvelutehdas/APIKA/statuses/2140a966386dc9f0d5ace25449af08956b74e1a6"}}}}
{"actor":{"display_login":"marla-singer"}}