Removed undo flags from dialog field specs.

Since the undo flag is now automatically set to false in dialogs,
it's no longer necessary to specify it in the field specs.

Ticket #1394
This commit is contained in:
Endi S. Dewata
2011-09-22 11:44:41 -05:00
parent 390d017e32
commit 8e95d1eb4e
10 changed files with 51 additions and 96 deletions

View File

@@ -69,22 +69,18 @@ IPA.entity_factories.permission = function() {
{
name: 'general',
fields: [
{
name: 'cn',
undo: false
},
'cn',
{
factory: IPA.rights_widget,
name: 'permissions',
join: true, undo: false
join: true
}
]
},
{
factory: IPA.target_section,
name: 'target',
label: IPA.messages.objects.permission.target,
undo: false
label: IPA.messages.objects.permission.target
}
]
}).
@@ -173,8 +169,7 @@ IPA.entity_factories.selfservice = function() {
'aciname',
{factory:IPA.attributes_widget,
object_type:'user',
name:'attrs',
undo: false
name:'attrs'
}]
}).
build();
@@ -218,21 +213,20 @@ IPA.entity_factories.delegation = function() {
factory: IPA.entity_select_widget,
name: 'group',
other_entity: 'group',
other_field: 'cn',
undo: false
other_field: 'cn'
},
{
factory: IPA.entity_select_widget,
name: 'memberof',
other_entity: 'group',
other_field: 'cn',
join: true,
undo: false
join: true
},
{
factory:IPA.attributes_widget,
name: 'attrs', object_type: 'user',
join: true, undo: false
factory: IPA.attributes_widget,
name: 'attrs',
object_type: 'user',
join: true
}]
}).
build();
@@ -400,7 +394,6 @@ IPA.target_section = function(spec) {
spec = spec || {};
var that = IPA.details_section(spec);
that.undo = typeof spec.undo == 'undefined' ? true : spec.undo;
var target_types = [
{
@@ -504,31 +497,26 @@ IPA.target_section = function(spec) {
var init = function() {
that.filter_text = IPA.text_widget({
name: 'filter',
undo: that.undo,
entity: spec.entity
});
that.subtree_textarea = IPA.textarea_widget({
entity: spec.entity,
name: 'subtree',
cols: 30, rows: 1,
undo: that.undo
cols: 30, rows: 1
});
that.group_select = IPA.entity_select_widget({
entity: spec.entity,
name: 'targetgroup',
other_entity: 'group',
other_field: 'cn',
undo: that.undo
other_field: 'cn'
});
that.type_select = IPA.select_widget({
entity: spec.entity,
name: 'type',
undo: that.undo
name: 'type'
});
that.attribute_table = IPA.attributes_widget({
entity: spec.entity,
name: 'attrs',
undo: that.undo
name: 'attrs'
});
that.add_field(that.filter_text);

View File

@@ -104,17 +104,10 @@ IPA.entity_factories.automountmap = function() {
value: 'add_indirect',
label: IPA.messages.objects.automountmap.indirect
}
],
undo: false
]
},
{
name: 'automountmapname',
undo: false
},
{
name: 'description',
undo: false
}
'automountmapname',
'description'
]
},
{
@@ -123,14 +116,12 @@ IPA.entity_factories.automountmap = function() {
{
name: 'key',
label: IPA.get_method_option(
'automountmap_add_indirect', 'key').label,
undo: false
'automountmap_add_indirect', 'key').label
},
{
name: 'parentmap',
label: IPA.get_method_option(
'automountmap_add_indirect', 'parentmap').label,
undo: false
'automountmap_add_indirect', 'parentmap').label
}
]
}

View File

