-
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
UI for add/remove interface on network router #60
Conversation
58ebed1
to
5838d94
Compare
So whoever reviews this, regarding the rubocop output, are all of those hash-related comments in the haml files false positives? They don't seem to match well to the actual content, and the content here is very similar to other haml files that have succeeded in the past. |
5838d94
to
e977e11
Compare
@@ -41,6 +46,30 @@ ManageIQ.angular.app.controller('networkRouterFormController', ['$http', '$scope | |||
miqService.miqAjaxButton(url, $scope.networkRouterModel, { complete: false }); | |||
}; | |||
|
|||
$scope.addInterfaceClicked = function() { | |||
miqService.sparkleOn(); | |||
var url = '/network_router/add_interface/' + networkRouterFormId + '?button=addInterface'; |
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.
Why addInterface
when the info is already contained in the path? This should be just:
var url = '/network_router/add_interface/' + networkRouterFormId + '?button=add';
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.
Mostly I was just following convention elsewhere for similar add/remove association functionality. I can change it to just 'add'. I need to verify that this won't cause any ambiguity with the normal create 'add' form, but from a quick glance I think it will be fine. I'll update and re-test to make sure it's working with the change, though.
|
||
$scope.removeInterfaceClicked = function() { | ||
miqService.sparkleOn(); | ||
var url = '/network_router/remove_interface/' + networkRouterFormId + '?button=removeInterface'; |
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.
Same as above.
%td{:align => 'right'} | ||
#buttons_on | ||
= render :partial => "layouts/angular/x_custom_form_buttons_angular", | ||
:locals => {:button_label => N_("Add"), |
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.
Not N_("Add")
, that wouldn't work. You need to use _("Add")
here.
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.
Sure. I just noticed that you made this same change last month to the code that I modeled this from -- I'll make the same change here.
%td{:align => 'right'} | ||
#buttons_on | ||
= render :partial => "layouts/angular/x_custom_form_buttons_angular", | ||
:locals => {:button_label => N_("Remove"), |
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.
_("Remove")
e977e11
to
aa50b80
Compare
@mzazrivec OK the suggested changes have been made and the PR updated. |
#buttons_on | ||
= render :partial => "layouts/angular/x_custom_form_buttons_angular", | ||
:locals => {:button_label => _("Remove"), | ||
:button_click => "removeInterfaceClicked()"} |
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.
@sseago I know this part with %table ...
was copied from other places in our views,
but I fixed that recently -- we don't want to use table for styling here, so please fix
this similarly to what I did here:
#buttons_on | ||
= render :partial => "layouts/angular/x_custom_form_buttons_angular", | ||
:locals => {:button_label => _("Add"), | ||
:button_click => "addInterfaceClicked()"} |
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.
Same as below.
aa50b80
to
380be9f
Compare
var url = '/network_router/remove_interface/' + networkRouterFormId + '?button=cancel'; | ||
miqService.miqAjaxButton(url); | ||
}; | ||
|
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.
Where are the cancelAddInterfaceClicked()
and cancelRemoveInterfaceClicked()
routines called from?
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.
Ahh, it looks like this is not needed as a result of earlier refactoring. More specifically, this PR was based off the add/remove host functionality on HostAggregate, so this came from cancelAddHostClicked and cancelRemoveHostClicked, both of which were originally called in the UI form with manually-created buttons but should have been removed when I created x_custom_form_buttons_angular.
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.
I'll remove these from network_router_form_controller, although I guess those two functions in host_aggregate_form_controller.js should also be removed (probably not as part of this PR, though)
380be9f
to
a4f83dd
Compare
@@ -0,0 +1,23 @@ | |||
%form#form_div{:name => "angularForm", 'ng-controller' => "networkRouterFormController"} |
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.
Please add :novalidate => true
to the list of options for the %form
here, so that the browser won't render that
annoying "Please Select an Item from the List."
popup when you click Cancel
in the add form. We do use
that in other angular forms as well.
@@ -0,0 +1,23 @@ | |||
%form#form_div{:name => "angularForm", 'ng-controller' => "networkRouterFormController"} |
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.
Same as above with novalidate
.
a4f83dd
to
23f6d91
Compare
@mzazrivec OK the novalidate changes have been made. |
Failing CI, because of backend changes, it seems. |
This commit adds UI code for adding and removing router interfaces. BZ for this is: https://bugzilla.redhat.com/show_bug.cgi?id=1394284 Euwe backport depends on merging ManageIQ/manageiq#13005
23f6d91
to
b91242e
Compare
Checked commit sseago@b91242e with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 app/controllers/network_router_controller.rb
spec/controllers/network_router_controller_spec.rb
|
@mzazrivec Looks like a recent change in the main repo (method names changed) broke my spec test. Fixed and the test works locally now, so hopefully the build goes through now. |
@miq-bot add_label euwe/yes, blocker, bug |
This commit adds UI code for adding and removing router interfaces. BZ for this is: https://bugzilla.redhat.com/show_bug.cgi?id=1394284 This is the Euwe-only backport PR corresponding to ManageIQ/manageiq-ui-classic#60
Euwe backport (to manageiq repo) details:
|
This commit adds UI code for adding and removing router interfaces.
BZ for this is:
https://bugzilla.redhat.com/show_bug.cgi?id=1394284
Euwe backport depends on merging ManageIQ/manageiq#13005