Added ProviderConfigProperty.CLIENT_LIST and refactor role federation mapper to use it
This commit is contained in:
1 parent
ce6576ce84
commit
98dd87efbc
10 files changed
+31
-31
No files matched your search
@@ -984,7 +984,10 @@ module.config([ '$routeProvider', function($routeProvider) {
|
||||
},
|
||||
mapper : function(UserFederationMapperLoader) {
|
||||
return UserFederationMapperLoader();
|
||||
}
|
||||
},
|
||||
clients : function(ClientListLoader) {
|
||||
return ClientListLoader();
|
||||
},
|
||||
},
|
||||
controller : 'UserFederationMapperCtrl'
|
||||
})
|
||||
@@ -1000,6 +1003,9 @@ module.config([ '$routeProvider', function($routeProvider) {
|
||||
mapperTypes : function(UserFederationMapperTypesLoader) {
|
||||
return UserFederationMapperTypesLoader();
|
||||
},
|
||||
clients : function(ClientListLoader) {
|
||||
return ClientListLoader();
|
||||
}
|
||||
},
|
||||
controller : 'UserFederationMapperCreateCtrl'
|
||||
})
|
||||
|
||||
+8
-6
@@ -754,10 +754,11 @@ module.controller('UserFederationMapperListCtrl', function($scope, $location, No
|
||||
|
||||
});
|
||||
|
||||
module.controller('UserFederationMapperCtrl', function($scope, realm, provider, mapperTypes, mapper, UserFederationMapper, Notifications, Dialog, $location) {
|
||||
module.controller('UserFederationMapperCtrl', function($scope, realm, provider, mapperTypes, mapper, clients, UserFederationMapper, Notifications, Dialog, $location) {
|
||||
console.log('UserFederationMapperCtrl');
|
||||
$scope.realm = realm;
|
||||
$scope.provider = provider;
|
||||
$scope.clients = clients;
|
||||
$scope.create = false;
|
||||
$scope.mapper = angular.copy(mapper);
|
||||
$scope.changed = false;
|
||||
@@ -780,10 +781,10 @@ module.controller('UserFederationMapperCtrl', function($scope, realm, provider,
|
||||
$location.url("/realms/" + realm.realm + '/user-federation/providers/' + provider.providerName + '/' + provider.id + '/mappers/' + mapper.id);
|
||||
Notifications.success("Your changes have been saved.");
|
||||
}, function(error) {
|
||||
if (error.status == 400) {
|
||||
if (error.status == 400 && error.data.error_description) {
|
||||
Notifications.error('Error in configuration of mapper: ' + error.data.error_description);
|
||||
} else {
|
||||
Notification.error('Unexpected error when creating mapper');
|
||||
Notifications.error('Unexpected error when creating mapper');
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -808,10 +809,11 @@ module.controller('UserFederationMapperCtrl', function($scope, realm, provider,
|
||||
|
||||
});
|
||||
|
||||
module.controller('UserFederationMapperCreateCtrl', function($scope, realm, provider, mapperTypes, UserFederationMapper, Notifications, Dialog, $location) {
|
||||
module.controller('UserFederationMapperCreateCtrl', function($scope, realm, provider, mapperTypes, clients, UserFederationMapper, Notifications, Dialog, $location) {
|
||||
console.log('UserFederationMapperCreateCtrl');
|
||||
$scope.realm = realm;
|
||||
$scope.provider = provider;
|
||||
$scope.clients = clients;
|
||||
$scope.create = true;
|
||||
$scope.mapper = { federationProviderDisplayName: provider.displayName, config: {}};
|
||||
$scope.mapperTypes = mapperTypes;
|
||||
@@ -844,10 +846,10 @@ module.controller('UserFederationMapperCreateCtrl', function($scope, realm, prov
|
||||
$location.url('/realms/' + realm.realm +'/user-federation/providers/' + provider.providerName + '/' + provider.id + '/mappers/' + id);
|
||||
Notifications.success("Mapper has been created.");
|
||||
}, function(error) {
|
||||
if (error.status == 400) {
|
||||
if (error.status == 400 && error.data.error_description) {
|
||||
Notifications.error('Error in configuration of mapper: ' + error.data.error_description);
|
||||
} else {
|
||||
Notification.error('Unexpected error when creating mapper');
|
||||
Notifications.error('Unexpected error when creating mapper');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
+6
-1
@@ -47,7 +47,7 @@
|
||||
<div data-ng-repeat="option in mapperType.properties" class="form-group">
|
||||
<label class="col-md-2 control-label">{{option.label}}</label>
|
||||
|
||||
<div class="col-sm-4" data-ng-hide="option.type == 'boolean' || option.type == 'List'">
|
||||
<div class="col-sm-4" data-ng-show="option.type == 'String'">
|
||||
<input class="form-control" type="text" data-ng-model="mapper.config[ option.name ]">
|
||||
</div>
|
||||
<div class="col-sm-4" data-ng-show="option.type == 'boolean'">
|
||||
@@ -58,6 +58,11 @@
|
||||
<option value="" selected> Select one... </option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-4" data-ng-show="option.type == 'ClientList'">
|
||||
<select ng-model="mapper.config[ option.name ]" ng-options="client.clientId as client.clientId for client in clients">
|
||||
<option value="" selected> Select one... </option>
|
||||
</select>
|
||||
</div>
|
||||
<kc-tooltip>{{option.helpText}}</kc-tooltip>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in new issue
Block a user