Merge "Adds support for directly patching boolean attributes"
This commit is contained in:
commit
791eecc71e
|
@ -29,6 +29,7 @@
|
||||||
'$rootScope',
|
'$rootScope',
|
||||||
'$controller',
|
'$controller',
|
||||||
'$uibModalInstance',
|
'$uibModalInstance',
|
||||||
|
'horizon.framework.widgets.toast.service',
|
||||||
'$log',
|
'$log',
|
||||||
'$q',
|
'$q',
|
||||||
'horizon.app.core.openstack-service-api.ironic',
|
'horizon.app.core.openstack-service-api.ironic',
|
||||||
|
@ -41,6 +42,7 @@
|
||||||
function EditPortController($rootScope,
|
function EditPortController($rootScope,
|
||||||
$controller,
|
$controller,
|
||||||
$uibModalInstance,
|
$uibModalInstance,
|
||||||
|
toastService,
|
||||||
$log,
|
$log,
|
||||||
$q,
|
$q,
|
||||||
ironic,
|
ironic,
|
||||||
|
@ -102,8 +104,8 @@
|
||||||
$log.info("Updating port " + JSON.stringify(port));
|
$log.info("Updating port " + JSON.stringify(port));
|
||||||
|
|
||||||
patcher.buildPatch(port.address, ctrl.address.value, "/address");
|
patcher.buildPatch(port.address, ctrl.address.value, "/address");
|
||||||
patcher.buildPatch(port.pxe_enabled ? 'True' : 'False',
|
patcher.buildPatch(port.pxe_enabled,
|
||||||
ctrl.pxeEnabled.value,
|
ctrl.pxeEnabled.value === 'True',
|
||||||
"/pxe_enabled");
|
"/pxe_enabled");
|
||||||
var attr = ctrl.localLinkConnection.toPortAttr();
|
var attr = ctrl.localLinkConnection.toPortAttr();
|
||||||
if (attr) {
|
if (attr) {
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
EditPortgroupController.$inject = [
|
EditPortgroupController.$inject = [
|
||||||
'$controller',
|
'$controller',
|
||||||
'$uibModalInstance',
|
'$uibModalInstance',
|
||||||
|
'horizon.framework.widgets.toast.service',
|
||||||
'$log',
|
'$log',
|
||||||
'horizon.app.core.openstack-service-api.ironic',
|
'horizon.app.core.openstack-service-api.ironic',
|
||||||
'horizon.dashboard.admin.ironic.update-patch.service',
|
'horizon.dashboard.admin.ironic.update-patch.service',
|
||||||
|
@ -34,6 +35,7 @@
|
||||||
|
|
||||||
function EditPortgroupController($controller,
|
function EditPortgroupController($controller,
|
||||||
$uibModalInstance,
|
$uibModalInstance,
|
||||||
|
toastService,
|
||||||
$log,
|
$log,
|
||||||
ironic,
|
ironic,
|
||||||
updatePatchService,
|
updatePatchService,
|
||||||
|
@ -72,9 +74,8 @@
|
||||||
|
|
||||||
patcher.buildPatch(portgroup.address, ctrl.address.value, "/address");
|
patcher.buildPatch(portgroup.address, ctrl.address.value, "/address");
|
||||||
patcher.buildPatch(portgroup.name, ctrl.name.value, "/name");
|
patcher.buildPatch(portgroup.name, ctrl.name.value, "/name");
|
||||||
patcher.buildPatch(portgroup.standalone_ports_supported
|
patcher.buildPatch(portgroup.standalone_ports_supported,
|
||||||
? 'True' : 'False',
|
ctrl.standalone_ports_supported.value === 'True',
|
||||||
ctrl.standalone_ports_supported.value,
|
|
||||||
"/standalone_ports_supported");
|
"/standalone_ports_supported");
|
||||||
patcher.buildPatch(portgroup.mode,
|
patcher.buildPatch(portgroup.mode,
|
||||||
ctrl.mode.value,
|
ctrl.mode.value,
|
||||||
|
|
|
@ -59,13 +59,15 @@
|
||||||
* @description Check whether an item is a property
|
* @description Check whether an item is a property
|
||||||
*
|
*
|
||||||
* @param {object} item - item to be tested
|
* @param {object} item - item to be tested
|
||||||
* @return {boolean} True if the item is a number, string, or date
|
* @return {boolean} True if the item is a number, string, date,
|
||||||
|
* or boolean.
|
||||||
*/
|
*/
|
||||||
function isProperty(item) {
|
function isProperty(item) {
|
||||||
return item === null ||
|
return item === null ||
|
||||||
angular.isNumber(item) ||
|
angular.isNumber(item) ||
|
||||||
angular.isString(item) ||
|
angular.isString(item) ||
|
||||||
angular.isDate(item);
|
angular.isDate(item) ||
|
||||||
|
typeof item === 'boolean';
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue