Fix JS error on routed-details-view when execute show-certificate

This fixes error on routed-details view when execute Show Certificate action
from details view.

Change-Id: Ic27ee6d77c98d255a20c7f3a028246af4ce346f7
Closes-Bug: #1788737
This commit is contained in:
Shu Muto 2018-08-24 10:43:29 +09:00
parent 51d641525b
commit 340942ea26
1 changed files with 8 additions and 1 deletions

View File

@ -28,12 +28,14 @@
showCertificateService.$inject = [
'horizon.app.core.openstack-service-api.magnum',
'horizon.dashboard.container-infra.clusters.resourceType',
'horizon.framework.util.actions.action-result.service',
'horizon.framework.util.file.text-download',
'horizon.framework.util.q.extensions'
];
function showCertificateService(
magnum, textDownload, $qExtensions
magnum, resourceType, actionResult, textDownload, $qExtensions
) {
var service = {
@ -53,6 +55,11 @@
// get certificate
return magnum.showCertificate(selected.id).then(function(response) {
textDownload.downloadTextFile(response.data.pem, selected.name + "_ca.pem");
response.data.id = response.data.uuid;
var result = actionResult.getActionResult()
.created(resourceType, response.data.id);
return result.result;
});
}