{"action":"created","issue":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3741","labels_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3741/labels{/name}","comments_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3741/comments","events_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3741/events","html_url":"https://github.com/ManageIQ/manageiq/issues/3741","id":99377251,"number":3741,"title":"VmOrTemplate validate buttons have a wrong condition","user":{"login":"Ladas","id":1737058,"avatar_url":"https://avatars.githubusercontent.com/u/1737058?v=3","gravatar_id":"","url":"https://api.github.com/users/Ladas","html_url":"https://github.com/Ladas","followers_url":"https://api.github.com/users/Ladas/followers","following_url":"https://api.github.com/users/Ladas/following{/other_user}","gists_url":"https://api.github.com/users/Ladas/gists{/gist_id}","starred_url":"https://api.github.com/users/Ladas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ladas/subscriptions","organizations_url":"https://api.github.com/users/Ladas/orgs","repos_url":"https://api.github.com/users/Ladas/repos","events_url":"https://api.github.com/users/Ladas/events{/privacy}","received_events_url":"https://api.github.com/users/Ladas/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/ManageIQ/manageiq/labels/ui","name":"ui","color":"5319e7"}],"state":"open","locked":false,"assignee":{"login":"Fryguy","id":52120,"avatar_url":"https://avatars.githubusercontent.com/u/52120?v=3","gravatar_id":"","url":"https://api.github.com/users/Fryguy","html_url":"https://github.com/Fryguy","followers_url":"https://api.github.com/users/Fryguy/followers","following_url":"https://api.github.com/users/Fryguy/following{/other_user}","gists_url":"https://api.github.com/users/Fryguy/gists{/gist_id}","starred_url":"https://api.github.com/users/Fryguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fryguy/subscriptions","organizations_url":"https://api.github.com/users/Fryguy/orgs","repos_url":"https://api.github.com/users/Fryguy/repos","events_url":"https://api.github.com/users/Fryguy/events{/privacy}","received_events_url":"https://api.github.com/users/Fryguy/received_events","type":"User","site_admin":false},"milestone":null,"comments":3,"created_at":"2015-08-06T07:39:40Z","updated_at":"2015-09-08T14:27:52Z","closed_at":null,"body":"https://github.com/ManageIQ/manageiq/blob/fd90bedc57ee51c77bc8fbb6dd2ea850191a8d4f/app/models/vm_or_template/operations.rb#L71\r\n\r\nThe 3 lines that returns true will overrride bahaviour of all buttons. That means all actions on a VM will show, e.g. when you delete an EMS. \r\n\r\nSeems to me all checks should return false, otherwise it should not be in that method. "},"comment":{"url":"https://api.github.com/repos/ManageIQ/manageiq/issues/comments/138581246","html_url":"https://github.com/ManageIQ/manageiq/issues/3741#issuecomment-138581246","issue_url":"https://api.github.com/repos/ManageIQ/manageiq/issues/3741","id":138581246,"user":{"login":"h-kataria","id":3450808,"avatar_url":"https://avatars.githubusercontent.com/u/3450808?v=3","gravatar_id":"","url":"https://api.github.com/users/h-kataria","html_url":"https://github.com/h-kataria","followers_url":"https://api.github.com/users/h-kataria/followers","following_url":"https://api.github.com/users/h-kataria/following{/other_user}","gists_url":"https://api.github.com/users/h-kataria/gists{/gist_id}","starred_url":"https://api.github.com/users/h-kataria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-kataria/subscriptions","organizations_url":"https://api.github.com/users/h-kataria/orgs","repos_url":"https://api.github.com/users/h-kataria/repos","events_url":"https://api.github.com/users/h-kataria/events{/privacy}","received_events_url":"https://api.github.com/users/h-kataria/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T14:27:52Z","updated_at":"2015-09-08T14:27:52Z","body":"@ladas @dclarizio i have looked at the lines of code in question, if we change 3 lines mentioned above to return false then buttons are hidden in UI because availability of those buttons is being returned as false, however if we leave them as it is and return true, UI disables the button and displays the message that's being returned by the method as hover over text to let user know why the button is disabled which to me is the correct behaviour.\r\ni think https://github.com/ManageIQ/manageiq/blob/fd90bedc57ee51c77bc8fbb6dd2ea850191a8d4f/app/models/vm_or_template/operations.rb#L69\r\nhttps://github.com/ManageIQ/manageiq/blob/fd90bedc57ee51c77bc8fbb6dd2ea850191a8d4f/app/models/vm_or_template/operations.rb#L70 should be changed to return true as well to be consistent. "}}