From c89633c9b0b105c89f5fcd33e5672cf4f839b46f Mon Sep 17 00:00:00 2001 From: Rob Cresswell Date: Wed, 23 Nov 2016 12:34:39 +0000 Subject: [PATCH] Update for ui bootstrap changes UI Bootstrap decided to prefix all of their services/functions, so we need to add these prefixes for the code to continue to function. This patch primarily addresses functionality - some styling is broken even with this patch, but those breakages can be fixed once this patch lands. Change-Id: Ia6f593e27f81b2b00b6376426cc469a776c4add7 Depends-On: I7d8ebd4e9018332c1974672a0b99080c152ce6c3 --- .../util/actions/action-result.service.js | 2 +- .../widgets/form/modal-form.controller.js | 8 ++--- .../form/modal-form.controller.spec.js | 2 +- .../widgets/form/modal-form.service.js | 6 ++-- .../widgets/form/modal-form.service.spec.js | 10 +++--- .../modal-wait-spinner.service.js | 6 ++-- .../modal-wait-spinner.spec.js | 14 ++++---- .../widgets/modal/simple-modal.controller.js | 8 ++--- .../widgets/modal/simple-modal.service.js | 8 ++--- .../widgets/modal/simple-modal.spec.js | 4 +-- .../widgets/modal/wizard-modal.service.js | 6 ++-- .../modal/wizard-modal.service.spec.js | 2 +- .../widgets/modal/wizard.controller.js | 8 ++--- .../widgets/modal/wizard.controller.spec.js | 4 +-- .../wizard/modal-container.controller.js | 8 ++--- .../framework/widgets/wizard/wizard.spec.js | 2 +- horizon/static/horizon/js/horizon.tables.js | 6 ++-- .../theme-preview/theme-preview.directive.js | 6 ++-- .../project/containers/containers.html | 12 +++---- .../containers/delete-objects-modal.html | 4 +-- .../containers/delete-objects.controller.js | 8 ++--- .../delete-objects.controller.spec.js | 16 ++++----- .../objects-batch-actions.service.js | 22 ++++++------ .../objects-batch-actions.service.spec.js | 36 +++++++++---------- .../containers/objects-row-actions.service.js | 18 +++++----- .../objects-row-actions.service.spec.js | 26 +++++++------- .../keypair/create-keypair.controller.js | 10 +++--- .../keypair/create-keypair.controller.spec.js | 2 +- .../keypair/import-keypair.controller.js | 11 +++--- .../keypair/import-keypair.controller.spec.js | 2 +- .../keypair/keypair.controller.js | 10 +++--- .../keypair/keypair.controller.spec.js | 22 ++++++------ .../launch-instance-modal.service.js | 6 ++-- .../launch-instance-modal.service.spec.js | 4 +-- .../launch-instance/source/source.html | 6 ++-- .../steps/create-image/create-image.html | 10 +++--- .../images/steps/edit-image/edit-image.html | 4 +-- .../core/metadata/modal/modal.controller.js | 10 +++--- .../metadata/modal/modal.controller.spec.js | 2 +- .../app/core/metadata/modal/modal.service.js | 6 ++-- .../core/metadata/modal/modal.service.spec.js | 12 +++---- 41 files changed, 185 insertions(+), 184 deletions(-) diff --git a/horizon/static/framework/util/actions/action-result.service.js b/horizon/static/framework/util/actions/action-result.service.js index eb89e15697..9184c406e6 100644 --- a/horizon/static/framework/util/actions/action-result.service.js +++ b/horizon/static/framework/util/actions/action-result.service.js @@ -61,7 +61,7 @@ * perform()'s final promise: * ``` * function performUpdate(item) { - * $modal.open(updateDialog).result.then(function result() { + * $uibModal.open(updateDialog).result.then(function result() { * return actionResult.updated('OS::Glance::Image', item.id).result; * }); * } diff --git a/horizon/static/framework/widgets/form/modal-form.controller.js b/horizon/static/framework/widgets/form/modal-form.controller.js index 14c8aff38e..04a5884db2 100644 --- a/horizon/static/framework/widgets/form/modal-form.controller.js +++ b/horizon/static/framework/widgets/form/modal-form.controller.js @@ -36,11 +36,11 @@ .controller('horizon.framework.widgets.form.ModalFormController', controller); controller.$inject = [ - '$modalInstance', + '$uibModalInstance', 'context' ]; - function controller($modalInstance, context) { + function controller($uibModalInstance, context) { var ctrl = this; ctrl.formTitle = context.title; ctrl.form = context.form; @@ -52,11 +52,11 @@ ctrl.cancel = cancel; function submit() { - return $modalInstance.close(context); + return $uibModalInstance.close(context); } function cancel() { - return $modalInstance.dismiss(context); + return $uibModalInstance.dismiss(context); } return ctrl; diff --git a/horizon/static/framework/widgets/form/modal-form.controller.spec.js b/horizon/static/framework/widgets/form/modal-form.controller.spec.js index 09884e0fce..ff5afde17f 100644 --- a/horizon/static/framework/widgets/form/modal-form.controller.spec.js +++ b/horizon/static/framework/widgets/form/modal-form.controller.spec.js @@ -35,7 +35,7 @@ ctrl = $controller( 'horizon.framework.widgets.form.ModalFormController', { - $modalInstance: modalInstance, + $uibModalInstance: modalInstance, context: context }); })); diff --git a/horizon/static/framework/widgets/form/modal-form.service.js b/horizon/static/framework/widgets/form/modal-form.service.js index 71e88f3864..2e2d245081 100644 --- a/horizon/static/framework/widgets/form/modal-form.service.js +++ b/horizon/static/framework/widgets/form/modal-form.service.js @@ -23,7 +23,7 @@ .factory('horizon.framework.widgets.form.ModalFormService', service); service.$inject = [ - '$modal', + '$uibModal', 'horizon.framework.widgets.basePath' ]; @@ -35,7 +35,7 @@ * Loads a Schema-Form (see modal-form.html) in a modal and returns the modal result promise. */ function service( - $modal, + $uibModal, widgetsBasePath ) { @@ -66,7 +66,7 @@ templateUrl: widgetsBasePath + 'form/modal-form.html' }; - return $modal.open(modalConfig).result; + return $uibModal.open(modalConfig).result; } } })(); diff --git a/horizon/static/framework/widgets/form/modal-form.service.spec.js b/horizon/static/framework/widgets/form/modal-form.service.spec.js index f001c411b8..04d65ced46 100644 --- a/horizon/static/framework/widgets/form/modal-form.service.spec.js +++ b/horizon/static/framework/widgets/form/modal-form.service.spec.js @@ -17,20 +17,20 @@ 'use strict'; describe('modal-form service', function () { - var service, $modal; + var service, $uibModal; beforeEach(module('horizon.framework.widgets')); beforeEach(module('horizon.framework.widgets.form')); - beforeEach(inject(function ($injector, _$modal_) { - $modal = _$modal_; + beforeEach(inject(function ($injector, _$uibModal_) { + $uibModal = _$uibModal_; service = $injector.get( 'horizon.framework.widgets.form.ModalFormService' ); })); it('sets open parameters to modal resolve.context', function() { - spyOn($modal, 'open').and.callFake(function(config) { + spyOn($uibModal, 'open').and.callFake(function(config) { return { result: config }; @@ -54,7 +54,7 @@ }); it('sets default values for optional parameters', function() { - spyOn($modal, 'open').and.callFake(function(config) { + spyOn($uibModal, 'open').and.callFake(function(config) { return { result: config }; diff --git a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.service.js b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.service.js index 00c0b10195..83bd358458 100644 --- a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.service.js +++ b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.service.js @@ -19,7 +19,7 @@ .module('horizon.framework.widgets.modal-wait-spinner') .factory('horizon.framework.widgets.modal-wait-spinner.service', WaitSpinnerService); - WaitSpinnerService.$inject = ['$modal']; + WaitSpinnerService.$inject = ['$uibModal']; /* * @ngdoc factory @@ -32,7 +32,7 @@ * Over time, uses of the existing Horizon spinner ( horizon.modals.modal_spinner() ) * can be phased out, or refactored to use this component. */ - function WaitSpinnerService ($modal) { + function WaitSpinnerService ($uibModal) { var spinner = this; var service = { showModalSpinner: showModalSpinner, @@ -54,7 +54,7 @@ template: '', windowClass: 'modal-wait-spinner modal_wrapper loading' }; - spinner.modalInstance = $modal.open(modalOptions); + spinner.modalInstance = $uibModal.open(modalOptions); } function hideModalSpinner() { diff --git a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js index 3401343a79..aaa432d344 100644 --- a/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js +++ b/horizon/static/framework/widgets/modal-wait-spinner/modal-wait-spinner.spec.js @@ -36,16 +36,16 @@ expect(service.showModalSpinner).toBeDefined(); }); - it('opens modal with the correct object', inject(function($modal) { + it('opens modal with the correct object', inject(function($uibModal) { var wanted = { backdrop: 'static', template: '', windowClass: 'modal-wait-spinner modal_wrapper loading' }; - spyOn($modal, 'open'); + spyOn($uibModal, 'open'); service.showModalSpinner('my text'); - expect($modal.open).toHaveBeenCalled(); - expect($modal.open.calls.count()).toBe(1); - expect($modal.open.calls.argsFor(0)).toEqual([wanted]); + expect($uibModal.open).toHaveBeenCalled(); + expect($uibModal.open.calls.count()).toBe(1); + expect($uibModal.open.calls.argsFor(0)).toEqual([wanted]); })); }); @@ -56,9 +56,9 @@ expect(service.hideModalSpinner).toBeDefined(); }); - it("dismisses modal when it has been opened", inject(function($modal) { + it("dismisses modal when it has been opened", inject(function($uibModal) { var modal = {dismiss: function() {}}; - spyOn($modal, 'open').and.returnValue(modal); + spyOn($uibModal, 'open').and.returnValue(modal); service.showModalSpinner('asdf'); spyOn(modal, 'dismiss'); service.hideModalSpinner(); diff --git a/horizon/static/framework/widgets/modal/simple-modal.controller.js b/horizon/static/framework/widgets/modal/simple-modal.controller.js index 3e6639be99..e311b073b7 100644 --- a/horizon/static/framework/widgets/modal/simple-modal.controller.js +++ b/horizon/static/framework/widgets/modal/simple-modal.controller.js @@ -37,18 +37,18 @@ .controller('SimpleModalController', SimpleModalController); SimpleModalController.$inject = [ - '$modalInstance', + '$uibModalInstance', 'context' ]; - function SimpleModalController($modalInstance, context) { + function SimpleModalController($uibModalInstance, context) { var ctrl = this; ctrl.context = context; ctrl.submit = function() { - $modalInstance.close(); + $uibModalInstance.close(); }; ctrl.cancel = function() { - $modalInstance.dismiss('cancel'); + $uibModalInstance.dismiss('cancel'); }; } // end of function diff --git a/horizon/static/framework/widgets/modal/simple-modal.service.js b/horizon/static/framework/widgets/modal/simple-modal.service.js index 67c9df2f7f..c158f017fb 100644 --- a/horizon/static/framework/widgets/modal/simple-modal.service.js +++ b/horizon/static/framework/widgets/modal/simple-modal.service.js @@ -25,7 +25,7 @@ * Horizon's wrapper for angular-bootstrap modal service. * It should only be use for small confirmation dialogs. * @param {object} the object containing title, body, submit, and cancel labels - * @param {object} the object returned from angular-bootstrap $modal + * @param {object} the object returned from angular-bootstrap $uibModal * * @example: * angular @@ -55,12 +55,12 @@ .factory('horizon.framework.widgets.modal.simple-modal.service', modalService); modalService.$inject = [ - '$modal', + '$uibModal', 'horizon.framework.widgets.basePath', 'horizon.framework.util.i18n.gettext' ]; - function modalService($modal, path, gettext) { + function modalService($uibModal, path, gettext) { var service = { modal: modal }; @@ -84,7 +84,7 @@ } } }; - return $modal.open(options); + return $uibModal.open(options); } } // end of modalOptions function } // end of modalService function diff --git a/horizon/static/framework/widgets/modal/simple-modal.spec.js b/horizon/static/framework/widgets/modal/simple-modal.spec.js index 59f0579e59..2f6e8c61cd 100644 --- a/horizon/static/framework/widgets/modal/simple-modal.spec.js +++ b/horizon/static/framework/widgets/modal/simple-modal.spec.js @@ -32,7 +32,7 @@ }; context = { what: 'is it' }; ctrl = $controller('SimpleModalController', - {$modalInstance: modalInstance, + {$uibModalInstance: modalInstance, context: context}); })); @@ -73,7 +73,7 @@ modal = { open: function() { return 'val'; }}; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function($injector) { diff --git a/horizon/static/framework/widgets/modal/wizard-modal.service.js b/horizon/static/framework/widgets/modal/wizard-modal.service.js index 56c8372ee7..35ac8c9344 100644 --- a/horizon/static/framework/widgets/modal/wizard-modal.service.js +++ b/horizon/static/framework/widgets/modal/wizard-modal.service.js @@ -48,10 +48,10 @@ WizardModalService.$inject = [ '$log', - '$modal' + '$uibModal' ]; - function WizardModalService($log, $modal) { + function WizardModalService($log, $uibModal) { var service = { modal: modal }; @@ -88,7 +88,7 @@ options.scope = params.scope; } - return $modal.open(options); + return $uibModal.open(options); } } } diff --git a/horizon/static/framework/widgets/modal/wizard-modal.service.spec.js b/horizon/static/framework/widgets/modal/wizard-modal.service.spec.js index 07ed69540d..920fe7e8e5 100644 --- a/horizon/static/framework/widgets/modal/wizard-modal.service.spec.js +++ b/horizon/static/framework/widgets/modal/wizard-modal.service.spec.js @@ -23,7 +23,7 @@ modal = { open: function() {} }; - $provide.value('$modal', modal); + $provide.value('$uibModal', modal); })); beforeEach(inject(function($injector, _$rootScope_) { diff --git a/horizon/static/framework/widgets/modal/wizard.controller.js b/horizon/static/framework/widgets/modal/wizard.controller.js index bf38d76e13..aeea96e4f3 100644 --- a/horizon/static/framework/widgets/modal/wizard.controller.js +++ b/horizon/static/framework/widgets/modal/wizard.controller.js @@ -22,7 +22,7 @@ .controller('WizardModalController', WizardModalController); WizardModalController.$inject = [ - '$modalInstance', + '$uibModalInstance', '$scope', 'workflow', // WizardModalService injected 'submit', // WizardModalService injected @@ -39,7 +39,7 @@ * This controller sets the modal actions and workflow on the given scope * as the Wizard needs them defined on the scope. */ - function WizardModalController($modalInstance, $scope, workflow, submit, data) { + function WizardModalController($uibModalInstance, $scope, workflow, submit, data) { /* eslint-disable angular/controller-as */ $scope.close = close; @@ -54,11 +54,11 @@ /* eslint-enable angular/controller-as */ function close(args) { - $modalInstance.close(args); + $uibModalInstance.close(args); } function cancel() { - $modalInstance.dismiss('cancel'); + $uibModalInstance.dismiss('cancel'); } } diff --git a/horizon/static/framework/widgets/modal/wizard.controller.spec.js b/horizon/static/framework/widgets/modal/wizard.controller.spec.js index 2ad0fa7a1e..04d6ccd885 100644 --- a/horizon/static/framework/widgets/modal/wizard.controller.spec.js +++ b/horizon/static/framework/widgets/modal/wizard.controller.spec.js @@ -21,7 +21,7 @@ describe(wizardCtrl, function() { var modalCalls = [ 'close', 'dismiss' ]; - var modalInstance = jasmine.createSpyObj('$modalInstance', modalCalls); + var modalInstance = jasmine.createSpyObj('$uibModalInstance', modalCalls); var scope; @@ -31,7 +31,7 @@ beforeEach(inject(function($controller, $rootScope) { scope = $rootScope.$new(); $controller(wizardCtrl, { - $modalInstance: modalInstance, + $uibModalInstance: modalInstance, $scope: scope, workflow: { steps: 'somestep' }, submit: { api: 'someapi' }, diff --git a/horizon/static/framework/widgets/wizard/modal-container.controller.js b/horizon/static/framework/widgets/wizard/modal-container.controller.js index 174fc1901a..00b6b3d095 100644 --- a/horizon/static/framework/widgets/wizard/modal-container.controller.js +++ b/horizon/static/framework/widgets/wizard/modal-container.controller.js @@ -21,7 +21,7 @@ .module('horizon.framework.widgets.wizard') .controller('ModalContainerController', ModalContainerController); - ModalContainerController.$inject = ['$scope', '$modalInstance', 'launchContext']; + ModalContainerController.$inject = ['$scope', '$uibModalInstance', 'launchContext']; /** * @ngdoc controller @@ -29,16 +29,16 @@ * @description * Extends the bootstrap-ui modal widget */ - function ModalContainerController($scope, $modalInstance, launchContext) { + function ModalContainerController($scope, $uibModalInstance, launchContext) { // $scope is used because the methods are shared between // wizard and modal-container controller /*eslint-disable angular/controller-as */ $scope.launchContext = launchContext; $scope.close = function(args) { - $modalInstance.close(args); + $uibModalInstance.close(args); }; $scope.cancel = function() { - $modalInstance.dismiss(); + $uibModalInstance.dismiss(); }; /*eslint-enable angular/controller-as */ } diff --git a/horizon/static/framework/widgets/wizard/wizard.spec.js b/horizon/static/framework/widgets/wizard/wizard.spec.js index 7320ff5276..b329df4450 100644 --- a/horizon/static/framework/widgets/wizard/wizard.spec.js +++ b/horizon/static/framework/widgets/wizard/wizard.spec.js @@ -250,7 +250,7 @@ modalInstance = { close: angular.noop, dismiss: angular.noop }; launchContext = { my: 'data' }; ctrl = $controller('ModalContainerController', - { $scope: scope, $modalInstance: modalInstance, + { $scope: scope, $uibModalInstance: modalInstance, launchContext: launchContext }); })); diff --git a/horizon/static/horizon/js/horizon.tables.js b/horizon/static/horizon/js/horizon.tables.js index 3623c68058..611acb37e1 100644 --- a/horizon/static/horizon/js/horizon.tables.js +++ b/horizon/static/horizon/js/horizon.tables.js @@ -246,7 +246,7 @@ horizon.datatables.confirm = function(action) { return; } - var $modal_parent = $action.closest('.modal'); + var $uibModal_parent = $action.closest('.modal'); var name_array = []; var action_string = $action.text(); var help_text = $action.attr("help_text") || ""; @@ -300,10 +300,10 @@ horizon.datatables.confirm = function(action) { var modal = horizon.modals.create(title, body, action_string); modal.modal(); - if ($modal_parent.length) { + if ($uibModal_parent.length) { var child_backdrop = modal.next('.modal-backdrop'); // re-arrange z-index for these stacking modal - child_backdrop.css('z-index', $modal_parent.css('z-index')+10); + child_backdrop.css('z-index', $uibModal_parent.css('z-index')+10); modal.css('z-index', child_backdrop.css('z-index')+10); } diff --git a/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js b/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js index 74550b9978..a46531c102 100644 --- a/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js +++ b/openstack_dashboard/contrib/developer/static/dashboard/developer/theme-preview/theme-preview.directive.js @@ -47,8 +47,8 @@ e.preventDefault(); }); - var $modal = $('#source-modal'); - var $pre = $modal.find('pre'); + var $uibModal = $('#source-modal'); + var $pre = $uibModal.find('pre'); var $button = $('
') .click(function(){ @@ -65,7 +65,7 @@ $fragment = stripChart($fragment); var html = cleanSource($fragment.html()); $pre.text(unescapeHtml(html)); - $modal.modal(); + $uibModal.modal(); }); var $component = $('.bs-component'); diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/containers/containers.html b/openstack_dashboard/dashboards/project/static/dashboard/project/containers/containers.html index 90764a6806..d146dae938 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/containers/containers.html +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/containers/containers.html @@ -11,11 +11,11 @@
- - +
- +
-
+
@@ -62,8 +62,8 @@ - - +
+
diff --git a/openstack_dashboard/dashboards/project/static/dashboard/project/containers/delete-objects-modal.html b/openstack_dashboard/dashboards/project/static/dashboard/project/containers/delete-objects-modal.html index d62dacce05..5c217ba282 100644 --- a/openstack_dashboard/dashboards/project/static/dashboard/project/containers/delete-objects-modal.html +++ b/openstack_dashboard/dashboards/project/static/dashboard/project/containers/delete-objects-modal.html @@ -22,9 +22,9 @@ class="text-danger" translate> Encountered {$ ctrl.model.deleted.failures $} failures.

