summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-02-29 18:53:11 +0100
committerEndi S. Dewata <edewata@redhat.com>2012-03-02 11:45:08 -0600
commit25fbebd813a44cdfae83e676ed0d814797b272a3 (patch)
tree17e3584d44c12d9519260bb02cd5c698e3af4bea
parent154696b5eaa165ea5dd8f03cf39fb61abf74274c (diff)
downloadfreeipa.git-25fbebd813a44cdfae83e676ed0d814797b272a3.tar.gz
freeipa.git-25fbebd813a44cdfae83e676ed0d814797b272a3.tar.xz
freeipa.git-25fbebd813a44cdfae83e676ed0d814797b272a3.zip
Removed CSV creation from UI
Creating CSV values in UI is unnecessary and error-prone because server converts them back to list. Possible problems with values containing commas may occur. All occurrences of CSV joining were therefore removed. https://fedorahosted.org/freeipa/ticket/2227
-rw-r--r--install/ui/aci.js14
-rw-r--r--install/ui/add.js12
-rw-r--r--install/ui/association.js24
-rw-r--r--install/ui/details.js2
-rw-r--r--install/ui/dns.js2
-rw-r--r--install/ui/field.js1
-rw-r--r--install/ui/rule.js2
-rw-r--r--install/ui/widget.js2
8 files changed, 18 insertions, 41 deletions
diff --git a/install/ui/aci.js b/install/ui/aci.js
index ec3c8065..ba4a22bf 100644
--- a/install/ui/aci.js
+++ b/install/ui/aci.js
@@ -46,7 +46,6 @@ IPA.aci.permission_entity = function(spec) {
{
type: 'rights',
name: 'permissions',
- join: true,
widget: 'rights.permissions'
},
{
@@ -142,7 +141,6 @@ IPA.aci.permission_entity = function(spec) {
{
type: 'rights',
name: 'permissions',
- join: true,
widget: 'general.permissions'
},
{
@@ -407,14 +405,12 @@ IPA.aci.delegation_entity = function(spec) {
type: 'entity_select',
name: 'memberof',
other_entity: that.group_entity,
- other_field: 'cn',
- join: true
+ other_field: 'cn'
},
{
type: 'attributes',
name: 'attrs',
- object_type: 'user',
- join: true
+ object_type: 'user'
}
]
}
@@ -434,14 +430,12 @@ IPA.aci.delegation_entity = function(spec) {
type: 'entity_select',
name: 'memberof',
other_entity: that.group_entity,
- other_field: 'cn',
- join: true
+ other_field: 'cn'
},
{
type: 'attributes',
name: 'attrs',
- object_type: 'user',
- join: true
+ object_type: 'user'
}
]
});
diff --git a/install/ui/add.js b/install/ui/add.js
index 9b473ccc..671d3f1f 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -123,16 +123,14 @@ IPA.entity_adder_dialog = function(spec) {
var field = fields[j];
var values = record[field.param];
- if (!values) continue;
-
- // TODO: Handle multi-valued attributes like in detail facet's update()
- var value = values.join(',');
- if (!value) continue;
+ if (!values || values.length === 0) continue;
if (field.param === pkey_name) {
- command.add_arg(value);
+ command.add_arg(values[0]);
+ } else if (values.length === 1) {
+ command.set_option(field.param, values[0]);
} else {
- command.set_option(field.param, value);
+ command.set_option(field.param, values);
}
}
diff --git a/install/ui/association.js b/install/ui/association.js
index 72e1f0c0..b170b39d 100644
--- a/install/ui/association.js
+++ b/install/ui/association.js
@@ -110,29 +110,17 @@ IPA.bulk_associator = function(spec) {
return;
}
- var value = that.values.shift();
- if (!value) {
- that.on_success();
- return;
- }
-
- while (that.values.length > 0) {
- value += ',' + that.values.shift();
- }
-
- var args = [that.pkey];
- var options = { 'all': true };
- options[that.other_entity.name] = value;
-
var command = IPA.command({
entity: that.entity.name,
method: that.method,
- args: args,
- options: options,
+ args: [that.pkey],
+ options: { 'all': true },
on_success: that.on_success,
on_error: that.on_error
});
+ command.set_option(that.other_entity.name, that.values);
+
//alert(JSON.stringify(command.to_json()));
command.execute();
@@ -556,7 +544,7 @@ IPA.association_table_widget = function (spec) {
on_success: on_success,
on_error: on_error
});
- command.set_option(that.other_entity.name, values.join(','));
+ command.set_option(that.other_entity.name, values);
command.execute();
};
@@ -619,7 +607,7 @@ IPA.association_table_widget = function (spec) {
on_error: on_error
});
- command.set_option(that.other_entity.name, values.join(','));
+ command.set_option(that.other_entity.name, values);
command.execute();
};
diff --git a/install/ui/details.js b/install/ui/details.js
index d68ebd07..8d5dcff6 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -844,8 +844,6 @@ IPA.command_builder = function() {
if (field.metadata.primary_key) return;
if (values.length === 1) {
command.set_option(name, values[0]);
- } else if (field.join) {
- command.set_option(name, values.join(','));
} else {
command.set_option(name, values);
}
diff --git a/install/ui/dns.js b/install/ui/dns.js
index 4182074a..4cc6d4c5 100644
--- a/install/ui/dns.js
+++ b/install/ui/dns.js
@@ -1613,7 +1613,7 @@ IPA.dns.record_type_table_widget = function(spec) {
});
var record_name = that.dnstype.toLowerCase()+'record';
- command.set_option(record_name, values.join(','));
+ command.set_option(record_name, values);
command.set_option('structured', true);
command.execute();
diff --git a/install/ui/field.js b/install/ui/field.js
index a6553b1a..5f073705 100644
--- a/install/ui/field.js
+++ b/install/ui/field.js
@@ -52,7 +52,6 @@ IPA.field = function(spec) {
that.enabled = spec.enabled === undefined ? true : spec.enabled;
that.undo = spec.undo === undefined ? true : spec.undo;
- that.join = spec.join;
that.metadata = spec.metadata;
that.validators = spec.validators || [];
diff --git a/install/ui/rule.js b/install/ui/rule.js
index 2a164832..b7e6a74a 100644
--- a/install/ui/rule.js
+++ b/install/ui/rule.js
@@ -213,7 +213,7 @@ IPA.rule_association_table_field = function(spec) {
options: {all: true, rights: true}
});
- command.set_option(that.widget.other_entity.name, values.join(','));
+ command.set_option(that.widget.other_entity.name, values);
update_info.append_command(command, that.priority);
}
}
diff --git a/install/ui/widget.js b/install/ui/widget.js
index d288a9bf..f906d165 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1916,7 +1916,7 @@ IPA.attribute_table_widget = function(spec) {
on_error: on_error
});
- command.set_option(that.attribute_name, values.join(','));
+ command.set_option(that.attribute_name, values);
var additional_options = that.get_additional_options();
for (var i=0; i<additional_options.length; i++) {