Class: Types::GroupType
Instance Method Summary
collapse
#cross_project_pipeline_available?, #root_storage_statistics, #timelog_categories
Methods inherited from BaseObject
accepts, assignable?, authorization, authorize, authorized?, #current_user, #id
#present, #unpresented
Instance Method Details
#avatar_url ⇒ Object
291
292
293
|
# File 'app/graphql/types/group_type.rb', line 291
def avatar_url
object.avatar_url(only_path: false)
end
|
#container_repositories_count ⇒ Object
299
300
301
|
# File 'app/graphql/types/group_type.rb', line 299
def container_repositories_count
group.container_repositories.size
end
|
#custom_emoji ⇒ Object
333
334
335
|
# File 'app/graphql/types/group_type.rb', line 333
def custom_emoji
object.custom_emoji if Feature.enabled?(:custom_emoji)
end
|
#dependency_proxy_blob_count ⇒ Object
311
312
313
|
# File 'app/graphql/types/group_type.rb', line 311
def dependency_proxy_blob_count
group.dependency_proxy_blobs.size
end
|
#dependency_proxy_image_count ⇒ Object
307
308
309
|
# File 'app/graphql/types/group_type.rb', line 307
def dependency_proxy_image_count
group.dependency_proxy_manifests.size
end
|
#dependency_proxy_manifests ⇒ Object
303
304
305
|
# File 'app/graphql/types/group_type.rb', line 303
def dependency_proxy_manifests
group.dependency_proxy_manifests.order_id_desc
end
|
#dependency_proxy_setting ⇒ Object
329
330
331
|
# File 'app/graphql/types/group_type.rb', line 329
def dependency_proxy_setting
group.dependency_proxy_setting || group.create_dependency_proxy_setting
end
|
#dependency_proxy_total_size ⇒ Object
315
316
317
318
319
|
# File 'app/graphql/types/group_type.rb', line 315
def dependency_proxy_total_size
ActiveSupport::NumberHelper.number_to_human_size(
dependency_proxy_total_size_in_bytes
)
end
|
#dependency_proxy_total_size_bytes ⇒ Object
325
326
327
|
# File 'app/graphql/types/group_type.rb', line 325
def dependency_proxy_total_size_bytes
group.dependency_proxy_manifests.sum(:size) + group.dependency_proxy_blobs.sum(:size)
end
|
#dependency_proxy_total_size_in_bytes ⇒ Object
321
322
323
|
# File 'app/graphql/types/group_type.rb', line 321
def dependency_proxy_total_size_in_bytes
dependency_proxy_total_size_bytes
end
|
#label(title:) ⇒ Object
282
283
284
285
286
287
288
289
|
# File 'app/graphql/types/group_type.rb', line 282
def label(title:)
BatchLoader::GraphQL.for(title).batch(key: group) do |titles, loader, args|
LabelsFinder
.new(current_user, group: args[:key], title: titles)
.execute
.each { |label| loader.call(label.title, label) }
end
end
|