-
Notifications
You must be signed in to change notification settings - Fork 897
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: Adds network provisioning for Network provider #11442
Conversation
@miq-bot add_label euwe/yes |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
@dclarizio, @martinpovolny, @himdel, could you please review? |
if (cloudNetworkFormId == 'new') { | ||
$scope.cloudNetworkModel.name = ""; | ||
$scope.newRecord = true; | ||
$scope.cloudNetworkModel.enabled= true; |
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.
Minor, but missing space before =
..
EDIT: and same in the else branch..
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.
Done, thanks.
|
||
$scope.addClicked = function() { | ||
miqService.sparkleOn(); | ||
var url = 'create/new' + '?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.
Any reason not to use the absolute (/cloud_network/create/new
) url here? And why concatenate 2 constants?
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.
Good question and I honestly have no idea, it's the same in many other forms, included the cloud_volume ones I got inspired 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.
Aah, you're right .. OK, in that case, I don't care either way, I'll be doing a PR to fix the others anyway :).
$scope.saveClicked = function() { | ||
miqService.sparkleOn(); | ||
var url = '/cloud_network/update/' + cloudNetworkFormId + '?button=save'; | ||
miqService.miqAjaxButton(url, true); |
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 don't use miqAjaxButton
with true
(trying to remove in #11324) - pass $scope.cloudNetworkModel
instead (or an object with whatever data you want to send to the server in general).
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, passing the scope model now.
@gildub I'm also seeing a lot of duplication between |
@himdel, yes, absolutely! |
@himdel, thanks for your help |
@gildub any time :) LGTM, except I still wonder about the duplication between IMHO only the javascript part has to be different. |
Actually once a network has been created there are fields that cannot be changed, the provider:network_type and tenant/project are among them. When creating such as in Unless you have a mechanism to make the select read only I don't see any benefit to have those in a common partial where there is going to be a conditional to triage between a plain text or a select depending if it's edit or new. |
👍 tested the UI; network was created, edited, and deleted correctly |
@gildub Well, the mechanism is |
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
Ok for ng-readonly flag, but unfortunately that doesn't work for select as a whole. And even if it did that would mean provide a single value in case of update (readonly) which I think is messy. I suppose a more pure javascript approach would be possible but out of scope for now. |
Views: Added edit and new - using Angular (as cloud_volume) Button: Adds configuration -> Add, Edit and Cancel Controllers/Models: EMS Network Provider updates using raw updates to be replaced with tasks. Rspec: Couples of issues
Checked commit https://github.com/gildub/manageiq/commit/86475e9e2827ccf3ee7c62366d855a426e442da4 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 app/controllers/cloud_network_controller.rb
app/helpers/application_helper/toolbar/cloud_network_center.rb
app/helpers/application_helper/toolbar/cloud_networks_center.rb
|
UI: Adds network provisioning for Network provider (cherry picked from commit 5c4d942)
Euwe Backport details: $ git log
commit 3be35cc1e5ffb75378cb23089449d6d235609f56
Author: Dan Clarizio <dclarizi@redhat.com>
Date: Fri Oct 7 13:48:46 2016 -0700
Merge pull request #11442 from gildub/network-provisioning-network
UI: Adds network provisioning for Network provider
(cherry picked from commit 5c4d9424ec2be2fd2171aac313d63bd5fff9b360) |
Views: Added edit and new - using Angular (as cloud_volume)
Button: Adds configuration -> Add, Edit and Cancel
Controllers/Models:
EMS Network Provider updates using raw updates
to be replaced with tasks.
Includes rspec
More fields to be added once following fixed:
fog/fog-openstack#192