mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 15:40:01 -06:00
WebUI: Unify adapter property definition for state evaluators
Move adapter property definition to IPA.state_evaluator since it is used by all evaluators Related: https://pagure.io/freeipa/issue/8336 Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com> Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
parent
df5526fbc7
commit
2d87cd4ae1
@ -1536,8 +1536,6 @@ exp.boolean_state_evaluator = IPA.boolean_state_evaluator = function(spec) {
|
||||
|
||||
that.param = spec.param || that.field_name;
|
||||
|
||||
that.adapter = builder.build('adapter', spec.adapter || 'adapter', { context: that });
|
||||
|
||||
/**
|
||||
* State to set when value is `true`
|
||||
* @property {string}
|
||||
@ -1643,8 +1641,6 @@ exp.acl_state_evaluator = IPA.acl_state_evaluator = function(spec) {
|
||||
|
||||
that.param = spec.param || 'attributelevelrights';
|
||||
|
||||
that.adapter = builder.build('adapter', spec.adapter || 'adapter', { context: that });
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
@ -1687,7 +1683,6 @@ exp.value_state_evaluator = IPA.value_state_evaluator = function(spec) {
|
||||
|
||||
spec.name = spec.name || 'value_state_evaluator';
|
||||
spec.event = spec.event || 'post_load';
|
||||
spec.adapter = spec.adapter || {};
|
||||
|
||||
var that = IPA.state_evaluator(spec);
|
||||
|
||||
@ -1712,9 +1707,6 @@ exp.value_state_evaluator = IPA.value_state_evaluator = function(spec) {
|
||||
*/
|
||||
that.representation = spec.representation;
|
||||
|
||||
that.adapter = builder.build('adapter',
|
||||
spec.adapter, { context: that });
|
||||
|
||||
that.param = spec.param;
|
||||
|
||||
/**
|
||||
@ -1798,7 +1790,6 @@ exp.has_keytab_evaluator = IPA.has_keytab_evaluator = function(spec) {
|
||||
spec.value = spec.value || [true];
|
||||
spec.representation = spec.representation || 'has_keytab';
|
||||
spec.param = spec.param || 'has_keytab';
|
||||
spec.adapter = spec.adapter || { $type: 'adapter' };
|
||||
|
||||
var that = IPA.value_state_evaluator(spec);
|
||||
|
||||
@ -1823,8 +1814,6 @@ exp.object_class_evaluator = IPA.object_class_evaluator = function(spec) {
|
||||
|
||||
var that = IPA.state_evaluator(spec);
|
||||
|
||||
that.adapter = builder.build('adapter', spec.adapter || 'adapter', { context: that });
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
@ -3187,6 +3187,13 @@ exp.state_evaluator = IPA.state_evaluator = function(spec) {
|
||||
*/
|
||||
that.first_pass = true;
|
||||
|
||||
/**
|
||||
* Adapter which selects values from record on load.
|
||||
*
|
||||
* @property {IPA.Adapter}
|
||||
*/
|
||||
that.adapter = builder.build('adapter', spec.adapter || 'adapter', { context: that });
|
||||
|
||||
/**
|
||||
* Init the evaluator
|
||||
*
|
||||
|
@ -1105,7 +1105,6 @@ IPA.host.has_password_evaluator = function(spec) {
|
||||
spec.value = spec.value || [true];
|
||||
spec.representation = spec.representation || 'has_password';
|
||||
spec.param = spec.param || 'has_password';
|
||||
spec.adapter = spec.adapter || { $type: 'adapter' };
|
||||
|
||||
var that = IPA.value_state_evaluator(spec);
|
||||
|
||||
|
@ -948,7 +948,6 @@ IPA.user.self_service_other_user_evaluator = function(spec) {
|
||||
var that = IPA.state_evaluator(spec);
|
||||
that.name = spec.name || 'self_service_other_user_evaluator';
|
||||
that.param = spec.param || 'uid';
|
||||
that.adapter = builder.build('adapter', spec.adapter || 'adapter', { context: that });
|
||||
|
||||
/**
|
||||
* Evaluates if user is in self-service and viewing himself
|
||||
@ -982,7 +981,6 @@ IPA.user.preserved_user_evaluator = function(spec) {
|
||||
var that = IPA.state_evaluator(spec);
|
||||
that.name = spec.name || 'preserved_user_evaluator';
|
||||
that.param = spec.param || 'dn';
|
||||
that.adapter = builder.build('adapter', { $type: 'adapter'}, { context: that });
|
||||
|
||||
/**
|
||||
* Evaluates if user is preserved, i.e. is in provisioning tree
|
||||
|
Loading…
Reference in New Issue
Block a user