Skip to content

Commit

Permalink
Add origin field for contributors detail list query.
Browse files Browse the repository at this point in the history
Signed-off-by: EdmondFrank <[email protected]>
  • Loading branch information
EdmondFrank committed Feb 22, 2024
1 parent b4dbee4 commit 2e6417c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/graphql/types/meta/contributor_detail_page_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Types
module Meta
class ContributorDetailPageType < BasePageObject
field :items, [Types::Meta::ContributorDetailType], null: false
field :origin, String, description: 'contributors origin', null: false
end
end
end
4 changes: 2 additions & 2 deletions app/graphql/types/queries/contributors_detail_list_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def resolve(label: nil, level: 'repo', page: 1, per: 9, filter_opts: [], sort_op

validate_date!(context[:current_user], label, level, begin_date, end_date)

indexer, repo_urls =
indexer, repo_urls, origin =
select_idx_repos_by_lablel_and_level(label, level, GiteeContributorEnrich, GithubContributorEnrich)
contributors_list =
indexer
Expand All @@ -39,7 +39,7 @@ def resolve(label: nil, level: 'repo', page: 1, per: 9, filter_opts: [], sort_op

count = contributors_list.length

{ count: count, total_page: (count.to_f/per).ceil, page: page, items: current_page }
{ count: count, total_page: (count.to_f/per).ceil, page: page, items: current_page, origin: origin }
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/concerns/contributor_enrich.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module ContributorEnrich
extend ActiveSupport::Concern

MAX_DEPTH = 10
MAX_PER_PAGE = 2000
MAX_PER_PAGE = 10000

class_methods do
def fetch_contributors_list(repo_urls, begin_date, end_date, label: nil, level: nil)
Expand Down

0 comments on commit 2e6417c

Please sign in to comment.