webui: facet policies for all facets
Now also facets other than details facet can use facet policies. Facet policies purpose is to extend facets behavior without overriding base class. This shared behavior could be reused in several other facets which may have completely different base classes. Reviewed-By: David Kupka <dkupka@redhat.com> Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
This commit is contained in:
1 parent
cae2df274a
commit
bf7ee6eeec
4 files changed
+14
-11
No files matched your search
@@ -1283,6 +1283,7 @@ exp.association_facet = IPA.association_facet = function (spec, no_init) {
|
||||
that.init_facet();
|
||||
that.init_table_columns();
|
||||
init();
|
||||
that.policies.init();
|
||||
};
|
||||
|
||||
if (!no_init) that.init_association_facet();
|
||||
@@ -1535,6 +1536,7 @@ exp.attribute_facet = IPA.attribute_facet = function(spec, no_init) {
|
||||
that.init_facet();
|
||||
that.init_table_columns();
|
||||
that.init_table(that.entity);
|
||||
that.policies.init();
|
||||
};
|
||||
|
||||
if (!no_init) that.init_attribute_facet();
|
||||
|
||||
@@ -574,15 +574,6 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
|
||||
*/
|
||||
that.fields = IPA.field_container({ container: that });
|
||||
|
||||
/**
|
||||
* Policies
|
||||
* @property {IPA.facet_policies}
|
||||
*/
|
||||
that.policies = IPA.facet_policies({
|
||||
container: that,
|
||||
policies: spec.policies
|
||||
});
|
||||
|
||||
that.fields.add_field = function(field) {
|
||||
|
||||
if (field.dirty_changed) {
|
||||
@@ -634,7 +625,6 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
|
||||
}
|
||||
|
||||
that.facet_create(container);
|
||||
that.policies.post_create();
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -225,6 +225,15 @@ exp.facet = IPA.facet = function(spec, no_init) {
|
||||
*/
|
||||
that.header_actions = spec.header_actions || [];
|
||||
|
||||
/**
|
||||
* Policies
|
||||
* @property {IPA.facet_policies}
|
||||
*/
|
||||
that.policies = IPA.facet_policies({
|
||||
container: that,
|
||||
policies: spec.policies
|
||||
});
|
||||
|
||||
/**
|
||||
* Facet header
|
||||
* @property {facet.facet_header}
|
||||
@@ -658,6 +667,7 @@ exp.facet = IPA.facet = function(spec, no_init) {
|
||||
|
||||
that.create_content(that.content);
|
||||
dom_node.removeClass('active-facet');
|
||||
that.policies.post_create();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -1897,7 +1907,7 @@ exp.table_facet = IPA.table_facet = function(spec, no_init) {
|
||||
}
|
||||
|
||||
that.table.refresh_pagination();
|
||||
|
||||
that.policies.post_load(data);
|
||||
that.post_load.notify([data], that);
|
||||
that.clear_expired_flag();
|
||||
};
|
||||
|
||||
@@ -314,6 +314,7 @@ IPA.search_facet = function(spec, no_init) {
|
||||
that.init_facet();
|
||||
that.init_table_columns();
|
||||
that.init_table(that.managed_entity);
|
||||
that.policies.init();
|
||||
};
|
||||
|
||||
if (!no_init) that.init_search_facet();
|
||||
|
||||
Reference in new issue
Block a user