From 06dcf99b42a0b4707bd11564014a95a8a1689e8b Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Fri, 7 Oct 2016 14:32:23 -0400 Subject: [PATCH] KEYCLOAK-3679: Add new flow, default (browser) flow always shown. --- .../base/admin/resources/js/controllers/realm.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js index c686171d0a..1589ffdff0 100644 --- a/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js +++ b/themes/src/main/resources/theme/base/admin/resources/js/controllers/realm.js @@ -1811,6 +1811,8 @@ module.controller('CreateExecutionFlowCtrl', function($scope, realm, topFlow, pa Notifications, $location) { $scope.realm = realm; $scope.formProviders = formProviders; + + var returnToTopFlow = parentFlow.topLevel ? parentFlow.alias : topFlow; var defaultFlowType = parentFlow.providerId == 'client-flow' ? 'client-flow' : 'basic-flow'; $scope.flow = { @@ -1826,12 +1828,12 @@ module.controller('CreateExecutionFlowCtrl', function($scope, realm, topFlow, pa $scope.save = function() { $scope.flow.provider = $scope.provider.id; CreateExecutionFlow.save({realm: realm.realm, alias: parentFlow.alias}, $scope.flow, function() { - $location.url("/realms/" + realm.realm + "/authentication/flows/" + topFlow); + $location.url("/realms/" + realm.realm + "/authentication/flows/" + returnToTopFlow); Notifications.success("Flow Created."); }) } $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/authentication/flows/" + topFlow); + $location.url("/realms/" + realm.realm + "/authentication/flows/" + returnToTopFlow); }; }); @@ -1840,6 +1842,9 @@ module.controller('CreateExecutionCtrl', function($scope, realm, topFlow, parent Notifications, $location) { $scope.realm = realm; $scope.parentFlow = parentFlow; + + var returnToTopFlow = parentFlow.topLevel ? parentFlow.alias : topFlow; + if (parentFlow.providerId == 'form-flow') { $scope.providers = formActionProviders; } else if (parentFlow.providerId == 'client-flow') { @@ -1858,12 +1863,12 @@ module.controller('CreateExecutionCtrl', function($scope, realm, topFlow, parent provider: $scope.provider.id } CreateExecution.save({realm: realm.realm, alias: parentFlow.alias}, execution, function() { - $location.url("/realms/" + realm.realm + "/authentication/flows/" + topFlow); + $location.url("/realms/" + realm.realm + "/authentication/flows/" + returnToTopFlow); Notifications.success("Execution Created."); }) } $scope.cancel = function() { - $location.url("/realms/" + realm.realm + "/authentication/flows/" + topFlow); + $location.url("/realms/" + realm.realm + "/authentication/flows/" + returnToTopFlow); }; });