mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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:
parent
cae2df274a
commit
bf7ee6eeec
@ -1283,6 +1283,7 @@ exp.association_facet = IPA.association_facet = function (spec, no_init) {
|
|||||||
that.init_facet();
|
that.init_facet();
|
||||||
that.init_table_columns();
|
that.init_table_columns();
|
||||||
init();
|
init();
|
||||||
|
that.policies.init();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!no_init) that.init_association_facet();
|
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_facet();
|
||||||
that.init_table_columns();
|
that.init_table_columns();
|
||||||
that.init_table(that.entity);
|
that.init_table(that.entity);
|
||||||
|
that.policies.init();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!no_init) that.init_attribute_facet();
|
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 });
|
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) {
|
that.fields.add_field = function(field) {
|
||||||
|
|
||||||
if (field.dirty_changed) {
|
if (field.dirty_changed) {
|
||||||
@ -634,7 +625,6 @@ exp.details_facet = IPA.details_facet = function(spec, no_init) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
that.facet_create(container);
|
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 || [];
|
that.header_actions = spec.header_actions || [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Policies
|
||||||
|
* @property {IPA.facet_policies}
|
||||||
|
*/
|
||||||
|
that.policies = IPA.facet_policies({
|
||||||
|
container: that,
|
||||||
|
policies: spec.policies
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Facet header
|
* Facet header
|
||||||
* @property {facet.facet_header}
|
* @property {facet.facet_header}
|
||||||
@ -658,6 +667,7 @@ exp.facet = IPA.facet = function(spec, no_init) {
|
|||||||
|
|
||||||
that.create_content(that.content);
|
that.create_content(that.content);
|
||||||
dom_node.removeClass('active-facet');
|
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.table.refresh_pagination();
|
||||||
|
that.policies.post_load(data);
|
||||||
that.post_load.notify([data], that);
|
that.post_load.notify([data], that);
|
||||||
that.clear_expired_flag();
|
that.clear_expired_flag();
|
||||||
};
|
};
|
||||||
|
@ -314,6 +314,7 @@ IPA.search_facet = function(spec, no_init) {
|
|||||||
that.init_facet();
|
that.init_facet();
|
||||||
that.init_table_columns();
|
that.init_table_columns();
|
||||||
that.init_table(that.managed_entity);
|
that.init_table(that.managed_entity);
|
||||||
|
that.policies.init();
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!no_init) that.init_search_facet();
|
if (!no_init) that.init_search_facet();
|
||||||
|
Loading…
Reference in New Issue
Block a user