WebUI: Fix topology graph navigation crash

Add get_navigation_options method to all facet variations to unify forming facet links.

Ticket: https://pagure.io/freeipa/issue/8523

Signed-off-by: Serhii Tsymbaliuk <stsymbal@redhat.com>
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Serhii Tsymbaliuk 2020-11-11 16:49:03 +01:00
parent 3722013dcd
commit 1512acc7de
2 changed files with 21 additions and 3 deletions

View File

@ -1087,6 +1087,15 @@ exp.facet = IPA.facet = function(spec, no_init) {
}
};
/**
* Form navigation options
*
* The options allow to build a link to the given facet.
*/
that.get_navigation_options = function() {
return {pkeys: that.get_pkeys()};
};
/**
* Initialize facet
* @protected
@ -1639,9 +1648,9 @@ exp.FacetGroupsWidget = declare([], {
$('<a/>', {
text: tab.tab_label,
'class': 'tab-link',
href: "#" + navigation.create_hash(tab, {
pkeys: self.facet.get_pkeys()
}),
href: "#" + navigation.create_hash(
tab, self.facet.get_navigation_options()
),
name: tab.name
}).appendTo(el);

View File

@ -333,6 +333,15 @@ define(['dojo/_base/declare',
window.console.warning('Unimplemented');
},
/**
* Form navigation options
*
* The method is needed to keep compatibility with IPA.facet class.
*/
get_navigation_options: function() {
return {};
},
/** Constructor */
constructor: function(spec) {