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
Convert vm_common controllers to use ControllerAs #1233
Convert vm_common controllers to use ControllerAs #1233
Conversation
@ZitaNemeckova Cannot apply the following label because they are not recognized: angular_dialogs |
@miq-bot add_label angular dialogs |
aeeb4d3
to
00ddbab
Compare
00ddbab
to
d07261b
Compare
@miq-bot remove_label wip |
@lgalis please review, thanks :) |
@ZitaNemeckova - this is what I see when selecting Cloud->Providers->Rellationshhips->Instances-> LiveMigrate for an instance |
$scope.modelCopy = angular.copy( $scope.vmCloudModel ); | ||
vm.floating_ips = []; | ||
vm.formId = vmCloudAssociateFloatingIpFormId; | ||
vm.modelCopy = angular.copy( vm.vmCloudModel ); | ||
|
||
ManageIQ.angular.scope = $scope; |
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.
= vm
vm.vmCloudModel = { name: '' }; | ||
vm.formId = vmCloudAttachFormId; | ||
vm.afterGet = false; | ||
vm.modelCopy = angular.copy( vm.vmCloudModel ); | ||
|
||
ManageIQ.angular.scope = $scope; |
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.
= vm
vm.hosts = []; | ||
vm.filtered_hosts = []; | ||
vm.formId = vmCloudLiveMigrateFormId; | ||
vm.modelCopy = angular.copy(vm.vmCloudModel); | ||
|
||
ManageIQ.angular.scope = $scope; |
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.
= vm
.. and you should no longer have to inject |
The checklist.. EDIT: moved to the PR description |
@miq-bot add_label wip |
12d32f4
to
1fc2b79
Compare
1fc2b79
to
7c4f9ba
Compare
|
||
%div_for_paging{'ng-controller' => "pagingDivButtonGroupController", | ||
'paging_div_buttons_id' => "angular_paging_div_buttons", | ||
'paging_div_buttons_type' => "Submit"} | ||
|
||
- unless @explorer |
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 is definitely broken .. looks like you had to move this right in associate
, so that the buttons are part of the form .. but forgot to do the same 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.
Also, submitClicked()
and cancelClicked()
look suspiciously vm-less ;)
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.
Well, %div_for_paging
is used elsewhere and it has vm-less submitClicked()
and cancelClicked()
so I left them to be on $scope
for now.
:miqrequired => false, | ||
:checkchange => true} | ||
'ng-model' => "vm.vmCloudModel.device_path", | ||
'ng-maxlength' => 128} |
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 should be maxlength
, 128
is a valid expression, but no need to use the ng- version with a constant...
'ng-model' => "vm.vmCloudModel.device_path", | ||
'ng-maxlength' => 128} | ||
|
||
%div_for_paging{'ng-controller' => "pagingDivButtonGroupController", |
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.
Was this moved inside form-horizontal
on purpose?
%div_for_paging{'ng-controller' => "pagingDivButtonGroupController", | ||
'paging_div_buttons_id' => "angular_paging_div_buttons", | ||
'paging_div_buttons_type' => "Submit"} | ||
%div_for_paging{'ng-controller' => "pagingDivButtonGroupController", |
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.
And here..
c3b0a75
to
7c8250e
Compare
|
||
%div_for_paging{'ng-controller' => "pagingDivButtonGroupController", | ||
'paging_div_buttons_id' => "angular_paging_div_buttons", | ||
'paging_div_buttons_type' => "Submit"} | ||
|
||
|
||
- unless @explorer |
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.
You want to move this to the right too, otherwise it's not part of the form and can't access the controller..
Tested in the UI:
|
@@ -45,8 +47,8 @@ | |||
= _('Destination Host') | |||
.col-md-8 | |||
%select{:name => 'destination_host_id', | |||
'ng-model' => 'vmCloudModel.host', | |||
'ng-options' => 'host.name as host.name for host in hosts track by host.id'} | |||
'ng-model' => 'vm.mCloudModel.host', |
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.
Typo - mCloudMode
l should be vmCloudModel
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.
If you have trouble testing this...
--- a/app/controllers/mixins/actions/vm_actions/live_migrate.rb
+++ b/app/controllers/mixins/actions/vm_actions/live_migrate.rb
@@ -50,6 +50,10 @@ module Mixins
hosts = []
end
end
+ hosts = [
+ {:name => "Karel", :id => 21},
+ {:name => "Lojza", :id => 123},
+ ]
render :json => {
:hosts => hosts
}
034afb9
to
bbc703a
Compare
bbc703a
to
8ba980d
Compare
Checked commits ZitaNemeckova/manageiq-ui-classic@3596313~...8ba980d with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/controllers/mixins/actions/vm_actions/disassociate_floating_ip.rb
|
vmCloudAssociateFloatingIpFormController
:OpenStack Instance summary page -> Configuration -> Associate a Floating IP with this Instance
vmCloudDisassociateFloatingIpFormController
:OpenStack Instance summary page -> Configuration -> Disassociate a Floating IP with this Instance
vmCloudAttachFormController
:OpenStack Instance summary page -> Configuration -> Attach a Cloud Volume to this Instance
vmCloudDetachFormController
:OpenStack Instance summary page -> Configuration -> Detach a Cloud Volume to this Instance
vmCloudLiveMigrateFormController
:OpenStack Instance summary page -> Lifecycle -> Migrate selected Instance
vm_clouds_center_tb
-> Lifecycle -> Migrate selected InstancesvmCloudEvacuateFormController
:OpenStack Instance summary page -> Lifecycle -> Evacuate selected Instance
vm_clouds_center_tb
-> Lifecycle -> Evacuate selected InstancesvmCloudResizeFormController
:OpenStack Instance summary page -> Configuration -> Reconfigure this Instance
vm_clouds_center_tb
-> Configuration -> Reconfigure this InstanceTo have
unless @explorer
part of partial (vm_clouds_center_tb
):Compute -> Cloud -> Providers -> select OpenStack one -> in summary page select Instances/Vms -> select one or more Instances/VMs -> Lifecycle -> etc...
@miq-bot add_label angular dialogs, technical debt, wip
https://www.pivotaltracker.com/story/show/143026077
https://www.pivotaltracker.com/story/show/143026061
https://www.pivotaltracker.com/story/show/143026049
https://www.pivotaltracker.com/story/show/143026033
https://www.pivotaltracker.com/story/show/143026085
TODO:
vm
ManageIQ.angular.scope
points tovm
$scope
unless needed for a $watch or events, or angularForm