-
Notifications
You must be signed in to change notification settings - Fork 356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add alerts drop down to provider view #1918
Conversation
@moolitayer This PR is depending on #1501 where we change |
c2d3384
to
2a723c0
Compare
@moolitayer PTAL (ignore code climate 'similar code' issues, according to @himdel it is set too high..) |
@nimrodshn how are we doing validation for this endpoint? we should use the code we have in monitoring_manager.verify_credentials (we might need to expose it differently) |
@moolitayer we do use You can look here: |
@nimrodshn it's not using monitoring_manager.verify_credentials. It's using container_manager_mixin.verify_credentials. A change is needed in the backend and i'm not really sure how to handle that, anyway I will handle that. |
@moolitayer good catch! for some reason the trace in my IDE led me to believe we are using monitoring manager.. let me know if there is something I can do to help with that. |
alerts endpoint configuration isn't producing an Authentication from irb(main):014:0> ap ems.connection_configurations[:prometheus_alerts]
OpenStruct {
:endpoint => #<Endpoint:0x0056215892a9a8> {
:id => 3,
:role => "prometheus_alerts",
:ipaddress => nil,
:hostname => "alerts-kube-system.10.35.48.200.nip.io",
:port => 443,
:resource_type => "ExtManagementSystem",
:resource_id => 1,
:created_at => Sun, 27 Aug 2017 12:40:45 UTC +00:00,
:updated_at => Sun, 27 Aug 2017 14:07:54 UTC +00:00,
:verify_ssl => 0,
:url => nil,
:security_protocol => "ssl-without-validation",
:api_version => nil,
:path => nil,
:certificate_authority => nil
},
:authentication => nil
}
=> nil |
@ilackarms good catch! @moolitayer could this be related to our previous discussion? |
@nimrodshn This is something else. Looks like you are creating the endpoint correct but missing the authentication.
[1] https://github.com/nimrodshn/manageiq-ui-classic/blame/2a723c03de96e3d5c6e9365a27216bbf597463e2/app/controllers/mixins/ems_common_angular.rb#L529 |
@nimrodshn btw if you run the alerts collection you can make sure the new endpoint is configured correctly. |
@nimrodshn can you remove the WIP please? |
@moolitayer just added authentication. |
d263025
to
fdc8e27
Compare
This pull request is not mergeable. Please rebase and repush. |
fdc8e27
to
4a35d46
Compare
59cfd30
to
c09bedd
Compare
f620892
to
5026e76
Compare
5026e76
to
5196725
Compare
5196725
to
3228bb5
Compare
@dclarizio please review |
@moolitayer @ilackarms can you report here that this is tested and working on your environments ? |
Right, tested today and working as expected! |
@@ -247,10 +264,15 @@ ManageIQ.angular.app.controller('emsCommonFormController', ['$http', '$scope', ' | |||
($scope.emsCommonModel.default_hostname != '' && $scope.emsCommonModel.default_api_port) && | |||
($scope.emsCommonModel.default_password != '' && $scope.angularForm.default_password.$valid)) { | |||
return true; | |||
} else if(($scope.emsCommonModel.metrics_selection != "disabled" && $scope.emsCommonModel.ems_controller == "ems_container") && | |||
} else if(($scope.emsCommonModel.ems_controller == "ems_container") && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use ===
instead of ==
Also, a space is preferred after if
per style guide
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AparnaKarve Thanks 👍 the if
with no space, looked wrong ... but codeclimate didn't shout so I thought is was ok :-)
($scope.emsCommonModel.emstype) && | ||
($scope.emsCommonModel.metrics_hostname != '' && $scope.emsCommonModel.metrics_api_port) && | ||
($scope.emsCommonModel.default_password != '' && $scope.angularForm.default_password.$valid)) { | ||
($scope.emsCommonModel.default_password != '' && $scope.angularForm.default_password.$valid) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly !==
instead of !=
Please apply this elsewhere too (to all your PR changes where this is applicable)
amqp: {}, | ||
metrics: {}, | ||
ssh_keypair: {}, | ||
prometheus_alerts: {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing comma is missing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Thanks ! how did this pass code climate ?
} else { | ||
angular.element("#metrics_tab").show(); | ||
angular.element(tabSelector).show(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code is OK for the first pass, since it has already been tested.
But I'm wondering if we should move this code in a directive later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes 👍 , the whole ruby = select_tag(...
in the .haml file, should be in angular so will not need this hack :-(
2872702
to
473c334
Compare
Based on what I saw in the uploaded video above, when the It is essential to have the error indicator on the tab to be consistent with the rest of our UI and also for better UX. If you want to implement this in a follow-up PR, that would be perfectly OK. |
We do (*) (*) Actually we are currently fixing the validation code in the backend :-( and we may need to retouch this UI if we find that we missed something that we didn't see because of a bug in the backend (like what happened in #2102 ) |
@ilackarms @moolitayer the screenshots here are obsolete, do you have current screenshots of what this PR looks now ? cc @AparnaKarve |
@@ -24,7 +24,7 @@ | |||
= _("Metrics") | |||
= miq_tab_header('alerts', nil, 'ng-click' => "changeAuthTab('alerts')") do | |||
%div{"ng-if" => "emsCommonModel.alerts_selection == 'prometheus'"} | |||
%i{"error-on-tab" => "alerts", :style => "color:#cc0000"} | |||
%i{"error-on-tab" => "prometheus_alerts", :style => "color:#cc0000"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Easy enough! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:-)
@AparnaKarve 👍 Thanks, I think the tab missing "error" sign is fixed, see last commit. |
Checked commits nimrodshn/manageiq-ui-classic@a67c6ed~...6da318b with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaacov Thanks for the updated screenshot and all the other code updates.
@dclarizio LGTM and GTG
Adding alert drop down to container provider view.
![screencast_08-15-2017_04-08-37 pm](https://user-images.githubusercontent.com/8366181/29318396-864969f6-81d8-11e7-9eba-482166273fb6.gif)
GIF:
Screenshot of the produced endpoint:
![screenshot from 2017-08-15 14-00-18](https://user-images.githubusercontent.com/8366181/29317517-e749bda4-81d4-11e7-9788-ae78bae25d2f.png)
CC: @moolitayer @himdel
@simon3z