- + value="ctrl.model.deleted.files + ctrl.model.deleted.folders + ctrl.model.deleted.failures">
@@ -46,7 +46,7 @@ + uib-btn-radio="option.value">{$ ::option.label $} @@ -85,7 +85,7 @@ + uib-btn-radio="option.value">{$ ::option.label $} diff --git a/openstack_dashboard/static/app/core/images/steps/create-image/create-image.html b/openstack_dashboard/static/app/core/images/steps/create-image/create-image.html index b150844bfc..2208c3ecac 100644 --- a/openstack_dashboard/static/app/core/images/steps/create-image/create-image.html +++ b/openstack_dashboard/static/app/core/images/steps/create-image/create-image.html @@ -62,7 +62,7 @@ + uib-btn-radio="option.value">{$ ::option.label $} @@ -84,7 +84,7 @@
- + {$ ctrl.uploadProgress $}%

{$ ::option.label $} + uib-btn-radio="option.value">{$ ::option.label $} @@ -234,7 +234,7 @@ + uib-btn-radio="option.value">{$ ::option.label $} @@ -249,7 +249,7 @@ + uib-btn-radio="option.value">{$ ::option.label $} diff --git a/openstack_dashboard/static/app/core/images/steps/edit-image/edit-image.html b/openstack_dashboard/static/app/core/images/steps/edit-image/edit-image.html index 348dd2261b..9949bcd264 100644 --- a/openstack_dashboard/static/app/core/images/steps/edit-image/edit-image.html +++ b/openstack_dashboard/static/app/core/images/steps/edit-image/edit-image.html @@ -123,7 +123,7 @@ + uib-btn-radio="option.value">{$ ::option.label $} @@ -136,7 +136,7 @@ + uib-btn-radio="option.value">{$ ::option.label $} diff --git a/openstack_dashboard/static/app/core/metadata/modal/modal.controller.js b/openstack_dashboard/static/app/core/metadata/modal/modal.controller.js index 83fa1c2e27..4816166e35 100644 --- a/openstack_dashboard/static/app/core/metadata/modal/modal.controller.js +++ b/openstack_dashboard/static/app/core/metadata/modal/modal.controller.js @@ -22,11 +22,11 @@ .controller('MetadataModalController', MetadataModalController); MetadataModalController.$inject = [ - '$modalInstance', + '$uibModalInstance', 'horizon.app.core.metadata.service', 'horizon.framework.widgets.metadata.tree.service', 'horizon.framework.widgets.toast.service', - // Dependencies injected with resolve by $modal.open + // Dependencies injected with resolve by $uibModal.open 'available', 'existing', 'params' @@ -39,7 +39,7 @@ * Controller used by `ModalService` */ function MetadataModalController( - $modalInstance, metadataService, metadataTreeService, + $uibModalInstance, metadataService, metadataTreeService, toastService, available, existing, params ) { var ctrl = this; @@ -77,12 +77,12 @@ } function cancel() { - $modalInstance.dismiss('cancel'); + $uibModalInstance.dismiss('cancel'); } function onEditSuccess() { toastService.add('success', gettext('Metadata was successfully updated.')); - $modalInstance.close(); + $uibModalInstance.close(); } function onEditFailure() { diff --git a/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js b/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js index 790e879f2c..24c89e97b6 100644 --- a/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js +++ b/openstack_dashboard/static/app/core/metadata/modal/modal.controller.spec.js @@ -112,7 +112,7 @@ function createController() { //Purposely use different cases in available and existing. return $controller('MetadataModalController', { - '$modalInstance': modalInstance, + '$uibModalInstance': modalInstance, 'horizon.framework.widgets.metadata.tree.service': treeService, 'horizon.app.core.metadata.service': metadataService, 'available': {data: {items: [availableItem]}}, diff --git a/openstack_dashboard/static/app/core/metadata/modal/modal.service.js b/openstack_dashboard/static/app/core/metadata/modal/modal.service.js index 928228a2fa..f376f50487 100644 --- a/openstack_dashboard/static/app/core/metadata/modal/modal.service.js +++ b/openstack_dashboard/static/app/core/metadata/modal/modal.service.js @@ -21,7 +21,7 @@ .factory('horizon.app.core.metadata.modal.service', modalService); modalService.$inject = [ - '$modal', + '$uibModal', 'horizon.app.core.basePath', 'horizon.app.core.metadata.service', 'horizon.app.core.metadata.modal.constants' @@ -31,7 +31,7 @@ * @ngdoc service * @name modalService */ - function modalService($modal, path, metadataService, modalConstants) { + function modalService($uibModal, path, metadataService, modalConstants) { var service = { open: open }; @@ -66,7 +66,7 @@ resolve: resolve, templateUrl: path + 'metadata/modal/modal.html' }; - return $modal.open(angular.extend(modalParams, modalConstants)); + return $uibModal.open(angular.extend(modalParams, modalConstants)); } } diff --git a/openstack_dashboard/static/app/core/metadata/modal/modal.service.spec.js b/openstack_dashboard/static/app/core/metadata/modal/modal.service.spec.js index d751b32f45..4344e7a0d2 100644 --- a/openstack_dashboard/static/app/core/metadata/modal/modal.service.spec.js +++ b/openstack_dashboard/static/app/core/metadata/modal/modal.service.spec.js @@ -19,12 +19,12 @@ describe('horizon.app.core.metadata.modal', function() { describe('service.modalservice', function() { - var modalService, metadataService, $modal; + var modalService, metadataService, $uibModal; beforeEach(module('ui.bootstrap', function($provide) { - $modal = jasmine.createSpyObj('$modal', ['open']); + $uibModal = jasmine.createSpyObj('$uibModal', ['open']); - $provide.value('$modal', $modal); + $provide.value('$uibModal', $uibModal); })); beforeEach(module('horizon.app.core', function($provide) { @@ -46,12 +46,12 @@ expect(modalService.open).toBeDefined(); }); - it('should invoke $modal.open with correct params', function() { + it('should invoke $uibModal.open with correct params', function() { modalService.open('resource', 'id'); - expect($modal.open).toHaveBeenCalled(); + expect($uibModal.open).toHaveBeenCalled(); - var args = $modal.open.calls.argsFor(0)[0]; + var args = $uibModal.open.calls.argsFor(0)[0]; expect(args.templateUrl).toEqual('/a/sample/path/metadata/modal/modal.html'); expect(args.resolve.params()).toEqual({resource: 'resource', id: 'id'}); });