Skip to content

Commit

Permalink
Review comments processed
Browse files Browse the repository at this point in the history
  • Loading branch information
kruge002 committed Feb 28, 2018
1 parent b65203c commit 47ee523
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,7 @@ ManageIQ.angular.app.controller('reconfigureFormController', ['$http', '$scope',
};

vm.setEnableAddNetworkAdapterButton = function() {
var nrNetworksAfterReconfigure = 0;
angular.forEach(vm.reconfigureModel.vmNetworkAdapters, function(network) {
switch (network.add_remove) {
case "remove":
break;
default:
nrNetworksAfterReconfigure++;
break;
}
});
var nrNetworksAfterReconfigure = _.reject(vm.reconfigureModel.vmNetworkAdapters, { add_remove: 'remove' }).length;
vm.reconfigureModel.enableAddNetworkAdapterButton = (nrNetworksAfterReconfigure < 4);
};

Expand Down Expand Up @@ -235,9 +226,9 @@ ManageIQ.angular.app.controller('reconfigureFormController', ['$http', '$scope',
vm.processAddSelectedNetwork = function() {
vm.reconfigureModel.vmNetworkAdapters.push(
{
name: 'to be determined',
name: __('to be determined'),
vlan: vm.reconfigureModel.vLan_requested,
mac: 'not available yet',
mac: __('not available yet'),
add_remove: 'add',
});
vm.resetAddNetworkAdapterValues();
Expand Down Expand Up @@ -291,8 +282,6 @@ ManageIQ.angular.app.controller('reconfigureFormController', ['$http', '$scope',
add_remove: 'add'});
vm.resetAddValues();
vm.updateDisksAddRemove();

vm.cb_disks = vm.reconfigureModel.vmAddDisks.length > 0 || vm.reconfigureModel.vmRemoveDisks.length > 0;
};

vm.enableDiskAdd = function() {
Expand Down Expand Up @@ -330,8 +319,6 @@ ManageIQ.angular.app.controller('reconfigureFormController', ['$http', '$scope',
}
}
vm.updateDisksAddRemove();

vm.cb_disks = vm.reconfigureModel.vmAddDisks.length > 0 || vm.reconfigureModel.vmRemoveDisks.length > 0;
};

vm.cancelAddRemoveDisk = function(vmDisk) {
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/mixins/actions/vm_actions/reconfigure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ def get_vlan_options(host_id)

# determine available switches for this host...
switch_ids = []
HostSwitch.where("host_id = ?", host_id).each do |host_switch|
Rbac.filtered(HostSwitch.where("host_id = ?", host_id)).each do |host_switch|
switch_ids << host_switch.switch_id
end

Lan.where("switch_id IN (?)", switch_ids).each do |lan|
Rbac.filtered(Lan.where("switch_id IN (?)", switch_ids)).each do |lan|
vlan_options << lan.name
end
vlan_options
Expand Down

0 comments on commit 47ee523

Please sign in to comment.