You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2019/03/18 19:06:57 UTC
[allura] 02/03: fixup! Track menu mount_point explicitly,
fixes [#8270] regression of unconfigurable external links
This is an automated email from the ASF dual-hosted git repository.
kentontaylor pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git
commit 407f92ded68398d5809fd2fce97efeacd23f0230
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Fri Mar 15 12:03:57 2019 -0400
fixup! Track menu mount_point explicitly, fixes [#8270] regression of unconfigurable external links
---
Allura/allura/model/project.py | 5 ++++-
Allura/allura/tests/functional/test_home.py | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Allura/allura/model/project.py b/Allura/allura/model/project.py
index 8738db1..8804ade 100644
--- a/Allura/allura/model/project.py
+++ b/Allura/allura/model/project.py
@@ -590,8 +590,9 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
ordinal = sub.ordinal + delta_ordinal
if ordinal > max_ordinal:
max_ordinal = ordinal
+ mount_point = sub.shortname.split('/')[-1]
entries.append({'ordinal': sub.ordinal + delta_ordinal,
- 'entry': SitemapEntry(sub.name, sub.url())})
+ 'entry': SitemapEntry(sub.name, sub.url(), mount_point=mount_point)})
for ac in self.app_configs + [a.config for a in new_tools]:
if per_tool_limit:
@@ -759,6 +760,8 @@ class Project(SearchIndexable, MappedClass, ActivityNode, ActivityObject):
elif len(grouped_nav[tool_name].children) == SITEMAP_PER_TOOL_LIMIT - 1:
e.url = self.url() + '_list/' + tool_name
e.label = 'More...'
+ e.mount_point = None
+ e.extra_html_attrs = {}
grouped_nav[tool_name].children.append(e)
return grouped_nav.values()
diff --git a/Allura/allura/tests/functional/test_home.py b/Allura/allura/tests/functional/test_home.py
index e8eb577..0dee4c7 100644
--- a/Allura/allura/tests/functional/test_home.py
+++ b/Allura/allura/tests/functional/test_home.py
@@ -127,7 +127,7 @@ class TestProjectHome(TestController):
menu = response.json['menu']
wiki_menu = [m for m in menu if m['tool_name'] == 'wiki'][0]
assert_equal(len(wiki_menu['children']), 10)
- assert_in({'url': '/p/test/_list/wiki', 'name': 'More...', 'mount_point': '_list',
+ assert_in({'url': '/p/test/_list/wiki', 'name': 'More...', 'mount_point': None,
'icon': 'tool-wiki', 'tool_name': 'wiki', 'is_anchored': False}, wiki_menu['children'])
@td.with_wiki