From a74cf7e68bf6ceb9a15cd7d26acb4a1dbc98e48a Mon Sep 17 00:00:00 2001 From: Tan Jiang Date: Wed, 3 Aug 2016 10:39:33 +0800 Subject: [PATCH] remove creator field from top repo query --- dao/accesslog.go | 2 +- dao/dao_test.go | 8 +++++--- models/toprepo.go | 2 +- .../top-repository/top-repository.directive.html | 5 ++--- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dao/accesslog.go b/dao/accesslog.go index 930607701..2aa1d46e7 100644 --- a/dao/accesslog.go +++ b/dao/accesslog.go @@ -184,7 +184,7 @@ func GetTopRepos(countNum int) ([]models.TopRepo, error) { for i := 0; i < len(list); i++ { for _, v := range usrnameList { if v.RepoName == list[i].RepoName { - list[i].Creator = v.Creator + // list[i].Creator = v.Creator break } } diff --git a/dao/dao_test.go b/dao/dao_test.go index 3d375927d..49de1d1a6 100644 --- a/dao/dao_test.go +++ b/dao/dao_test.go @@ -770,9 +770,11 @@ func TestGetTopRepos(t *testing.T) { if topRepos[0].AccessCount != 1 { t.Errorf("error occured in get top reop's access count, expected: %v, actual: %v", 1, topRepos[0].AccessCount) } - if topRepos[0].Creator != currentUser.Username { - t.Errorf("error occured in get top reop's creator, expected: %v, actual: %v", currentUser.Username, topRepos[0].Creator) - } + /* + if topRepos[0].Creator != currentUser.Username { + t.Errorf("error occured in get top reop's creator, expected: %v, actual: %v", currentUser.Username, topRepos[0].Creator) + } + */ err = ToggleProjectPublicity(currentProject.ProjectID, publicityOff) if err != nil { t.Errorf("Error occurred in ToggleProjectPublicity: %v", err) diff --git a/models/toprepo.go b/models/toprepo.go index 6ccb46227..b977e4c18 100644 --- a/models/toprepo.go +++ b/models/toprepo.go @@ -19,5 +19,5 @@ package models type TopRepo struct { RepoName string `json:"name"` AccessCount int64 `json:"count"` - Creator string `json:"creator"` + // Creator string `json:"creator"` } diff --git a/static/resources/js/components/top-repository/top-repository.directive.html b/static/resources/js/components/top-repository/top-repository.directive.html index c45a7adfa..a44c1dc93 100644 --- a/static/resources/js/components/top-repository/top-repository.directive.html +++ b/static/resources/js/components/top-repository/top-repository.directive.html @@ -18,8 +18,7 @@ - - +
// 'repository_name' | tr //// 'count' | tr //// 'creator' | tr //// 'count' | tr //
@@ -30,7 +29,7 @@

// 'no_top_repositories' | tr //

- //t.name////t.count////t.creator === '' ? '-' : t.creator // + //t.name////t.count//