summaryrefslogtreecommitdiffstats
path: root/install/ui/group.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-07-30 13:31:11 +0200
committerMartin Kosek <mkosek@redhat.com>2012-08-14 08:09:23 +0200
commit44e86aa3bb7206991bbe1118ee3a35b6949b6ac9 (patch)
tree45dbb03de93bd0d32a4ef6a0c8205207bd4108d8 /install/ui/group.js
parent6341eff07891dfd4ed253081eb056ff6eb5aa573 (diff)
downloadfreeipa-44e86aa3bb7206991bbe1118ee3a35b6949b6ac9.tar.gz
freeipa-44e86aa3bb7206991bbe1118ee3a35b6949b6ac9.tar.xz
freeipa-44e86aa3bb7206991bbe1118ee3a35b6949b6ac9.zip
Add external group
Group can be normal, posix and external. Posix checkbox was removed and was replaced by radio for selecting group type. This adds possibility of adding of external group. https://fedorahosted.org/freeipa/ticket/2895
Diffstat (limited to 'install/ui/group.js')
-rw-r--r--install/ui/group.js70
1 files changed, 44 insertions, 26 deletions
diff --git a/install/ui/group.js b/install/ui/group.js
index 5ad9ba1f1..ad26676ab 100644
--- a/install/ui/group.js
+++ b/install/ui/group.js
@@ -111,10 +111,25 @@ IPA.group.entity = function(spec) {
name: 'description'
},
{
- type: 'nonposix_checkbox',
- name: 'nonposix',
- label: IPA.messages.objects.group.posix,
- checked: true
+ type: 'radio',
+ name: 'type',
+ label: IPA.messages.objects.group.type,
+ flags: ['no_command'],
+ default_value: 'normal',
+ options: [
+ {
+ value: 'normal',
+ label: IPA.messages.objects.group.normal
+ },
+ {
+ value: 'external',
+ label: IPA.messages.objects.group.external
+ },
+ {
+ value: 'posix',
+ label: IPA.messages.objects.group.posix
+ }
+ ]
},
'gidnumber'
]
@@ -124,43 +139,46 @@ IPA.group.entity = function(spec) {
return that;
};
-IPA.group_nonposix_checkbox_widget = function (spec) {
+IPA.group_adder_dialog = function(spec) {
spec = spec || {};
- var that = IPA.checkbox_widget(spec);
+ var that = IPA.entity_adder_dialog(spec);
+
+ var init = function() {
- that.save = function() {
- var value = that.checkbox_save()[0];
- // convert posix into non-posix
- return [!value];
+ var type_field = that.fields.get_field('type');
+ type_field.widget.value_changed.attach(that.on_type_change);
};
- return that;
-};
+ that.on_type_change = function(value) {
-IPA.widget_factories['nonposix_checkbox'] = IPA.group_nonposix_checkbox_widget;
-IPA.field_factories['nonposix_checkbox'] = IPA.checkbox_field;
+ var gid_field = that.fields.get_field('gidnumber');
+ var external_field = that.fields.get_field('external');
-IPA.group_adder_dialog = function(spec) {
+ var posix = value[0] === 'posix';
- spec = spec || {};
+ if (!posix) {
+ gid_field.reset();
+ }
- var that = IPA.entity_adder_dialog(spec);
+ gid_field.set_enabled(posix);
+ };
- var init = function() {
+ that.create_add_command = function(record) {
- var posix_field = that.fields.get_field('nonposix');
- posix_field.widget.value_changed.attach(that.on_posix_change);
- };
+ var command = that.entity_adder_dialog_create_add_command(record);
- that.on_posix_change = function (value) {
+ var type_field = that.fields.get_field('type');
+ var type = type_field.save()[0];
- var gid_field = that.fields.get_field('gidnumber');
- if (value[0]) {
- gid_field.reset();
+ if (type === 'normal') {
+ command.set_option('nonposix', true);
+ } else if (type === 'external') {
+ command.set_option('external', true);
}
- gid_field.set_enabled(!value[0]);
+
+ return command;
};
init();