allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [2/3] allura git commit: [#8215] Personal Dashboard - Fix the link of merge request, add 'creator_id' to index list and sort search results according to 'mod_date'
Date Fri, 06 Jul 2018 18:26:24 GMT
[#8215] Personal Dashboard - Fix the link of merge request, add 'creator_id' to index list
and sort search results according to 'mod_date'


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/762f9938
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/762f9938
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/762f9938

Branch: refs/heads/master
Commit: 762f9938dbfbb07c483b46c5ca7bbf3866adbd0e
Parents: 1e8a47e
Author: deshanigtk <deshani.14@cse.mrt.ac.lk>
Authored: Fri Jul 6 10:47:32 2018 +0530
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Fri Jul 6 14:18:59 2018 -0400

----------------------------------------------------------------------
 .../personal_dashboard/templates/sections/merge_requests.html  | 6 +++---
 Allura/allura/model/auth.py                                    | 3 ++-
 Allura/allura/model/repository.py                              | 2 +-
 3 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/762f9938/Allura/allura/ext/personal_dashboard/templates/sections/merge_requests.html
----------------------------------------------------------------------
diff --git a/Allura/allura/ext/personal_dashboard/templates/sections/merge_requests.html b/Allura/allura/ext/personal_dashboard/templates/sections/merge_requests.html
index ba9740d..368e1df 100644
--- a/Allura/allura/ext/personal_dashboard/templates/sections/merge_requests.html
+++ b/Allura/allura/ext/personal_dashboard/templates/sections/merge_requests.html
@@ -43,9 +43,9 @@
         <tbody>
         {% for req in requests %}
             <tr>
-                <td><a href="{{ req.request_number }}/">{{ req.request_number
}}</a></td>
-                <td><a href="{{ req.request_number }}/">{{ req.status }}</a></td>
-                <td><a href="{{ req.request_number }}/">{{ req.summary }}</a></td>
+                <td><a href="{{ req.url() }}">{{ req.request_number }}</a></td>
+                <td><a href="{{ req.url() }}">{{ req.status }}</a></td>
+                <td><a href="{{ req.url() }}">{{ req.summary }}</a></td>
                 <td>{% if req.downstream_repo %}
                     <a href="{{ req.downstream_url }}">{{ req.downstream_url }}</a>
                 {% else %}

http://git-wip-us.apache.org/repos/asf/allura/blob/762f9938/Allura/allura/model/auth.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/auth.py b/Allura/allura/model/auth.py
index 0abdaa5..cd48331 100644
--- a/Allura/allura/model/auth.py
+++ b/Allura/allura/model/auth.py
@@ -735,13 +735,14 @@ class User(MappedClass, ActivityNode, ActivityObject, SearchIndexable):
         from .project import Project
 
         return Project.query.find({'_id': {'$in': projects}, 'deleted': False}).all()
+
     def my_merge_requests(self):
         if self.is_anonymous():
             return
 
         from .repository import MergeRequest
 
-        return MergeRequest.query.find({'creator_id': self._id}).sort('request_number', pymongo.ASCENDING)
+        return MergeRequest.query.find({'creator_id': self._id}).sort('mod_date', pymongo.ASCENDING)
 
     def set_password(self, new_password):
         return plugin.AuthenticationProvider.get(request).set_password(

http://git-wip-us.apache.org/repos/asf/allura/blob/762f9938/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 4724165..8ec5959 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -794,7 +794,7 @@ class MergeRequest(VersionedArtifact, ActivityObject):
 
     class __mongometa__:
         name = 'merge-request'
-        indexes = ['commit_id']
+        indexes = ['commit_id', 'creator_id']
         unique_indexes = [('app_config_id', 'request_number')]
     type_s = 'MergeRequest'
 


Mime
View raw message