From 27836cba9d865b1c912a65d0cd04562194f9e93f Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Fri, 16 May 2014 18:19:19 +0200 Subject: [PATCH] webui: support standalone facets in navigation module One can access standard standalone facets with: `navigation.show('facet_name')` and completely custom facets with low level call: `navigation.show_generic('/custom/hash', facet)`` Reviewed-By: Endi Sukma Dewata --- install/ui/src/freeipa/navigation.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/install/ui/src/freeipa/navigation.js b/install/ui/src/freeipa/navigation.js index ef0a0bf3f..7cf309f15 100644 --- a/install/ui/src/freeipa/navigation.js +++ b/install/ui/src/freeipa/navigation.js @@ -77,7 +77,7 @@ define([ * type. * * When facet is defined as a string it has to be registered in - * facet register. //FIXME: not yet implemented + * facet register. * * When it's an object (Facet) and has an entity set it will be * dealt as entity facet. @@ -98,9 +98,7 @@ define([ var facet = params.facet; if (typeof facet === 'string') { - // FIXME: doesn't work at the moment - throw 'Not yet supported'; - //facet = IPA.get_facet(facet); + nav.navigate_to_facet(facet, params.args); } if (!facet) throw 'Argument exception: missing facet'; @@ -140,6 +138,22 @@ define([ params.pkeys, params.args); }, + /** + * Uses lower level access + * + * `experimental` + * + * Navigates to generic page by changing hash. + * + * @param {string} hash Hash of the change + * @param {Object} [facet] Facet we are navigating to. Usually used for + * notification purposes + */ + show_generic: function(hash, facet) { + var nav = get_router(); + nav.navigate_to_hash(hash, facet); + }, + /** * Show default facet * @method show_default