From 27616377953eeca51cbcff6bd9caa09c3457fdcb Mon Sep 17 00:00:00 2001 From: qiaomin Date: Tue, 10 Jan 2017 14:51:25 +0800 Subject: [PATCH] Update for ui bootstrap changes Change-Id: I329ae0fb6c8e6f0d97866c63e53486a0a08ae084 --- .../create/create.action.service.spec.js | 2 +- .../delete/delete.action.service.spec.js | 2 +- .../actions/edit/edit.action.service.spec.js | 2 +- .../actions/batch-actions.service.spec.js | 2 +- .../delete/delete.action.service.spec.js | 2 +- .../actions/row-actions.service.spec.js | 2 +- .../listeners/detail.controller.spec.js | 2 +- .../listeners/table.controller.spec.js | 2 +- .../actions/associate-ip/modal.controller.js | 12 +++++----- .../associate-ip/modal.controller.spec.js | 22 +++++++++---------- .../actions/associate-ip/modal.service.js | 8 +++---- .../associate-ip/modal.service.spec.js | 14 ++++++------ .../actions/batch-actions.service.spec.js | 2 +- .../delete/delete.action.service.spec.js | 2 +- .../disassociate-ip/modal.service.spec.js | 2 +- .../actions/row-actions.service.spec.js | 2 +- .../loadbalancers/detail.controller.spec.js | 2 +- .../loadbalancers/table.controller.spec.js | 2 +- .../actions/batch-actions.service.spec.js | 2 +- .../actions/edit-weight/modal.controller.js | 12 +++++----- .../edit-weight/modal.controller.spec.js | 18 +++++++-------- .../actions/edit-weight/modal.service.js | 8 +++---- .../actions/edit-weight/modal.service.spec.js | 14 ++++++------ .../update-member-list.service.spec.js | 2 +- .../lbaasv2/members/detail.controller.spec.js | 2 +- .../lbaasv2/members/table.controller.spec.js | 2 +- .../create/create.action.service.spec.js | 2 +- .../delete/delete.action.service.spec.js | 2 +- .../actions/edit/edit.action.service.spec.js | 2 +- .../project/lbaasv2/workflow/modal.service.js | 8 +++---- .../lbaasv2/workflow/modal.service.spec.js | 2 +- 31 files changed, 80 insertions(+), 80 deletions(-) diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/create/create.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/create/create.action.service.spec.js index 27e5d897..1030317e 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/create/create.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/create/create.action.service.spec.js @@ -41,7 +41,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/delete/delete.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/delete/delete.action.service.spec.js index f64be57a..326376d9 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/delete/delete.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/delete/delete.action.service.spec.js @@ -59,7 +59,7 @@ }); beforeEach(module(function($provide) { - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: makePromise() diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/edit/edit.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/edit/edit.action.service.spec.js index e08ee9dd..98522853 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/edit/edit.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/healthmonitors/actions/edit/edit.action.service.spec.js @@ -41,7 +41,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/batch-actions.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/batch-actions.service.spec.js index 63984d18..4f190ec5 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/batch-actions.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/batch-actions.service.spec.js @@ -42,7 +42,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); $provide.value('horizon.dashboard.project.lbaasv2.loadbalancers.service', { isActionable: function() { return $q.when(); diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/delete/delete.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/delete/delete.action.service.spec.js index a28f3353..e6960045 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/delete/delete.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/delete/delete.action.service.spec.js @@ -51,7 +51,7 @@ }); beforeEach(module(function($provide) { - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: makePromise() diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/row-actions.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/row-actions.service.spec.js index f25d025e..15debc82 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/row-actions.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/actions/row-actions.service.spec.js @@ -64,7 +64,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/detail.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/detail.controller.spec.js index 3f12f4a9..8b70cc8a 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/detail.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/detail.controller.spec.js @@ -48,7 +48,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', {}); + $provide.value('$uibModal', {}); })); beforeEach(inject(function($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/table.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/table.controller.spec.js index c949ed72..379f12d2 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/table.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/listeners/table.controller.spec.js @@ -46,7 +46,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', {}); + $provide.value('$uibModal', {}); })); beforeEach(inject(function($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.js index f8f7692a..d1bc2e2f 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.js @@ -21,10 +21,10 @@ .controller('AssociateFloatingIpModalController', AssociateFloatingIpModalController); AssociateFloatingIpModalController.$inject = [ - '$modalInstance', + '$uibModalInstance', 'horizon.app.core.openstack-service-api.network', 'horizon.framework.util.i18n.gettext', - // Dependencies injected with resolve by $modal.open + // Dependencies injected with resolve by $uibModal.open 'loadbalancer', 'floatingIps', 'floatingIpPools' @@ -37,7 +37,7 @@ * Controller used by the modal service for associating a floating IP address to a * load balancer. * - * @param $modalInstance The angular bootstrap $modalInstance service. + * @param $uibModalInstance The angular bootstrap $uibModalInstance service. * @param api The horizon network API service. * @param gettext The horizon gettext function for translation. * @param loadbalancer The load balancer to associate the floating IP with. @@ -48,7 +48,7 @@ */ function AssociateFloatingIpModalController( - $modalInstance, api, gettext, loadbalancer, floatingIps, floatingIpPools + $uibModalInstance, api, gettext, loadbalancer, floatingIps, floatingIpPools ) { var ctrl = this; var port = loadbalancer.vip_port_id + '_' + loadbalancer.vip_address; @@ -69,11 +69,11 @@ } function cancel() { - $modalInstance.dismiss('cancel'); + $uibModalInstance.dismiss('cancel'); } function onSuccess() { - $modalInstance.close(); + $uibModalInstance.close(); } function onFailure() { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.spec.js index 243032ea..f0eb5444 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.controller.spec.js @@ -17,7 +17,7 @@ 'use strict'; describe('LBaaS v2 Load Balancers Table Associate IP Controller', function() { - var ctrl, network, floatingIps, floatingIpPools, $controller, $modalInstance; + var ctrl, network, floatingIps, floatingIpPools, $controller, $uibModalInstance; var associateFail = false; beforeEach(module('horizon.framework.util.i18n')); @@ -41,7 +41,7 @@ } }; }; - $provide.value('$modalInstance', { + $provide.value('$uibModalInstance', { close: angular.noop, dismiss: angular.noop }); @@ -64,7 +64,7 @@ beforeEach(inject(function ($injector) { network = $injector.get('horizon.app.core.openstack-service-api.network'); $controller = $injector.get('$controller'); - $modalInstance = $injector.get('$modalInstance'); + $uibModalInstance = $injector.get('$uibModalInstance'); })); it('should define controller properties', function() { @@ -107,11 +107,11 @@ ctrl = $controller('AssociateFloatingIpModalController'); ctrl.selected = ctrl.options[0]; spyOn(network, 'associateFloatingIp').and.callThrough(); - spyOn($modalInstance, 'close'); + spyOn($uibModalInstance, 'close'); ctrl.save(); expect(ctrl.saving).toBe(true); expect(network.associateFloatingIp).toHaveBeenCalledWith('ip2', 'port_address'); - expect($modalInstance.close).toHaveBeenCalled(); + expect($uibModalInstance.close).toHaveBeenCalled(); }); it('should allocate floating IP if floating IP pool selected', function() { @@ -119,28 +119,28 @@ ctrl.selected = ctrl.options[1]; spyOn(network, 'allocateFloatingIp').and.callThrough(); spyOn(network, 'associateFloatingIp').and.callThrough(); - spyOn($modalInstance, 'close'); + spyOn($uibModalInstance, 'close'); ctrl.save(); expect(ctrl.saving).toBe(true); expect(network.allocateFloatingIp).toHaveBeenCalledWith('pool1'); expect(network.associateFloatingIp).toHaveBeenCalledWith('foo', 'port_address'); - expect($modalInstance.close).toHaveBeenCalled(); + expect($uibModalInstance.close).toHaveBeenCalled(); }); it('should dismiss modal if cancel clicked', function() { ctrl = $controller('AssociateFloatingIpModalController'); - spyOn($modalInstance, 'dismiss'); + spyOn($uibModalInstance, 'dismiss'); ctrl.cancel(); - expect($modalInstance.dismiss).toHaveBeenCalledWith('cancel'); + expect($uibModalInstance.dismiss).toHaveBeenCalledWith('cancel'); }); it('should not dismiss modal if save fails', function() { ctrl = $controller('AssociateFloatingIpModalController'); ctrl.selected = ctrl.options[0]; associateFail = true; - spyOn($modalInstance, 'dismiss'); + spyOn($uibModalInstance, 'dismiss'); ctrl.save(); - expect($modalInstance.dismiss).not.toHaveBeenCalled(); + expect($uibModalInstance.dismiss).not.toHaveBeenCalled(); expect(ctrl.saving).toBe(false); }); diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.js index a8f273a1..cec7389f 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.js @@ -23,7 +23,7 @@ modalService.$inject = [ '$q', - '$modal', + '$uibModal', '$route', 'horizon.dashboard.project.lbaasv2.basePath', 'horizon.app.core.openstack-service-api.policy', @@ -41,7 +41,7 @@ * Provides the service for the Load Balancer Associate Floating IP action. * * @param $q The angular service for promises. - * @param $modal The angular bootstrap $modal service. + * @param $uibModal The angular bootstrap $uibModal service. * @param $route The angular $route service. * @param basePath The LBaaS v2 module base path. * @param policy The horizon policy service. @@ -55,7 +55,7 @@ function modalService( $q, - $modal, + $uibModal, $route, basePath, policy, @@ -110,7 +110,7 @@ } } }; - $modal.open(spec).result.then(onModalClose); + $uibModal.open(spec).result.then(onModalClose); } function onModalClose() { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.spec.js index 0ea8308b..a70c0334 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/associate-ip/modal.service.spec.js @@ -17,7 +17,7 @@ 'use strict'; describe('LBaaS v2 Load Balancers Table Associate IP Service', function() { - var service, policy, $scope, $route, item, $modal, toast; + var service, policy, $scope, $route, item, $uibModal, toast; function allowed(item) { spyOn(policy, 'ifAllowed').and.returnValue(true); @@ -52,7 +52,7 @@ } }; }; - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: fakePromise() @@ -74,7 +74,7 @@ toast = $injector.get('horizon.framework.widgets.toast.service'); $scope = $injector.get('$rootScope').$new(); $route = $injector.get('$route'); - $modal = $injector.get('$modal'); + $uibModal = $injector.get('$uibModal'); service = $injector.get( 'horizon.dashboard.project.lbaasv2.loadbalancers.actions.associate-ip.modal.service'); })); @@ -94,18 +94,18 @@ }); it('should open the modal', function() { - spyOn($modal, 'open').and.callThrough(); + spyOn($uibModal, 'open').and.callThrough(); service.perform(item); $scope.$apply(); - expect($modal.open.calls.count()).toBe(1); + expect($uibModal.open.calls.count()).toBe(1); }); it('should resolve data for passing into the modal', function() { - spyOn($modal, 'open').and.callThrough(); + spyOn($uibModal, 'open').and.callThrough(); service.perform(item); $scope.$apply(); - var resolve = $modal.open.calls.argsFor(0)[0].resolve; + var resolve = $uibModal.open.calls.argsFor(0)[0].resolve; expect(resolve).toBeDefined(); expect(resolve.loadbalancer).toBeDefined(); expect(resolve.loadbalancer()).toEqual(item); diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/batch-actions.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/batch-actions.service.spec.js index cea20ba9..c83d036f 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/batch-actions.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/batch-actions.service.spec.js @@ -42,7 +42,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.spec.js index 6a47d17f..372d7b6a 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/delete/delete.action.service.spec.js @@ -51,7 +51,7 @@ }); beforeEach(module(function($provide) { - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: makePromise() diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/disassociate-ip/modal.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/disassociate-ip/modal.service.spec.js index 772d7d53..8c07d3b9 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/disassociate-ip/modal.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/disassociate-ip/modal.service.spec.js @@ -50,7 +50,7 @@ func(); } }; - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: fakePromise diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/row-actions.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/row-actions.service.spec.js index 8211f19f..8cb06567 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/row-actions.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/actions/row-actions.service.spec.js @@ -56,7 +56,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/detail.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/detail.controller.spec.js index fabd8d92..71924939 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/detail.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/detail.controller.spec.js @@ -36,7 +36,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', {}); + $provide.value('$uibModal', {}); })); beforeEach(inject(function($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/table.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/table.controller.spec.js index 57ebc15b..933f6c0f 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/table.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/loadbalancers/table.controller.spec.js @@ -42,7 +42,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', {}); + $provide.value('$uibModal', {}); })); beforeEach(inject(function($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/batch-actions.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/batch-actions.service.spec.js index 2aea65e8..110582d0 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/batch-actions.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/batch-actions.service.spec.js @@ -42,7 +42,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.js index f09e5f8e..ec08f0e8 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.js @@ -21,10 +21,10 @@ .controller('EditWeightModalController', EditWeightModalController); EditWeightModalController.$inject = [ - '$modalInstance', + '$uibModalInstance', 'horizon.app.core.openstack-service-api.lbaasv2', 'horizon.framework.util.i18n.gettext', - // Dependencies injected with resolve by $modal.open + // Dependencies injected with resolve by $uibModal.open 'poolId', 'member' ]; @@ -35,7 +35,7 @@ * @description * Controller used by the modal service for editing the weight of a pool member. * - * @param $modalInstance The angular bootstrap $modalInstance service. + * @param $uibModalInstance The angular bootstrap $uibModalInstance service. * @param api The LBaaS v2 API service. * @param gettext The horizon gettext function for translation. * @param poolId The pool ID. @@ -44,7 +44,7 @@ * @returns The Edit Weight modal controller. */ - function EditWeightModalController($modalInstance, api, gettext, poolId, member) { + function EditWeightModalController($uibModalInstance, api, gettext, poolId, member) { var ctrl = this; ctrl.weight = member.weight; @@ -60,11 +60,11 @@ } function cancel() { - $modalInstance.dismiss('cancel'); + $uibModalInstance.dismiss('cancel'); } function onSuccess() { - $modalInstance.close(); + $uibModalInstance.close(); } function onFailure() { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.spec.js index 7f8c72c1..7395e31a 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.controller.spec.js @@ -17,7 +17,7 @@ 'use strict'; describe('LBaaS v2 Member Edit Weight Controller', function() { - var ctrl, api, $controller, $modalInstance, $scope, $q; + var ctrl, api, $controller, $uibModalInstance, $scope, $q; var fail = false; function makePromise(reject) { @@ -30,7 +30,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modalInstance', { + $provide.value('$uibModalInstance', { close: angular.noop, dismiss: angular.noop }); @@ -49,7 +49,7 @@ beforeEach(inject(function ($injector) { api = $injector.get('horizon.app.core.openstack-service-api.lbaasv2'); $controller = $injector.get('$controller'); - $modalInstance = $injector.get('$modalInstance'); + $uibModalInstance = $injector.get('$uibModalInstance'); $scope = $injector.get('$rootScope').$new(); $q = $injector.get('$q'); ctrl = $controller('EditWeightModalController'); @@ -65,26 +65,26 @@ it('should edit member weight', function() { spyOn(api, 'editMember').and.callThrough(); - spyOn($modalInstance, 'close'); + spyOn($uibModalInstance, 'close'); ctrl.save(); $scope.$apply(); expect(ctrl.saving).toBe(true); expect(api.editMember).toHaveBeenCalledWith('pool1', 'member1', { weight: 1 }); - expect($modalInstance.close).toHaveBeenCalled(); + expect($uibModalInstance.close).toHaveBeenCalled(); }); it('should dismiss modal if cancel clicked', function() { - spyOn($modalInstance, 'dismiss'); + spyOn($uibModalInstance, 'dismiss'); ctrl.cancel(); - expect($modalInstance.dismiss).toHaveBeenCalledWith('cancel'); + expect($uibModalInstance.dismiss).toHaveBeenCalledWith('cancel'); }); it('should not dismiss modal if save fails', function() { fail = true; - spyOn($modalInstance, 'dismiss'); + spyOn($uibModalInstance, 'dismiss'); ctrl.save(); $scope.$apply(); - expect($modalInstance.dismiss).not.toHaveBeenCalled(); + expect($uibModalInstance.dismiss).not.toHaveBeenCalled(); expect(ctrl.saving).toBe(false); }); diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.js index 3f67a81e..32396dbb 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.js @@ -23,7 +23,7 @@ modalService.$inject = [ '$q', - '$modal', + '$uibModal', '$route', 'horizon.dashboard.project.lbaasv2.basePath', 'horizon.app.core.openstack-service-api.policy', @@ -39,7 +39,7 @@ * Provides the service for the pool member Edit Weight action. * * @param $q The angular service for promises. - * @param $modal The angular bootstrap $modal service. + * @param $uibModal The angular bootstrap $uibModal service. * @param $route The angular $route service. * @param basePath The LBaaS v2 module base path. * @param policy The horizon policy service. @@ -51,7 +51,7 @@ function modalService( $q, - $modal, + $uibModal, $route, basePath, policy, @@ -110,7 +110,7 @@ } } }; - $modal.open(spec).result.then(onModalClose); + $uibModal.open(spec).result.then(onModalClose); } function onModalClose() { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.spec.js index dd74a945..11bdf764 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/edit-weight/modal.service.spec.js @@ -17,7 +17,7 @@ 'use strict'; describe('LBaaS v2 Member Edit Weight Service', function() { - var service, policy, $scope, $route, $modal, toast; + var service, policy, $scope, $route, $uibModal, toast; var member = { id: 'member1' }; var fakePromise = function(response) { @@ -49,7 +49,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: fakePromise() @@ -63,7 +63,7 @@ toast = $injector.get('horizon.framework.widgets.toast.service'); $scope = $injector.get('$rootScope').$new(); $route = $injector.get('$route'); - $modal = $injector.get('$modal'); + $uibModal = $injector.get('$uibModal'); service = $injector.get( 'horizon.dashboard.project.lbaasv2.members.actions.edit-weight.modal.service'); service.init('pool1', fakePromise()); @@ -79,18 +79,18 @@ }); it('should open the modal', function() { - spyOn($modal, 'open').and.callThrough(); + spyOn($uibModal, 'open').and.callThrough(); service.perform(member); $scope.$apply(); - expect($modal.open.calls.count()).toBe(1); + expect($uibModal.open.calls.count()).toBe(1); }); it('should resolve data for passing into the modal', function() { - spyOn($modal, 'open').and.callThrough(); + spyOn($uibModal, 'open').and.callThrough(); service.perform(member); $scope.$apply(); - var resolve = $modal.open.calls.argsFor(0)[0].resolve; + var resolve = $uibModal.open.calls.argsFor(0)[0].resolve; expect(resolve).toBeDefined(); expect(resolve.poolId()).toBe('pool1'); expect(resolve.member()).toBe(member); diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/update-list/update-member-list.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/update-list/update-member-list.service.spec.js index 2bee91ee..effe9e91 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/update-list/update-member-list.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/actions/update-list/update-member-list.service.spec.js @@ -56,7 +56,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/detail.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/detail.controller.spec.js index ca4e17d1..9577b3c8 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/detail.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/detail.controller.spec.js @@ -48,7 +48,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', {}); + $provide.value('$uibModal', {}); $provide.value('horizon.dashboard.project.lbaasv2.members.actions.rowActions', { init: function() { return { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/table.controller.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/table.controller.spec.js index 4f3e3e81..f93976e3 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/table.controller.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/members/table.controller.spec.js @@ -42,7 +42,7 @@ beforeEach(module('horizon.dashboard.project.lbaasv2')); beforeEach(module(function($provide) { - $provide.value('$modal', {}); + $provide.value('$uibModal', {}); })); beforeEach(inject(function($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/create/create.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/create/create.action.service.spec.js index f31db715..f12a07d3 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/create/create.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/create/create.action.service.spec.js @@ -56,7 +56,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/delete/delete.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/delete/delete.action.service.spec.js index 7aefe728..b9115f35 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/delete/delete.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/delete/delete.action.service.spec.js @@ -58,7 +58,7 @@ }); beforeEach(module(function($provide) { - $provide.value('$modal', { + $provide.value('$uibModal', { open: function() { return { result: makePromise() diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/edit/edit.action.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/edit/edit.action.service.spec.js index 1f6c3565..66fceaa4 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/edit/edit.action.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/pools/actions/edit/edit.action.service.spec.js @@ -56,7 +56,7 @@ }; } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js index ccbe37d8..b8838d03 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.js @@ -21,7 +21,7 @@ .factory('horizon.dashboard.project.lbaasv2.workflow.modal', modalService); modalService.$inject = [ - '$modal', + '$uibModal', 'horizon.framework.widgets.toast.service' ]; @@ -32,12 +32,12 @@ * @description * Provides the service for opening the LBaaS create / edit modal. * - * @param $modal The angular bootstrap $modal service. + * @param $uibModal The angular bootstrap $uibModal service. * @param toastService The horizon toast service. * @returns The modal service for the LBaaS workflow. */ - function modalService($modal, toastService) { + function modalService($uibModal, toastService) { var service = { init: init @@ -93,7 +93,7 @@ } } }; - $modal.open(spec).result.then(onModalClose); + $uibModal.open(spec).result.then(onModalClose); } function onModalClose(response) { diff --git a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.spec.js b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.spec.js index 0a624517..a9a64809 100644 --- a/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.spec.js +++ b/neutron_lbaas_dashboard/static/dashboard/project/lbaasv2/workflow/modal.service.spec.js @@ -42,7 +42,7 @@ } }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function ($injector) {