summaryrefslogtreecommitdiffstats
path: root/install/ui/details.js
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-03-22 17:03:57 +0100
committerPetr Vobornik <pvoborni@redhat.com>2012-03-29 13:39:37 +0200
commitbbe672a2aea1651a4a0eeca20b8339f0799f3431 (patch)
tree6f14a8c94472b33f1c6373fd0e0f6ba51b790e96 /install/ui/details.js
parent5cfee2338d548035151926c5c235f3426fca0499 (diff)
downloadfreeipa.git-bbe672a2aea1651a4a0eeca20b8339f0799f3431.tar.gz
freeipa.git-bbe672a2aea1651a4a0eeca20b8339f0799f3431.tar.xz
freeipa.git-bbe672a2aea1651a4a0eeca20b8339f0799f3431.zip
Facet expiration flag
Problem: For performance reason a facet may cache the data in browser's memory. There should be a flag to indicate whether a facet has expired and should be refreshed. The expired flag could be set by these events: 1) any update operation 2) changing search filter in search facet 3) switching page in a multi-paged search/association facet 4) switching direct/indirect view in association facet 5) facet expiration time A facet should be able to use these methods to refresh itself: 6) on demand: an expired facet should be refreshed when a user opens it. 7) automatic: an open facet should automatically refresh itself when it expires. Solution: This patch solves cases: #2, #3, #5, #6. Case #4 works without any change. Case #1 will be solved later. Case #7 is deffered. Default expiration timeout was set to 10 minutes. In this patch are also updated facet.needs_update methods to reflect changes in containing facets. https://fedorahosted.org/freeipa/ticket/2075
Diffstat (limited to 'install/ui/details.js')
-rw-r--r--install/ui/details.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/install/ui/details.js b/install/ui/details.js
index 32ace398..f7e95ebf 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -413,14 +413,21 @@ IPA.details_facet = function(spec) {
that.facet_show();
that.pkey = IPA.nav.get_state(that.entity.name+'-pkey');
+ that.old_key_prefix = that.entity.get_primary_key_prefix();
that.header.set_pkey(that.pkey);
};
that.needs_update = function() {
if (that._needs_update !== undefined) return that._needs_update;
+
+ var needs_update = that.facet_needs_update();
+
var pkey = IPA.nav.get_state(that.entity.name+'-pkey');
- var needs_update = that.error_displayed();
+ var key_prefix = that.entity.get_primary_key_prefix();
+
needs_update = needs_update || pkey !== that.pkey;
+ needs_update = needs_update || IPA.array_diff(key_prefix, that.old_key_prefix);
+
return needs_update;
};
@@ -472,6 +479,7 @@ IPA.details_facet = function(spec) {
}
that.policies.post_load(data);
that.enable_update(false);
+ that.clear_expired_flag();
};
that.save = function(record) {