534a61179e
These are backend changes. Use Vue for the import feature UI for "githubish" providers (GitHub and Gitea). Add "Go to project" button after a successful import. Use CI-style status icons and improve spacing of the table and its component. Adds ETag polling to the github and gitea import jobs endpoint.
25 lines
598 B
Ruby
25 lines
598 B
Ruby
# frozen_string_literal: true
|
|
|
|
class ProviderRepoEntity < Grape::Entity
|
|
include ImportHelper
|
|
|
|
expose :id
|
|
expose :full_name
|
|
expose :owner_name do |provider_repo, options|
|
|
owner_name(provider_repo, options[:provider])
|
|
end
|
|
|
|
expose :sanitized_name do |provider_repo|
|
|
sanitize_project_name(provider_repo[:name])
|
|
end
|
|
|
|
expose :provider_link do |provider_repo, options|
|
|
provider_project_link_url(options[:provider_url], provider_repo[:full_name])
|
|
end
|
|
|
|
private
|
|
|
|
def owner_name(provider_repo, provider)
|
|
provider_repo.dig(:owner, :login) if provider == :github
|
|
end
|
|
end
|