Merge pull request #1592 from stianst/master
KEYCLOAK-1794 Admin console issues with kc-provider-config directive
This commit is contained in:
commit
853f1af40d
5 changed files with 85 additions and 86 deletions
|
@ -1840,7 +1840,6 @@ module.directive('kcTabsUserFederation', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
module.controller('RoleSelectorModalCtrl', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) {
|
module.controller('RoleSelectorModalCtrl', function($scope, realm, config, configName, RealmRoles, Client, ClientRole, $modalInstance) {
|
||||||
console.log('realm: ' + realm.realm);
|
|
||||||
$scope.selectedRealmRole = {
|
$scope.selectedRealmRole = {
|
||||||
role: undefined
|
role: undefined
|
||||||
};
|
};
|
||||||
|
@ -1888,6 +1887,25 @@ module.controller('RoleSelectorModalCtrl', function($scope, realm, config, confi
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
|
module.controller('ProviderConfigCtrl', function ($modal, $scope) {
|
||||||
|
$scope.openRoleSelector = function (configName, config) {
|
||||||
|
$modal.open({
|
||||||
|
templateUrl: resourceUrl + '/partials/modal/role-selector.html',
|
||||||
|
controller: 'RoleSelectorModalCtrl',
|
||||||
|
resolve: {
|
||||||
|
realm: function () {
|
||||||
|
return $scope.realm;
|
||||||
|
},
|
||||||
|
config: function () {
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
configName: function () {
|
||||||
|
return configName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
module.directive('kcProviderConfig', function ($modal) {
|
module.directive('kcProviderConfig', function ($modal) {
|
||||||
return {
|
return {
|
||||||
|
@ -1895,32 +1913,12 @@ module.directive('kcProviderConfig', function ($modal) {
|
||||||
config: '=',
|
config: '=',
|
||||||
properties: '=',
|
properties: '=',
|
||||||
realm: '=',
|
realm: '=',
|
||||||
clients: '='
|
clients: '=',
|
||||||
|
configName: '='
|
||||||
},
|
},
|
||||||
restrict: 'E',
|
restrict: 'E',
|
||||||
replace: true,
|
replace: true,
|
||||||
link: function(scope, element, attrs) {
|
controller: 'ProviderConfigCtrl',
|
||||||
scope.openRoleSelector = function(configName) {
|
|
||||||
$modal.open({
|
|
||||||
templateUrl: resourceUrl + '/partials/modal/role-selector.html',
|
|
||||||
controller: 'RoleSelectorModalCtrl',
|
|
||||||
resolve: {
|
|
||||||
realm: function () {
|
|
||||||
return scope.realm;
|
|
||||||
},
|
|
||||||
config: function() {
|
|
||||||
return scope.config;
|
|
||||||
},
|
|
||||||
configName: function() {
|
|
||||||
|
|
||||||
return configName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
},
|
|
||||||
templateUrl: resourceUrl + '/templates/kc-provider-config.html'
|
templateUrl: resourceUrl + '/templates/kc-provider-config.html'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" data-ng-show="access.manageRealm">
|
<div class="form-group" data-ng-show="access.manageRealm">
|
||||||
<div class="col-md-12">
|
<div class="col-md-10 col-md-offset-2">
|
||||||
<button kc-save data-ng-disabled="!changed">Save</button>
|
<button kc-save data-ng-disabled="!changed">Save</button>
|
||||||
<button kc-reset data-ng-disabled="!changed">Cancel</button>
|
<button kc-reset data-ng-disabled="!changed">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,9 +4,9 @@
|
||||||
</button>
|
</button>
|
||||||
<h4 class="modal-title">Role Selector</h4>
|
<h4 class="modal-title">Role Selector</h4>
|
||||||
</div>
|
</div>
|
||||||
<div style="padding: 15px 60px 75px 60px">
|
<div style="padding: 0 15px 15px 15px;">
|
||||||
<form>
|
<form>
|
||||||
<div data-ng-show="realmRoles.length > 0">
|
<div data-ng-show="realmRoles.length > 0" style="margin-bottom: 30px;">
|
||||||
<label class="control-label" for="available">Realm Roles</label>
|
<label class="control-label" for="available">Realm Roles</label>
|
||||||
<kc-tooltip>Realm roles that can be selected.</kc-tooltip>
|
<kc-tooltip>Realm roles that can be selected.</kc-tooltip>
|
||||||
<select id="available" class="form-control" size="5"
|
<select id="available" class="form-control" size="5"
|
||||||
|
@ -19,8 +19,6 @@
|
||||||
Select Realm Role</i>
|
Select Realm Role</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
|
||||||
<br>
|
|
||||||
<div data-ng-show="clients.length > 0">
|
<div data-ng-show="clients.length > 0">
|
||||||
<label class="control-label">
|
<label class="control-label">
|
||||||
<span>Client Roles</span>
|
<span>Client Roles</span>
|
||||||
|
@ -39,7 +37,4 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" data-ng-class="btns.cancel.cssClass" ng-click="cancel()">Cancel</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -60,7 +60,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group" data-ng-show="access.manageRealm">
|
<div class="form-group" data-ng-show="access.manageRealm">
|
||||||
<div class="col-md-12">
|
<div class="col-md-10 col-md-offset-2">
|
||||||
<button kc-save data-ng-disabled="!changed">Save</button>
|
<button kc-save data-ng-disabled="!changed">Save</button>
|
||||||
<button kc-reset data-ng-disabled="!changed">Cancel</button>
|
<button kc-reset data-ng-disabled="!changed">Cancel</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<div data-ng-repeat="option in properties" class="form-group">
|
<div>
|
||||||
|
<div data-ng-repeat="option in properties" class="form-group" data-ng-controller="ProviderConfigCtrl">
|
||||||
<label class="col-md-2 control-label">{{option.label}}</label>
|
<label class="col-md-2 control-label">{{option.label}}</label>
|
||||||
|
|
||||||
<div class="col-sm-6" data-ng-hide="option.type == 'boolean' || option.type == 'List' || option.type == 'Role' || option.type == 'ClientList'">
|
<div class="col-sm-6" data-ng-hide="option.type == 'boolean' || option.type == 'List' || option.type == 'Role' || option.type == 'ClientList'">
|
||||||
|
@ -13,10 +14,14 @@
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-6" data-ng-show="option.type == 'Role'">
|
<div class="col-sm-6" data-ng-show="option.type == 'Role'">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-8">
|
||||||
<input class="form-control" type="text" data-ng-model="config[ option.name ]" >
|
<input class="form-control" type="text" data-ng-model="config[ option.name ]" >
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4" data-ng-show="option.type == 'Role'">
|
<div class="col-sm-2">
|
||||||
<button type="submit" data-ng-click="openRoleSelector(option.name)" class="btn btn-default" tooltip-placement="top" tooltip-trigger="mouseover mouseout" tooltip="Enter role in the textbox to the left, or click this button to browse and select the role you want">Select Role</button>
|
<button type="submit" data-ng-click="openRoleSelector(option.name, config)" class="btn btn-default" tooltip-placement="top" tooltip-trigger="mouseover mouseout" tooltip="Enter role in the textbox to the left, or click this button to browse and select the role you want">Select Role</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-4" data-ng-show="option.type == 'ClientList'">
|
<div class="col-sm-4" data-ng-show="option.type == 'ClientList'">
|
||||||
<select ng-model="config[ option.name ]" ng-options="client.clientId as client.clientId for client in clients">
|
<select ng-model="config[ option.name ]" ng-options="client.clientId as client.clientId for client in clients">
|
||||||
|
@ -25,4 +30,5 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<kc-tooltip>{{option.helpText}}</kc-tooltip>
|
<kc-tooltip>{{option.helpText}}</kc-tooltip>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
Reference in a new issue