You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2019/03/04 16:00:31 UTC
[allura] 02/02: [#8269] link directly to the external url from the
menu
This is an automated email from the ASF dual-hosted git repository.
brondsem pushed a commit to branch db/8269
in repository https://gitbox.apache.org/repos/asf/allura.git
commit 317e9b66282facd0816d2e1ac1fbe877fddbd2ad
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Mar 1 18:29:04 2019 -0500
[#8269] link directly to the external url from the menu
---
ForgeLink/forgelink/link_main.py | 2 +-
ForgeLink/forgelink/tests/functional/test_root.py | 15 ++++++++++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/ForgeLink/forgelink/link_main.py b/ForgeLink/forgelink/link_main.py
index 43a4624..cece76e 100644
--- a/ForgeLink/forgelink/link_main.py
+++ b/ForgeLink/forgelink/link_main.py
@@ -82,7 +82,7 @@ class ForgeLinkApp(Application):
@h.exceptionless([], log)
def sitemap(self):
menu_id = self.config.options.mount_label
- return [SitemapEntry(menu_id, '.')[self.sidebar_menu()]]
+ return [SitemapEntry(menu_id, self.config.options.get('url') or '.')]
def sidebar_menu(self):
return []
diff --git a/ForgeLink/forgelink/tests/functional/test_root.py b/ForgeLink/forgelink/tests/functional/test_root.py
index f0fe1fd..c861748 100644
--- a/ForgeLink/forgelink/tests/functional/test_root.py
+++ b/ForgeLink/forgelink/tests/functional/test_root.py
@@ -16,7 +16,8 @@
# under the License.
import json
-from nose.tools import assert_equal
+
+from nose.tools import assert_equal, assert_in
from allura import model as M
from allura.tests import decorators as td
@@ -113,3 +114,15 @@ class TestConfigOptions(TestController):
assert_equal(flash['status'], 'error')
assert_equal(flash['message'], 'url: That is not a valid URL')
self.assert_url('link', None)
+
+ @td.with_link
+ def test_menu_url(self):
+ resp = self.app.get('/p/test/admin/')
+ assert_in('/p/test/link/', str(resp.html.find(id='top_nav')))
+
+ response = self.app.get('/admin/link/options')
+ response.form['url'] = 'http://foo.bar/baz'
+ response.form.submit()
+
+ resp = self.app.get('/p/test/admin/')
+ assert_in('http://foo.bar/baz', str(resp.html.find(id='top_nav')))