{"action":"created","comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/47489630","id":47489630,"diff_hunk":"@@ -73,51 +73,34 @@ def status\n   end\n \n   def providers\n+    provider_classes_to_ui_types = {\n+      \"ManageIQ::Providers::Openshift::ContainerManager\"           => :openshift,\n+      \"ManageIQ::Providers::OpenshiftEnterprise::ContainerManager\" => :openshift,\n+      \"ManageIQ::Providers::Kubernetes::ContainerManager\"          => :kubernetes,\n+      \"ManageIQ::Providers::Atomic::ContainerManager\"              => :atomic,\n+      \"ManageIQ::Providers::AtomicEnterprise::ContainerManager\"    => :atomic\n+    }\n+\n     if @ems.present?\n-      if @ems.kind_of?(ManageIQ::Providers::Openshift::ContainerManager) ||\n-         @ems.kind_of?(ManageIQ::Providers::OpenshiftEnterprise::ContainerManager)\n-        {\n-          :iconClass    => \"pficon pficon-openshift\",\n-          :id           => \"openshift\",\n-          :providerType => \"OpenShift\"\n-        }\n-      elsif @ems.kind_of?(ManageIQ::Providers::Kubernetes::ContainerManager)\n-        {\n-          :iconClass    => \"pficon pficon-kubernetes\",\n-          :id           => \"kubernetes\",\n-          :providerType => \"Kubernetes\"\n-        }\n-      elsif @ems.kind_of?(ManageIQ::Providers::Atomic::ContainerManager) ||\n-            @ems.kind_of?(ManageIQ::Providers::AtomicEnterprise::ContainerManager)\n-        {\n-          :iconClass    => \"pficon icon-atomic\",\n-          :id           => \"atomic\",\n-          :providerType => \"Atomic\"\n-        }\n-      end\n+      ui_type = provider_classes_to_ui_types[@ems.type]","path":"app/services/container_dashboard_service.rb","position":34,"original_position":34,"commit_id":"878fe12ba99e220840a7fafaeecc686c405d4571","original_commit_id":"878fe12ba99e220840a7fafaeecc686c405d4571","user":{"login":"abonas","id":6277245,"avatar_url":"https://avatars.githubusercontent.com/u/6277245?v=3","gravatar_id":"","url":"https://api.github.com/users/abonas","html_url":"https://github.com/abonas","followers_url":"https://api.github.com/users/abonas/followers","following_url":"https://api.github.com/users/abonas/following{/other_user}","gists_url":"https://api.github.com/users/abonas/gists{/gist_id}","starred_url":"https://api.github.com/users/abonas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abonas/subscriptions","organizations_url":"https://api.github.com/users/abonas/orgs","repos_url":"https://api.github.com/users/abonas/repos","events_url":"https://api.github.com/users/abonas/events{/privacy}","received_events_url":"https://api.github.com/users/abonas/received_events","type":"User","site_admin":false},"body":"@zeari, please refactor this area as we discussed today.","created_at":"2015-12-14T12:03:51Z","updated_at":"2015-12-14T12:03:51Z","html_url":"https://github.com/ManageIQ/manageiq/pull/5781#discussion_r47489630","pull_request_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781","_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments/47489630"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/5781#discussion_r47489630"},"pull_request":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781"}}},"pull_request":{"url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781","id":53242897,"html_url":"https://github.com/ManageIQ/manageiq/pull/5781","diff_url":"https://github.com/ManageIQ/manageiq/pull/5781.diff","patch_url":"https://github.com/ManageIQ/manageiq/pull/5781.patch","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5781","number":5781,"state":"open","locked":false,"title":"containers dashboard shows only providers types that are allowed ","user":{"login":"zeari","id":11256940,"avatar_url":"https://avatars.githubusercontent.com/u/11256940?v=3","gravatar_id":"","url":"https://api.github.com/users/zeari","html_url":"https://github.com/zeari","followers_url":"https://api.github.com/users/zeari/followers","following_url":"https://api.github.com/users/zeari/following{/other_user}","gists_url":"https://api.github.com/users/zeari/gists{/gist_id}","starred_url":"https://api.github.com/users/zeari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeari/subscriptions","organizations_url":"https://api.github.com/users/zeari/orgs","repos_url":"https://api.github.com/users/zeari/repos","events_url":"https://api.github.com/users/zeari/events{/privacy}","received_events_url":"https://api.github.com/users/zeari/received_events","type":"User","site_admin":false},"body":"Containers dashboard now shows providers types count if they are allowed in the system and if theres at least one of that type.\r\n\r\nBefore:\r\n![before_allowed_providers](https://cloud.githubusercontent.com/assets/11256940/11713500/7e2d9ed4-9f3c-11e5-8e82-6668d2fab11f.png)\r\n\r\nAfter:\r\n![after_allowed_provider](https://cloud.githubusercontent.com/assets/11256940/11713513/8f9a2e9e-9f3c-11e5-8272-2baa14da24f6.png)\r\n\r\nIn the screenshots Kubernetes was ommited since it was not allowed in the system or because its entity count was zero.\r\n\r\n@simon3z @abonas Please review\r\nfyi @jeff-phillips-18 @serenamarie125","created_at":"2015-12-10T10:55:30Z","updated_at":"2015-12-14T12:03:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1873b6b7025e98ff3b88abc99d448abc3561526","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781/commits","review_comments_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781/comments","review_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/5781/comments","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/878fe12ba99e220840a7fafaeecc686c405d4571","head":{"label":"zeari:dashboard_show_providers_by_permissions","ref":"dashboard_show_providers_by_permissions","sha":"878fe12ba99e220840a7fafaeecc686c405d4571","user":{"login":"zeari","id":11256940,"avatar_url":"https://avatars.githubusercontent.com/u/11256940?v=3","gravatar_id":"","url":"https://api.github.com/users/zeari","html_url":"https://github.com/zeari","followers_url":"https://api.github.com/users/zeari/followers","following_url":"https://api.github.com/users/zeari/following{/other_user}","gists_url":"https://api.github.com/users/zeari/gists{/gist_id}","starred_url":"https://api.github.com/users/zeari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeari/subscriptions","organizations_url":"https://api.github.com/users/zeari/orgs","repos_url":"https://api.github.com/users/zeari/repos","events_url":"https://api.github.com/users/zeari/events{/privacy}","received_events_url":"https://api.github.com/users/zeari/received_events","type":"User","site_admin":false},"repo":{"id":32809554,"name":"manageiq","full_name":"zeari/manageiq","owner":{"login":"zeari","id":11256940,"avatar_url":"https://avatars.githubusercontent.com/u/11256940?v=3","gravatar_id":"","url":"https://api.github.com/users/zeari","html_url":"https://github.com/zeari","followers_url":"https://api.github.com/users/zeari/followers","following_url":"https://api.github.com/users/zeari/following{/other_user}","gists_url":"https://api.github.com/users/zeari/gists{/gist_id}","starred_url":"https://api.github.com/users/zeari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zeari/subscriptions","organizations_url":"https://api.github.com/users/zeari/orgs","repos_url":"https://api.github.com/users/zeari/repos","events_url":"https://api.github.com/users/zeari/events{/privacy}","received_events_url":"https://api.github.com/users/zeari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zeari/manageiq","description":"ManageIQ Cloud Management Platform","fork":true,"url":"https://api.github.com/repos/zeari/manageiq","forks_url":"https://api.github.com/repos/zeari/manageiq/forks","keys_url":"https://api.github.com/repos/zeari/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zeari/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zeari/manageiq/teams","hooks_url":"https://api.github.com/repos/zeari/manageiq/hooks","issue_events_url":"https://api.github.com/repos/zeari/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/zeari/manageiq/events","assignees_url":"https://api.github.com/repos/zeari/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/zeari/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/zeari/manageiq/tags","blobs_url":"https://api.github.com/repos/zeari/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zeari/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zeari/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/zeari/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zeari/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/zeari/manageiq/languages","stargazers_url":"https://api.github.com/repos/zeari/manageiq/stargazers","contributors_url":"https://api.github.com/repos/zeari/manageiq/contributors","subscribers_url":"https://api.github.com/repos/zeari/manageiq/subscribers","subscription_url":"https://api.github.com/repos/zeari/manageiq/subscription","commits_url":"https://api.github.com/repos/zeari/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/zeari/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/zeari/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/zeari/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/zeari/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/zeari/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zeari/manageiq/merges","archive_url":"https://api.github.com/repos/zeari/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zeari/manageiq/downloads","issues_url":"https://api.github.com/repos/zeari/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/zeari/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/zeari/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/zeari/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zeari/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/zeari/manageiq/releases{/id}","created_at":"2015-03-24T16:05:33Z","updated_at":"2015-04-19T08:03:20Z","pushed_at":"2015-12-14T09:33:07Z","git_url":"git://github.com/zeari/manageiq.git","ssh_url":"git@github.com:zeari/manageiq.git","clone_url":"https://github.com/zeari/manageiq.git","svn_url":"https://github.com/zeari/manageiq","homepage":"manageiq.org","size":97808,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ManageIQ:master","ref":"master","sha":"57b3eadbbdbc9230d91e9e2b164b78f623c54b2e","user":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"repo":{"id":20789757,"name":"manageiq","full_name":"ManageIQ/manageiq","owner":{"login":"ManageIQ","id":1125575,"avatar_url":"https://avatars.githubusercontent.com/u/1125575?v=3","gravatar_id":"","url":"https://api.github.com/users/ManageIQ","html_url":"https://github.com/ManageIQ","followers_url":"https://api.github.com/users/ManageIQ/followers","following_url":"https://api.github.com/users/ManageIQ/following{/other_user}","gists_url":"https://api.github.com/users/ManageIQ/gists{/gist_id}","starred_url":"https://api.github.com/users/ManageIQ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ManageIQ/subscriptions","organizations_url":"https://api.github.com/users/ManageIQ/orgs","repos_url":"https://api.github.com/users/ManageIQ/repos","events_url":"https://api.github.com/users/ManageIQ/events{/privacy}","received_events_url":"https://api.github.com/users/ManageIQ/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ManageIQ/manageiq","description":"ManageIQ Cloud Management Platform","fork":false,"url":"https://api.github.com/repos/ManageIQ/manageiq","forks_url":"https://api.github.com/repos/ManageIQ/manageiq/forks","keys_url":"https://api.github.com/repos/ManageIQ/manageiq/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ManageIQ/manageiq/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ManageIQ/manageiq/teams","hooks_url":"https://api.github.com/repos/ManageIQ/manageiq/hooks","issue_events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/events{/number}","events_url":"https://api.github.com/repos/ManageIQ/manageiq/events","assignees_url":"https://api.github.com/repos/ManageIQ/manageiq/assignees{/user}","branches_url":"https://api.github.com/repos/ManageIQ/manageiq/branches{/branch}","tags_url":"https://api.github.com/repos/ManageIQ/manageiq/tags","blobs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ManageIQ/manageiq/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ManageIQ/manageiq/git/refs{/sha}","trees_url":"https://api.github.com/repos/ManageIQ/manageiq/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ManageIQ/manageiq/statuses/{sha}","languages_url":"https://api.github.com/repos/ManageIQ/manageiq/languages","stargazers_url":"https://api.github.com/repos/ManageIQ/manageiq/stargazers","contributors_url":"https://api.github.com/repos/ManageIQ/manageiq/contributors","subscribers_url":"https://api.github.com/repos/ManageIQ/manageiq/subscribers","subscription_url":"https://api.github.com/repos/ManageIQ/manageiq/subscription","commits_url":"https://api.github.com/repos/ManageIQ/manageiq/commits{/sha}","git_commits_url":"https://api.github.com/repos/ManageIQ/manageiq/git/commits{/sha}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/comments{/number}","issue_comment_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments{/number}","contents_url":"https://api.github.com/repos/ManageIQ/manageiq/contents/{+path}","compare_url":"https://api.github.com/repos/ManageIQ/manageiq/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ManageIQ/manageiq/merges","archive_url":"https://api.github.com/repos/ManageIQ/manageiq/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ManageIQ/manageiq/downloads","issues_url":"https://api.github.com/repos/ManageIQ/manageiq/issues{/number}","pulls_url":"https://api.github.com/repos/ManageIQ/manageiq/pulls{/number}","milestones_url":"https://api.github.com/repos/ManageIQ/manageiq/milestones{/number}","notifications_url":"https://api.github.com/repos/ManageIQ/manageiq/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/labels{/name}","releases_url":"https://api.github.com/repos/ManageIQ/manageiq/releases{/id}","created_at":"2014-06-13T02:31:26Z","updated_at":"2015-12-14T02:23:28Z","pushed_at":"2015-12-14T11:00:19Z","git_url":"git://github.com/ManageIQ/manageiq.git","ssh_url":"git@github.com:ManageIQ/manageiq.git","clone_url":"https://github.com/ManageIQ/manageiq.git","svn_url":"https://github.com/ManageIQ/manageiq","homepage":"manageiq.org","size":132381,"stargazers_count":178,"watchers_count":178,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":195,"mirror_url":null,"open_issues_count":472,"forks":195,"open_issues":472,"watchers":178,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781"},"html":{"href":"https://github.com/ManageIQ/manageiq/pull/5781"},"issue":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/5781"},"comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/issues/5781/comments"},"review_comments":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781/comments"},"review_comment":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ManageIQ/manageiq/pulls/5781/commits"},"statuses":{"href":"https://api.github.com/repos/ManageIQ/manageiq/statuses/878fe12ba99e220840a7fafaeecc686c405d4571"}}}}