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 2020/01/28 15:12:17 UTC

[allura] branch master updated (b6f250a -> 0f274c1)

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git.


    from b6f250a  [#7878] ldap unicode fixes
     new ee36931  [#7878] activity rss feed unicode fixes
     new 7026b64  Make my_projects_by_role_name always return a list, even when logged out
     new 0f274c1  Repo sidebar: no Browse Commits if repo is empty; add Browse Files for SVN which has no branches links

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 Allura/allura/lib/repository.py                           | 12 ++++++++++--
 Allura/allura/model/auth.py                               |  2 +-
 ForgeActivity/forgeactivity/main.py                       |  5 +++--
 ForgeActivity/forgeactivity/tests/functional/test_root.py |  7 +++++--
 4 files changed, 19 insertions(+), 7 deletions(-)


[allura] 03/03: Repo sidebar: no Browse Commits if repo is empty; add Browse Files for SVN which has no branches links

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 0f274c149ef0fb49e9f6c09a697883147002ac09
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Tue Jan 28 10:06:14 2020 -0500

    Repo sidebar: no Browse Commits if repo is empty; add Browse Files for SVN which has no branches links
---
 Allura/allura/lib/repository.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/lib/repository.py b/Allura/allura/lib/repository.py
index f05206c..1de7045 100644
--- a/Allura/allura/lib/repository.py
+++ b/Allura/allura/lib/repository.py
@@ -125,8 +125,10 @@ class RepositoryApp(Application):
     def sidebar_menu(self):
         if not self.repo or self.repo.status != 'ready':
             return []
-        links = [SitemapEntry('Browse Commits', c.app.url +
-                              'commit_browser', ui_icon=g.icons['browse_commits'])]
+        links = []
+        if not self.repo.is_empty():
+            links.append(SitemapEntry('Browse Commits', c.app.url + 'commit_browser',
+                                      ui_icon=g.icons['browse_commits']))
         if self.forkable and self.repo.status == 'ready' and not self.repo.is_empty():
             links.append(
                 SitemapEntry('Fork', c.app.url + 'fork', ui_icon=g.icons['fork']))
@@ -196,6 +198,12 @@ class RepositoryApp(Application):
                         'More Branches',
                         ref_url + 'branches/',
                     ))
+        elif not self.repo.is_empty():
+            # SVN repos, for example, should have a sidebar link to get to the main view
+            links.append(
+                SitemapEntry('Browse Files', c.app.url)
+            )
+
         tags = self.repo.get_tags()
         if tags:
             links.append(SitemapEntry('Tags'))


[allura] 02/03: Make my_projects_by_role_name always return a list, even when logged out

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 7026b64a9e083996ee00064a25af0018378cb4ce
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Jan 27 18:36:00 2020 -0500

    Make my_projects_by_role_name always return a list, even when logged out
---
 Allura/allura/model/auth.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index fdda9ca..9abe552 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -757,7 +757,7 @@ class User(MappedClass, ActivityNode, ActivityObject, SearchIndexable):
         that role.
         """
         if self.is_anonymous():
-            return
+            return []
         reaching_role_ids = list(
             g.credentials.user_roles(user_id=self._id).reaching_ids_set)
         reaching_roles = ProjectRole.query.find(


[allura] 01/03: [#7878] activity rss feed unicode fixes

Posted by br...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/allura.git

commit ee36931d6d53b43ba82b6108925d6029eb3e0e0d
Author: Dave Brondsema <da...@brondsema.net>
AuthorDate: Mon Jan 27 18:35:24 2020 -0500

    [#7878] activity rss feed unicode fixes
---
 ForgeActivity/forgeactivity/main.py                       | 5 +++--
 ForgeActivity/forgeactivity/tests/functional/test_root.py | 7 +++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/ForgeActivity/forgeactivity/main.py b/ForgeActivity/forgeactivity/main.py
index 1e6ba97..33ce2e1 100644
--- a/ForgeActivity/forgeactivity/main.py
+++ b/ForgeActivity/forgeactivity/main.py
@@ -166,7 +166,8 @@ class ForgeActivityController(BaseController):
         else:
             feed = FG.Rss201rev2Feed(**d)
         for t in data['timeline']:
-            url = h.absurl(t.obj.activity_url.encode('utf-8'))
+            url_id = h.absurl(t.obj.activity_url)  # try to keep this consistent over time (not url-quoted)
+            url = h.absurl(h.urlquote_path_only(t.obj.activity_url))
             feed.add_item(title='%s %s %s%s' % (
                                 t.actor.activity_name,
                 t.verb,
@@ -176,7 +177,7 @@ class ForgeActivityController(BaseController):
                 link=url,
                 pubdate=t.published,
                 description=t.obj.activity_extras.get('summary'),
-                unique_id=url,
+                unique_id=url_id,
                 author_name=t.actor.activity_name,
                 author_link=h.absurl(t.actor.activity_url))
         return feed.writeString('utf-8')
diff --git a/ForgeActivity/forgeactivity/tests/functional/test_root.py b/ForgeActivity/forgeactivity/tests/functional/test_root.py
index faaac4d..751f515 100644
--- a/ForgeActivity/forgeactivity/tests/functional/test_root.py
+++ b/ForgeActivity/forgeactivity/tests/functional/test_root.py
@@ -1,3 +1,4 @@
+# coding=utf-8
 #       Licensed to the Apache Software Foundation (ASF) under one
 #       or more contributor license agreements.  See the NOTICE file
 #       distributed with this work for additional information
@@ -192,7 +193,7 @@ class TestActivityController(TestController):
                 "activity_extras": {
                     "summary": "Just wanted to leave a comment on this..."
                 },
-                "activity_url": "/p/test/tickets/34/?limit=25#ed7c",
+                "activity_url": "/p/test/unicode•º/?limit=25#ed7c",
                 "activity_name": "a comment"
             },
             "target": {
@@ -228,8 +229,10 @@ class TestActivityController(TestController):
                      'Administrator 1 posted a comment on ticket #34')
         assert_equal(activity.find('description').text,
                      'Just wanted to leave a comment on this...')
+        assert_equal(activity.find('guid').text,
+                     'http://localhost/p/test/unicode•º/?limit=25#ed7c')
         assert_equal(activity.find('link').text,
-                     'http://localhost/p/test/tickets/34/?limit=25#ed7c')
+                     'http://localhost/p/test/unicode%E2%80%A2%C2%BA/?limit=25#ed7c')
 
     @td.with_tool('test', 'activity')
     @patch('forgeactivity.main.g.director')