summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--install/ui/add.js6
-rw-r--r--install/ui/details.js16
-rw-r--r--install/ui/field.js11
-rw-r--r--install/ui/rule.js4
-rw-r--r--install/ui/service.js2
5 files changed, 21 insertions, 18 deletions
diff --git a/install/ui/add.js b/install/ui/add.js
index c1031f8b..9b473ccc 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -122,17 +122,17 @@ IPA.entity_adder_dialog = function(spec) {
for (var j=0; j<fields.length; j++) {
var field = fields[j];
- var values = record[field.name];
+ 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 (field.name == pkey_name) {
+ if (field.param === pkey_name) {
command.add_arg(value);
} else {
- command.set_option(field.name, value);
+ command.set_option(field.param, value);
}
}
diff --git a/install/ui/details.js b/install/ui/details.js
index acd498aa..d68ebd07 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -493,7 +493,7 @@ IPA.details_facet = function(spec) {
if (only_dirty && !field.is_dirty()) continue;
- var values = record[field.name];
+ var values = record[field.param];
if (require_value && !values) continue;
update_info.append_field(field, values);
@@ -838,23 +838,25 @@ IPA.command_builder = function() {
that.add_field_option = function(command, field, values) {
if (!field || !values) return;
+ var name = field.param;
+
if (field.metadata) {
if (field.metadata.primary_key) return;
if (values.length === 1) {
- command.set_option(field.name, values[0]);
+ command.set_option(name, values[0]);
} else if (field.join) {
- command.set_option(field.name, values.join(','));
+ command.set_option(name, values.join(','));
} else {
- command.set_option(field.name, values);
+ command.set_option(name, values);
}
} else {
if (values.length) {
- command.add_option('setattr', field.name+'='+values[0]);
+ command.add_option('setattr', name+'='+values[0]);
} else {
- command.add_option('setattr', field.name+'=');
+ command.add_option('setattr', name+'=');
}
for (var k=1; k<values.length; k++) {
- command.add_option('addattr', field.name+'='+values[k]);
+ command.add_option('addattr', name+'='+values[k]);
}
}
};
diff --git a/install/ui/field.js b/install/ui/field.js
index e78a4e96..5c10abb6 100644
--- a/install/ui/field.js
+++ b/install/ui/field.js
@@ -32,6 +32,7 @@ IPA.field = function(spec) {
that.entity = IPA.get_entity(spec.entity);
that.container = null;
that.name = spec.name;
+ that.param = spec.param || spec.name;
that.label = spec.label;
that.tooltip = spec.tooltip;
that.formatter = spec.formatter;
@@ -66,7 +67,7 @@ IPA.field = function(spec) {
var init = function() {
if (!that.metadata && that.entity) {
- that.metadata = IPA.get_entity_param(that.entity.name, that.name);
+ that.metadata = IPA.get_entity_param(that.entity.name, that.param);
}
if (that.metadata) {
if (that.label === undefined) {
@@ -148,7 +149,7 @@ IPA.field = function(spec) {
that.load = function(record) {
that.record = record;
- that.values = that.get_value(record, that.name);
+ that.values = that.get_value(record, that.param);
that.load_writable(record);
@@ -185,7 +186,7 @@ IPA.field = function(spec) {
}
if (record.attributelevelrights) {
- var rights = record.attributelevelrights[that.name];
+ var rights = record.attributelevelrights[that.param];
if (!rights || rights.indexOf('w') < 0) {
that.writable = false;
}
@@ -249,7 +250,7 @@ IPA.field = function(spec) {
}
if(record) {
- record[that.name] = values;
+ record[that.param] = values;
}
return values;
@@ -600,7 +601,7 @@ IPA.sshkeys_field = function(spec) {
that.load = function(record) {
- var keys = that.get_value(record, that.name);
+ var keys = that.get_value(record, that.param);
var fingerprints = that.get_value(record, that.sshfp_attr);
var values = [];
diff --git a/install/ui/rule.js b/install/ui/rule.js
index f2d7c6dd..2a164832 100644
--- a/install/ui/rule.js
+++ b/install/ui/rule.js
@@ -170,7 +170,7 @@ IPA.rule_association_table_field = function(spec) {
if (typeof record !== 'object') {
record = {};
- record[that.name] = values[i];
+ record[that.param] = values[i];
}
record[that.external] = external;
@@ -180,7 +180,7 @@ IPA.rule_association_table_field = function(spec) {
};
that.load = function(result) {
- that.values = result[that.name] || [];
+ that.values = result[that.param] || [];
if (that.external) {
that.set_values_external(that.values, '');
diff --git a/install/ui/service.js b/install/ui/service.js
index f60d4555..c86a6d05 100644
--- a/install/ui/service.js
+++ b/install/ui/service.js
@@ -347,7 +347,7 @@ IPA.service_provisioning_status_field = function (spec) {
that.load = function(record) {
that.values = {
- value: record[that.name],
+ value: record[that.param],
pkey: record['krbprincipalname'][0]
};