{"action":"created","comment":{"url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments/79038021","id":79038021,"diff_hunk":"@@ -31,54 +31,58 @@ def lookup_student_id\n \n     def build_feed(response)\n       return {} unless response && (feed = response['ROOT'])\n-      links = (resources = feed['UC_ADVISING_RESOURCES']) && resources['UC_ADVISING_LINKS']\n-\n-      if links\n-        # The following links are hard-coded, for now. Ideally they would be served by CS API but there is an urgent need\n-        # thus we manage the content via CalCentral settings.\n-        add_cs_link links, :eforms_center, 'EFORMS_CENTER', 'eForms Center'\n-        add_cs_link links, :eforms_work_list, 'EFORMS_WORK_LIST', 'eForms Work List'\n-        add_cs_link links, :web_now_documents, 'WEB_NOW_DOCUMENTS', 'WebNow Documents'\n-        add_cs_link links, :multi_year_academic_planner_generic, 'MULTI_YEAR_ACADEMIC_PLANNER_GENERIC', 'Multi-Year Planner'\n-        add_cs_link links, :multi_year_academic_planner, 'MULTI_YEAR_ACADEMIC_PLANNER_STUDENT_SPECIFIC', 'Multi-Year Planner', \"?UCemplid=#{lookup_student_id}\"\n-        add_cs_link links, :schedule_planner, 'SCHEDULE_PLANNER_STUDENT_SPECIFIC', 'Schedule Planner', \"?EMPLID=#{lookup_student_id}\"\n-\n-        # LINK-API CALLS\n-        appointment_system_link = fetch_link('UC_CX_APPOINTMENT_ADV_MY_APPTS', {\n+      links = feed.fetch('UC_ADVISING_RESOURCES').fetch('UC_ADVISING_LINKS', {})\n+\n+      # The following links are hard-coded, for now. Ideally they would be served by CS API but there is an urgent need\n+      # thus we manage the content via CalCentral settings.\n+      add_cs_link links, :web_now_documents, 'WEB_NOW_DOCUMENTS', 'WebNow Documents'\n+      add_cs_link links, :multi_year_academic_planner, 'MULTI_YEAR_ACADEMIC_PLANNER_STUDENT_SPECIFIC', 'Multi-Year Planner', \"?UCemplid=#{lookup_student_id}\"\n+      add_cs_link links, :schedule_planner, 'SCHEDULE_PLANNER_STUDENT_SPECIFIC', 'Schedule Planner', \"?EMPLID=#{lookup_student_id}\"\n+\n+      # LINK-API CALLS\n+      link_ids = {\n+        uc_appointment_system: 'UC_CX_APPOINTMENT_ADV_MY_APPTS',\n+        uc_eforms_center: 'UC_CX_GT_ACTION_CENTER',\n+        uc_eforms_work_list: 'UC_CX_GT_WORK_CENTER',\n+        uc_multi_year_academic_planner_generic: 'UC_CX_PLANNER_ADV'\n+      }\n+\n+      link_ids.each do |key, url_id|","path":"app/models/campus_solutions/advising_resources.rb","position":34,"original_position":34,"commit_id":"e0f0daffb162a87b88225889f3684818b019cfd2","original_commit_id":"e0f0daffb162a87b88225889f3684818b019cfd2","user":{"login":"redconfetti","id":746759,"avatar_url":"https://avatars.githubusercontent.com/u/746759?v=3","gravatar_id":"","url":"https://api.github.com/users/redconfetti","html_url":"https://github.com/redconfetti","followers_url":"https://api.github.com/users/redconfetti/followers","following_url":"https://api.github.com/users/redconfetti/following{/other_user}","gists_url":"https://api.github.com/users/redconfetti/gists{/gist_id}","starred_url":"https://api.github.com/users/redconfetti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/redconfetti/subscriptions","organizations_url":"https://api.github.com/users/redconfetti/orgs","repos_url":"https://api.github.com/users/redconfetti/repos","events_url":"https://api.github.com/users/redconfetti/events{/privacy}","received_events_url":"https://api.github.com/users/redconfetti/received_events","type":"User","site_admin":false},"body":"@lyttam I'm not sure why these links that involve an `:EMPLID` parameter are not considered \"Student-Specific Links\", while the ones below this are.\r\n\r\nIs it possible for us to create some sort of Hash structure that defines all the various link keys, boolean to indicate if the EMPLID is required as a parameter, and the key we want to use for the link in the feed... then get this done in fewer lines of code?","created_at":"2016-09-15T19:02:17Z","updated_at":"2016-09-15T19:05:27Z","html_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5870#discussion_r79038021","pull_request_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870","_links":{"self":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments/79038021"},"html":{"href":"https://github.com/ets-berkeley-edu/calcentral/pull/5870#discussion_r79038021"},"pull_request":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870"}}},"pull_request":{"url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870","id":85270782,"html_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5870","diff_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5870.diff","patch_url":"https://github.com/ets-berkeley-edu/calcentral/pull/5870.patch","issue_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5870","number":5870,"state":"open","locked":false,"title":"SISRP-25248 - Replaces hard-coded links in Advising Resources","user":{"login":"lyttam","id":12432859,"avatar_url":"https://avatars.githubusercontent.com/u/12432859?v=3","gravatar_id":"","url":"https://api.github.com/users/lyttam","html_url":"https://github.com/lyttam","followers_url":"https://api.github.com/users/lyttam/followers","following_url":"https://api.github.com/users/lyttam/following{/other_user}","gists_url":"https://api.github.com/users/lyttam/gists{/gist_id}","starred_url":"https://api.github.com/users/lyttam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyttam/subscriptions","organizations_url":"https://api.github.com/users/lyttam/orgs","repos_url":"https://api.github.com/users/lyttam/repos","events_url":"https://api.github.com/users/lyttam/events{/privacy}","received_events_url":"https://api.github.com/users/lyttam/received_events","type":"User","site_admin":false},"body":"SISRP-25248 - Replaces hard-coded links in Advising Resources with calls to link api\r\n\r\nhttps://jira.berkeley.edu/browse/SISRP-25248","created_at":"2016-09-14T17:27:07Z","updated_at":"2016-09-15T19:05:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"412d2e685f15e08ef5f50b1b0b1f21f2a9aba2ce","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870/commits","review_comments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870/comments","review_comment_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5870/comments","statuses_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/statuses/e0f0daffb162a87b88225889f3684818b019cfd2","head":{"label":"lyttam:SISRP-25248","ref":"SISRP-25248","sha":"e0f0daffb162a87b88225889f3684818b019cfd2","user":{"login":"lyttam","id":12432859,"avatar_url":"https://avatars.githubusercontent.com/u/12432859?v=3","gravatar_id":"","url":"https://api.github.com/users/lyttam","html_url":"https://github.com/lyttam","followers_url":"https://api.github.com/users/lyttam/followers","following_url":"https://api.github.com/users/lyttam/following{/other_user}","gists_url":"https://api.github.com/users/lyttam/gists{/gist_id}","starred_url":"https://api.github.com/users/lyttam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyttam/subscriptions","organizations_url":"https://api.github.com/users/lyttam/orgs","repos_url":"https://api.github.com/users/lyttam/repos","events_url":"https://api.github.com/users/lyttam/events{/privacy}","received_events_url":"https://api.github.com/users/lyttam/received_events","type":"User","site_admin":false},"repo":{"id":66117337,"name":"calcentral","full_name":"lyttam/calcentral","owner":{"login":"lyttam","id":12432859,"avatar_url":"https://avatars.githubusercontent.com/u/12432859?v=3","gravatar_id":"","url":"https://api.github.com/users/lyttam","html_url":"https://github.com/lyttam","followers_url":"https://api.github.com/users/lyttam/followers","following_url":"https://api.github.com/users/lyttam/following{/other_user}","gists_url":"https://api.github.com/users/lyttam/gists{/gist_id}","starred_url":"https://api.github.com/users/lyttam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lyttam/subscriptions","organizations_url":"https://api.github.com/users/lyttam/orgs","repos_url":"https://api.github.com/users/lyttam/repos","events_url":"https://api.github.com/users/lyttam/events{/privacy}","received_events_url":"https://api.github.com/users/lyttam/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lyttam/calcentral","description":null,"fork":true,"url":"https://api.github.com/repos/lyttam/calcentral","forks_url":"https://api.github.com/repos/lyttam/calcentral/forks","keys_url":"https://api.github.com/repos/lyttam/calcentral/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lyttam/calcentral/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lyttam/calcentral/teams","hooks_url":"https://api.github.com/repos/lyttam/calcentral/hooks","issue_events_url":"https://api.github.com/repos/lyttam/calcentral/issues/events{/number}","events_url":"https://api.github.com/repos/lyttam/calcentral/events","assignees_url":"https://api.github.com/repos/lyttam/calcentral/assignees{/user}","branches_url":"https://api.github.com/repos/lyttam/calcentral/branches{/branch}","tags_url":"https://api.github.com/repos/lyttam/calcentral/tags","blobs_url":"https://api.github.com/repos/lyttam/calcentral/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lyttam/calcentral/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lyttam/calcentral/git/refs{/sha}","trees_url":"https://api.github.com/repos/lyttam/calcentral/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lyttam/calcentral/statuses/{sha}","languages_url":"https://api.github.com/repos/lyttam/calcentral/languages","stargazers_url":"https://api.github.com/repos/lyttam/calcentral/stargazers","contributors_url":"https://api.github.com/repos/lyttam/calcentral/contributors","subscribers_url":"https://api.github.com/repos/lyttam/calcentral/subscribers","subscription_url":"https://api.github.com/repos/lyttam/calcentral/subscription","commits_url":"https://api.github.com/repos/lyttam/calcentral/commits{/sha}","git_commits_url":"https://api.github.com/repos/lyttam/calcentral/git/commits{/sha}","comments_url":"https://api.github.com/repos/lyttam/calcentral/comments{/number}","issue_comment_url":"https://api.github.com/repos/lyttam/calcentral/issues/comments{/number}","contents_url":"https://api.github.com/repos/lyttam/calcentral/contents/{+path}","compare_url":"https://api.github.com/repos/lyttam/calcentral/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lyttam/calcentral/merges","archive_url":"https://api.github.com/repos/lyttam/calcentral/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lyttam/calcentral/downloads","issues_url":"https://api.github.com/repos/lyttam/calcentral/issues{/number}","pulls_url":"https://api.github.com/repos/lyttam/calcentral/pulls{/number}","milestones_url":"https://api.github.com/repos/lyttam/calcentral/milestones{/number}","notifications_url":"https://api.github.com/repos/lyttam/calcentral/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lyttam/calcentral/labels{/name}","releases_url":"https://api.github.com/repos/lyttam/calcentral/releases{/id}","deployments_url":"https://api.github.com/repos/lyttam/calcentral/deployments","created_at":"2016-08-19T23:03:32Z","updated_at":"2016-08-19T23:06:48Z","pushed_at":"2016-09-14T21:31:56Z","git_url":"git://github.com/lyttam/calcentral.git","ssh_url":"git@github.com:lyttam/calcentral.git","clone_url":"https://github.com/lyttam/calcentral.git","svn_url":"https://github.com/lyttam/calcentral","homepage":"https://calcentral.berkeley.edu","size":26518,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ets-berkeley-edu:master","ref":"master","sha":"c547e31616bab3676a2fd2184f192a852291c749","user":{"login":"ets-berkeley-edu","id":283538,"avatar_url":"https://avatars.githubusercontent.com/u/283538?v=3","gravatar_id":"","url":"https://api.github.com/users/ets-berkeley-edu","html_url":"https://github.com/ets-berkeley-edu","followers_url":"https://api.github.com/users/ets-berkeley-edu/followers","following_url":"https://api.github.com/users/ets-berkeley-edu/following{/other_user}","gists_url":"https://api.github.com/users/ets-berkeley-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/ets-berkeley-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ets-berkeley-edu/subscriptions","organizations_url":"https://api.github.com/users/ets-berkeley-edu/orgs","repos_url":"https://api.github.com/users/ets-berkeley-edu/repos","events_url":"https://api.github.com/users/ets-berkeley-edu/events{/privacy}","received_events_url":"https://api.github.com/users/ets-berkeley-edu/received_events","type":"Organization","site_admin":false},"repo":{"id":5483921,"name":"calcentral","full_name":"ets-berkeley-edu/calcentral","owner":{"login":"ets-berkeley-edu","id":283538,"avatar_url":"https://avatars.githubusercontent.com/u/283538?v=3","gravatar_id":"","url":"https://api.github.com/users/ets-berkeley-edu","html_url":"https://github.com/ets-berkeley-edu","followers_url":"https://api.github.com/users/ets-berkeley-edu/followers","following_url":"https://api.github.com/users/ets-berkeley-edu/following{/other_user}","gists_url":"https://api.github.com/users/ets-berkeley-edu/gists{/gist_id}","starred_url":"https://api.github.com/users/ets-berkeley-edu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ets-berkeley-edu/subscriptions","organizations_url":"https://api.github.com/users/ets-berkeley-edu/orgs","repos_url":"https://api.github.com/users/ets-berkeley-edu/repos","events_url":"https://api.github.com/users/ets-berkeley-edu/events{/privacy}","received_events_url":"https://api.github.com/users/ets-berkeley-edu/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ets-berkeley-edu/calcentral","description":"","fork":false,"url":"https://api.github.com/repos/ets-berkeley-edu/calcentral","forks_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/forks","keys_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/teams","hooks_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/hooks","issue_events_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/events{/number}","events_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/events","assignees_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/assignees{/user}","branches_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/branches{/branch}","tags_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/tags","blobs_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/refs{/sha}","trees_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/statuses/{sha}","languages_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/languages","stargazers_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/stargazers","contributors_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/contributors","subscribers_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/subscribers","subscription_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/subscription","commits_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/commits{/sha}","git_commits_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/git/commits{/sha}","comments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/comments{/number}","issue_comment_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/comments{/number}","contents_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/contents/{+path}","compare_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/merges","archive_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/downloads","issues_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues{/number}","pulls_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls{/number}","milestones_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/milestones{/number}","notifications_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/labels{/name}","releases_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/releases{/id}","deployments_url":"https://api.github.com/repos/ets-berkeley-edu/calcentral/deployments","created_at":"2012-08-20T16:45:39Z","updated_at":"2016-08-21T03:04:47Z","pushed_at":"2016-09-15T19:05:23Z","git_url":"git://github.com/ets-berkeley-edu/calcentral.git","ssh_url":"git@github.com:ets-berkeley-edu/calcentral.git","clone_url":"https://github.com/ets-berkeley-edu/calcentral.git","svn_url":"https://github.com/ets-berkeley-edu/calcentral","homepage":"https://calcentral.berkeley.edu","size":30145,"stargazers_count":66,"watchers_count":66,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":66,"mirror_url":null,"open_issues_count":4,"forks":66,"open_issues":4,"watchers":66,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870"},"html":{"href":"https://github.com/ets-berkeley-edu/calcentral/pull/5870"},"issue":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5870"},"comments":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/issues/5870/comments"},"review_comments":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870/comments"},"review_comment":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/pulls/5870/commits"},"statuses":{"href":"https://api.github.com/repos/ets-berkeley-edu/calcentral/statuses/e0f0daffb162a87b88225889f3684818b019cfd2"}}}}
{"actor":{"display_login":"redconfetti"}}