Skip to content

Commit

Permalink
Closes: #469 (#510)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevgliss authored Nov 17, 2016
1 parent d54a11a commit d11f254
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions lemur/static/app/angular/authorities/authority/authority.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,20 @@ angular.module('lemur')
.controller('AuthorityCreateController', function ($scope, $uibModalInstance, AuthorityService, AuthorityApi, LemurRestangular, RoleService, PluginService, WizardHandler, toaster) {
$scope.authority = LemurRestangular.restangularizeElement(null, {}, 'authorities');
// set the defaults
AuthorityService.getDefaults($scope.authority);
AuthorityService.getDefaults($scope.authority).then(function () {
PluginService.getByType('issuer').then(function (plugins) {
$scope.plugins = plugins;
if ($scope.authority.defaultIssuerPlugin) {
plugins.forEach(function(plugin) {
if (plugin.slug === $scope.authority.defaultIssuerPlugin) {
$scope.authority.plugin = plugin;
}
});
} else {
$scope.authority.plugin = plugins[0];
}
});
});

$scope.getAuthoritiesByName = function (value) {
return AuthorityService.findAuthorityByName(value).then(function (authorities) {
Expand Down Expand Up @@ -71,19 +84,6 @@ angular.module('lemur')
});
};

PluginService.getByType('issuer').then(function (plugins) {
$scope.plugins = plugins;
if ($scope.authority.defaultIssuerPlugin) {
plugins.forEach(function(plugin) {
if (plugin.slug === $scope.authority.defaultIssuerPlugin) {
$scope.authority.plugin = plugin;
}
});
} else {
$scope.authority.plugin = plugins[0];
}
});

$scope.roleService = RoleService;
$scope.authorityService = AuthorityService;

Expand Down

0 comments on commit d11f254

Please sign in to comment.