Update $modal to $uibModal

Due to updating XStatic-Angular-Bootstrap to 2.2.0.0,
$modal is deprecated, so we need to use $uibModal.
This patch updates $modal to $uibModal.

Change-Id: I3c0881eb740ad97dfd1b450966e72db99b489b9c
Closes-Bug: #1651054
This commit is contained in:
Shu Muto 2016-12-19 16:42:24 +09:00
parent 387dad0af1
commit c5dacdb58a
2 changed files with 8 additions and 9 deletions

View File

@ -27,7 +27,7 @@
signCertificateService);
signCertificateService.$inject = [
'$modal',
'$uibModal',
'horizon.app.core.openstack-service-api.magnum',
'horizon.framework.util.actions.action-result.service',
'horizon.framework.util.i18n.gettext',
@ -39,7 +39,7 @@
];
function signCertificateService(
$modal, magnum, actionResult, gettext, $qExtensions, toast, basePath, resourceType, model
$uibModal, magnum, actionResult, gettext, $qExtensions, toast, basePath, resourceType, model
) {
var message = {
@ -59,19 +59,18 @@
function initAction() {
}
function signCertificateModal(html, $modal) {
function signCertificateModal() {
var localSpec = {
backdrop: 'static',
controller: 'horizon.dashboard.container-infra.clusters.signCertificateController as ctrl',
templateUrl: html
templateUrl: basePath + 'sign-certificate/sign-certificate-modal.html'
};
return $modal.open(localSpec).result;
return $uibModal.open(localSpec).result;
}
function perform(selected) {
model.init(selected.id);
return signCertificateModal(basePath + 'sign-certificate/sign-certificate-modal.html', $modal)
.then(submit);
return signCertificateModal().then(submit);
}
function allowed() {

View File

@ -40,7 +40,7 @@
beforeEach(module('horizon.framework'));
beforeEach(module('horizon.dashboard.container-infra.clusters'));
beforeEach(inject(function($injector, _$rootScope_, _$q_, $modal) {
beforeEach(inject(function($injector, _$rootScope_, _$q_, $uibModal) {
$q = _$q_;
service = $injector.get(
'horizon.dashboard.container-infra.clusters.sign-certificate.service');
@ -54,7 +54,7 @@
fakeDeferred.resolve(fakesignCertificate);
spyOn(model, 'signCertificate').and.returnValue(fakeDeferred.promise);
spyOn($modal, 'open').and.returnValue(fakeModal);
spyOn($uibModal, 'open').and.returnValue(fakeModal);
}));
it('should pass allow()', function() {