Skip to content

Commit

Permalink
Merge pull request #1505 from chalettu/documentation
Browse files Browse the repository at this point in the history
BZ#1644250 - Added ability for documentation to be dynamically configured

(cherry picked from commit 224193f)

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1655769
  • Loading branch information
AllenBW authored and simaishi committed Dec 14, 2018
1 parent 16e3e13 commit c50b977
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions client/app/core/navigation/navigation-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
user: Session.currentUser,
API_BASE: API_BASE,
switchGroup: switchGroup,
documentation: '/support/index?support_tab=about',
items: [],
notificationsDrawerShown: false,
newNotifications: false,
Expand All @@ -79,6 +80,14 @@ export function NavigationController (Text, Navigation, Session, API_BASE, Shopp
about: about(),
sites: sites()
})

CollectionsApi.query('settings/help_menu/documentation').then((data) => {
const documentation = data.help_menu.documentation
const matches = documentation.href.match(/http.*(http.*)/)
if (matches[1]) {
vm.documentation = matches[1]
}
})
vm.items = Navigation.init()
refresh()
if (ShoppingCart.allowed()) {
Expand Down
2 changes: 1 addition & 1 deletion client/app/layouts/application.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
</a>
<ul uib-dropdown-menu aria-labelledby="aboutModal">
<li ng-if="vm.permissions.help.documentation">
<a href="/support/index?support_tab=about" target="_blank">
<a href="{{vm.documentation}}" target="_blank">
{{ 'Documentation' | translate}}
</a>
</li>
Expand Down

0 comments on commit c50b977

Please sign in to comment.