mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-26 17:01:14 -06:00
Make summary conditions declarative
https://fedorahosted.org/freeipa/ticket/3235
This commit is contained in:
parent
bee39848d3
commit
c206249bd2
@ -24,6 +24,7 @@
|
||||
/* IPA Object Details - populating definiton lists from entry data */
|
||||
|
||||
define([
|
||||
'dojo/_base/lang',
|
||||
'./builder',
|
||||
'./ipa',
|
||||
'./jquery',
|
||||
@ -32,7 +33,7 @@ define([
|
||||
'./text',
|
||||
'./facet',
|
||||
'./add'],
|
||||
function(builder, IPA, $, phases, reg, text) {
|
||||
function(lang, builder, IPA, $, phases, reg, text) {
|
||||
|
||||
var exp = {};
|
||||
|
||||
@ -1194,21 +1195,26 @@ exp.delete_action = IPA.delete_action = function(spec) {
|
||||
|
||||
|
||||
exp.enabled_summary_cond = IPA.enabled_summary_cond = function() {
|
||||
return {
|
||||
|
||||
var that = IPA.object();
|
||||
lang.mixin(that, {
|
||||
pos: ['enabled'],
|
||||
neg: [],
|
||||
description: text.get('@i18n:status.enabled'),
|
||||
state: ['enabled']
|
||||
};
|
||||
});
|
||||
return that;
|
||||
};
|
||||
|
||||
exp.disabled_summary_cond = IPA.disabled_summary_cond = function() {
|
||||
return {
|
||||
var that = IPA.object();
|
||||
lang.mixin(that, {
|
||||
pos: [],
|
||||
neg: ['enabled'],
|
||||
description: text.get('@i18n:status.disabled'),
|
||||
state: ['disabled']
|
||||
};
|
||||
});
|
||||
return that;
|
||||
};
|
||||
|
||||
exp.register = function() {
|
||||
|
@ -255,8 +255,8 @@ IPA.dns.zone_entity = function(spec) {
|
||||
IPA.dns.zone_has_permission_evaluator
|
||||
],
|
||||
summary_conditions: [
|
||||
IPA.enabled_summary_cond(),
|
||||
IPA.disabled_summary_cond()
|
||||
IPA.enabled_summary_cond,
|
||||
IPA.disabled_summary_cond
|
||||
]
|
||||
}
|
||||
}).
|
||||
|
@ -1787,7 +1787,7 @@ exp.state = IPA.state = function(spec) {
|
||||
that.evaluators = builder.build('state_evaluator', spec.evaluators) || [];
|
||||
that.summary_evaluator = builder.build('', spec.summary_evaluator || IPA.summary_evaluator);
|
||||
|
||||
that.summary_conditions = spec.summary_conditions || [];
|
||||
that.summary_conditions = builder.build('', spec.summary_conditions) || [];
|
||||
|
||||
that.init = function(facet) {
|
||||
|
||||
|
@ -82,8 +82,8 @@ IPA.hbac.rule_entity = function(spec) {
|
||||
}
|
||||
],
|
||||
summary_conditions: [
|
||||
IPA.enabled_summary_cond(),
|
||||
IPA.disabled_summary_cond()
|
||||
IPA.enabled_summary_cond,
|
||||
IPA.disabled_summary_cond
|
||||
]
|
||||
}
|
||||
}).
|
||||
|
@ -81,8 +81,8 @@ IPA.selinux.selinuxusermap_entity = function(spec) {
|
||||
}
|
||||
],
|
||||
summary_conditions: [
|
||||
IPA.enabled_summary_cond(),
|
||||
IPA.disabled_summary_cond()
|
||||
IPA.enabled_summary_cond,
|
||||
IPA.disabled_summary_cond
|
||||
]
|
||||
}
|
||||
}).
|
||||
|
@ -80,8 +80,8 @@ IPA.sudo.rule_entity = function(spec) {
|
||||
}
|
||||
],
|
||||
summary_conditions: [
|
||||
IPA.enabled_summary_cond(),
|
||||
IPA.disabled_summary_cond()
|
||||
IPA.enabled_summary_cond,
|
||||
IPA.disabled_summary_cond
|
||||
]
|
||||
}
|
||||
}).
|
||||
|
@ -251,8 +251,8 @@ IPA.user.entity = function(spec) {
|
||||
IPA.user.reset_password_acl_evaluator
|
||||
],
|
||||
summary_conditions: [
|
||||
IPA.enabled_summary_cond(),
|
||||
IPA.disabled_summary_cond()
|
||||
IPA.enabled_summary_cond,
|
||||
IPA.disabled_summary_cond
|
||||
]
|
||||
}
|
||||
}).
|
||||
|
Loading…
Reference in New Issue
Block a user