@@ -93,15 +93,13 @@ IPA.entity_factories.dnszone = function() {
fields: [
{
name: 'idnsname',
optional: true,
undo: false
optional: true
},
'name_from_ip',
'idnssoamname',
{
name: 'idnssoarname',
optional: true,
undo: false
optional: true
},
{
factory: IPA.force_dnszone_add_checkbox_widget,
@@ -583,7 +581,7 @@ IPA.entity_factories.dnsrecord = function() {
]
}).
adder_dialog({
pre_execute_hook:function(command){
pre_execute_hook: function(command) {
var record_type = command.options.record_type;
var record_data = command.options.record_data;
@@ -594,17 +592,15 @@ IPA.entity_factories.dnsrecord = function() {
fields: [
'idnsname',
{
name:'record_type',
label:IPA.messages.objects.dnsrecord.type,
factory:IPA.dnsrecord_type_widget,
undo: false
name: 'record_type',
label: IPA.messages.objects.dnsrecord.type,
factory: IPA.dnsrecord_type_widget
},
{
name:'record_data',
label:IPA.messages.objects.dnsrecord.data,
factory:IPA.text_widget,
param_info:{required:true},
undo: false
name: 'record_data',
label: IPA.messages.objects.dnsrecord.data,
factory: IPA.text_widget,
param_info: {required:true}
}
]
}).
@@ -670,7 +666,6 @@ IPA.force_dnszone_add_checkbox_widget = function(spec) {
var param_info = IPA.get_method_option('dnszone_add', spec.name);
spec.label = param_info.label;
spec.tooltip = param_info.doc;
spec.undo = false;
return IPA.checkbox_widget(spec);
};

View File

@@ -120,20 +120,17 @@ IPA.entity_factories.entitle = function() {
fields: [
{
name: 'username',
label: IPA.get_method_arg('entitle_register', 'username').label,
undo: false
label: IPA.get_method_arg('entitle_register', 'username').label
},
{
name: 'password',
label: IPA.get_method_option('entitle_register', 'password').label,
type: 'password',
undo: false
type: 'password'
}
/* currently not supported
, {
name: 'ipaentitlementid',
label: IPA.get_method_option('entitle_register', 'ipaentitlementid').label,
undo: false
label: IPA.get_method_option('entitle_register', 'ipaentitlementid').label
}
*/
]
@@ -146,8 +143,7 @@ IPA.entity_factories.entitle = function() {
fields: [
{
name: 'certificate',
label: IPA.messages.objects.entitle.certificate,
undo: false
label: IPA.messages.objects.entitle.certificate
}
]
}).
@@ -159,7 +155,6 @@ IPA.entity_factories.entitle = function() {
{
name: 'quantity',
label: IPA.get_method_arg('entitle_consume', 'quantity').label,
undo: false,
metadata: IPA.get_method_arg('entitle_consume', 'quantity')
}
]
@@ -172,8 +167,7 @@ IPA.entity_factories.entitle = function() {
fields: [
{
name: 'certificate',
label: IPA.messages.objects.entitle.certificate,
undo: false
label: IPA.messages.objects.entitle.certificate
}
]
});

View File

@@ -95,7 +95,6 @@ IPA.entity_factories.group = function () {
factory: IPA.group_nonposix_checkbox_widget,
name: 'nonposix',
label: IPA.messages.objects.group.posix,
undo: false,
checked: true
},
'gidnumber']

View File

@@ -134,8 +134,7 @@ IPA.entity_factories.host = function () {
factory: IPA.text_widget,
name: 'hostname',
label: IPA.messages.objects.service.host,
param_info: { required: true },
undo: false
param_info: { required: true }
},
{
factory: IPA.dnszone_select_widget,
@@ -143,8 +142,7 @@ IPA.entity_factories.host = function () {
label: IPA.metadata.objects.dnszone.label_singular,
editable: true,
empty_option: false,
param_info: { required: true },
undo: false
param_info: { required: true }
}
]
},
@@ -154,8 +152,7 @@ IPA.entity_factories.host = function () {
{
factory: IPA.text_widget,
name: 'ip_address',
param_info: IPA.get_method_option('host_add', 'ip_address'),
undo: false
param_info: IPA.get_method_option('host_add', 'ip_address')
},
{
factory: IPA.force_host_add_checkbox_widget,
@@ -406,7 +403,6 @@ IPA.force_host_add_checkbox_widget = function(spec) {
var param_info = IPA.get_method_option('host_add', spec.name);
spec.label = param_info.label;
spec.tooltip = param_info.doc;
spec.undo = false;
return IPA.checkbox_widget(spec);
};
@@ -630,15 +626,13 @@ IPA.host_password_widget = function(spec) {
var password1 = dialog.add_field(IPA.text_widget({
name: 'password1',
label: IPA.messages.password.new_password,
type: 'password',
undo: false
type: 'password'
}));
var password2 = dialog.add_field(IPA.text_widget({
name: 'password2',
label: IPA.messages.password.verify_password,
type: 'password',
undo: false
type: 'password'
}));
dialog.add_button(label, function() {

View File

@@ -49,8 +49,7 @@ IPA.entity_factories.pwpolicy = function() {
factory: IPA.entity_select_widget,
name: 'cn',
other_entity: 'group',
other_field: 'cn',
undo: false
other_field: 'cn'
},
'cospriority'],
width: 400,

View File

@@ -119,8 +119,7 @@ IPA.service_add_dialog = function(spec) {
label: IPA.messages.objects.service.service,
size: 20,
entity: spec.entity,
param_info: { required: true },
undo: false
param_info: { required: true }
})).
field(IPA.entity_select_widget({
name: 'host',
@@ -128,14 +127,12 @@ IPA.service_add_dialog = function(spec) {
other_field: 'fqdn',
entity: spec.entity,
label: IPA.messages.objects.service.host,
param_info: { required: true },
undo: false
param_info: { required: true }
})).
field(IPA.checkbox_widget({
name: 'force',
entity: spec.entity,
param_info: IPA.get_method_option('service_add', 'force'),
undo: false
param_info: IPA.get_method_option('service_add', 'force')
}));

View File

@@ -570,8 +570,7 @@ IPA.sudo.options_section = function(spec) {
var ipasudoopt = dialog.add_field(IPA.text_widget({
name: 'ipasudoopt',
label: label,
undo: false
label: label
}));
dialog.add_button(IPA.messages.buttons.add, function() {

View File

@@ -142,11 +142,12 @@ IPA.entity_factories.user = function() {
fields: [
{
factory : IPA.text_widget,
undo: false,
optional: true,
name:'uid'
},
'givenname', 'sn']
'givenname',
'sn'
]
});
return builder.build();
@@ -324,15 +325,13 @@ IPA.user_password_widget = function(spec) {
var password1 = dialog.add_field(IPA.text_widget({
name: 'password1',
label: IPA.messages.password.new_password,
type: 'password',
undo: false
type: 'password'
}));
var password2 = dialog.add_field(IPA.text_widget({
name: 'password2',
label: IPA.messages.password.verify_password,
type: 'password',
undo: false
type: 'password'
}));
dialog.add_button(IPA.messages.password.reset_password, function() {