mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fixed self-service links.
In self-service mode the user's association facets have been modified such that the entries are not linked since the only available entity is the user entity. A 'link' parameter has been added to IPA.association_facet and IPA.column to control whether to link the entries. The link_handler() method can be used to define how to handle the link. Ticket #1072
This commit is contained in:
committed by
Adam Young
parent
724dd99744
commit
d6343f4bb0
@@ -51,26 +51,6 @@ IPA.search_facet = function(spec) {
|
||||
|
||||
that.init_table = function(entity){
|
||||
|
||||
function setup_column(column,entity) {
|
||||
column.setup = function(container, record) {
|
||||
container.empty();
|
||||
|
||||
var value = record[column.name];
|
||||
value = value ? value.toString() : '';
|
||||
|
||||
$('<a/>', {
|
||||
'href': '#'+value,
|
||||
'html': value,
|
||||
'click': function (value) {
|
||||
return function() {
|
||||
IPA.nav.show_page(entity.name, 'default', value);
|
||||
return false;
|
||||
};
|
||||
}(value)
|
||||
}).appendTo(container);
|
||||
};
|
||||
}
|
||||
|
||||
that.table = IPA.table_widget({
|
||||
id: entity.name+'-search',
|
||||
'class': 'content-table',
|
||||
@@ -88,9 +68,13 @@ IPA.search_facet = function(spec) {
|
||||
|
||||
var param_info = IPA.get_entity_param(entity.name, column.name);
|
||||
column.primary_key = param_info && param_info['primary_key'];
|
||||
column.link = column.primary_key;
|
||||
|
||||
if (column.primary_key) {
|
||||
setup_column(column,entity);
|
||||
if (column.link) {
|
||||
column.link_handler = function(value) {
|
||||
IPA.nav.show_page(entity.name, 'default', value);
|
||||
return false;
|
||||
};
|
||||
}
|
||||
|
||||
that.table.add_column(column);
|
||||
|
||||
Reference in New Issue
Block a user