Skip to content

Commit

Permalink
Bug 1425728 - Fix cancel from add config files page
Browse files Browse the repository at this point in the history
If you click create secret, then cancel out both forms, you go back to
the create secret page. Use `$window.history.back()` instead of a `then`
parameter from the create secret page to prevent this.

https://bugzilla.redhat.com/show_bug.cgi?id=1425728
  • Loading branch information
spadgett committed Feb 22, 2017
1 parent 5d8765c commit bbad484
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
3 changes: 0 additions & 3 deletions app/scripts/controllers/addConfigVolume.js
Expand Up @@ -63,9 +63,6 @@ angular.module('openshiftConsole')
includeProject: true
});

// Return URL for creating secrets.
$scope.returnURL = $location.url();

var humanizeKind = $filter('humanizeKind');
$scope.groupByKind = function(object) {
return humanizeKind(object.kind);
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/controllers/createSecret.js
Expand Up @@ -43,7 +43,7 @@ angular.module('openshiftConsole')
return;
}

Navigate.toResourceList('secrets', $scope.projectName);
$window.history.back();
};

ProjectsService
Expand Down
2 changes: 1 addition & 1 deletion app/views/add-config-volume.html
Expand Up @@ -61,7 +61,7 @@ <h1>Add Config Files</h1>
</span>
<span ng-if="'secrets' | canI : 'create'">
<span ng-if="'configmaps' | canI : 'create'" class="action-divider" aria-hidden="true">|</span>
<a ng-href="project/{{project.metadata.name}}/create-secret?then={{returnURL | encodeURIComponent}}">Create Secret</a>
<a ng-href="project/{{project.metadata.name}}/create-secret">Create Secret</a>
</span>
</div>
<div class="help-block">
Expand Down
4 changes: 2 additions & 2 deletions dist/scripts/scripts.js
Expand Up @@ -6991,7 +6991,7 @@ link:"project/" + d.projectName + "/browse/secrets"
title:"Create Secret"
} ];
var l = function() {
return c.then ? void b.url(c.then) :void j.toResourceList("secrets", d.projectName);
return c.then ? void b.url(c.then) :void e.history.back();
};
k.get(c.project).then(_.spread(function(b, e) {
return d.project = b, d.context = e, d.breadcrumbs[0].title = a("displayName")(b), h.canI("secrets", "create", c.project) ? (d.postCreateAction = function(a, b) {
Expand Down Expand Up @@ -9182,7 +9182,7 @@ kind:c.kind,
namespace:c.project,
subpage:"Add Config Files",
includeProject:!0
}), d.returnURL = b.url();
});
var p = a("humanizeKind");
d.groupByKind = function(a) {
return p(a.kind);
Expand Down
2 changes: 1 addition & 1 deletion dist/scripts/templates.js
Expand Up @@ -982,7 +982,7 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function(
"</span>\n" +
"<span ng-if=\"'secrets' | canI : 'create'\">\n" +
"<span ng-if=\"'configmaps' | canI : 'create'\" class=\"action-divider\" aria-hidden=\"true\">|</span>\n" +
"<a ng-href=\"project/{{project.metadata.name}}/create-secret?then={{returnURL | encodeURIComponent}}\">Create Secret</a>\n" +
"<a ng-href=\"project/{{project.metadata.name}}/create-secret\">Create Secret</a>\n" +
"</span>\n" +
"</div>\n" +
"<div class=\"help-block\">\n" +
Expand Down

0 comments on commit bbad484

Please sign in to comment.