Skip to content
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

Introduce UI for Nuage events #2186

Merged
merged 1 commit into from Oct 25, 2017

Conversation

gberginc
Copy link
Contributor

With the introduction of Nuage event catcher, users need to be able to configure the AMQP connection for their Nuage network manager. This patch adds a secondary tab for the Events allowing users to opt-in and create authentication for the AMQP. Complete validation of all credentials is supported.

This PR is based on a contribution from @VojkoR in this commit. It adds additional logic to configure the endpoint and authentications.

Links [Optional]

  • video: shows validation of credentials, both default and amqp for Nuage network manager
  • depends on this Nuage PR

@gberginc
Copy link
Contributor Author

@miha-plesko This one is related to the Nuage PR. Can you please have a look?

Copy link
Contributor

@miha-plesko miha-plesko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks great @gberginc , please see the two minor comments below. Other than that I've also noticed that if I input an invalid endpoint in AMQP tab and then click Validate, then I get notification complaining about

VM802:4 SyntaxError: Unexpected token < in JSON at position 0

But I believe this is a backend problem and we're not able to solve it here, right?

@@ -394,6 +394,10 @@ ManageIQ.angular.app.controller('emsCommonFormController', ['$http', '$scope', '
if ($scope.emsCommonModel.emstype === 'openstack') {
$scope.emsCommonModel.tenant_mapping_enabled = false;
}
} else if ($scope.emsCommonModel.emstype === 'nuage_network') {
$scope.emsCommonModel.default_api_port = $scope.getDefaultApiPort($scope.emsCommonModel.emstype);
$scope.emsCommonModel.event_stream_selection = "none";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use single quotes 'none' here as well. I see we're following a pattern here, but we shouldn't IMO.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@@ -218,7 +222,7 @@
:prefix => "amqp",
:basic_info_needed => true}
.form-group
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'openstack' || #{ng_model}.emstype == 'openstack_infra'"}
.col-md-12{"ng-if" => "#{ng_model}" == "emsCommonModel" && "#{ng_model}.emstype == 'openstack' || #{ng_model}.emstype == 'openstack_infra' || #{ng_model}.emstype == 'nuage_network'"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This prints the wrong message:

capture2

May I suggest to add additional .col-md-12 here for Nuage provider? Similarly as there is one for OpenStack in L225 and one for VMWare in L231. I think you will need something more similar to VMWare than OpenStack.

Alternatively, you could make VMWare's message little more general and then hook Nuage there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely missed this message there - thanks for spotting!

With the introduction of Nuage event catcher, users need to be able to
configure the AMQP connection for their Nuage network manager. This
patch adds a secondary tab for the Events allowing users to opt-in and
create authentication for the AMQP. Complete validation of all
credentials is supported.

Signed-off-by: Gregor Berginc <gregor.berginc@xlab.si>
@gberginc
Copy link
Contributor Author

Thanks @miha-plesko for the review! Regarding the Unexpected token < in JSON at position 0 I can confirm that indeed happens in case you do not have the required gem (this causes exception). However, when correct version of Nuage provider is used, it does not produce this message.

@miq-bot
Copy link
Member

miq-bot commented Sep 26, 2017

Checked commit gberginc@d1e49f3 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 5 offenses detected

app/views/layouts/angular/_multi_auth_credentials.html.haml

  • ⚠️ - Line 178 - Line is too long. [233/160]
  • ⚠️ - Line 178 - Prefer to_s over string interpolation.
  • ⚠️ - Line 179 - Line is too long. [164/160]
  • ⚠️ - Line 237 - Prefer to_s over string interpolation.
  • ⚠️ - Line 37 - Redundant curly braces around a hash parameter.

Copy link
Contributor

@miha-plesko miha-plesko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @gberginc , LGTM now. @AparnaKarve I leave it to you to either comment or merge.

@martinpovolny
Copy link

@AparnaKarve : please, take a look at this one. I am not familiar with this form. Thx!

Copy link
Contributor

@AparnaKarve AparnaKarve left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gberginc Changes look good and relating them with your video demo helped me. So LGTM.
(I did not test this PR myself since it is dependent on the other Nuage PR - ManageIQ/manageiq-providers-nuage#9)

@martinpovolny martinpovolny merged commit 1506f61 into ManageIQ:master Oct 25, 2017
@martinpovolny martinpovolny added this to the Sprint 72 Ending Oct 30, 2017 milestone Oct 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants