summaryrefslogtreecommitdiffstats
path: root/install/ui
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-03-01 21:21:19 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-03-02 19:11:28 -0500
commit81fd790cda41644d21b9deecdc5c6e3c50155b3d (patch)
treefbbdf3d808636a3be039aab313d49f8af1481a52 /install/ui
parentcd61ef61ad9bbfecd84dc7199d17af9e7031ef2d (diff)
downloadfreeipa-81fd790cda41644d21b9deecdc5c6e3c50155b3d.tar.gz
freeipa-81fd790cda41644d21b9deecdc5c6e3c50155b3d.tar.xz
freeipa-81fd790cda41644d21b9deecdc5c6e3c50155b3d.zip
Use modified entity find commands for associations
https://fedorahosted.org/freeipa/ticket/1011 Does not completely fix the problem in the ticket, but it does mitigate the failure.
Diffstat (limited to 'install/ui')
-rw-r--r--install/ui/associate.js45
-rw-r--r--install/ui/host.js10
-rw-r--r--install/ui/service.js8
3 files changed, 28 insertions, 35 deletions
diff --git a/install/ui/associate.js b/install/ui/associate.js
index 2f1a28d5a..db3a9cd55 100644
--- a/install/ui/associate.js
+++ b/install/ui/associate.js
@@ -430,8 +430,12 @@ IPA.association_table_widget = function (spec) {
'on_success': on_success,
'on_error': on_error
});
+ var length = that.values.length;
+ if (length > 100){
+ length = 100;
+ }
- for (var i=0; i<that.values.length; i++) {
+ for (var i=0; i< length; i++) {
var value = that.values[i];
var command = IPA.command({
@@ -917,28 +921,29 @@ IPA.association_facet = function (spec) {
if (!pkeys.length) return;
- var batch = IPA.batch_command({
- 'name': that.entity_name+'_'+that.name,
+
+ var options = {
+ 'all': true,
+ 'rights': true
+ };
+
+ var pkey = $.bbq.getState(that.entity_name + '-pkey', true) || '';
+ var args =[];
+ /* TODO: make a general solution to generate this value */
+ var relationship_filter = 'in_' + that.entity_name;
+ options[relationship_filter] = pkey;
+
+ var command = IPA.command({
'on_success': on_success,
- 'on_error': on_error
+ 'on_error': on_error,
+ 'method': that.other_entity+'_find',
+ 'args': args,
+ options: options
});
- for (var i=0; i<pkeys.length; i++) {
- var pkey = pkeys[i];
-
- var command = IPA.command({
- 'method': that.other_entity+'_show',
- 'args': [pkey],
- 'options': {
- 'all': true,
- 'rights': true
- }
- });
+ command.execute();
- batch.add_command(command);
- }
- batch.execute();
};
that.refresh = function() {
@@ -962,9 +967,9 @@ IPA.association_facet = function (spec) {
that.get_records(
pkeys,
function(data, text_status, xhr) {
- var results = data.result.results;
+ var results = data.result.result;
for (var i=0; i<results.length; i++) {
- var record = results[i].result;
+ var record = results[i];
that.table.add_record(record);
}
}
diff --git a/install/ui/host.js b/install/ui/host.js
index 981bfc021..9ef7553e9 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -50,7 +50,7 @@ IPA.entity_factories.host = function () {
that.add_facet(facet);
facet = IPA.host_managedby_host_facet({
- 'name': 'managedby_host'
+ name: 'managedby_host'
});
that.add_facet(facet);
@@ -503,18 +503,12 @@ IPA.host_managedby_host_facet = function (spec) {
}).appendTo(container);
};
- that.create_column({name: 'description'});
-
that.create_adder_column({
name: 'fqdn',
primary_key: true,
- width: '100px'
+ width: '200px'
});
- that.create_adder_column({
- name: 'description',
- width: '100px'
- });
that.association_facet_init();
};
diff --git a/install/ui/service.js b/install/ui/service.js
index ff642a808..d8d8ad501 100644
--- a/install/ui/service.js
+++ b/install/ui/service.js
@@ -395,17 +395,11 @@ IPA.service_managedby_host_facet = function(spec) {
}).appendTo(container);
};
- that.create_column({name: 'description'});
that.create_adder_column({
name: 'fqdn',
primary_key: true,
- width: '100px'
- });
-
- that.create_adder_column({
- name: 'description',
- width: '100px'
+ width: '200px'
});
that.association_facet_init();