diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2015-04-29 17:25:28 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-05-20 14:04:10 +0200 |
commit | 6bcb90ef36f7400e9f1eb197421134d5650c39fe (patch) | |
tree | fe2d49ba601f49d640067990380eb917f5389029 /install/ui | |
parent | 2be8eeb04f08cb51a25651794a2f356a2a7b499e (diff) | |
download | freeipa-6bcb90ef36f7400e9f1eb197421134d5650c39fe.tar.gz freeipa-6bcb90ef36f7400e9f1eb197421134d5650c39fe.tar.xz freeipa-6bcb90ef36f7400e9f1eb197421134d5650c39fe.zip |
webui: prefer entity fallback in menu item select
While selecting menu item based on a facet which have an entity defined,
prefer entity fallback over facet name fallback.
It solves an issue which appears when a menu item of a different entity
has the same facet name specified. In such case this menu item was selected
instead of the desired one.
E.g.: there are menu items:
{ entity: 'foo' }
{ entity: 'bar', facet: 'search'}
Showing a foo's search facet resulted in selecting
{ entity: 'bar', facet: 'search'} item.
Reviewed-By: David Kupka <dkupka@redhat.com>
Reviewed-By: Thierry Bordaz <tbordaz@redhat.com>
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/src/freeipa/Application_controller.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/install/ui/src/freeipa/Application_controller.js b/install/ui/src/freeipa/Application_controller.js index 4bf76f8f5..5877ed63e 100644 --- a/install/ui/src/freeipa/Application_controller.js +++ b/install/ui/src/freeipa/Application_controller.js @@ -365,16 +365,16 @@ define([ items = this.menu.query({ entity: facet.entity.name, facet: facet.name }); } - // normal facets - if (!items.total) { - items = this.menu.query({ facet: facet.name }); - } - // entity fallback if (!items.total && facet.entity) { items = this.menu.query({ entity: facet.entity.name }); } + // normal facets + if (!items.total) { + items = this.menu.query({ facet: facet.name }); + } + // fallback: Top level item if (!items.total) { items = this.menu.query({ parent: null }); |